2 Replies Latest reply on Dec 15, 2011 8:22 AM by indesignhangman

    programming paragraph styles using the Javascript

    indesignhangman

      I am exporting xml into a  indesign template and then creating a .jpeg programmaticatlly.  On conversion, is there anyway to format the xml so that paragraph styles are applied?

        • 1. Re: programming paragraph styles using the Javascript
          John Hawkinson Level 5

          I think your question is extremely underspecified, but see the InDesign help: Home / Using InDesign / XML / Importing XML / Map XML tags to styles

          • 2. Re: programming paragraph styles using the Javascript
            indesignhangman Level 1

            Let me be clear:

             

            1.  We have some xml i.e.

             

            <?xml version="1.0"?><Root Customer="BusinessCard" xmlns="" ID="0"><Story><Story><Field ID="1" Label="Fullname" Type="TextBox" Required="True" Prefix="" Suffix="" RegEx="">JohnDoe</Field><Field ID="2" Label="Job Title" Type="TextBox" Required="False" Prefix="" Suffix="" RegEx=""></Field><Field ID="3" Label="Telephone" Type="TextBox" Required="False" Prefix="T   " Suffix="&#xd;" RegEx="">T   0123456456&#xd;</Field><Field ID="5" Label="Mobile" Type="TextBox" Required="False" Prefix="M  " Suffix="&#xd;" RegEx="">M  0123456789&#xd;</Field><Field ID="6" Label="Email" Type="TextBox" Required="True" Prefix="" Suffix="" RegEx="">aaa@aa.com</Field></Story><Field ID="7" Label="Address1" Type="TextBox" Required="False" Prefix="" Suffix="&#xd;" RegEx="">&#xd;</Field><Field ID="8" Label="Address2" Type="TextBox" Required="False" Prefix="" Suffix="&#xd;" RegEx="">&#xd;</Field><Field ID="9" Label="Address3" Type="TextBox" Required="False" Prefix="" Suffix="&#xd;" RegEx="">Middlesex T5 4566&#xd;</Field><Field ID="11" Label="Postcode" Type="TextBox" Required="False" Prefix="" Suffix="" RegEx="">Visit uytyu</Field></Story></Root>

             

             

            2  We have an indesign template. template.indd

             

            3. We import the xml into the template programatically and need to apply character styles to the prefixes on mobile, and telephone numbers.

            4.  We need to apply the character styles in the .jsx script  that then exports the image as a jpeg and a pdf.