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 ?
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;
}
}
Copy link to clipboard
Copied
I think this:
i = GetPropIndex( oaOpenProps, Constants.FS_DontNotifyAPIClients );
oaOpenProps.propVal.ival = true;
fixed my issue
thanks
Copy link to clipboard
Copied
but then I don't see cross references