[JS IDCS5] XML geometricBounds for inline frames

The following script works on InDesign Office. It's playback imported XML to apply the values of attributes for graphics inserted as scale, geometricBounds and offset:

// #include "glue code.jsx"

main(myDocument);

function main(){

var myRuleSet = new Array (
new findObjAttribute("//image")
);
with(myDocument){
var elements = xmlElements;
__processRuleSet(elements.item(0), myRuleSet);
}

function findObjAttribute(XPATH){
this.name = "findObjAttribute";
this.xpath = XPATH;
this.apply = function(myElement, myRuleProcessor)
{

var myHeigth=myElement.xmlAttributes.itemByName("height").value;
var myWidth=myElement.xmlAttributes.itemByName("width").value;
var myScale=parseInt(myElement.xmlAttributes.itemByName("scale").value);
var myXoffset=myElement.xmlAttributes.itemByName("xoffset").value;
var myYoffset=myElement.xmlAttributes.itemByName("yoffset").value;

with(myHeigth, myWidth, myScale, myYoffset, myXoffset){

var myRectangle = myElement.xmlContent.parent;

try {

myRectangle.graphics[0].horizontalScale = myScale;
myRectangle.graphics[0].verticalScale = myScale;
myRectangle.graphics[0].move(undefined, [myYoffset, myXoffset]);
myRectangle.geometricBounds = [0, 0, myHeigth, myWidth];

     } catch(e){};
}
return true;
}
}
}

When you run it on InDesign Server, the geometricBouns applies only to the first chart in the document. Scales and offsets are applied to all the graphics.

Here is an example of the XML file:

<Root>
<Paragraph>
<image href="image1.jpg" scale="110" xoffset="-10mm" yoffset="10mm" width="87mm" height="60mm"></image>
</Paragraph>
<Paragraph>
<image href="image2.jpg" scale="90" xoffset="20mm" yoffset="0mm" width="87mm" height="50mm"></image>
</Paragraph>
<Paragraph>
<image href="image3.jpg" scale="100" xoffset="-15mm" yoffset="5mm" width="87mm" height="80mm"></image>
</Paragraph>
</Root>

Why only geometricBounds values apply for the first chart with InDesign Server?

Best regards, Sjoerd

Well, you will need to inspect the properties of the graphics that it does not work on. There is probably something...

Tags: InDesign

