Highlighted

avoid references to images and overall xrefs

Community Beginner ,
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

402

Likes

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

avoid references to images and overall xrefs

Community Beginner ,
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

403

Likes

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

  }

}

Likes

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
Reply
Loading...
Feb 21, 2019 2
Community Beginner ,
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

Likes

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
Reply
Loading...
Feb 21, 2019 0
Jacob_AA LATEST
Community Beginner ,
Feb 21, 2019

Copy link to clipboard

Copied

but then I don't see cross references

Likes

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
Reply
Loading...
Feb 21, 2019 0