Skip to main content
Participant
August 26, 2014
Answered

I am seeing book.SetProps() and doc.SetProps() crash both FrameMaker 11 and 12.

  • August 26, 2014
  • 2 replies
  • 436 views

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

This topic has been closed for replies.
Correct answer RussDWard

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

2 replies

frameexpert
Community Expert
Community Expert
August 27, 2014

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

www.frameexpert.com
RussDWardCorrect answer
Inspiring
August 27, 2014

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