Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Setting the page print range via JavaScript

Explorer ,
Dec 05, 2022 Dec 05, 2022

I have a 5 page form. I want to print it, for saving purposes, as 2 A5 pages on one A4. So we set the A4 page as landscape and place one reduced A4 page in the left half and the other in the right half. There's a little problem with that last odd page number 5, though.
Namely, setting the print range as:

pp = this.getPrintParams();
ppback = pp;
pp.pageHandling = pp.constants.handling.nUp;
pp.nUpPageOrders = pp.constants.nUpPageOrders.Vertical;
pp.nUpNumPagesH = 1;
pp.nUpNumPagesV = 2;
pp.nUpPageBorder=true;
pp.nUpAutoRotate=true;
pp.DuplexType = pp.constants.duplexTypes.DuplexFlipShortEdge;
pp.printRange=[[1, 1], [0, 0], [3,3], [2,2], [4,4]];
this.print(pp);

Page 5 (which is 4 counting from 0) is printed on the right side of the last sheet, leaving the left side blank. Is there any way to force it to be printed on the left side of the page? It's an aesthetic problem, but it's a minor thing that annoys me.

TOPICS
JavaScript , PDF forms
1.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Dec 05, 2022 Dec 05, 2022

Not really. You can add a blank page before it, though, and then print both pages together. Then delete the page after the print command. Just be aware you'll need to adjust all the page numbers following the location where you added that page.

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 05, 2022 Dec 05, 2022

Not really. You can add a blank page before it, though, and then print both pages together. Then delete the page after the print command. Just be aware you'll need to adjust all the page numbers following the location where you added that page.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 05, 2022 Dec 05, 2022
LATEST

Thanks, that's the answer I expected. I assumed you'd have to cheat. Actually, I even did before you answered 🙂

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines