Copy link to clipboard
Copied
I have an interactive pdf that I am creating a print version for. I have created pages with the layer that will be printed, but when I export I now have a number of blank pages. Is there a way to make those pages not visible when exported?
Copy link to clipboard
Copied
Unfortunately, I can not post the document online. It is a Classified Document. I made all of the pages that are not to be printed templates and unchecked the boxes and added the javascript action to the "Print" buttons. after printing all of the pages that I don't want visible in the digital pdf are added to the doc again. I assume that is what the delete command is for. unfortunately I did add it and it did not work. I adjusted the page numbers as page 9 through page 35 are what I want to no show, but still, have it print. I adjusted the command to
this.deletePages({nStart: 9,nEnd: 35});
Did I use it correctly?
Copy link to clipboard
Copied
I just tested my suggestion, and here's what I found: form fields can be hidden and not printable. But, when made visible, they also become printable.
I have created a workaround that can be done with in Acrobat. Here is a link to the file I worked, download first and view in Acrobat or Reader.
Copy link to clipboard
Copied
You say:
I made all of the pages that are not to be printed templates ...
Did you mean ''pages that are to be printed but not showed in Acrobat? "
Otherwise I'm even more confused now...
The trick I suggested was about preventing pages from being displayed in Acrobat but printed while hitting the print button.
If you want to display pages and prevent them from being printed, then a n other javaScript action would be necessary, defining pages range for printing.
About the deleting code, please note javaScript starts numbering at 0. Meaning
this.deletePages({nStart: 9,nEnd: 35}); will delete pages 10 to 36.
Please be aware that applying javaScript instructions to a print button will never prevent a user from printing directly (Ctrl+P or file>print).
Copy link to clipboard
Copied
I did everything that you did in that GIF. This was exactly what I was looking for.
I turned the pages I do not want visible, but to print into page templates. I then added var a=getTemplate("Page Templatei Title");a.spawn(); to the "Print" button to spawn these pages before printing. I then added the this.deletePages({nStart: #,nEnd: #}); to delete these pages after printing. I got this to work as desired.
Now I am looking to add these javascript commands to the File>Print menu item. How would I do so?
I tried adding the above javascripts to Document Actions>Document Will Print and Document Did Print, respectively, but it did not have the same effect. Is this the correct place to add these?
Copy link to clipboard
Copied
Hi BMurr2
Creating 2 functions (i.e. mySpawn and myDelete) and respectively applying them to "Will Print" and "Did Print" Document Actions definitely sounded like a great idea!
Much better than applying them to the print button(s).
Now, since you said you couldn't make it work, I got curious and tested it (Acrobat X).
As a matter of fact, "Will Print" action does NOT work as expected...
For some reason, templates get spawned AFTER the PDF is printed, while it should run BEFORE...
I honestly don't know why, and suggest (again) you ask the Acrobat Forum. This goes beyond my Acrobat skills...
This is quite frustrating... almost there, but... nope!
Copy link to clipboard
Copied
Well, thank you for all your help to this point. IT's been a big help.
Copy link to clipboard
Copied
You're welcome...
But I must admit I was frustrated about the Willprint event not working.
So I did ask the Acrobat javascript forum about it, and probably understood why it isn't working. (thanks to try67)
See Willprint... javascript code is triggered after the actual print here
Copy link to clipboard
Copied
When you export to interactive document you can leave the option for layers active to create Acrobat Layers, when you export for print, check the menu for layers in the export options window, you have to choose the option for export just visible and printable layers
Find more inspiration, events, and resources on the new Adobe Community
Explore Now