Skip to content

Commit

Permalink
Issue42
Browse files Browse the repository at this point in the history
  • Loading branch information
VahidN committed Aug 17, 2019
1 parent a2f225b commit 8fd0bbc
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/iTextSharp.LGPLv2.Core.FunctionalTests/Issues/Issue42.cs
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 not shown.

0 comments on commit 8fd0bbc

Please sign in to comment.