Similar Questions

  • XML file for GigE Vision camera

    Hello

    I'm working on a model of GigE Vision camera. It should be very simple linescan camera. I put in place the necessary set of registers GigE Vision, can communicate with the camera in MAX. The problem is that I need creata this XML file for the camera. There is this here XML file:

    http://www.EMVA.org/CMS/upload/standards/GenICam_Downloads/SFNC_Reference_Version_2_0_0_Schema_1_1.x...

    What should I do with it? My first version of the camera will have 2 functions: turn on and off I'm confused, because the model xml file has many functions, I don't really have. Should I remove them? Or leave it inside with default values? That she needs a configuration minimum XML file?

    Kind regards

    Linus

    Hi Linus,

    If you look at the GigE Vision specification, you will see that there is a minimal subset of functionality that must be present for the camera be declared compliant. That's all what IMAQdx will need for the camera works fine. All other functions in the XML file that you downloaded are part of the SFNC (features Standard Naming Convention) defines the names/behavior for common characteristics that are often found on machine vision cameras. As a general rule, cameras implement a subset of these features. You should not let any features that are not implemented in the XML because it would be just confused because they would do nothing.

    Eric

  • I have a problem with corruption.  How can I change the timeline on an existing project.  Each image is moved about 2.5 min.;  My preferences are for 180 frames.  It does not seem to consider one after the fact.  Is it possible to copy the entire thing on

    I am new to use the forums.  How to start a discussion?  The ICO next which is grayed out.

    I have a problem with corruption.  How can I change the timeline on an existing project.  Each image is moved about 2.5 min.;  My preferences are for 180 frames.  It does not seem to consider one after the fact.  Is it possible to copy the whole thing and put it in a new, m not corrupted project?

    Hello and welcome.

    I feel for you after reading your story, however, it that are supposed to do? It is a forum for Dreamweaver and to my knowledge, Dreamweaver has no functionality called the chronology.

    Could you please explain the problem so that we can understand?

  • How to load an XML file for salesforce using API BULK?

    Hello

    Please let me know how to download an XML file for salesforce using API bulk?

    Thank you

    AND

    Hello

    I think it's a matter of SalesForce.com more and think that you will have better luck in looking at SOAP API Developer Guide for salesforce. Sending of a server API SOAP request is very straight forward and there are several tutorials and well documented in this topic.

    See you soon,.

    Stefan

  • Inline frames

    Can you do inline frames in the muses

    Cut the object you want to put online. Use the text and do an insertion point in the text frame where you want the inline and paste. Once an object is in line in a text block, you can use the Layout Panel to control where and how the text flows around it.

  • [JS CS5] Access to an inline frame between an insertion point

    Given an insertion point, how can I determine if it contains a picture inline/embedded? And if so, how to reference the inline/anchored frame?

    I know how to reference the surrounding paragraph, characters, etc, but can't find out how to get to the graphic inline/anchored.

    I normally would just loop through all inserted graphics in the document, but it this case I have to access the incorporations through their insertion points.

    To reference the inline frame:

    prevChar.pageItems [0]

    or

    nextChar.pageItems [0];

  • Select the inline frame

    Hi all

    Please tell me how should I do to select a frame that is inserted from the selected image.

    Thanks in advance

    Shiv

    app.selection[0].pageItems[0].select();
    

    (you can select an element of a page at a time, even if your selected image can contain more than one - or zero - inline frames)

  • Is the XML API for Oracle 10.1, the same version 10.2?

    Hi all

    The XML API for Oracle 10.1, the same version 10.2 or 10.2 include additions?

    Kind regards

    Tim

    N °

    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14214/Chapter1.htm#OBJECTIVENO04031

    Werner

  • XML workflow - adjust the width of text for images frame

    Kings of expensive java script,

    I was checking writing scripts for based on the xml workflow. Here, I did face the problem, the images do not set in the width of the text (screenshot attached for your reference) frame.


    @ I needed: all images automatically fit to the width of the text frame and the resizing of the images also.

    Width of the text frame: pt 325,984

    Text frame hight: pt 535,748

    This fair to the script?

    Screen Shot 2016-03-17 at 6.04.15 PM.png

    Thanks in advance

    HTH,

    function main(){
      var doc = app.properties.activeDocument,
      rects, rect, n =0, columnWidth, ratio, rectBounds;
    
      if(!doc) return;
    
      rects = doc.stories.everyItem().rectangles.everyItem().getElements();
    
      n = rects.length;
    
      while ( n-- ) {
      rect = rects[n];
      if ( rect.parent.parentTextFrames.length ) {
      columnWidth = rect.parent.parentTextFrames[0].textFramePreferences.textColumnFixedWidth;
      rectBounds = rect.visibleBounds;
      ratio = columnWidth/(Math.abs(rectBounds[3]-rectBounds[1]));
      rect.resize ( CoordinateSpaces.INNER_COORDINATES, AnchorPoint.TOP_LEFT_ANCHOR, ResizeMethods.MULTIPLYING_CURRENT_DIMENSIONS_BY, [ratio,ratio] );
      }
      }
    }
    
    app.doScript( "main();", u,u, UndoModes.ENTIRE_SCRIPT, "Fit images to column" );
    

    Loïc

    www.ozalto.com

  • XML format for the export of result set by the user

    Hello

    I would like to export my entire test sequence results in a new XML file. The format of the XML file is given and fixed.

    My first attempt was to create a LabView VI to export data in XML format.

    I read that there is no way to set the format with the standard version of LabView. But I have a suspicion that there is an upgrade so I can set the XML format by myself.

    Does anyone know what update I need?

    Or did someone knows how to export XML in a different way?

    Thanks for your help!

    You're right that the current implementation does not do.

    You have two options:

    1. create your own plugin that analyzes your resultlist and generates the XML file

    2. create something late MainSequence which analyses the resultlist and generates the XML file

    It depends on the scope of your project.  If there is one thing to type 1 and then option 2 would be easier.  If it's something, you use through multiple tests and then I'd go with Option 1.

    In both cases, you must go to analyze thorugh the results list and generate code for XML.  I recommend keeping the algorithm in TestStand to browse the resultlist.  It is much easier and simpler.  Simply create a sous-suite that does and pass the list of results.

    Kind regards

  • XML work for guests

    Hi all

    I'm working on XML files. The XML files and files wav in the web server. I need to play the guests of the web server. For example playing guests like this

    P [http://x.x.x.x/prompt.wav]. I got the XML path with script. How to do this? Do I need to download web of ccx wav files?



     
     http://10.34.170.27/Gunaydin.wav
     

     
     http://10.34.170.27/hoscakalin.wav
     

     
     http://10.34.170.27/iyiaksamlar.wav
     

     
       http://10.34.170.27/iyigunler.wav
     

    Hello

    You don't need to download the guest to the repository UCCX. Once you define the value of create a Document URL in the promptset then you can use the game, but controls prompt calling your promptset variable:

    Fast read (- trigger Contact-, promptset)

    Gabriel.

  • Using a single XML tag for ListView

    Hi all

    I try to fill my ListView with a series of specific tags from my XML file. For example, using this XML file:

    For what it's worth, this is how I solved this:

    1. Add a class ListItemProvider based in your project:

    class ViewerListItemManager: public bb::cascades::ListItemProvider
    {
    public:
        ViewerListItemManager();
    
        VisualNode * createItem(ListView* list, const QString &type);
    
        void updateItem(ListView* list, bb::cascades::VisualNode *listItem,
                const QString &type, const QVariantList &indexPath, const QVariant &data);
    };
    

    2. implementation of the new class:

    ViewerListItemManager::ViewerListItemManager()
    {
    }
    
    VisualNode * ViewerListItemManager::createItem(ListView* list, const QString &type)
    {
        Q_UNUSED(list);
    
        if (type.compare(GroupDataModel::Header) == 0) {
            return new Header();
        } else {
            return new StandardListItem();
        }
    }
    
    void ViewerListItemManager::updateItem(ListView* list, bb::cascades::VisualNode *listItem,
            const QString &type, const QVariantList &indexPath, const QVariant &data)
    {
        Q_UNUSED(list);
        Q_UNUSED(indexPath);
    
        if (type.compare(GroupDataModel::Header) == 0) {
            QString caption = data.value();
            static_cast(listItem)->setTitle(caption);
        } else {
            QVariantMap map = data.value();
            static_cast(listItem)->setTitle(QString("%1").arg(map["firstname"].toString()));
        }
    }
    

    3 assign the ListItemProvider to your list:

    groupDatamodel = new GroupDataModel();
    XmlDataAccess xda;
    QVariant list = xda.load(QDir::currentPath()+"/data/employees.xml", "/root/employee");
    
    groupDatamodel->insertList(list.value());
    listView = new ListView();
    ViewerListItemManager *viewerItemProvider = new ViewerListItemManager();
    listView->setListItemProvider(viewerItemProvider);
    listView->setDataModel(groupDatamodel);
    
  • XML parser for the GPX file

    Hello

    I wonder how to get GPS to GPX file information. The GPX file is also XML, but I can't do the values "lat" and "lon" of the file.

    The GPX file:


    http://www.mooncity.pl"xmlns:nmea ="http://www.mooncity.pl">."
     
       
         
            150,0
           
            2D
            7
         

    Code:

    XML
    String _node, element;
    try {}
    DocumentBuilderFactory docBuilderFactory is DocumentBuilderFactory. newInstance();
    DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder ();
    docBuilder.isValidating ();
    Doc document;
    doc = docBuilder.parse (fc.openInputStream ());
    doc.getDocumentElement () .normalize ();
    NodeList list = doc.getElementsByTagName ("*");
    Root = doc.getDocumentElement () of the element;
    NodeList list = root.getChildNodes ();
    _node = new String();
    element = new String();
    This loop 'for' is used to parse through the
    XML document and extract all the elements and their
    value, so they can be displayed on the device

    for (int i = 0; i)<>
    Node value = list.item (i).
    getChildNodes () .item (0);
    System.out.Print
    (list.item (i) .getNodeName ());
    System.out.println (value.getNodeValue ());
                    
    element value = .getNodeValue ();
    System.out.println
    (list.item (i) .getNodeValue ());
    System.out.println
    (element = value .getNodeValue ();
    updateField (_node, element);
             
    (_node, element);
    } //end for
    }
    catch (Exception e) {}
    System.out.println (try ());
    }
                        
    end of XML

    The output of the program:

    GPX
    TRK
    trkseg
    trkpt
    ele150.0
    time2009-08 - 22 T 11: 25:41 + 01:00
    fix2d
    SAT7

    Missing values:

    lat = lon "12.273434000" = "10.993777000."

    Are there other method or the GPX file scanner?

    You must get the attributes to read these values... Use the getAttributes method. You might could google to find examples of xml parsing.

  • XML Parser for BlackBerry 5.0

    Hi all! I am new to the world of BlackBerry development! I am looking for a XML parser. I used kXML in other devices (not ripe) and I had no problem. But with BlackBerry my application never starts. The Simulator says: "error of JVM 104. Search for this error, I saw that it takes place only in the Simulator, but when I install the software in the device, the application start. Anyone can help me?

    for xml parsing you can leverage the following packages:
    * javax.xml.parsers
    * net.rim.device.api.xml.parsers

  • Plugin de Cordova for iOS, binary embedded for custom frame

    Hi all

    I am trying to create a wrapper to Cordova iOS for a native of specific features.

    The plugin uses a custom frame that must be added in the binary shipped (XCode - general) before building. For the normal plugin of Cordova, I can't open XCode project and add in the binaries shipped, but I don't know how in the MAF to the Oracle.

    If the custom frame is not added in the binary incorporated, the application is able to build and run but accident after the launch.

    Thank you

    Kind regards

    There are workaround is, open the project (after having built and deployed by MAF jdeveloper) / project/ViewController/deploy/ios_deploy_name/then in xCode, manually add the framework for binaries shipped.

    I have not found any solution to Cordova plugin config to automatically add embedded binary files.

    Thank you

