Hi,
I get an application exception while using TextFragmentAbsorber.
Using this code:
[TestCase(@"TestData\Sample1.pdf", @"TestData\Sample2.pdf")]
public void ShouldExtractTextFragmentsInParallel(params string[] paths)
{
bool exceptionOccured = false;
Parallel.ForEach(paths, path =>
{
try
{
Document document = new Document(path);
foreach (Page page in document.Pages)
{
TextFragmentAbsorber textFragmentAbsorber = new TextFragmentAbsorber();
page.Accept(textFragmentAbsorber);
}
}
catch (ApplicationException ex)
{
exceptionOccured = true;
Assert.AreEqual("Font Helvetica was not found", ex.Message);
}
});
Assert.IsTrue(exceptionOccured);
}
I get following stack trace:
{System.ApplicationException: Font Helvetica was not found
at Aspose.Pdf.Text.FontRepository.FindFont(String fontName)
at Aspose.Pdf.TextStamp.()
at Aspose.Pdf.Text.TextState.(TextState , )
at Aspose.Pdf.Text.TextState.( )
at Aspose.Pdf.Text.TextState..ctor(TextSegment )
at Aspose.Pdf.Text.TextSegment.( , Int32 , Int32 , TextEditOptions )
at Aspose.Pdf.Text.TextSegment..ctor( , Int32 , Int32 )
at Aspose.Pdf.Text.TextFragmentAbsorber.( , [] )
at Aspose.Pdf.Text.TextFragmentAbsorber.Visit(Page page)
at Aspose.Pdf.Page.Accept(TextFragmentAbsorber visitor)
at ePublisher.Engine.Tests.Services.Processors.BlueLinksServiceTest.<>c__DisplayClass1.b__0(String path) in ...... cs :line 135}
Exception occurs only on first run of the code. If I add another test case, the later one runs fine.
I attached two sample files, but it occurs on every doc I tried.
Version of Aspose.PDF.dll I'm using is 6.8.0.0 (2012.03.01).