I have created an interactive letter where the first page is a front end which is completed by the user - details of which are used to populate the letter on pages 2/3/4 etc. When pressing the print button, I don't want the front end (Page 1) to print, and I only want to print from page 2 onwards. Is this possible? Any script which can be used or any other way of making this work? Many thanks
in Acrobat / Reader XI Adobe added a new property to the print method of the JS API.
You can use it to define what pages to print, but it only works in Acrobat / Reader XI or above.
var pp = event.target.getPrintParams();
pp.interactive = pp.constants.interactionLevel.full;
pp.printRange=[[1, 1], [3, 4]];
Hi, thanks for your response but this doesn't seem to work. I have Reader XI, should I just over right the existing script for the print button with the script you have given above? Apologies I am a bit of a novice!
you have to create your own print button.
Explaination from the JS API reference:
Use the printRange property to print multiple sets of pages, each having a different page range. The
parameter format is an array of pairs (nStart, nEnd), where nStart and nEnd are 0-based index pages of
the PDF document.
PHEW! A much needed solution..thanks radzmar!!!!!!
I tried hiding/revealing pages on prePrint/postPrint but it renumbers the page #'s in the footer (i.e. if only page 2 is printed (hiding page 1), then page 2 becomes page 1 on prePrint). However, the solution noted above allows the pages #'s to remain the same as a custom print range is specified.
Very glad I found this post.
In case the user has a XDP form that displays only one page at a time and is designed in a way that the user has to navigate through each page to complete the form and on completion has to print the form, what can one do as all the previous forms are hidden, When xfa.host.print() is called on the click event, only the pages whose presence is visible only gets printed,
I had in my case used the prePrint / mouseDown event to make all the pages visible and on postPrint again revert to the presence to hidden.
Is there any other simpler way of achieving the same.