8 Replies Latest reply on May 3, 2016 1:49 PM by Pickory

    Export Page Item Backgrounds

    Pickory Level 3

      Hello,

       

      I would like export the background of a page item. For instance, a table with some cell fills and stokes, I want to leave out the text.

       

      The idea, export the graphic part of the page item and then overlay the text part.

       

      I know this can be done through a C++ plugin, but it would be really handy to do it by via scripting.

       

      P.

        • 1. Re: Export Page Item Backgrounds
          Laubender Adobe Community Professional & MVP

          Hi, how about setting the fillColor of the text in the table to "None"?

           

          Basically a good idea, if you want to output to an image file, but:

          If there is a strokeWeight defined for the text, that would perhaps not work as expected. If you set the strokeColor to "None" the strokeWeight will be 0 in an instance; and that could change the amount of lines in the cell. Followed by shrinking the height of a cell, if it is set to autoGrow == true.

           

          To workaround that problem, one could set all cells to a fixed height and remove all the text.

          Then export to an image format (PNG or JPEG) or whatever you see fit.

           

          And the overlay with the text? *
          Do a table with no fillColor and no strokeColor for the cells?
          Not quite. If you set the strokeColor of the cells to "None", height and width of the cells (the table) could change. And with that the relative position of the text to its initial position.

           

          There is a way out of this.
          Set the stroke type of every cell to null.
          That should "freeze" the cells' height and width.

           

          // TextFrame selected with one table:
          var table = app.selection[0].tables[0];
          
          table.cells.everyItem().properties =
          {
              rightEdgeStrokeType : null ,
              leftEdgeStrokeType : null ,
              bottomEdgeStrokeType : null ,
              topEdgeStrokeType : null ,
              fillColor : "None" ,
              topLeftDiagonalLine : false ,
              topRightDiagonalLine : false
          };
          

           

          * Be aware, that with InDesign CC 2015 there are also graphic cells, that may or may not contain images or arbitrary objects pasted inside.

          Uwe

          1 person found this helpful
          • 2. Re: Export Page Item Backgrounds
            Pickory Level 3

            Hi,

             

            Setting the text fill colour none does seem to work quite well, I currently use, thank you.

             

            I was rather hoping for a text attribute of noPrint, which I will have to invent through a plugin.

             

            My process, export the underlying images, and then export the text. Destination, HTML or SVG, keeping the text layer apart from the underly images allows me to search the text in the browser.

             

            P.

            • 3. Re: Export Page Item Backgrounds
              Laubender Adobe Community Professional & MVP

              Pickory wrote:

               

              Hi,

               

              Setting the text fill colour none does seem to work quite well, I currently use, thank you.

              That will depend on the stroke weight (and stroke color) that are set in the table's cells.

               

              So what exactly is your problem here?
              Duplicating the table and position it exactly on top of the original?

               

              Deciding what to do, if a text frame ( as part of a group with images ) is pasted inside a graphic cell?

               

              Uwe

              • 4. Re: Export Page Item Backgrounds
                Pickory Level 3

                The 'problem', I just want to export the none text bits, frames, effects... anything none text.

                 

                P.

                 

                Edited to say: I don't want to export the text effects when export the underlying graphic. So a text frame may have a drop shadow, I want that in my image layer. I will deal with any text shadows in my text layer.

                 

                P.

                • 5. Re: Export Page Item Backgrounds
                  Laubender Adobe Community Professional & MVP

                  What is counting as "background", what is counting as "foreground"? :

                   

                  Background-Foreground-Text-is-what.png

                   

                  Uwe

                  • 6. Re: Export Page Item Backgrounds
                    Laubender Adobe Community Professional & MVP

                    Laubender wrote:

                    Deciding what to do, if a text frame ( as part of a group with images ) is pasted inside a graphic cell?

                     

                     

                    Important Note: If you are trying to duplicate a table with a cell like that, InDesign CC 2015 will instantly crash.

                    That's a miserable bug. TextFrames inside of graphic cell will crash InDesign when the page where the table lives will be duplicated; if the table is duplicated.

                     

                    Uwe

                    • 7. Re: Export Page Item Backgrounds
                      Pickory Level 3

                      Good image.

                       

                      The export I am working on currently knows the hierarchy of page items, I am sure there are some subtleties that will go wrong.

                       

                      I think it would go:

                       

                      Image

                      text

                      Image

                      itest...

                       

                      The images would be laid down first, text over. I suppose effects on text could turn them into images and that would rule them out of the text export.

                       

                      P.

                      • 8. Re: Export Page Item Backgrounds
                        Pickory Level 3

                        Hmm,

                         

                        I think you have made it very clear, that if I want to draw / export a page without text. I need to do this via a plugin that suspends drawing of text during export.

                         

                        Sounds fun, I know it will keep me occupied.

                         

                        P.