PDF/A stamp size issue

Hi, I have an issue with ImageStamp size in PDF/A document.

If pdf document has for example PDF/X compliance, stamp size is ok and it has right placing. But if pdf has PDF/A format or converted to this format then image stretches to page width and resides in the middle. All setups are ignored even opacity, it's always 100%. Is this a known bug or I missed something?

Hi there,


Thanks for your inquriy. I have tested the scenario with my sample documents using Aspose.Pdf for Java 11.8.0 and noticed that only opacity property of ImageStamp is ignored in resultant PDFA, position and size of ImageStamp remain same as per source PDF document. So I have logged this issue as PDFJAVA-36100 in our issue tracking system for further investigation and rectification.

However, we will appreciate it if you please share your input/output documents along with source code here, so we will investigate it further and provide you information accordingly.

We are sorry for the inconvenience.

Best Regards,

Attached files.

1.pdf - source

2.pdf - correct with no compliance

3.pdf - bad with compliance

Here is the code of wrong behavior.

   Document d = new Document("C:\\opt\\1.pdf");
        ImageStamp imageStamp = new ImageStamp("C:\\opt\\aspose.png");
        imageStamp.setXIndent(100);
        imageStamp.setYIndent(100);
        imageStamp.setWidth(100);
        imageStamp.setHeight(100);
        imageStamp.setBackground(false);
        d.getPages().get_Item(1).addStamp(imageStamp);
        d.convert("log.xml", PdfFormat.PDF_A_1A, ConvertErrorAction.Delete);
        d.save("C:\\opt\\3.pdf");

As a result I have 3.pdf

Btw, I’m using 11.4.0 version of aspose-pdf. Can you try in that version?

Hi there,


Thanks for sharing additional information. I have tried the scenario with 11.4.0 and noticed the reported issue with PNG image stamp. However as stated above unable to reproduce in latest release, so please download and try latest version of Aspose.Pdf for Java, it will resolve the issue.

Furthermore in reference to above reported opacity issue, it is not bug but PDFA standard compliance. Transparent objects and layers (Optional Content Groups) are forbidden in PDF/A-1, but are allowed in PDF/A-2.

Please feel free to contact us for any further assistance.

Best Regards,

Hi there,


Please note we have reopened PDFJAVA-36100, as decided to try to fix the issue without using transparent objects. We will keep you updated about the issue resolution progress within this forum thread.

Thanks for your patience and cooperation.

Best Regards,

The issues you have found earlier (filed as PDFJAVA-36100) have been fixed in Aspose.PDF for Java 24.5.