Expand my Community achievements bar.

Print Button

Avatar

Former Community Member
This is going to be a simple answer I can tell...



How can I get a print button to only print a certain # of Pages?



Is there anyway to save a completed PDF form for future reference?
5 Replies

Avatar

Level 5
Here is FormCalc code for printing... this you suppose to use with regular button not with Print Button given in the library.



this code goes into click event of the button.



$host.print( BOOLEAN param1, INTEGER param2, INTEGER param3, BOOLEAN param4, BOOLEAN param5, BOOLEAN param6, BOOLEAN param7, BOOLEAN param8)



ex: $host.print(1, "0", "2", 0, 1, 0, 0, 0)



"0" stands for starting page number.

"2" stands for ending page number.



More about this can be found in the LC Designer help. Check for "print method".



To answer your second question... You need to add user rights to your final PDF using Adobe ReaderExtensions software to be able to save the PDF with filled in data.



Good Luck,

SekharN

www.lawson.com

Avatar

Former Community Member
This script isnt working within my form, does it need to be saved as a dynamic pdf ? or do I need to change:



$host.print( BOOLEAN param1, INTEGER param2, INTEGER param3, BOOLEAN param4, BOOLEAN param5, BOOLEAN param6, BOOLEAN param7, BOOLEAN param8)



to conform to the page #s for the parameters?

Avatar

Level 5
That is just syntax.... you need to read "LiveCycle" help for 'print method'...



I have also included an example next to core syntax. Did you see that?



Let me know id you still have problem.



Thanks,

SekharN

www.lawson.com

Avatar

Former Community Member
Thank you, I got the script to work for pages 1-5, but when I try to place another button on page 6 (to print pages 6-15) it doesnt work, Is there a reason for this? are you only allowed to execute a print option once within the same document?

Avatar

Level 5
I am confused... are you intentionally printing pages 1 to 5? Here is what I will code just in case I need to print only pages 1 to 5.



$host.print(1, "0", "4", 0, 1, 0, 0, 0)



"0" stands for starting page number. In this case page 1.

"4" stands for ending page number. in this case page 5.



Note: This numbering system starts from 0 indexing.



So for to print page 6 to 15 I would use...



$host.print(1, "5", "14", 0, 1, 0, 0, 0)



"5" stands for starting page number. I this case page 6.

"14" stands for ending page number. In this case page 15.



for to print pages 1 to 15 I would use...

$host.print(1, "0", "14", 0, 1, 0, 0, 0)



And to print all the pages in the document me knowing number of pages I would use following JavaScript code...



xfa.host.print(1, "0", (xfa.host.numPages -1).toString(), 0, 1, 0, 0, 0);



Check your code with these scenarios.



Good luck,

SekharN,

www.lawson.com