Maybe you are looking for

  • Video in the Timeline doesn't expand

    Hello, I am trying to edit a video. When I drag the film down to the timeline, it shows that in a small frame, but the movie is here. I've tried everything. I tried dragging the cursor, messed with settings etc. Here is a picture of what it looks lik

  • HP Pavilion Slimeline 400-224: upgrade memory on Pavilion Slimline 400-224

    I want to upgrade the memory of my HP pavilion slimline 400-224.  After opening the case, how do I determine how many memory locations is available?  The current Council of the memory is SK Hynix 4 G 1Rx8 PC3L 12800 S-11-13 - B4.   It seems to be ano

  • Symbolic notation on the chart MS2009 axis labels?

    I use Measurement Studio 2009 (c#) to display graphs of waveform. Question: How can I format the labels to the major division of a XAxis (or YAxis) such as: -A value of 1000 will display "1 k". -A value of 0.001 will display "1 m". -etc. I'm looking

  • T510 4314-2 and AT &amp; T Wireless WAN

    When I purchsed this unit, I was under the impression that she had the ability built cellular broadband - maybe not needing to add a SIMM card. Anything can confirm that it is included in this model and where SIMM card is installed (or must be instal

  • Windows Media Player script error

    Windows Media Player gives me a script error when I am trying to find information about the album. Line 240, tank 25. The value of the btnFinish_onclick hardware error is null or undefined, not a function object. What should I do?