0

I am working on a Extend Script which saves FrameMaker Book as a PDF. The script is able to save to the PDF but when I tried to add the PDF Metadata (Author/CreationDate/Keywords/Subject/Title) etc, the same does not reflect in the generated PDF.

On Closure inspection I found that Metadata elements were not added to PDFDocInfo property of the Book.

Here is the code which I wrote to update the Author Details in PDFDocInfo

$.writeln("Length before"  + doc.PDFDocInfo.length);
doc.PDFDocInfo.push("Author");
doc.PDFDocInfo.push("Mr Bond");
$.writeln("Length after"  + doc.PDFDocInfo.length);

where doc is an Object of type Book

The output is

Length before0
Length after0

Should the PDFDocInfo not have 2 elements in it now. Am I missing any thing here ?

Gunjan
  • 1
  • 2
  • 1
    The docs generated by jongware say (http://jongware.com/idjshelp.html) "PDFDocInfo Strings readwrite Contains a list of strings expressing values to be set in the PDF Document Info dictionary when you save the book as PDF. Each dictionary entry is expressed as a pair of strings; the first string expresses the field name, and the second string expresses the field value." Maybe try to set some infos via the UI and then read PDFDocInfo via script. If it takes 2 strings it may not be an Array. It could be an object. This is just a guess. I don't have and never used FrameMaker. – fabianmoronzirfas Apr 29 '14 at 07:25

1 Answers1

0

The following code did the trick...

        var pdfDocInfo = new Strings();
        pdfDocInfo.push("Author");
        pdfDocInfo.push("Mr Bond");
        book.PDFDocInfo = pdfDocInfo;
Gunjan
  • 1
  • 2