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 PdfExtractor pdfExtractor = new PdfExtractor(); pdfExtractor.BindPdf(pdfDocument); var endPage = pdfExtractor.EndPage; // pdfExtractor.EndPage is 0 pdfExtractor.ExtractImage(); endPage = pdfExtractor.EndPage; // now endpage is 106 }
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); var endPage = pdfExtractor.EndPage; // pdfExtractor.EndPage is 106 pdfExtractor.ExtractImage(); endPage = pdfExtractor.EndPage; // endpage is still 106 }It would appear that something is not correctly initialized when working with a Document. Can you please help me with this?
Regards,
Arjan Vermunt