Skip to main content
Jacob_AA
Known Participant
Feb 21, 2019 2:05 PM UTC
Question

avoid references to images and overall xrefs

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 ?

This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

Jacob_AA
Jacob_AAAuthor
Known Participant
Feb 21, 2019 3:00 PM UTC

but then I don't see cross references

Translate
Jacob_AA
Jacob_AAAuthor
Known Participant
Feb 21, 2019 2:54 PM UTC

I think this:

  i = GetPropIndex( oaOpenProps, Constants.FS_DontNotifyAPIClients );

  oaOpenProps.propVal.ival = true;

fixed my issue

thanks

Translate
4everJang
Legend
Feb 21, 2019 2:15 PM UTC

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;

  }

}

Translate