pdf-generationextendscriptframemaker

Issues in Updating Metadata while Generating PDF


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 ?


Solution

  • The following code did the trick...

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