PdfExtractor not working with constructor with Document

Hi,


I’m trying to work with the PdfExtractor on an in-memory Document. The EndPage property of the PdfExtractor is 0 (zero). And when I invoke the ExtractImage method of the PdfExtractor the EndPage is set to the correct value. This is the code I’m using:
private void Foo(byte[] data)
{
MemoryStream stream = new MemoryStream(data);
Document pdfDocument = new Document(stream);
// pdfDocument.Pages.Count is 106
<span style="color:#2b91af;">PdfExtractor</span> pdfExtractor = <span style="color:blue;">new</span> <span style="color:#2b91af;">PdfExtractor</span>();
pdfExtractor.BindPdf(pdfDocument);

<span style="color:blue;">var</span> endPage = pdfExtractor.EndPage;
<span style="color:green;">// pdfExtractor.EndPage is 0</span>
pdfExtractor.ExtractImage();
endPage = pdfExtractor.EndPage;
<span style="color:green;">// now endpage is 106</span>

}

The following code does work correctly. The EndPage of the PdfExtractor has been set correctly from the start:
private void Foo(string fileName)
{
PdfExtractor pdfExtractor = new PdfExtractor();
pdfExtractor.BindPdf(fileName);
<span style="color:blue;">var</span> endPage = pdfExtractor.EndPage;
<span style="color:green;">// pdfExtractor.EndPage is 106</span>
pdfExtractor.ExtractImage();
endPage = pdfExtractor.EndPage;
<span style="color:green;">// endpage is still 106</span>

}

It would appear that something is not correctly initialized when working with a Document. Can you please help me with this?

Regards,
Arjan Vermunt

Hi Arjan,


Thanks
for contacting support.
<o:p></o:p>

I
have tested the scenario and I am able to notice the same problem. For the sake
of correction, I have logged this problem as PDFNEWNET-36178 in
our issue tracking system. We will further look into the details of this
problem and will keep you updated on the status of correction. Please be
patient and spare us little time. We are sorry for this inconvenience.