Skip to main content
Known Participant
February 7, 2018
Question

Import MIF files -> pgf problem?

  • February 7, 2018
  • 1 reply
  • 359 views

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

This topic has been closed for replies.

1 reply

frameexpert
Community Expert
Community Expert
February 7, 2018

Are you importing them by reference or by copy?

www.frameexpert.com
selimc777Author
Known Participant
February 8, 2018

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);

};

frameexpert
Community Expert
Community Expert
February 8, 2018

Try commenting out line 11 and see what you get.

www.frameexpert.com