[InDesign c# Script] Problem with textframe.place (imageName)

Hello everyboy.


I start with InDesign scripting in c#, and the documentation is very poor. I have a problem and I can't find the solution.


I place an image in a textframe on the page of my document.

I create my textframe with no problems:

myDocument.Layers.Add ();
InDesign.Layer lastLayer = myDocument.Layers [myDocument.Layers.Count (InDesign.Layer)];
InDesign.TextFrame myPicture = myPage.TextFrames.Add (lastLayer, InDesign.idLocationOptions.idUnknown, myPage);

myPicture.GeometricBounds = new string [4] {myY, myX, myY2, myX2};

Then I try to place my picture, but I can't find what kind of object is returned by. Place the method:

First test:

InDesign.Graphics myGraphic = (InDesign.Graphic) myPicture.Place (path, false);

And I got this error:

{System.InvalidCastException: unable to cast COM type object 'System.__ComObject' interface type 'InDesign.Graphics'.} This operation failed because the QueryInterface call on the COM component for the interface with IID '{C85A4AB3-9492-4C40-8A7B-F8305706C8B8}' failed due to the following error: no such interface supported (Exception from HRESULT: 0 x 80004002 (E_NOINTERFACE)).
to Service.createPhotograph (XmlNode photo, Page myPage) in c:\Documents and Settings\melaniep\My Documents\Visual Studio 2005\WebSites\WebSite6\App_Code\Service.cs:line 204}

And I saw this tutorial on javascript to place images at http://www.Adobe.com/devnet/InDesign/PDFs/indesigncs4_scriptingtutorial.PDF


Display a standard dialog box open the file to select a graphic file.
var myGraphicFile is File.openDialog ("choose a graphic file");.
If you have selected a graphics file, and if you didn't press Cancel,
Place the graphic file on the page.
If ((myGraphicFile! = "") & & (myGraphicFile!) (= null)) {}
var myGraphic = myDocument.pages.item (0) .place (myGraphicFile);
Since you can place multiple graphics at once, the place method
Returns an array. For the graph you have placed, get the first
element of the array (beginning of JavaScript arrays with element 0).
myGraphic = myGraphic [0];

So I tried:

InDesign.Graphics myGraphics = myPicture.Place (InDesign.Graphics) (path, false);
InDesign.Graphic = (InDesign.Graphic) myGraphics myGraphic [0];

But I got the same error.

Someone has an idea? I'm really lost, and I don't know what to do :'(

Another small issue.

My photo is smaller than my textFrame.

And I want my picture fits the texframe.

MyGraphic.HorizontalScale = widthOfTextFrame

MyGraphic.VerticalScale = heightOfTextFrame

Not working? Or am I in the wrong way?

