HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML Forums › Technical questions / Troubleshooting › PDF UA set LANG metadata
- This topic has 7 replies, 2 voices, and was last updated Jun 08, 2022
21:56:17 byPD4ML.
-
AuthorPosts
-
May 24, 2022 at 10:15#34756
Hello,
Is there a possibility to set metadata (Title, LANG) for PDF UA feature through PD4ML api rather than in the content of HTML?
I’ve found a sample where this data is passed in HTML tags. I’m trying to use PD4ML.addMetadata(“lang”, “DE-de”, false) method but it seems does not change language metadata.
Could you please suggest an option?Thanks,
NinaMay 24, 2022 at 14:22#34757Hi Nina,
the title can be set with
void setDocumentTitle(String title)API call. But withlangit is a bit more tricky.Try the following:
pd4ml.addStyle("HTML, BODY {lang: DE-de !important}", true);June 3, 2022 at 09:06#34769Thank you, it works!
One more question, is that possible to set other metadata values (Subject, Keywords, Creator, Producer, CreationDate, ModDate and Trapped) using something like PD4ML.set*** similarly to setDocumentTitle() and setAuthorName()? I cannot find corresponding methods for these fields in the PD4ML class api.June 3, 2022 at 21:23#34772The method updates PDF’s XMP metadata.
Note, that date may appear in PDF in two different formats.
XMP metadata: “2009-11-27T18:25:45+01:00”
PDF info object: “D:20091127182545+01’00′”So you’ll probably also need to call
pd4ml.setParam(Constants.PD4ML_DOCUMENT_DATE, "D:20091127211216+01'00'");to keep the doc dates in syncJune 7, 2022 at 14:15#34775addMetadata() tells that I should not use keys for standard properties:
key – a unique name, which must not be one of the standard property names Title, Author, Subject, Keywords, Creator, Producer, CreationDate, ModDate and Trapped
So, could you please confirm that I can use addMetadata() method to set these properties?
June 8, 2022 at 08:48#34777Sorry for the misleading hint. You are right, addMetadata() is a wrong way.
PD4ML allows to override “Creator” via environment variable:
System.getProperty( “pd4ml.creator.application”, cLogo );“Author”
“Keywords”
“Subject”can be set in <head> section of HTML with i.e <meta name=”Keywords” content=”test meta”>
June 8, 2022 at 10:50#34778Hello,
can be set in section of HTML with i.e
last post seems to be incomplete, could you please update?
June 8, 2022 at 21:56#34780Updated. See the comment above.
If you copy-paste the meta tag, please make sure the copied double quotes are regular (not typographical). -
AuthorPosts
You must be logged in to reply to this topic.
