forked from VahidN/iTextSharp.LGPLv2.Core
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
src/iTextSharp.LGPLv2.Core.FunctionalTests/Issues/Issue42.cs
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System.Collections.Generic; | ||
using iTextSharp.text.pdf; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace iTextSharp.LGPLv2.Core.FunctionalTests.Issues | ||
{ | ||
/// <summary> | ||
/// https://github.com/VahidN/iTextSharp.LGPLv2.Core/issues/42 | ||
/// </summary> | ||
[TestClass] | ||
public class Issue42 | ||
{ | ||
[TestMethod] | ||
public void Verify_Issue42_CanBe_Processed() | ||
{ | ||
var inPdfFile = TestUtils.GetPdfsPath("issue42.pdf"); | ||
var reader = new PdfReader(inPdfFile); | ||
|
||
var content = reader.GetPageContent(1); | ||
var tokenizer = new PrTokeniser(new RandomAccessFileOrArray(content)); | ||
|
||
var stringsList = new List<string>(); | ||
while (tokenizer.NextToken()) | ||
{ | ||
if (tokenizer.TokenType == PrTokeniser.TK_STRING) | ||
{ | ||
stringsList.Add(tokenizer.StringValue); | ||
} | ||
} | ||
|
||
reader.Close(); | ||
Assert.IsTrue(stringsList.Contains("demonstration")); | ||
} | ||
} | ||
} |
Binary file added
BIN
+146 KB
src/iTextSharp.LGPLv2.Core.FunctionalTests/iTextExamples/resources/pdfs/issue42.pdf
Binary file not shown.