-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
966bf49
commit 33e4ead
Showing
1 changed file
with
29 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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", "*.pdf"); | ||
//[Fact] | ||
//public void Tests() | ||
//{ | ||
// var files = Directory.GetFiles(@"C:\temp\pdfs", "*.pdf"); | ||
|
||
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); | ||
// } | ||
// } | ||
//} | ||
} | ||
} | ||
} |