How to change a PDF's title? #1006
-
So I have a template PDF (it's a medical claim form), with fields for everything that needs filled in. This part is easy, I can easily fill in the required data from my application. But even poring over the Javadocs I cannot figure out how to change the Stamper-generated PDF's title. There is no setTitle() method or similar...anywhere. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 13 replies
-
What kind of title do you mean? You can set the PDF metadata if you want. There are two types of metadata: the DID (document information dictionary) and XMP metadata. DID: XMP (a bit more effort since you have to edit/create it by yourself. You might want to use adobe's XMP lib for that): |
Beta Was this translation helpful? Give feedback.
-
It is either the file name or it is the PDF title defined in the XMP metadata. Do you have *dobe Reader installed? Then open it and under File\Properties\Document Properties\Descripton (Tab) you'll find it. Or post the file here and we can check... |
Beta Was this translation helpful? Give feedback.
-
But I am still using version 5.X so it might need some changes if you use the latest version:
|
Beta Was this translation helpful? Give feedback.
-
Ok that doesn't make sense. Sure you got the correct document (reloaded)? |
Beta Was this translation helpful? Give feedback.
AHA! I figured it out. Even though the
InfoDictionary
is empty in the Reader, creating a Stamper from the Reader moves the original XMP data into the corresponding keys in theInfoDictionary
in the Stamper. So setting theInfoDictionary
in the Stamper... does finally work. Apparently that overrides the XMP data in viewers. VERY CONFUSING.