Search code examples
javapdfnetbeansitextopacity

Does Itext 5.5.13.3 support Transparent pdf backgrounds?


I am working on an existing codebase which is using Itext 5.5.13.3, I found this page https://kb.itextpdf.com/home/it5kb/faq/how-to-change-a-background-image-into-a-watermark-by-altering-the-opacity which seems to be about image transparency and the background transparency link is dead.

I have not attempted anything and I am simply wondering if it is possible with this version of Itext and where I can look for the proper documentation or method. I am using Netbeans and writing in Java

Edit: I want to have an option that allows the user to export a PDF with transparent/no background from my program similar to how it is done in PNG. The buttons are already functional, all I am missing is the actual pdf logic


Solution

  • Here is the correct link to the background transparency example - https://github.com/itext/i5js-sandbox/blob/master/src/main/java/sandbox/images/BackgroundTransparent.java

    If you (or anyone else) want the equivalent example for iText 7, you can find it here - https://github.com/itext/i7js-examples/blob/develop/src/main/java/com/itextpdf/samples/sandbox/images/BackgroundTransparent.java, or here for the C# version - https://github.com/itext/i7ns-samples/blob/develop/itext/itext.samples/itext/samples/sandbox/images/BackgroundTransparent.cs