finish support for revision 5 encryption using aes 256 #34

This commit is contained in:
Eliot Jones
2019-06-13 19:46:08 +01:00
parent d0a3cd398f
commit 4c716fcbd6
6 changed files with 52 additions and 35 deletions

View File

@@ -1,39 +1,39 @@
namespace UglyToad.PdfPig.Tests.Integration
{
//using System;
//using System.Diagnostics;
//using System.IO;
//using Xunit;
using System;
using System.Diagnostics;
using System.IO;
using Xunit;
/// <summary>
/// A class for testing files which are not checked in to source control.
/// </summary>
public class LocalTests
{
//[Fact]
//public void Tests()
//{
// var files = Directory.GetFiles(@"C:\temp\pdfs");
[Fact]
public void Tests()
{
var files = Directory.GetFiles(@"C:\temp\pdfs");
// foreach (var file in files)
// {
// try
// {
// using (var document = PdfDocument.Open(file, new ParsingOptions { UseLenientParsing = false }))
// {
// for (var i = 1; i <= document.NumberOfPages; i++)
// {
// var page = document.GetPage(i);
// var text = page.Text;
// Trace.WriteLine(text);
// }
// }
// }
// catch (Exception ex)
// {
// throw new InvalidOperationException($"Error parsing: {Path.GetFileName(file)}.", ex);
// }
// }
//}
foreach (var file in files)
{
try
{
using (var document = PdfDocument.Open(file, new ParsingOptions { UseLenientParsing = false }))
{
for (var i = 1; i <= document.NumberOfPages; i++)
{
var page = document.GetPage(i);
var text = page.Text;
Trace.WriteLine(text);
}
}
}
catch (Exception ex)
{
throw new InvalidOperationException($"Error parsing: {Path.GetFileName(file)}.", ex);
}
}
}
}
}