Import a text formatting in a text box in indesign.

I have a string stored in the XML to RTF. I need to import this string in a text box in indesign.  I wrote the code below. But when I run the code, I get only a blank created textframe. The contents are not displayed. Could someone guide me on what I do for this?

ServiceRegistry InterfacePtr < IK2ServiceRegistry > (gSession, UseDefaultIID());

Int32 ImportProviderCount = serviceRegistry-> GetServiceProviderCount (kImportProviderService);

for (int32 ImportProviderIndex = 0; ImportProviderIndex < ImportProviderCount;. ImportProviderIndex ++)

{

Provider InterfacePtr < IK2ServiceProvider > (serviceRegistry-> QueryNthServiceProvider (kImportProviderService, ImportProviderIndex));

InterfacePtr < IImportProvider > importProvider (provider, IID_IIMPORTPROVIDER);

Assert (importProvider);

if (! importProvider)

{

Continue ;

}

char buffer [5000];

Memset (buffer, 0, 5000);

strcpy (buffer, itemText.GrabCString ());

PMString tt = buffer;

CAlert::InformationAlert (tt);

(Flow) InterfacePtr < IPMStream >

static_cast <>(StreamUtil::CreatePointerStreamRead (buffer, 5000))); IPMStream *.

if (importProvider-> CanImportThisStream (flow) == IImportProvider::kFullImport)

{

UIDRef item1;

importProvider-> ImportThis (docUIDRef.GetDataBase (), flow, K2::kSuppressUI, & item1, & point);

}

}

Any help or advice would be appreciated.

Thank you

PS

Sorry, I have an error.

Refer,

Int32 numHandlers = registry-> GetServiceProviderCount (kImportProviderService);

for (int32 index = 0; index)< numhandlers;="" index="" ++)="">

InterfacePtr (provider)

Registry-> QueryNthServiceProvider (kImportProviderService, index As Integer));

InterfacePtr importProvider (provider, IID_IIMPORTPROVIDER);

Int32 count is importProvider-> CountFormats();.

Int32 formatIndex = 0;

for (; formatIndex< count;="" formatindex++)="">

FormatName PMString = importProvider-> GetFormatName (formatIndex);

If (formatName == PMString ("RTF import filter")) break;

}

If (formatIndex< count)="">

UIDRef Webster (none, kInvalidUID);

DB-> BeginTransaction();

importProvider-> ImportThis (db, myStream, kSuppressUI, &uRef);)

If (uRef == nil) {}

Cannot read as data RTF

DB-> EndTransaction();

break;

}

need to copy the imported data of uRef in textModel

DB-> EndTransaction();

break;

}

}

Tags: InDesign

Similar Questions

  • Impossible to move objects or text boxes in inDesign CC

    I was working on an inDesign document without problem, and suddenly, I was unable to move objects or areas of text with the selection tools. I could move only with the help of my arrows. The objects are not locked and are not on a locked layer. This problem occurs now in all my other documents, and create a document did not help.

    I found this thread (why can I not move objects and text boxes in Indesign CS5.5?), which suggests that I have my inDesign preferences 'trash '. I did, and it does not solve the problem. I also uninstalled and then reinstalled inDesign, but that didn't fix the problem either. I use a version of Mac OS X 10.9.5.

    Can anyone help? Thank you.

    I don't have any of this

    but I deleted the cache & restart & now its good working

  • Add a little height to the text box in indesign?

    Hello!

    I have a big and nice script that applies the changes of height/width of a document based on the object styles, and other settings.

    But what I really need, is a script that comes Add a little height to a text box selected. It doesn't have to rely on the object styles and should only apply to a single box.

    I learn to program, but have no knowledge in javascript so far...

    Is it possible to shoot the script under?

    (Source: https://forums.adobe.com/thread/628574)

    setBoundsOfObjectsWithAppliedObjectStyle.jsx

    DESCRIPTION: change the settings of the applied with a certain style of object

    2010/02

    var doc = app.documents.firstItem ();

    var the_operator is ["absolut", "addieren", "multiplizieren", "prozentual scale"];.

    var r = get_param (doc.objectStyles.everyItem () .getElements () .slice (0), the_operator);

    var f_objects = get_objects (r.style);

    apply_values (f_objects, r, the_operator);

    function apply_values (the_objects, r)

    {

    for (var i = the_objects.length - 1; i > = 0; i--)

    {

    var f is the_objects [i] .visibleBounds;.

    If (r.op == the_operator [0]) / / 'absolut')

    {

    _y2 var = (r.height! = 0)

    ? Go [0] + r.height

    : gb [2];

    var _x2 = (r.width! = 0)

    ? GB [1] + r.width

    : GB [3];

    }

    Else if (r.op == the_operator [2] | r.op == the_operator [3]) / / oder "multiplizieren" "prozentual scale".

    {

    var the_div = (r.op == the_operator [2]) / / 'multiplizieren')

    ? 1

    : 100;

    _y2 var = (r.height! = 0)

    ? Go [0] + (gb [2] - gb [0]) * r.height/the_div

    : gb [2];

    var _x2 = (r.width! = 0)

    ? GB [1] + (gb [3] - gb [1]) * r.width/the_div

    : GB [3];

    }

    Else if (r.op == the_operator [1]) / / "addieren")

    {

    var _y2 = r.height; + GB [2]

    var _x2 = GB [3] + r.width;

    }

    the_objects [i] .visibleBounds = [[0] [1], _y2, _x2];

    }

    }

    function get_objects (a_style)

    {

    app.findObjectPreferences = null;

    app.findChangeObjectOptions.objectType = ObjectTypes.ALL_FRAMES_TYPE;

    app.findObjectPreferences.appliedObjectStyles = a_style;

    var the_result = doc.findObject ();

    app.findObjectPreferences = null;

    Return the_result;

    }

    function get_param (_styles, the_operator)

    {

    var style_names = new Array;

    Ausklammern von "CLX Raster []"

    for (var a = 1; a < _styles.length; a ++)

    style_names.push (_styles [a]. (Name)

    var min_width = 140;

    var field_width = 40;

    myDialog = app.dialogs.add var ({name: "Breite und Höhe von objects verandern"});

    with (myDialog.dialogColumns.add ())

    {

    with (dialogRows.Add ())

    {

    with (dialogColumns.Add ())

    {

    staticTexts.add ({staticLabel: "Objektstil:", minWidth:min_width});})

    }

    with (dialogColumns.Add ())

    {

    var myStylesDropDown = dropdowns.add ({stringList:style_names, selectedIndex:style_names.length - 1,:min_width}) minWidth;})

    }

    }

    with (dialogRows.Add ())

    {

    with (dialogRows.Add ())

    {

    with (dialogColumns.Add ())

    {

    staticTexts.add ({staticLabel: "Breite:", minWidth:min_width});})

    }

    with (dialogColumns.Add ())

    {

    var myWidthTextEditbox = textEditboxes.add ({editContents: "0", minWidth:field_width});})

    }

    }

    with (dialogRows.Add ())

    {

    with (dialogColumns.Add ())

    {

    staticTexts.add ({staticLabel: "height:", minWidth:min_width});})

    }

    with (dialogColumns.Add ())

    {

    var myHeightTextEditbox = textEditboxes.add ({editContents: "0", minWidth:field_width});})

    }

    }

    with (dialogRows.add ()) {}

    {with (dialogColumns.Add ())}

    staticTexts.add ({staticLabel: "operation:", minWidth: min_width ""});

    }

    with (dialogColumns.Add ())

    {

    var radio_buttons = radiobuttonGroups.add ();

    {with (radio_buttons)}

    radiobuttonControls.add ({staticLabel: the_operator [0], checkedState: true, minWidth: min_width});

    radiobuttonControls.add ({staticLabel: the_operator [1], checkedState: false, minWidth: min_width});

    radiobuttonControls.add ({staticLabel: the_operator [2], checkedState: false, minWidth: min_width});

    radiobuttonControls.add ({staticLabel: the_operator [3], checkedState: false, minWidth: min_width});

    }

    }

    }

    }

    }

    Ditto var = myDialog.show ();

    if(myResult == true)

    {

    var a_style = doc.objectStyles.item (myStylesDropDown.selectedIndex);

    var a_width = Number (myWidthTextEditbox.editContents.replace (', ','.'));

    var a_height = Number (myHeightTextEditbox.editContents.replace (', ','.'));

    var a_operator = the_operator [radio_buttons.selectedButton]

    If (isNaN (a_width))

    a_width = 0;

    If (isNaN (a_height))

    a_height = 0;

    myDialog.destroy ();

    }

    on the other

    {

    myDialog.destroy ();

    Exit();

    }

    return {style: a_style, width: a_width, height: a_height, op: a_operator};

    }

    var resizeItem = function(item, h) {
      const cs = CoordinateSpaces.INNER_COORDINATES,
      ap = AnchorPoint.TOP_LEFT_ANCHOR,
      rm = ResizeMethods.ADDING_CURRENT_DIMENSIONS_TO;
      item.resize  ( cs, ap, rm, [0,h] );
      }
    
    var h = new UnitValue ( "2mm").as("pt");
    resizeItem ( app.selection[0], h );
    

    Here you are

    Loïc

    www.ozalto.com

  • The text in a text box in InDesign disappears when I resize or move

    I have a running footer in a text box on a colored background. I want to push the text up a little so that it is centered in the colored band. But when I do, the text disappears. It is not aligned to the baseline grid and the text wrapping is disabled.

    Can anyone help? I use InDesign CS 5.5 on Windows.

    If you delete the color box, and then move the text, already done?   I think it may be an object hide it is the origin of the problem.

  • How create 2 text boxes in inDesign to pdf interactive related?

    I created interactive PDFs with many boxes and in the box 'address', I want it to be on two lines in case of long text. When I turn 2 text frames related in boxes of interactive text, they became distinct. But I need the text is flowed by one box to another when the person is completing the form. Help, please!

    To bind form fields text is flowed from one field to another you will need to do in Acrobat with javascript, here is a link that describes the procedure. There is no way to do this directly in Indesign.

  • How to: ungroup or remove text boxes in InDesign

    Hello

    I work on the 300-page report, how can I break the wire between the chapters? Please see the figure:
    Untitled-2.jpg

    Note: I use InDesign CC 2015 on Mac

    Thank you

    /*
    ------------------------------------------------------------------------------------------ ------------------------
    StorySplitter
    ------------------------------------------------------------------------------------------ ------------------------
    An InDesign CS/CS2/CS3 JavaScript by FourAces
    © The Final Touch 2006
    Version 3.0.0
    
    Splits the selected Story to separate Text Frames, while maintaining their contents.
    ------------------------------------------------------------------------------------------ ------------------------
    */
    var myScriptVer = "3.0";
    
    if(app.documents.length != 0){
              var mySelection = app.activeDocument.selection;
              if(mySelection.length != 0){
                        myObjectType = mySelection[0].constructor.name;
                        if(myObjectType == "TextFrame"){
                                  //The Interface Dialog
                                  var myDialog = app.dialogs.add({name:"Story Splitter v"+ myScriptVer});
                                  with(myDialog){
                                            with(dialogColumns.add()){
                                                      with (dialogRows.add()){
                                                                with(borderPanels.add()){
                                                                          var mySplitOptions = radiobuttonGroups.add();
                                                                          with(mySplitOptions){
                                                                                    radiobuttonControls.add({staticLabel:"Split All Frames", checkedState:true});
                                                                                    radiobuttonControls.add({staticLabel:"Split Before Selected Frame"});
                                                                                    radiobuttonControls.add({staticLabel:"Split After Selected Frame"});
                                                                          }
                                                                }
                                                      }
                                                      with (dialogRows.add()){
                                                                staticTexts.add({staticLabel:"© The Final Touch"});
                                                      }
                                            }
                                  }
                                  var myResult = myDialog.show({name:"SplitOptions"});
                                  if(myResult == true){
                                            var myStory = mySelection[0].parentStory;
                                            if(app.version.split(".")[0] >= 5){
                                                      var myTextFrames = myStory.textContainers;
                                            }
                                            else{
                                                      var myTextFrames = myStory.textFrames;
                                            }
                                            var myStoryFramesCount = myTextFrames.length;
                                            if(myStoryFramesCount > 1){
                                                      for(f = 0; f < myStoryFramesCount; f++){
                                                                if (mySelection[0] == myStory.textFrames[f]){
                                                                          var myTextFrame = f;
                                                                }
                                                      }
                                                      switch(mySplitOptions.selectedButton){
                                                                case 0:
                                                                          mySplitAll();
                                                                          break;
                                                                case 1:
                                                                          mySplitBefore();
                                                                          break;
                                                                case 2:
                                                                          mySplitAfter();
                                                                          break;
                                                      }
                                            }
                                            else{
                                                      alert("Are You Kidding Me?!\nThe Story you selected has only ONE text frame.");
                                            }
                                  }
                        }
                        else{
                                  alert("Wrong Selection\nYou selected the wrong type of object. Please select a Text Frame.");
                        }
              }
              else{
                        alert("No Selection Made.\nPlease select a Story to split.");
              }
    }
    else{
              alert("No Active Document Found.\nPlease open an InDesign document and select a Story to split.");
    }
    
    //----------------------------------------------------------------------------
    function mySplitAll(){
              for(i = 0; i < myStoryFramesCount; i++){
                        myTextFrames[i].duplicate();
              }
              for(i = 0; i < myStoryFramesCount; i++){
                        if(app.version.split(".")[0] >= 5){
                                  myTextFrames[i].remove();
                        }
                        else{
                                  myTextFrames[0].remove();
                        }
              }
    }
    
    function mySplitBefore(){
              if(mySelection[0].previousTextFrame == null){
                        alert("Unable Break Thread.\nThe selected Text Frame is the FIRST text frame of the thread.");
              }
              else{
                        var myBfBreakFrame = mySelection[0].previousTextFrame;
                        var myAfBreakFrame = mySelection[0];
                        var myBreakStory = myBfBreakFrame.parentStory;
                        mySelection[0].previousTextFrame = null;
                        if(myBfBreakFrame.overflows == true){
                                  var myOversetText = myBreakStory.texts.itemByRange(myBfBreakFrame.insertionPoints[-1],myBreakStory.insertionPoints[-1]);
                                  myOversetText.select();
                                  app.cut();
                                  app.select(myAfBreakFrame.insertionPoints[0]);
                                  app.paste();
                        }
              }
    }
    
    function mySplitAfter(){
              if(mySelection[0].nextTextFrame == null){
                        alert("Unable Break Thread.\nThe selected Text Frame is the LAST text frame of the thread.");
              }
              else{
                        var myBfBreakFrame = mySelection[0];
                        var myAfBreakFrame = mySelection[0].nextTextFrame;
                        var myBreakStory = myBfBreakFrame.parentStory;
                        mySelection[0]          .nextTextFrame = null;
                        if(myBfBreakFrame.overflows == true){
                                            var myOversetText = myBreakStory.texts.itemByRange(myBfBreakFrame.insertionPoints[-1],myBreakStory.insertionPoints[-1]);
                                  myOversetText.select();
                                  app.cut();
                                  app.select(myAfBreakFrame.insertionPoints[0]);
                                  app.paste();
    
                        }
              }
    }
    

    When a script is written a lot, that's eternity! It works perfectly with ID CC!

    Adi, thank you very much!

  • Why can I not move objects and text boxes in Indesign CS5.5?

    I've recently upgraded to Indesign CS5.5.I have worked on a document and everything was fine, but I suddenly realized I could move is no longer areas of text or objects using the direct Selection tool and dragging. Objects do not just move. I can move them by selecting them and then painstakingly moving with the arrow keys. I can also reshape their dragging points middle and corners. The objects are not locked and are not on a locked layer. The "anchored object ' options are grayed out and I can not also copy one of the objects."  Please can someone help?

    Garbage, replace, reset or restore the application preferences: http://forums.adobe.com/thread/526990

  • How can I get rid of the text box in InDesign CS4?

    For some reason, I can't get rid of the surrounding area of my text, how can I get rid of this? The text is also a link so...

    Thanks in advance...

    Open hyperlink Panel, double-click your hyperlink under URL field. Set your appearance of hyperlink´s the form of Rectangle Invisible...

  • / Text box link to another article in Indesign

    Hey guys,.

    I hope I can do so.

    I copy the text and/or text boxes in an Indesign document that has been put in place for printing (210 x 297) and paste it into a new document put in place for iPad (1024 x 768) to Adobe DPS.

    After pasting, I replace the missing fonts with versions of open Type.

    If I then close print document which I copied the text and then click a text box in the iPad-target document, print file will open immediately.

    Similarly, import of the article focus on the iPad in a folio will result in the original InDesign file is inaccessible during the import process.

    To remedy this, I have severed all ties to the styles, removed all paragraph and character styles, copied the text into a new text box in InDesign temporary document then copied the text in that targeted iPad... and always the same--opening of original print document has a third.

    Any help would be totally fantastic.

    See you soon.

    Nathan Ford

    Reddo Media

    I had the same problem with some of my files. We understand that the problem may be caused by a left on hyperlinks or interactivity attached with this text. If you go to links and break everything that it should be corrected.

    If that does not try not select and copy only the text and paste it into the new InDesign document. Do not copy and paste the text box I have found causes more often this type of behavior.

  • Smart txt reflow - how do you work with several text boxes?

    Hello

    I create ID cards to work, for 650 employees. I had used the reflow of text before smart on other jobs and I don't foresee any problems with its use for this project. To explain my problem:

    I'm doing a template with a trial of ten employees file. The design on each card, it is a name and a unique ID to be used. The name is 18pt and code 10pt.

    On my main page, I have a block of text for the name and a text block for the employee ID. The text blocks are as wide as the work plan but only high enough to adapt to a single name by image to the relevant point size.

    On the first page of my document, I select 'place' and then select the text file with all the names, I get the change of cursor in the image of the text, I hold SHIFT for the debit option and click on my name text box. InDesign automatically creates 9 new pages, and I now have a 10 page document. So far, perfect.

    I select "place" again, choose the employee code text file, click on my block of text in code used on the first page, and repeat the same process as above.

    My problem starts - I want codes for the employee to just flow through ten pages, as the names, but when I place the codes file and select the text on the first page, inDesign creates 10 new pages after the tenth page. So I find myself with 20 pages - the first ten pages with names and nothing in the code text boxes and the last ten pages with the codes but nothing in the name text boxes.

    I am at a loss as to why he does this. I was playing with the settings in the preferences, but nothing changes. I tried to select both the two text files and import at the same time.

    How do you work with several text boxes and several import of text file on a doicument? There are no extra spaces or something like that in my text files.

    I really don't want to have to link all text blocks - that will forever, but right now it's the only way I can get it to do what I want.

    Also, is there anyway to specify the font and the size of the text is important as? Because it keeps import as minion pro, even if the text boxes on the master are set to the correct font and size. Not a big deal though.

    Help, please! Any help is appreciated, thanks in advance!

    Ah, I think I misunderstood your original post and thought you wanted to do 10 badges per page. If it's only one, you need only a set of images. Same procedure for setting in place, but you have no need to screw anything or use the step and repaet to make copies.

    Place the file name in the frames of name and ID will add pages and then return to the first page and place the numbers. Just don't forget to put the bad slider in the space where the framework and to stay away from the guides (if you click on a guide, ID will ignore masters executives) and hold down the SHIFT key when you click.

  • Layered text boxes

    I try to layer text boxes in Indesign and can not understand.  I have several pages with linked text boxes, but I want to create a new text box on some pages to display a new one; as a Medallion.  I hope that makes sense, suggestions on how to achieve this?  This is probably very simple, I have not found the right command or tutorial!

    Thank you

    Clear skin for block of main text, or ignore wrap them for executives you want to put on main text block.

    --

    tomaxxi

  • Reference imported from the Word will not be deleted in indesign textbox

    I have an annoying problem!

    I received an indesign doc of my client, they have already imported the text (with styles) of the word to me.

    But now, I continue to have problems wit a footnotecontainer who does not want to be removed from my text box. It remains at the bottom of my text box to indesign, visible with a black line.

    I have tried everything I know to remove it, but goes beyond my knowledge of indesign (which is a lot). Does anyone have a solution for me?

    Schermafbeelding 2014-09-11 om 12.51.54.png

    Best regards and thanks, Liek

    Liek,

    I would text van voetnoot weggegooid in het vakje hotel of voetnoot-text. Maar op of pagina zelf staat voetnoot vermelding nog, en DUS squeeze somewhere I toch nog een get onderaan vak. ALS I of vermelding weggooit verdwijnt ook het vak.

    Of gemakkelijkste handle vermelding om you vinden is said:

    1. Klik met tekstcursor in het zijn voetnoot-vak.

    2 Klik daarna om het text rechtermuisknop op menu op you roepen.

    3 Kies 'Ga naar Voetnoot Referentie' (uh... ik heb een myself versie en daar heet to say ' go to the reference to the ".) I what het wel Hij staat min of meer in het midden van het menu.)

    4. of tekstcursor zou nu achter direct of vermelding like Haag. 1 x back en hij is weg.

    ALS said niet proberen lukt we wat anders.

    ---

    (In English, for those who have the same problem):

    1. click in the reference at the bottom zone

    2. in the contextual pop-up menu, choose "go to the reference to the".

    3. Select "go to reference to the" somewhere close to the middle of the list of the menu.

    4. the text cursor moves to behind the reference. BACKSPACE to delete it.

    If this does not work you try something else.

  • Text box formatting

    Hello. I'm fairly new to using APEX and I'm trying to understand some formatting for the text boxes.

    I currently have a text field (with the tag search) which was originally the model "Optional (Horizontal - right-aligned) ', but using this fact my text field appear in the center of the region, it is in.

    I wanted the text field appear on the left of the area by assigning "Optional (Horizontal - left-aligned).

    However, only the 'Search' label has been moved to the left and the text field was not moving, so it appears as follows:

    Current.png

    Is there a way I can make it appear as if it was below?

    New.png

    Thank you.

    set these properties it will work for you

  • Text boxes have gone white! Problem of formatting or glitch?

    We use InDesign on the same computer for years, and today (while establishing a print publication), text boxes went white. The text was not deleted, just inaccessible and invisible. The only way that the text could become visible was messing with the formatting - change column number, increasing the border spacing, etc. - and even then it would not completely work. Is it a formatting problem or a bug in the program? We have already done basic troubleshooting (restarting the computer, modify files, etc.). I would like to know why this happened, so we could avoid any incident in the future.

    Yes we usually postpone files from previous publications and who for years without any problem.

    Could it be a corrupted file?

  • Formatting of a single element of text in a text box (I know... I'm sorry)

    Hello

    I have a real problem to identify ways to format a single word in a text border box.

    I looked at all the issues here around that and they all seem relatively simple, but nothing that I do doesn't work.

    I created a symbol with a text box called initialText. I then placed the following code in compositionReady on the stage:

    SYM. $('initialText') .html ("< p > for business decisions, it is useful to ask yourself five questions < strong > < facilities > on the left.") If your answer to any of these questions is 'no', you have to stop what you're doing immediately and seek advice from your manager, your human resources department or your legal team and compliance. (< /p > ');

    However, it is simply not displaying all the text at all. I am pulling my hair - how can be so hard to format a single word?

    Could someone please talk me through it step by step, assuming that I'm a fool?

    Thank you

    -mat

    Post edited by: Matt Hindle - changed apostrophes on 'no' to double

    Yes. I guess that your text is placed somewhere in the main timeline or in a symbol. If you are not sure of the way, when you are in compositionReady of the timeline on the side, you can use the code window to add your code.

    Chose / editing text and the forest down to the text name and double-click it. Will add the code text where you are (compostionReady of the chronology of the coast or where you are.) See the example below:

Maybe you are looking for

  • HD download purchases SD again?

    Hello. Some time before, I bought elements to format SD. Now, whenever the attempt to download these same items in HD, I get a line item. That remove each SD element allows me to download article in HD without extra charge. This workaround is necessa

  • a6000n: memory upgrade, changes in Bios?

    I increased my memory to 6 shown g and only 2.75 g is usable. Don't change the dimm places no help. I have to do something with the Bios settings to use illustrated 6 GB memory? I use 2-2 g and sticks 2-1 g. The specification on the a6000n show 32-bi

  • What to do when you think you have a virus on your computer.

    I did a scan on my Avast security and he hooked, I had 4 different virus and I did what she asked him to put "in the chest", but it would, nt go so I deleted and restarted my computer. I still have the problem, when I go to search it is redirected to

  • Delivery to the recipient has failed

    This is the only message that I get no error codes nothing, but I don't know why it has failed-i havew been emailing this addy more than 2 years

  • Widows vista SP1 installed watch, but still giving it to me as an unpdate, what should I do?

    I installed windows vista service pack 1 as an update, and when I check the history update watch installed and successful, but when I go to update the system still gives it to me as if it was not installed. I installed again and it shows successful,