Copy link to clipboard
Copied
Hello friends,
once more I have a question for you all.
I am importing .mif files with this function:
function render_file(file_path){
var doc = doc_GLOBAL;
var importFile = File(file_path);
var importParams = getImportPrefs();
var importReturnParams = new PropVals();
if(doc.ObjectValid()){
if(renderIndex == 0){ // Checking, if it is the first import. If so, use mainflowindoc, to get position
filePgf = doc.NewSeriesObject(Constants.FO_Pgf, doc.MainFlowInDoc);
}
else{ // if not first import, create the new pgf after the old one
filePgf = doc.NewSeriesObject(Constants.FO_Pgf, filePgf);
}
}
var textLoc = new TextLoc();
textLoc.obj = filePgf;
textLoc.offset = 0 ;
var res = doc.Import(textLoc, file_path, importParams, importReturnParams);
renderIndex++;
};
After importing the mif files one by one, I can see them in the doc, but between all the imported mif docs , there is one additional pgf i don't want to appear, and don't know why it appears.
The first imported mif file is in the green box, the second one in the blue box. In between of them, the yellow-red area, is the pgf (so i guess?) I don't want to have.
Am I doing something wrong with my pgf objects while importing?
Hope you can answer that question!
Thanks
Selim
Copy link to clipboard
Copied
Are you importing them by reference or by copy?
Copy link to clipboard
Copied
I am importing them by reference. Below you can see the function for loading the import params.
function getImportPrefs(){
var params, i;
params = GetImportDefaultParams();
i = GetPropIndex(params, Constants.FS_HowToImport);
params.propVal.ival = Constants.FV_DoByRef;
i = GetPropIndex(params, Constants.FS_ManualUpdate);
params.propVal.ival = false;
i = GetPropIndex(params, Constants.FS_FormatImportedText);
params.propVal.ival = Constants.FV_EnclosingDoc;
i = GetPropIndex(params, Constants.FS_UseMainFlow);
params.propVal.ival = true;
return (params);
};
Copy link to clipboard
Copied
Try commenting out line 11 and see what you get.