5 Replies Latest reply on Dec 14, 2011 8:00 PM by John Hawkinson

    Exporting What Pages use what Master Doc Types


      I have a large book with 200 pages. 

      There are various master pages I use throughout the document. 

      Each master page has an image in a different location.  So one master page might have a large image on right, one might have a large image on the left, next might be small image right, so on and so on. 

      Throughout the book, I mix when I use each of these master pages according to how I wanted to design the book visually.


      My task is to extract the different pages in jpg format and list where the image is for each page.  I can export to jpg no problem of course.  I know that certain master pages always have the image in a certain location. I noticed that in the page window it shows me which template I used to create each page. The issue is I have no idea what master page each page is using when I do a standard export.  If I had a way of exporting the pages and which master template they are using I could easily map the master templates to where the image orientation is for each page.  So ultimately, is there a way that I can get a listing of the page to page template mapping I used? 

        • 1. Re: Exporting What Pages use what Master Doc Types
          John Hawkinson Level 5

          I'm not quite sure what you want here [why do you want to do this?], but if you want an easy list of pages to mater pages, try this script:


          var i,d=app.activeDocument;
          for (i=0; i<d.pages.length; i++) {
            $.writeln("Page "+d.pages[i].name+": "+d.pages[i].appliedMaster.name);

          It'll give you output like this:


          Page 1: A-Master
          Page 2: B-Master
          Page 3: C-Master
          Page 4: C-Master
          Page 5: B-Master
          Page 6: A-Master



          • 2. Re: Exporting What Pages use what Master Doc Types
            unatratnag Level 1

            Yep, that was exactly what I needed


            To answer why, we're creating the an interactive book with two column design.  The design is being handled in InDesign. Certain pages have been designed to have an image visible. In the eBook, clicking on the image should load the image, or video, in full screen. 


            Hence, it will be easiest to export the master page-to-page mapping to know where I should put the hot spot for pulling up the images and video.  I might put C-Master hotspot on the right hand side of the screen, while A-Master might be lower left and B-Master might be upper left in your example.  This answered my question, thanks!

            • 3. Re: Exporting What Pages use what Master Doc Types
              John Hawkinson Level 5

              Ah. So you're going to postprocess an epub produced by InDesign, or perhaps a PDF produced by it?

              JPEG isn't a very good format for anything with sharp edges, like text. What would restrict you to it?


              You could also achieve your positional mapping more explicitly.

              For instance, if you have a single image on each page, you could easily have a script report the page number and the coordinates of the image, etc.

              Depends on the specifics of course...

              • 4. Re: Exporting What Pages use what Master Doc Types
                unatratnag Level 1

                Hi John,


                It will be an interactive book for tablets and the pages will be exported to a book engine that specifically publishes to iPad/Nook/Kindle Fire etc. It accepts jpg for page flow. When we export the pages at a high enough quality, we don't really see any image loss when looking at the mobile device screens. The image hotspots are defined in app flow so we've design our master pages to be the exact specifications for the hotspot.


                These responses have been quite helpful.  I didn't know you could even do scripting in indesign so this has been a fanstastic learning experience for me.

                • 5. Re: Exporting What Pages use what Master Doc Types
                  John Hawkinson Level 5

                  unatratnag: Huh. Can you tell us more about this book engine? It doesn't accept anything other than JPEG such as PNG, TIFF, GIF, BMP? Those are probably all better choices...


                  Glad to give you a hint of InDesign's scripting power. In truth, you can do almost anything in scripting that you can do in the UI, so it is immensely powerful.