Copy link to clipboard
Copied
I am attempting to set the PDFDocInfo at the book and doc level.
I can get the active book, get its props, and read and write to the PDFDocInfo. When I add book.SetProps( props ); to the code it crashes FrameMaker 11 or 12.
I tried doing only:
var book = app.ActiveBook;
var props = book.GetProps ( );
book.SetProps ( props );
Simplest possible case, and the same with doc, it still crashes.
Has anybody else seen this?
Regards,
Stuart
Stuart,
I am seeing generally the same behavior, except that FM doesn't crash, it just hangs and I have to kill it with the task manager.
So, I don't know what to tell you about SetProps(). Seems like a bug. Can you just set the property directly? Like:
var docInfo = new Array(0);
docInfo.push("some_string");
docInfo.push("some_other_string");
var book = app.ActiveBook;
book.PDFDocInfo = docInfo;
Russ
Copy link to clipboard
Copied
Stuart,
I am seeing generally the same behavior, except that FM doesn't crash, it just hangs and I have to kill it with the task manager.
So, I don't know what to tell you about SetProps(). Seems like a bug. Can you just set the property directly? Like:
var docInfo = new Array(0);
docInfo.push("some_string");
docInfo.push("some_other_string");
var book = app.ActiveBook;
book.PDFDocInfo = docInfo;
Russ
Copy link to clipboard
Copied
Here is one way that seems to work:
#target framemaker
var doc = app.ActiveDoc;
var info = doc.PDFDocInfo;
info.push ("Author");
info.push ("Charlie");
doc.PDFDocInfo = info;
This won't work if there is already an Author as it will just push a new Author into the "Strings" object. In that case, you can loop through the object and find the existing Author member and then replace the next member with the new Author name. I am pressed for time right now, but will try to work this out later. Thanks. Rick