6 Replies Latest reply on Nov 17, 2006 12:47 PM by (Michael_Burbidge)

    updating template

      What is the best way to update template items with data supplied from a client program. If a template has a couple of text frames and a graphic item, what is the best way to pass the data to the server so I can update the template? I will convert the template to an eps for later viewing, but was not sure how to get the data to the server - maybe an xml file? Is there an example similar to this supplied within sdk? I will keep searching, but any help would be Appreciated.

      Thanks Steve
        • 1. Re: updating template
          Level 1
          Just to be clear:

          Are you trying to "update the template" in the sense that you end up with a new template with the text frames and graphic different from before? Or are trying to populate the text frames and graphic frame of a document derived from the template to include user-delivered content?

          • 2. Re: updating template
            Level 1
            I do not want to change the template only update the content which I will export to eps (or pdf) to display later.

            Thanks Steve
            • 3. Re: updating template
              Level 1
              OK, in that case, if you're planning to change the graphic, you're going to need to supply the graphic in a form that InDesign can import somewhere on the server where InDesign server can access it.

              Then, it's up to you whether you use XML or custom scripts to provide the information needed to insert the user-provided information in the document for exporting.

              If I were doing this, I'd be strongly guided by the form the client wants to use to provide the information. If it's coming to you as XML, then make sure your template is structured properly to accept the XML as provided and import it.

              If it's coming in some other form, then it's a matter of style which approach to use. Do what ever makes you the most comfortable.

              • 4. Re: updating template
                Level 1
                A "template.indt" will be created by InDesign GUI - the data to populate text items (and any graphics) will come from a web page. I could package all the data within an XML file and call a server script passing the XML file as a paramter, but I thought there might be an "easier" method to do this (not sure how I will map XML items to template items, but I will figure that out later).

                Thanks for your help

                • 5. Re: updating template
                  I have a similar situation where I have .indd files (not templates) and a web application to make the textframe and image changes, then exporting it out as a .pdf. I am thinking about using custom scripts to make the necessary changes to the textframes and images. By using layers I don't see a need to use XML b/c each editable element is defined and identified in it's own layer. Is this considered "normal" practise?
                  • 6. Re: updating template
                    Level 1
                    There are a number of ways to create templates in InDesign and then replace content using the server. Using XML import is probably the most general. You would create the template using InDesign. Using the structure view in InDesign you can map elements in the structure to page items. To use the template you would need to generate an XML file that matches the structure in the InDesign template, then open the template and import the XML file. You can then save as a document, generate PDF or whatever else you might want to do.

                    The second method works well if you only have a few images and text to replace in the template. Page items including text frames, have a script label in InDesign. You can give any page a name using the script label panel in InDesign. Then on the server you can get the page item by name and place text or images in the page item.