• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

New Here ,
Aug 26, 2014 Aug 26, 2014

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

TOPICS
Scripting

Views

365

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Aug 27, 2014 Aug 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

Votes

Translate

Translate
Explorer ,
Aug 27, 2014 Aug 27, 2014

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 27, 2014 Aug 27, 2014

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines