Free Support Forum - aspose.com

PDF Extract - Page gets duplicated on single page

Hi,

When I extract a pdf, the result page is overridden twice on the single page, once in portrat and other in lanscape.

We do have an enterprize license.

I have a 2 page PDF document and want to extract the first page. I execute the following code and return a byte array. I do not set any other properties, if i have to, please let me know what properties must be retrieved from the source and what must be set in the result page.

Please find attached the Source_Error.pdf and Result_Error.pdf.

aspose-pdf-kit-4.5.0.jar

java jdk 1.6

InputStream imageInputStream;

int[] extractPageNumbers;

OutputStream extractedImageOutputStream = new OutputStream()

//SPLIT IMAGE

pdfEditor = new PdfFileEditor();

pdfEditor.extract(imageInputStream, extractPageNumbers, extractedImageOutputStream);

Hi Zirk,


Thanks for using our products.

I have tested the scenario using Aspose.Pdf for Java 4.0.0 and I am unable to notice any issue. Please note that recently we have ported Aspose.Pdf for .NET to Java platform and we have release a MergedAPI of Aspose.Pdf for Java. Now this single component provides the feature to create and manipulate existing PDF files.

For your reference, I have attached the resultant PDF file which is generated over my end. I would suggest you to please try migrating to latest release of Aspose.Pdf for Java.

[Java]

com.aspose.pdf.facades.PdfFileEditor
pdfEditor =
new com.aspose.pdf.facades.PdfFileEditor();<o:p></o:p>

pdfEditor.extract(“c:/pdftest/Source_Error.pdf”,1,1, “c:/pdftest/Extracted_output.pdf”);