9 Replies Latest reply on Sep 15, 2011 8:34 AM by Peter Spier

    Hidden Layers printing unwanted blank pages.

    Stan-C

      When I use layers to hide portions of a document that I do not want to print all is well on pages that only include hidden layers and these pages do not print UNTIL I add page numbers to the document, and then all pages print - including the ones that only include hidden layers, and these pages are blank except for the page number.  I do need the page numbers included - so is there any way to not print pages that only have a page number on them?

        • 1. Re: Hidden Layers printing unwanted blank pages.
          Peter Spier Most Valuable Participant (Moderator)

          You lost me. If there are page numbers, the pages are not blank. And is this some sort of book? If so, how would you propose to print it without including blank pages?

          • 2. Re: Hidden Layers printing unwanted blank pages.
            Laubender Adobe Community Professional & MVP

            Stan,

            you can do that by scripting only. I don't know if you are familliar with using or even writing scripts, but the following lines of code written in JavaScript (ExtendScript) will do what you want:

             

            var _d=app.activeDocument;
            var _pages = _d.pages;
            
            var _pageRangeArray = new Array();
            
            for (var n=0;n<_pages.length;n++){
                 if(_pages[n].pageItems.length >0){
                      _pageRangeArray.push(_pages[n].name);
                      };
                 };
            
            //Set the page range:
            var _pageRangeString = _d.printPreferences.pageRange = _pageRangeArray.join();
            
            alert("The page range of the print dialog is set to pages: "+_pageRangeString);

             

            Background: page elements that are positioned on master pages do not count as pageItems on a given page. And as you wrote the only page element on the pages you do not want to print is on a master page. So this trick will work.

             

             

            Uwe

            1 person found this helpful
            • 3. Re: Hidden Layers printing unwanted blank pages.
              Laubender Adobe Community Professional & MVP

              It's a little more complicated if you hide elements by setting layers to "not printing" or "invisible".
              So I'm not sure about your situation here…

               

              Please describe in more detail if you have hidden layers with page elements or even whole pages with only elements from master pages.
              In that case the script will fail.

               

              Uwe

              • 4. Re: Hidden Layers printing unwanted blank pages.
                Laubender Adobe Community Professional & MVP

                Here is a script that cares for "hidden layers": it only counts page objects that are on visible layers and leaves those out that are on master pages:

                 

                var _d=app.activeDocument;
                var _pages = _d.pages;
                
                var _pageRangeArray = new Array();
                
                for (var n=0;n<_pages.length;n++){
                    var _allPageItems = _pages[n].allPageItems;
                    var _counter = 0;
                    for(var m=0;m<_allPageItems.length;m++){
                        if(_allPageItems[m].itemLayer.visible === true){++_counter};
                        };
                    if(_counter >0){
                        _pageRangeArray.push(_pages[n].name);
                        };
                    };
                
                //Set the page range:
                var _pageRangeString = _d.printPreferences.pageRange = _pageRangeArray.join();
                
                alert("The page range of the print dialog is set to pages: "+_pageRangeString);
                


                Be aware that empty objects like blank text frames or other objects without fill or stroke properties count as normal page content.

                 

                Hope, that helps…

                 

                Uwe

                • 5. Re: Hidden Layers printing unwanted blank pages.
                  Stan-C Level 1

                  Here is what we are trying to accomplish:

                   

                  Simply put we have a book with chapter content with questions and answers to the questions at the end of the chapters. Currently outside of InDesign we have 3 different documents which are being converted to InDesign:

                   

                  A – The book or manual normal chapter content (Layer 1) with the questions at the end (Layer 2)

                   

                  B – The questions only for the student (Layer 2) which is a template with questions to be answered and table templates to be completed

                   

                  C – The Answer Key for the instructor with questions (Layer 2) and Answers (Layer 3)

                   

                  Our current approach outside of InDesign is inefficient and a maintenance headache - for example: Layer 2, the Questions are duplicated in all 3 documents currently.

                   

                  Converting our 3 documents and combining these documents in InDesign into one document using layers almost works. A above is OK. The problem with using layers and page numbers is that when we print B, questions only, and hide Layer 1 (Content) and Layer 3 (Answers), or when we print C (Q & A only) and hide layer 1, the blank pages for layer 1 show up at the beginning of documents B & C with page numbers only.

                   

                  If we set these up properly there will not be any entries at all or empty frames on the hidden Layer 1, normal chapter content pages.

                  • 6. Re: Hidden Layers printing unwanted blank pages.
                    Peter Spier Most Valuable Participant (Moderator)

                    Have you considered using Conditional Text for the answers?

                     

                    It's not clear to me, either what the numbering scheme here might be. In the teacher's edition, do the pages with the answers get numbered in sequence, or do they have a special numbering system applied? If they are numbered in sequence, how do you synchronize numbering between the two editions if you don't include blank pages?

                     

                    How is this bound? And how is it printed? Changing the page counts can be problematic unless the answer pages can be tipped in at binding.

                    • 7. Re: Hidden Layers printing unwanted blank pages.
                      Stan-C Level 1

                      Have you considered using Conditional Text for the answers?

                       

                      I am not familiar with conditional text – I will need to investigate.

                       

                      It's not clear to me, either what the numbering scheme here might be. In the teacher's edition, do the pages with the answers get numbered in sequence, or do they have a special numbering system applied?

                       

                      Good question – In the teacher’s Answer Key I could go either way. My first choice would for the pages to be numbered sequentially with the first printable non-blank page to be #1. If the pages printed with the same page numbers that they have in the book that would not be the end of the world, there would be gaps in the page numbers for the non-printed chapter content – either way I don’t want the blank hidden content pages to be included in the document.

                       

                      If they are numbered in sequence, how do you synchronize numbering between the two editions if you don't include blank pages?

                       

                      Sequencing and synchronizing page numbers is not a significant problem – the instructor is just glad to have the answers and they do not care a lot about how the pages are numbered. However, having said that it would be really nice if a future version of InDesign Books could create both sequential page numbers and a Table of Contents for only the printed pages in an output document that would have layers that are not hidden.

                       

                      How is this bound? And how is it printed? Changing the page counts can be problematic unless the answer pages can be tipped in at binding.

                       

                      We deliver all of our documents electronically on CDs as PDF files so binding and printing are not problems for us.

                      • 8. Re: Hidden Layers printing unwanted blank pages.
                        Peter Spier Most Valuable Participant (Moderator)

                        It's relatively easy to keep the page numbering consistent between versions by using sections and restarting the numbers at whatever values you want. You say the teachers are just gald to get the answers, but I bet they'd be even happier if page numbers in their version correspond to the numbers in the student version so they can say "please turn to page 327" and everyone will be in the same place.

                         

                        Conditional text can be ideal for this sort of project. No extra layers required. Just mark the answers with a condition, then show or hide the condition as desired. The downside might be text reflow, depending on how you organize things and whether you use Smart Text Reflow. You should definitely do some reading about it.

                        1 person found this helpful
                        • 9. Re: Hidden Layers printing unwanted blank pages.
                          Stan-C Level 1

                          Thank you all - this has been very helpful