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

Free Support Forum - aspose.com

PDF/A compliance lost after adding dokument bookmark

Hello!

I convert documents zu PDF/A (using Aspose.Words), and after the conversion bookmarks are added to the pdf (with Aspose.PDF). This worked as expected so far.
Now I wanted to change the PDF compliance to PDF/A-2A and now I see, that adding bookmarks results in losing the pdf compliance.

Whats is the difference here between PDF/A-1A and PDF/A-2A and what can be done to fix this issue?
Input and output files are here: pdfABookmark.zip (330.5 KB)

Kind regards

@dvtdaten

We need to investigate this issue in order to further comment on it. Can you please share the code snippet to generate PDF using Aspose.Words as well as adding bookmarks to it? We will log a ticket in our issue tracking system and share the ID with you.

As the conversion is part of a complex use case, where different types of documents in a zip file are converted into one pdf document, I left out irrelevant parts of the code and set up a minimalistic code exampe, with which I can reproduce the issue:

// Aspose.Words Conversion
com.aspose.words.Document word = new com.aspose.words.Document(bis, new LoadOptions());

PdfSaveOptions saveOptions = new PdfSaveOptions();
saveOptions.setCompliance(PdfCompliance.PDF_A_2_A);

ByteArrayOutputStream stream = new ByteArrayOutputStream();
word.save(stream, saveOptions);

// Aspose.PDF sets Bookmark
com.aspose.pdf.Document pdf = new com.aspose.pdf.Document(new ByteArrayInputStream(stream.toByteArray()))
pdf.getOutlines().clear();

OutlineItemCollection pdfOutline = new OutlineItemCollection(pdf.getOutlines())
pdfOutline.setTitle(“test”);
pdfOutline.setDestination(new GoToAction(pdf.getPages().get_Item(1)));
pdf.getOutlines().add(pdfOutline);
pdf.save(stream, new PdfSaveOptions());

@dvtdaten

An investigation ticket as PDFJAVA-42347 has been logged in our issue tracking system for further analysis on this case. We will look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.