• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
0

Element Boundaries

Community Beginner ,
Nov 20, 2019 Nov 20, 2019

Copy link to clipboard

Copied

Hi, I'm trying not to print ElementBoundaries in to pdf when ElementBoundaries is turn on but square brackets are printed in pdf in Fm19. I tried use F_ApiSetInt(FV_SessionId, fm_docId, FP_ElementBoundaryDisplay, FV_ELEM_DISP_NONE). In Fm10 this solution is working pretty nice but in Fm19 donĀ“t. Any suggestion how to fix this ? Thanks.

TOPICS
Formatting and numbering , PDF output , Scripting

Views

778

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

Mentor , Nov 20, 2019 Nov 20, 2019

Hi, this was a major source of frustration for me, for some time. The problem showed up when the element boundary display became "global." I put "global" in quotes, because it affects documents at the application level, but the property still lives at the document level. Once you set it on one document, all other documents inherit that setting.

 

Anyway, despite the fact that others said F_ApiSetInt() still worked the normal way, it never worked for me. Finally, I got a suggestion to use FCodes, w

...

Votes

Translate

Translate
Community Expert ,
Nov 20, 2019 Nov 20, 2019

Copy link to clipboard

Copied

It must be a bug in FrameMaker 2019 and 2017. This is the ExtendScript code I am testing with:

#target framemaker

var doc;

doc = app.ActiveDoc;
doc.ElementBoundaryDisplay = Constants.FV_ELEM_DISP_NONE;

 It works in 2015, but fails in 2017 and 2019.

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 Beginner ,
Nov 20, 2019 Nov 20, 2019

Copy link to clipboard

Copied

Thanks for reply, so if it is bug it will be fixed in next update? Is there another way to set this element property to FV_ELEM_DISP_NONE ? Thanks.

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
Mentor ,
Nov 20, 2019 Nov 20, 2019

Copy link to clipboard

Copied

Hi, this was a major source of frustration for me, for some time. The problem showed up when the element boundary display became "global." I put "global" in quotes, because it affects documents at the application level, but the property still lives at the document level. Once you set it on one document, all other documents inherit that setting.

 

Anyway, despite the fact that others said F_ApiSetInt() still worked the normal way, it never worked for me. Finally, I got a suggestion to use FCodes, which does work for me. It is a little more complicated, because you are emulating the usage of the FM menus, which is clumsy at best. Effectively, you have to determine what the current setting is, in order to determine what code to execute. Here is an FDK function that works for me:

 

// For setting, send one of:
// FV_ELEM_DISP_NONE
// FV_ELEM_DISP_BRACKETS
// FV_ELEM_DISP_TAGS
VoidT setElemBoundaryDisplay(F_ObjHandleT docId, IntT setting)
{
  //If the doc is invalid, return
  if(!F_ApiObjectValid(FV_SessionId, docId)) return;

  //If there is nothing to change, just return
  if (F_ApiGetInt(FV_SessionId, docId, FP_ElementBoundaryDisplay) == setting) return;

  //If we are turning off, we need to first see what is
  //currently turned on, so we know how to turn off.
  if (setting == FV_ELEM_DISP_NONE)
  {
    if (F_ApiGetInt(FV_SessionId, docId, FP_ElementBoundaryDisplay) == FV_ELEM_DISP_BRACKETS)
      ws_DoFCode(KBD_ELEM_BORDER);
    else
      ws_DoFCode(KBD_ELEM_TAGS);
  }

  //Otherwise, if we are setting brackets...
  else if (setting == FV_ELEM_DISP_BRACKETS)
    ws_DoFCode(KBD_ELEM_BORDER);

  //Otherwise, if we are setting tags...
  else
    ws_DoFCode(KBD_ELEM_TAGS);
}

 

...and here is my ws_DoFCode() function:

 

VoidT ws_DoFCode(IntT fcode)
{
  IntT fcodes[] = {fcode};
  F_ApiFcodes(sizeof(fcodes)/sizeof(IntT), fcodes);
}

 

Here is the ExtendScript equivalent:

 

// For setting, send one of:
// Constants.FV_ELEM_DISP_NONE
// Constants.FV_ELEM_DISP_BRACKETS
// Constants..FV_ELEM_DISP_TAGS
function setElemBoundaryDisplay(doc, setting)
{
    //If the doc is invalid, return
    if(!doc.ObjectValid()) return;
    
    //If there is nothing to change, just return
    if(doc.ElementBoundaryDisplay == setting) return;
    
    //If we are turning off, we need to first see what is
    //currently turned on, so we know how to turn off.
    if(setting == Constants.FV_ELEM_DISP_NONE)
    {
        if(doc.ElementBoundaryDisplay == Constants.FV_ELEM_DISP_BRACKETS)
          Fcodes([FCodes.KBD_ELEM_BORDER]);
        else
          Fcodes([FCodes.KBD_ELEM_TAGS]);
    }
    
    //Otherwise, if we are setting brackets...
    else if(setting == Constants.FV_ELEM_DISP_BRACKETS)
      Fcodes([FCodes.KBD_ELEM_BORDER]);
    
    //Otherwise, if we are setting tags...
    else 
      Fcodes([FCodes.KBD_ELEM_TAGS]);
}

 

I hope this helps.

 

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 Beginner ,
Nov 20, 2019 Nov 20, 2019

Copy link to clipboard

Copied

LATEST

Russ, thank you it works.

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