itextpfg 5.5.0 add watermark to existing pdf for printing only - itext

I am new to the PDF and have been working through examples and have understood the technology. I want be able to print watermark on existing pdf, but not show it in viewing mode. I am using PdfStamper to read in the existing pdf and then adding PdfLayer using getUnderContent(pagenum) and adding the watermark the layer. I set the attributes of layer for print to be true and false to be visible.
When I try to print it, no watermark. Now I can hide the watermark and printed if I create new pdf, but on existing pdf.
Any idea what I am doing wrong?

Related

How I can clean the pdf view

I have a form that makes a pdf when finished and I'm using flutter_pdfview package to view the pdf. I expect to finish the form and view the pdf, but if I want to modify something I want to see the changes, but I just see the first version of the pdf. I have this theory that if I clean the String of the path that pdfview uses to render the pdf. Maybe I could see some changes, but well I have no idea.
Thanks for your attention!

How can I set the Navigation tab to bookmarks Panel and Page

I'm generating a report using itext and creating bookmarks in the report. I would like the PDF to open with the bookmark section expanded. I can modify the properties of the document AFTER generation so that this occurs, but the PDF is generated by a batch process, so I want to add this into the generation.
I've tried using addViewerPreference(PdfName, PdfObject) but cannot seem to get this setting to work. I am able to use it to set other initial properties, but not this one.
I'm guessing that either that property isn't supported at all, or is not supported in the version of itext I'm using. I'm still using 2.1.7.

How to add custom properties to PDF document in Jasper Reports?

I need to put some custom properties into PDF document. Is possible to do that on JRPdfExporter class or somewhere else (filler etc) ? I can't find this.
Update:
I found only PdfStamper.setMoreInfo() method from iText. It works on exising pdf file only.

Repeat Image in fpdf without creating another instance

I know in PDFs one can have an image repeated (appear in the PDF more than once) without having multiple instance of the image (i.e. the image data appears in the file only once).
Is there a way to do this with fPDF? I am generating a PDF containing sheets of cards; each has artwork. The artwork, which can be 300dpi, may appear in the file thousands of times.
FPDF will only embed the image once.
From http://www.fpdf.org/en/doc/image.htm
Remark: if an image is used several times, only one copy is embedded in the file.
fPDF does this always. It checks to see if the filename has been added already and creates a reference to the original rather than re-add the image data.
I had used a report designer where this kind of reference had to be made explicitly and I erroneously expected fPDF would work similarly.

Now that I have the report viewer working in Local mode, how do I set the default render method?

I have finally gotten the ReportViewer to work in Local mode. Now I would like a report to render as a PDF or Excel spreadsheet automatically.
You use the LocalReport.Render method.
I've forgotten exact details but here is a PDF render I found