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

avoid references to images and overall xrefs

Community Beginner ,
Feb 21, 2019 Feb 21, 2019

Copy link to clipboard

Copied

How to avoid references to images and overall xrefs during opening dita files with ExtendScript

Is there any parameter for that?

I'm having problem when I open dita files with extendscript in visible mode. but when I copy the file to different path where it doesn't see images and references then it is okey, so I am thinking to avoid references when I open the file.

any thoughts ?

TOPICS
Scripting

Views

479

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
Advocate ,
Feb 21, 2019 Feb 21, 2019

Copy link to clipboard

Copied

I created a function that allows me to open documents in all my scripts easily.

If you want your document to be opened invisibly, just use

var oMyDoc = OpenDoc( sFilename, "invisible" );

when oMyDoc is not null, it is the handle to the opened file.

function OpenDoc( sFilename, sOptions )

{

  var oaOpenProps = GetOpenDefaultParams( );

    if( sOptions != null && sOptions.match( "invisible" ) )

    {

        i = GetPropIndex( oaOpenProps, Constants.FS_MakeVisible );

        oaOpenProps.propVal.ival = Constants.FV_DoCancel;

    }

  i = GetPropIndex( oaOpenProps, Constants.FS_DontNotifyAPIClients );

  oaOpenProps.propVal.ival = true;

  i = GetPropIndex( oaOpenProps, Constants.FS_FileIsOldVersion );

  oaOpenProps.propVal.ival = Constants.FV_DoOK;

  i = GetPropIndex( oaOpenProps, Constants.FS_FontNotFoundInCatalog );

  oaOpenProps.propVal.ival = Constants.FV_DoOK;

  i = GetPropIndex( oaOpenProps, Constants.FS_FontNotFoundInDoc );

  oaOpenProps.propVal.ival = Constants.FV_DoOK;

  i = GetPropIndex( oaOpenProps, Constants.FS_RefFileNotFound );

  oaOpenProps.propVal.ival = Constants.FV_AllowAllRefFilesUnFindable;

  i = GetPropIndex( oaOpenProps, Constants.FS_UpdateTextReferences );

  oaOpenProps.propVal.ival = Constants.FV_DoNo;

  i = GetPropIndex( oaOpenProps, Constants.FS_UpdateXRefs );

  oaOpenProps.propVal.ival = Constants.FV_DoNo;

  oaRetParms = new PropVals( );

  oDocOpen = Open( sFilename, oaOpenProps, oaRetParms );

  if( oDocOpen.ObjectValid( ) )

  {

  return oDocOpen;

  }

  else

  {

  return null;

  }

}

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 ,
Feb 21, 2019 Feb 21, 2019

Copy link to clipboard

Copied

I think this:

  i = GetPropIndex( oaOpenProps, Constants.FS_DontNotifyAPIClients );

  oaOpenProps.propVal.ival = true;

fixed my issue

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
Community Beginner ,
Feb 21, 2019 Feb 21, 2019

Copy link to clipboard

Copied

LATEST

but then I don't see cross references

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