Thank you very much (and sorry for my bad English, I'm french )

To resize the image, look at "suitable" and fitOptions.

Bob

Tags: InDesign

Similar Questions

  • Help. Very stupid problem with the placement of word files.

    As you can see I am a beginner total to Indesign. I don't know how but I can't place any text imported from Word into my project. Weird thing that if I create a new document it works. However, in this project I've done a lot of styles and other things so I don't want to start from scratch, so the question is:

    Is there some option "I accidentally the entire project" and is anyway to fix it. [Or maybe export styles and master pages to another document?]

    The problem with the placement of text word said that the text is too big (Red Cross).

    InDesign CS6 30 day trial.

    Post edited by: Niebieski_Mak

    Ok.

    There are a number of possibilities for what are the causes of the text immediately became excessive. Is usually only a problem with a youove of added restrictions that makes a too wide to fit in the frame line (but it can also occur if you have a set of "keep the option" which requires the text to stay together and there is inusfficient space to hold all the lines, or requiring that the text starts on an odd page / hand and the one you have is wrong).

    The most common cause is probably the wrong application of the No. Break attribute. New users sometimes confuse this to how to disable hyphenation, but in fact it prevents any text to which it is applied to break even between words. Next most common, I think, is a long text string with nonbreaking spaces between the words (I see a lot of this in Word documents), and not allowing not standard, yet once, there are no place to get out.

    I've also seen cases where the format for the text calls for a font size of very large size, which makes it impossible to fit the text, or when the dashes from left or right, in the paragraph style, override local formatting or text block options, are too large to allow the text to fit.

    The best way to find out, in my opinion, is to choose the frame then go to Edition > edit in story editor, you can see and select the text and check these things.

  • You have a problem with 6th place with the CAP in ythe filter in photoshop CC2015?


    Hi

    I have a problem with the number of places 6 on my Mac 2 in photoshop CC 2015: the number 6 plug won't run right... I ask a question about Adobe helpdesq phone, the creators of witch plugin work not... but no answer!

    and Digital Anarchy give tme he good answer (a big thanks to them) 6 places are sometimes a "dead spot", you need to install a trial version of antoher Plug and after cursed instead number 6 is busy and all the other plugsin run right: according to the response of Digital Anarchy

    "Ah, we've seen this bug before. We do not know why this is happening, this happens on all applications Adobe CC I think, but when some plugins are listed as the 6th plugin in the filters dropdown you get the error you see. This is purely something on side of things Adobe. It's annoying, but the only way around is to remove some plugins, so that the 6th plugin is changed it's order in the list of 5 or lower OR install another plugin (trial version would work fine) which would fall our plugins up to 7 or higher. Sorry, there is no way to change the order of the plugins either. »


    Samsam


    Hi samar.

    This is a bug experienced with Photoshop CC2015 and the engineering team working on it.

  • Problem with the placement of layer 3D Ray Trace

    I have problems with this ORB. I want it revolve around the ferret, as it seems to be made up display on the right, but when it is in the camera activates, it remains before the ferret. If I place the ORB layer below the layer of ferret, so everything is behind the ferret. I can't surround around well. Any ideas on how to get this to work? I work in Raytraced 3D.

    I am running After Effects on mac osx 10.7.4 11.0.1.12 CS6.

    Screen Shot 2012-06-18 at 3.55.19 PM.png

    Edit: To give more information, the orb is a CC Particle World with a glow effect.

    So here is what I found that worked. I took the extruded ferret and the movement of the camera and pre-comp had, he fell into a new comp, he made a 3D layer, then put my particle effect in and using the obstructing layer as you suggest, I could successfully create the scene that I was going to. He also spead to the top the overview and updates LiveUpdate considerably.  I also used a mask to make smaller ferret model, although I don't know if that actually does something.

    Thanks ShiftHorizon for suggesting particular and thanks Mylenium for obfuscation layer!

  • Problems with the placement of PDFs in CS4

    I recently upgraded to CS4. I'm having a problem when I place a pdf in indesign CS4. When I place the PDF changes the size of the pdf file. For example, I'm trying to put a pdf file which is in 3.5 by 4.75 in. When I place it in CS3 it keeps the same size. When I put in CS4, it changes the size of 4.515 in by in 6,125. I looked at the preferences options import. I have searched for it and I can't understand how to solve this problem.

    Image by placing the behavior has undergone a radical change between CS3 and CS4. In CS4 when you click and drag a slider to place the image will evolve to adapt to the resulting image. If you click on and release, it will be set to 100%. If you put in an existing framework, it will come in according to the options of adjustment applied to the frame.

  • problems with the placement of dynamic stamps on javascript

    I can place a stamp with:

    this.addAnnot ({page: this.pageNum, type: 'Stamp', AP: 'Project', rect:[144,72,144,72]});})

    everything works fine, but if I change the static a dynamic stamp stamp (for example, approved with name and date), I only get a black rectangle with a cross inside.

    I checked the name of stamp to choose the right pair. As I said before with static stamps without problem.

    I use the XI Version of Acrobat 11.0.11

    Any hint of what goes wrong?

    Thomas

    This occurs when you use the wrong value of AP, which is not the same as the name of the stamp you see in the stamps palette.

    The best way to get the correct value of AP is to apply the patch manually, then select it with the mouse and run this code in the console:

    this.selectedAnnots [0]. AP

    Then use the value that is printed in your code.

  • Problems with the placement of two images

    I'm trying to merge two photos with Photoshop CC. In the latest version of PS I select an image and drag it to the other image & it would appear as a new layer.

    In online tutorials, it shows a similar approach except that they say convert the background into a layer layer in the two images. I did it but nothing happens. I left the as they are, and nothing happens. The files are NAVE about 35 MB.

    Is there a switch or a preference that I missed?

    Thank you

    Neil

    Hi Neil,

    Greetings.

    I think you are trying to place one image on another, please visit this link on how to do it- http://www.photoshopessentials.com/basics/moving-photos-between-documents/

    Concerning

    Rohit

  • interactive PDF using Indesign CS5.5 problem with overlay

    Hi all

    I designed an interactive pdf - not for the web. I have a stratification of problem on a page. On the page, there are 6 buttons. Each key pressed will propose a box containing information and content. When I designed the page using indesign cs5.5, I did so that most information box has been at the top of the layer. I thought this would be the cleanest way to present the page. By having the largest area of content (each of the six boxes of content are different sizes) in the upper part, it would cover the other boxes. When I exported the file to the smallest box was the head, and then the secondest etc. It seems pretty messy.

    Is there a way to make sure that the lagest content area is upstairs when it exported in pdf format?

    Concerning

    Have patience!

    Have you tried to put this bigger box on its own layer at the top?  I don't know much about buttons etc but if you expect someone coming here makes.  A large number of contributors are in zones different, but...

  • A problem with the placement of images

    I'm working on my profolio projects and superior finals. When I import a file that is located in high resolution, it seems blurry and pixelated after resizing with automatic adjustment. (When I resize using the AutoFit feature, I use shift.) Is that what I can do to fix this problem? I don't want to redo the project.

    Click the object, and then select object / editing / adjust proportionally

    G

  • Problem with the placement of nav.

    I have three columns, or with the navigation centered at the top under the header, but for some reason bar any in Safari and IE navigation bar faces the color of the columns on the left and the right.  The code is below, no idea what I did wrong?  I tried to change the margins and padding, but without success.

    Thank you!

    < ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > ""

    " < html xmlns =" http://www.w3.org/1999/xhtml "> < head > .

    < meta http-equiv = "Content-Type" content = text/html"; charset = utf-8 "/ >"

    < title > Radio Health Journal < /title >

    < style type = "text/css" >

    <!--

    {body

    fonts: 100% Verdana, Arial, Helvetica, without serif.

    background: #FFF;

    margin: 0; / * It is advisable to zero, the margin and the filling of the body to hold element has a different default browser * /.

    padding: 0;

    text-align: center; / * This centers the container in IE 5 * browsers. The text is then set left aligned by default in the #container selector * /.

    color: #000000;

    }

    / * Tips for Elastic layouts

    1. Since the elastic layouts overall size is based on the user's default font size, they are more unpredictable. Used correctly, they are also more accessible for those who need larger fonts given the length of the line remains proportionate.

    2. sizing of the divs in this provision are based on 100% font size in the body element. If you decrease the overall size of the text by using a font size: 80% on the body element or the #container, remember that the complete provision will reduce proportionally. You can increase the widths of the divs to compensate for this.

    3. If the sizing of fonts is changed in different quantities on each div instead of on the overall design (ie: #sidebar1 is a font size of 70% and #mainContent has a font size of 85%), this will change proportionally each of the overall size of divs. You can adjust the base on your final sizing of fonts.

    */

    .thrColElsHdr #container {}

    width: 65em;  / * This width will create a container that can fit in a 800px browser window if text is left to default browser font sizes * /.

    background: url #FFFFFF (.. / graphics/faux.gif) repeat-y;

    margin: 0 auto; / * margins (in conjunction with a width) auto Center the page * /.

    text-align: left; / * This setting overrides the text-align: center on the body element. */

    }

    .thrColElsHdr #header {}

    background: #FFF;

    padding: 0 10px;  / * This filling is the alignment to the left of the items in the div that appear below. If an image is used in the #header instead of text, you can remove the padding. */

    }

    .thrColElsHdr #header h1 {}

    margin: 0; / * zero setting of the margin of the last element in the #header div tag will prevent the collapse of margin - inexplicable space between divs. If the div has a border around it, this isn't necessary, which also allows to avoid the collapse of margin * /.

    padding: 10px 0; / * padding instead of margin will allow you to keep the edges of the div element * /.

    }

    / * Sidebar1″ tips:

    1 be aware that if you set a value for the font size on this div, the width of the div will be adjusted accordingly.

    2. as we work in ems, it is preferable not to use the filling in the sidebar itself. It will be added to the width for browsers compatible standards creating a real unknown width.

    3. the space between the wall of the div and the items it contains can be created by placing a margin left and right on these items as seen in the rule ".thrColElsHdr #sidebar1 p.

    */

    {.thrColElsHdr #sidebar1}

    float: left;

    width: 20em; / * because this element is floating, it takes a width * /.

    background: #3399FF; / * the background color will be displayed for the length of the content of the column, but no further * /.

    padding: 45px 0; / * upper and lower padding create a Visual space within this div * /.

    }

    {.thrColElsHdr #sidebar2}

    float: right;

    width: 20em; / * because this element is floating, it takes a width * /.

    background: #3399FF; / * the background color will be displayed for the length of the content of the column, but no further * /.

    padding: 45px 0; / * upper and lower padding create a Visual space within this div * /.

    }

    H3 .thrColElsHdr # sidebar1″, p.. thrColElsHdr # sidebar1″, .thrColElsHdr #sidebar2 .thrColElsHdr #sidebar2 h3 {}

    margin-left: 10px; / * the left and right margins should be to all of the items that will be placed in the side columns * /.

    margin-right: 10px;

    }

    / * MainContent tips:

    1. If you give this div #mainContent a value of different size of the div # sidebar1″, the margins of the #mainContent div will be based on the font size and the width of the div #sidebar1 depend on the size of the font. You can adjust the values of these divs.

    2. the space between the mainContent and sidebar1″ is created with the left on the mainContent div margin regardless of how content div the sidebar1″ contains, the space of the columns will remain. You can remove the left margin if you want the #mainContent div text to fill the space of #sidebar1 when the content of #sidebar1 is complete.

    3. to avoid falling of float, you may have to test to determine the size of the image/approximate maximum element because this provision is based on the calibration of fonts the user combined with the values that you set. However, if the user has their browser game lower than normal font size, less space will be available in the #mainContent div that you see on the test.

    4. in the Internet Explorer conditional comment below, the zoom property is used to give the mainContent "hasLayout". This avoids several specific IE bugs that may occur.

    */

    {.thrColElsHdr #mainContent

    margin: 20em 0 0 20em; / right margin can be given in pixels or ems. He created space on the right side of the page. */

    padding: 10px 45px;

    }

    .thrColElsHdr #footer {}

    padding: 0 10px; / * This filling is the alignment to the left of the items in the div that appear above him. */

    background: #FFFFFF;

    }

    .thrColElsHdr #footer p {}

    margin: 0; / * zero setting the margins of the first element in the footer will avoid the possibility of the collapse of the margin - a space between the div tags * /.

    padding: 10px 0; / * padding on that element will create space, just as it would the margin, free margin collapse question * /.

    }

    / * Various classes for reuse * /.

    .fltrt {/ * this class can be used to float right to the item in your page.} The floating element must precede the element it should be next to the page. */

    float: right;

    margin left: 8px;

    }

    .fltlft {/ * this class can be used to float an element on your page to the left * /}

    float: left;

    right margin: 8px;

    }

    .clearfloat {/ * this class must be placed on an element div or break and should be the last item before closing a container should completely contain a float * /}

    clear: both;

    height: 0;

    font size: 1px;

    line-height: 0px;

    }

    a: link {}

    color: #000;

    text-decoration: none;

    }

    a: visited {}

    text-decoration: none;

    color: #000;

    }

    a: hover {}

    text-decoration: none;

    }

    a: active {}

    text-decoration: none;

    }

    {.navbar}

    fonts: more great Verdana, Arial, Helvetica, without serif.

    color: #000000;

    background: #FFFFFF;

    height: 20px;

    }

    #navbar ul {}

    margin: 0px;

    padding: 0px;

    list-style: none;

    text-align: center

    }

    #navbar ul li {}

    display: inline;

    }

    #navbar ul li a {}

    fonts: more great Verdana, Arial, Helvetica, without serif.

    color: #000000;

    text-decoration: none;

    padding: 10px 15px;

    float: none;

    }

    ->

    < / style >

    <!-[if IE] >

    < style type = "text/css" >

    / * place patches css for all versions of Internet Explorer in this conditional comment * /.

    .thrColElsHdr # sidebar1″, .thrColElsHdr #sidebar2 {padding-top: 30px ;}}

    .thrColElsHdr #mainContent {zoom: 1; padding-top: 15px ;}}

    / * the owner above zoom gives IE the hasLayout property, avoid several bugs * /.

    < / style >

    <! [endif]--> < / head >

    < body class = "thrColElsHdr" >

    < div id = "container" >

    < div id = "header" >

    "" < p > < img src = "... width/graphic/Logo RHJ 1.JPG" = '195' height = '73' / > < / p >

    < div class = "navbar" id = "navbar" >

    < ul >

    < li > < a href = "#" > satisfy guests < /a > < /li >

    < li > < a href = "#" > links < /a > < /li >

    < li > < a href = "mailto: " [email protected] "> contact us < /a > < /li > .

    < /ul >

    < / div >

    <!-end #header--> < / div >

    < div id = "sidebar1″" >

    This week on Radio Health Journal < h3 > < / h3 >

    < p > Teenage Blues: is it anxiety or depression? Discover could save a life. < /p >

    < p > synesthesia: when the people & quot; See & quot; sounds or & quot; hear & quot; colors. < /p >

    < h3 > < / h3 >

    Top new health < h3 > today < / h3 >

    < p > the vitamins C and E allowed in fear melanoma < /p >

    the < p > older men often binge drinking, too < /p >

    < p > some children are psychologically OK < /p >

    < p > new drug for schizophrenia and bipolar disorder approved < /p >

    < p > Mediterranean diet and exercise reduces the risk of Alzheimer's disease < /p >

    < p > lack of sleep may increase the risk of diabetes < /p >

    < h3 > < / h3 >

    <!-end # sidebar1″--> < / div >

    < div id = 'sidebar2' >

    < h3 > Podcasts: depth, award-winning radio health Journal Reporting < / h3 >

    "" < p > < a href = "... /Secret Shoppers.mp3" target = "_blank" > medical mysteries: Fake patients who keep the quality of care high < /a > < /p >

    "" < p > < a href = "... / Pediatric Liver.mp3" target = "_blank" > Pediatric liver transplantation: children can receive a slice from a living donor adult < /a > < /p >

    "< p > < a href ="... And sale of Healthcare.mp3' target = '_blank' > selling health care reform: why revved rhetoric questions more facts < /a > < /p >

    "" < p > < a href = "... / Alzheimer's Disease Diagnosis.mp3" target = "_blank" > early diagnosis of Alzheimer's disease: the benefits of early treatment < /a > < /p >

    "" < p > < a href = "... / dementia drugs.mp3 ' target = '_blank' > dementia drugs: are too common drugs in nursing homes? < /a > < /p >

    < p > Pregorexia: anorexia while speakers more common than we think < /p >

    "" < p > < a href = "... / death cleanup.mp3 ' target = '_blank' > Mop men: people clean up after the unexpected death < /a > < /p >

    "" < p > < a href = '... / Gout.mp3 ' target = '_blank' > drop: the return of the 'disease of the King' < /a > < /p >

    < p > prevention and health reform: how much money can prevent really save? < /p >

    <!-end #sidebar2-> < / div >

    < div id = "mainContent" >

    < H3 > Featured Content < / h3 >

    " < p > < a href =" http://speakaboutbipolardepression.com/ "target ="_blank"> the economy causes many Americans to feel extra pressure.  This is particularly worrisome for Americans over the age of 8 million with bipolar disorder. < /a > < /p >

    " < p > < a href =" http://ALZ.org/index.asp "target ="_blank"> that modern medicine extends the life expectancy, the prevalence of Alzheimer's disease in the United States should skyrocket since about 5 1 million in 2050.  It is more important than ever to understand the risk factors. < /a > < /p >

    < p > you might thing a transfusion of blood that are prescribed by a physician would be safe and effective.  But a new analysis by an international panel of sbows majority of transfusions have few benefits.  In fact, they can be dangerous. < /p >

    < p > < / p >

    < h3 > customer information. < / h3 >

    " < p > < a href =" http://www.psychology.Emory.edu/clinical/westen/index.html "target ="_blank"> The sale of Healthcare Reform: Dr. Drew Westen, Professor of psychology and Psychiatry, Emory University and the author of < em > The Brain political: the role of emotion decided the fate of the Nation < /em > < /a > < /p > "

    " < p > < a href =" http://www.hschange.com/ "target ="_blank"> The sale of Healthcare Reform: Dr. Paul Ginsberg, President, Center for the study of change in health care < /a > < /p > "

    " < p > < a href =" http://www.stlouischildrens.org/content/ "target ="_blank"> Pediatric Liver Transplantation: transplant of Dr. Jeffrey Lowell, surgeon, hospital Saint-Louis for childhood < /a > < /p > "

    " < p > < a href =" http://www.ucityphila.org/news/release/340 "target ="_blank"> early diagnosis of Alzheimer's disease: Dr. Richard Stefanacci, Director, Institute for geriatric studies, University of Sciences < /a > < /p > "

    <!-end #mainContent--> < / div >

    <!-this element of compensation should immediately follow the #mainContent div in order to force the #container div to contain all the child floats--> < br class = 'clearfloat' / >

    < div id = "footer" >

    < p > < / p >

    <!-end #footer--> < / div >

    <!-end #container--> < / div >

    < / body >

    < / html >

    Oooops, I forgot, I also closed the header tag before the navigation bar...

    Gary

  • [CS3 Server] Problem with image placement

    I use the kImportAndPlaceCmdBoss command to place the text and images in my document.

    With the text, it works correctly, but when I try to place the image (jpg) I got a gray rectangle instead of the image. Order processed without any error message.

    What is the correct way to place the image?

    Search the IServerSettings directly from ISession, make changes through IServerSettings.  See the documentation for the methods, etc.

    Ian

  • Problem with the placement of components in the Center

    I have the screen or full-screen and four ButtonField. How can I put buttons to this container in the Center (vertically and horizontally)?

    I try to use the Field.FIELD_HCENTER flag. ButtonField.HCENTER | Field.FIELD_VCENTER | ButtonField.VCENTER for buttons, but they take only horizontal center

    I struggled with this before as well.  Here's what I found to work for a single centering element:

    VerticalFieldManager vfm = new VerticalFieldManager(VerticalFieldManager.USE_ALL_WIDTH | VerticalFieldManager.NO_HORIZONTAL_SCROLL | VerticalFieldManager.NO_VERTICAL_SCROLL);
    
    // Create a horizontally centered HFM
    HorizontalFieldManager hfm = new HorizontalFieldManager(HorizontalFieldManager.USE_ALL_HEIGHT | HorizontalFieldManager.NO_HORIZONTAL_SCROLL | HorizontalFieldManager.NO_VERTICAL_SCROLL | HorizontalFieldManager.FIELD_HCENTER);
    
    // Create a vertically centered label
    LabelField label = new LabelField("Test", LabelField.FIELD_VCENTER);
    hfm.add(label);
    
    vfm.add(hfm);
    add(vfm);
    

    You should be able to extend this to do what you want to do with an another VerticalFieldManager.

    T

  • problems with the script in indesign

    Hi all

    I'm new and scripts so I hope I can explain what I need

    Well, I have an indesign file in which I need to insert an extra layer with the translation of a language, have a layer IN English and an extra a FR for the french.

    I found a script that's like that

    with (app.clipboardPreferences) {}

    pasteRemembersLayers = true;

    }

    var docTarget = app.documents.itemByName ('French.indd');

    var docSource = app.documents.itemByName ('French.indd');

    If (docSource.isValid & & docTarget.isValid) {}

    var numSpreads = docSource.spreads.length;

    for (var i = 0; i < numSpreads; i ++) {}

    app.activeDocument = docSource;

    app.activeWindow.activeSpread = app.activeDocument.spreads [i];

    App.Select (App.activeDocument.spreads [i] .allPageItems);

    If (app.selection.length > 0) {}

    app. Copy ();

    app.activeDocument = docTarget;

    If (app.activeDocument.spreads [i] .isValid) {}

    app.activeWindow.activeSpread = app.activeDocument.spreads [i];

    app.pasteInPlace ();

    }

    }

    }

    }

    but it seems to cause problems with the files,

    I have to say that the source is a file very heavy, even enter takes a long time.

    but I want to just get into the text layer,

    Do you think this script works finally, can you spot an error or something?

    Hello

    Your script is copying content of any doc (allPageItems) in an another doc - all number two need to have equal variances.

    You don't need to run the script if your goal is to create the new layer in the existing doc.

    The questions are

    What elements of the page must be copied into this layer

    AND

    should bound texts copied frames play any content

    AND

    wherever the content come from?

    Jarek

  • Problem with InDesign startup script does not import XML images

    I'm doing an XML import automatically from a startup script when a document is loaded. I managed to get most of the content to fill, but the images are ignored. Everything works, including images, when I do a manual 'Import XML' through the user interface or a manual script.

    Here's my manual script:

    var myDocument = app.activeDocument;
    var xmlFile = File('/c/Full/Path/To/data.xml');
    
    myDocument.importXML(xmlFile);

    But the goal is to do at startup. Here's my startup script:

    #targetengine "session"
    
    app.addEventListener('afterOpen', function(myEvent) {
       if (myEvent.target.constructor.name !== 'Document') {
       return;
       }
    
       var myDocument = myEvent.target;
       var xmlFile = File('/c/Full/Path/To/data.xml');
    
      myDocument.importXML(xmlFile);
    });

    Here is the XML tag for the image:

    <Image href="file:///C:/Full/Path/To/Image/02.png" />

    I wonder there is a problem with the 'afterOpen' event reminder, and it is the reason why it works manually using the same method, but not in the startup script.

    I solved it by avoiding the event quite listener:

    main();
    
    function main () {
    
        // create a path for a file object
        var curFile = File('/c/Path/To/file.indd);
        var xmlFile = File('/c/Path/To/data.xml');
    
        // close app if files don't exist
        if (!curFile.exists || !xmlFile.exists) {
            app.quit(SaveOptions.NO);
        }
    
        // open the file
        var curDoc = app.open(curFile);
    
        // import the xml
        curDoc.importXML(xmlFile);
    
        // create a new file object
        var pdfFile = new File(curFile.parent + '/' + curFile.name + '.pdf');
    
        // export to pdf
        curDoc.exportFile(ExportFormat.PDF_TYPE, pdfFile);
    
        // close app
        app.quit(SaveOptions.NO);
    
    }
    
  • Erroe Code 1720: There is a problem with this Windows Installer package. A script required for this intall could not be executed.

    I have Windows Vista with Service Pack 2 installed on my system.  I am trying to install a small program.  The installation process starts, but soon, I get the following error message: Error 1720: there is a problem with this Windows Installer package.  A script required for this intall to complete could not be run...  How can I solve this problem?

    Try the steps mentioned in the answers marked by kmlure and Imran Chand at the following link: http://answers.microsoft.com/en-us/windows/forum/windows_vista-windows_programs/error-1720-there-is-a-problem-with-this-windows/0b965fe8-2d16-498c-bb88-395911e13146

    If you have downloaded the program, you can try to download it again or check if there is a different place, you can download it since the file itself is not the problem.

Maybe you are looking for

  • How can I recover messages deleted from my iPhone?

    I accidentally deleted an entire thread of messages from a person and want to get back them. I use version 9.2 of the software on the iPhone 6. I don't want to restore my phone from tyre to the last backup, because I don't want to lose all other phot

  • ShellExecuteEx failed; Code 203

    I searched around a field for this and I'm not sure what to do,whenever I try to download anything it continues to show this: ErrorShellExecuteEx failed; Code 203.The system could not find the environment option that was entered. I don't know what th

  • HP Pavilion a6745f stop error message

    Hello again! I'm new to the forum.  I've known a stop error message regarding hpqgpc01.exe.  He says that the program is unable to put end to, click to complete.  I recently bought an HP F4440 AIO.  I tried a solution of a post here. but it did not w

  • problem with appearance of pane tab

    The following code creates a tab simple part Manager with 2 tabs and simple LabelField for the tab labels.  In the image as an attachment, you will see that there is a solid experience behind the LabelField.  I tried to give transparent backgrounds o

  • Anyone know how to use the buttons on the touchpad while typing? (Windows 8)

    I've already solved the problem when I use the touchpad when typing, but not the buttons on the touchpad while typing, I really want to play this shooting game where I have to run and I can't shoot while running I have to stay still and push that I w