Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Importing to InDesign from MySQL Database

Return to Member Forum

  • Author
    Posts
    • #59419
      BenMajor
      Participant

      Hello,

      I am currently working on a new book which comprises a large amount of data. The data already exists in a MySQL database, and I'm fairly certain that I can import the information relatively easily into Adobe InDesign using the XML file format.

      However, my problem is that each item in the database has a unique number (five digits in length). The last two digits of this number are used to colour a simple bar code as follows:

      Top Row > Penultimate Digit
      Second Row > Last Digit
      Third Row > Penultimate Digit

      The digits 0 to 9 are assigned with a specific colour and the bars are coloured accordingly. For example, the number 43256 would result in the barcode looking lik RED GREEN RED.

      Does anyone know how I might be able to auotmate this process using InDesign? The database contains more than 2,500 items, and I do not want to manually go through each one and assign the colours to the barcode.

      Any thoughts and comments would be most welcome.

      Thanks and kind regards,
      Ben.

    • #59420
      David Blatner
      Keymaster

      Maybe you could do something clever with grep styles. See:

      https://creativepro.com/ins…..styles.php

      or

      https://creativepro.com/5-c…..styles.php

    • #59426
      BenMajor
      Participant

      Thanks for your help, David. I think that is the best way to go.

      Unfortunately, I'm relatively new to using GREP styles in InDesign. I wonder if you could give me a few pointers as to how this could be achieved?

      Thanks,
      Ben.

    • #59427
      BenMajor
      Participant

      Actually, on second thoughts I think it might be easier if I use PHP to output the XML. This way, I don't need to use GREP styles in InDesign to determine which colour each row would be. For example, I could create an XML file which is structured as follows:

      <item>

      12345

      <description>My Item 1</description>
      <row1Col>red</row1Col>
      <row2Col>blue</row2Col>
      <row3Col>red</row3Col>
      </item>

      My question now is, can I use the value from the rowNCol nodes as the name of the stlye to be applied to each Table Cell?

      Thanks,
      Ben.

Viewing 3 reply threads
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads