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

Free Support Forum - aspose.com

Merging PDFs

I creating a new pdf file by merging a couple of pfd files.. some of these files already have bookmarks.. when I merge them I am losing the bookmarks on the new file.. how can I merge and keep the bookmarks on the new created file?

Thank You.

Hi,


Thanks for your inquiry.
Please share pdf files and code snippet for more details.

Hi,


Thanks for your inquiry. As your request is related to Aspose.Pdf, I will move your request in Aspose.Pdf forum. My colleagues from Aspose.Pdf component team will answer you shortly.

Best Regards,

Hi,


Thanks for using our products.

I am a representative from Aspose.Pdf team. As requested by Imran, please share the source PDF files and the code snippet that you are using, so that we can test the scenario at our end.We are really sorry for this inconvenience.

string[] filesToMerge = documentList.ToArray<string>();

Aspose.Pdf.Facades.PdfFileEditor pdfEditor = new Aspose.Pdf.Facades.PdfFileEditor();

pdfEditor.Concatenate(filesToMerge, inPathFile);

// add bookmarks

Aspose.Pdf.Facades.PdfBookmarkEditor bmEditor = new Aspose.Pdf.Facades.PdfBookmarkEditor();

bmEditor.BindPdf(inPathFile);

Aspose.Pdf.Facades.PdfContentEditor contentEditor = new Aspose.Pdf.Facades.PdfContentEditor();

contentEditor.BindPdf(tempfile);

contentEditor.ChangeViewerPreference(Aspose.Pdf.Facades.ViewerPreference.PageModeUseOutlines);

contentEditor.Save(inPathFile);

contentEditor.Close();

Adding new bookmarks works just fine but the existing bookmarks from the merged files dissapera

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for the sample code.

To re-generate your issue at our end, we need your source PDF files which you are using for concatenation. This will help us identify your issue soon.

Sorry for the inconvenience,