PD4ML v4 Forums PD4ML Forums Technical questions / Troubleshooting PDF UA set LANG metadata

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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,
    Nina

    #34757

    Hi Nina,

    the title can be set with void setDocumentTitle(String title) API call. But with lang it is a bit more tricky.

    Try the following:
    pd4ml.addStyle("HTML, BODY {lang: DE-de !important}", true);

    #34769

    Thank 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.

    #34772

    See addMetadata() Javadoc

    The 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 sync

    #34775

    addMetadata() 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?

    #34777

    Sorry 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”>

    #34778

    Hello,

    can be set in section of HTML with i.e

    last post seems to be incomplete, could you please update?

    #34780

    Updated. See the comment above.
    If you copy-paste the meta tag, please make sure the copied double quotes are regular (not typographical).

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.