• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Import MIF files -> pgf problem?

Community Beginner ,
Feb 07, 2018 Feb 07, 2018

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.

asasd.png

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

TOPICS
Scripting

Views

231

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
community guidelines
Community Expert ,
Feb 07, 2018 Feb 07, 2018

Copy link to clipboard

Copied

Are you importing them by reference or by copy?

Votes

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
community guidelines
Community Beginner ,
Feb 08, 2018 Feb 08, 2018

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

};

Votes

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
community guidelines
Community Expert ,
Feb 08, 2018 Feb 08, 2018

Copy link to clipboard

Copied

LATEST

Try commenting out line 11 and see what you get.

Votes

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
community guidelines