We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Merged PDF opens the last page in acrobat

I am using aspose pdf 10.6.1, after concatenating pdf files the pdf file doesnt open the first page, it opens the last page.

The pdf are merged using
PdfFileEditor editor = new PdfFileEditor();
editor.concatenate(inStreams, outputStream);

I have tried
Document doc = new Document(new ByteArrayInputStream(mergedPdfStream));
GoToAction action = new GoToAction();
action.setDestination(new XYZExplicitDestination(doc.getPages().get_Item(1), 0, 0, 0));
doc.setOpenAction( action);

Document doc = new Document(new ByteArrayInputStream(mergedPdfStream));
doc.setOpenAction( null);

if it is saved to output file it works, issue with the array stream save.


Hi Kalyan,

Thanks for using our API’s.

I have tested the scenario using couple of my sample PDF documents and I am unable to notice any issue. As per my observations, the resultant file is opening at first page of document. However, can you please share your sample PDF files, so that we can test the scenario in our environment.

Also please share that how you are viewing the document when saving contents in Stream array, once you have updated PDF OpenAction. We are sorry for this inconvenience.

I am able to resolve the issue using below steps

Pdf pdf=new Pdf();
Document doc=new Document(pdf);

for(all binary contents in array){
Document docTmp=new Document(new ByteArrayOutputStream(binaryContent));

--bos is byte array output stream


Hi Kalyan,

Thanks for the acknowledgement. We are glad to hear that your problem is resolved. Please continue using our API and in the event of any further query, please feel free to contact.