code to print
- December 9, 2023
- 1 reply
- 3946 views
hi
I created the attached code to print the 181 pages of a pdf file
In fields
this.getField("start of mandate").value;
this.getField("end of mandate").value;
this.getField("privacy start").value;
etc.........
I inserted this function in the script of the field event.value=event.target.page; which returns the page number where the fields are located.
when in the drop-down menu of the "OPTIONS" field I select "PRINT BANK" when the file print arrives at this code:
var pp = this.getPrintParams();
pp.colorOverride = st1;
pp.pageHandling = st2;
if (/1/.test(a1))pp.printRange=[[s38,s41],[s45,s45],[s47,s47],[s51,s52]];
if (/2/.test(a1))pp.printRange=[[s38,s42],[s45,s48],[s51,s52]];
if (/3/.test(a1))pp.printRange=[[s38,s43],[s45,s49],[s51,s52]];
if (/4/.test(a1))pp.printRange=[[s38,s52]];
pp.NumCopies=1;
pp.DuplexType =1;
pp.printerName = st3;
pp.interactive = st4;
this.print(pp);}
the pages indicated in the code are not printed, but all 181 pages of the pdf file are printed
However, when I select the other items in the drop-down menu of the "OPTIONS" field, the code described above works perfectly.
I can't figure out where I made the mistake.
Please, can anyone help me fix my code?
Thank you very much for your attention
