This content has been marked as final. Show 5 replies
1. PDF file will be placed in a folder after generation and that should not be copied to other locations.You can't control that from Java. You probably can't control it at all.
2. PDF file should only have an option print nothing else. The save/save as options should never be enabled.That should be in the security API if supported.
3. PDF expiry date is required, so that PDF file will get expire after duration.Ditto.
I did that too, with too much experiments.
Code snippet for reference.
PdfReader reader = new PdfReader(getOutputFilePath());
PdfStamper stamper = new PdfStamper(reader, new FileOutputStream("my-new-file.pdf"));
int permissions = PdfWriter.HideMenubar & PdfWriter.HideToolbar & PdfWriter.HideWindowUI & ~( PdfWriter.AllowCopy | PdfWriter.AllowModifyAnnotations | PdfWriter.AllowFillIn | PdfWriter.AllowAssembly | PdfWriter.AllowModifyContents | PdfWriter.AllowScreenReaders);
I am able to disable the save button, but I am unable to disable the save as option.
It would be great help, if you can give some inputs on this.