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

How to change page orientation when printing with JavaScript?

New Here ,
Jan 10, 2023 Jan 10, 2023

Copy link to clipboard

Copied

I'm using the following code to batch print portrait-oriented pages with two pages per sheet:

 

pp = this.getPrintParams();
pp.pageHandling = pp.constants.handling.nUp;

pp.nUpPageOrders = pp.constants.nUpPageOrders.Horizontal; 
pp.nUpNumPagesH = 2;
// pp.nUpNumPagesV = 1;
pp.nUpPageBorder=false;
pp.nUpAutoRotate=true;
pp.DuplexType = pp.constants.duplexTypes.DuplexFlipLongEdge;
pp.interactive = pp.constants.interactionLevel.silent; //non-interactive printing
pp.printerName = "My Printer"; //select printer
this.print(pp);

While this script does run successfully, the printed pages always show up in portrait format. It looks something like this:

Screen Shot 2023-01-10 at 8.21.10 AM.png

 

What I'd like is that they cover the whole sheet, i.e. rotate them and fit them side by side in portrait mode.

 

Essentially, I'm trying to print like I was choosing the following settings in the print dialog:

- Multiple pages per sheet

- Pages per sheet: 2

- Page order: Horizontal

- Orientation: Portrait

 

I'm attaching a picture with my desired result:

Screen Shot 2023-01-10 at 8.19.23 AM.png

TOPICS
JavaScript , Print and prepress

Views

326

Translate

Translate

Report

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
no replies

Have something to add?

Join the conversation