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

Javascript- printing multiple cropped pages in one sheet

Community Beginner ,
Sep 15, 2022 Sep 15, 2022

Copy link to clipboard

Copied

I have a pdf file of 100 cropped A4 size pages- page widths are same, but cropped lengths are different. For example, first 3 cropped pages make an A4 page length (11 inches), next 2 pages makes an A4 page length. I want to print first 3 cropped pages in an A4 page and next 2 cropped pages in another A4 page.

 

Can 'multiple pages per sheet option' print one after another? As far as I know, it only prints pages as tiles in a page. I don't want tiled pages, I want one after another. What can I do to print these pages?

 

Can it be done through javascript ? Or any other third party softwares?
If javascript, how to approach it? Any ideas?

 

TOPICS
Edit and convert PDFs , How to , JavaScript , Print and prepress

Views

483

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

correct answers 1 Correct answer

Community Expert , Sep 15, 2022 Sep 15, 2022

Yes, that should be possible, but each print command will have to be separate.

You should read the documentation of the PrintParams object to get started with this. It's not a trivial task, though.

Votes

Translate

Translate
Community Expert ,
Sep 15, 2022 Sep 15, 2022

Copy link to clipboard

Copied

Not quite sure that's what you mean, but in the Print dialog you can specify the page to print 1x4 to get four original pages onto one physical one, for example:

 

try67_0-1663232818269.png

 

The pages will be automatically scaled to fit the paper you're printing them to.

Votes

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
Community Beginner ,
Sep 15, 2022 Sep 15, 2022

Copy link to clipboard

Copied

Thank you! Thank you! Thank you! I don't know how but I completely missed that in the settings! When I tried, it was printing tiles of pages. Because I tried 2x4, 3x4 but never tried 1x4.

 

Now,
This solves part of my problem. If I take 1x4 for the entire document, in some output pages some parts are scaled down to fit the page. I dont want that. In my case, it is not 1x4 throughout the entire document. It is like 1x4 in the first page, 1x3 the next page...and so on. 

 

Now I have an idea that printing multiple pages a sheet can be done through javascript console.

 

So I want to write a code that takes all page lengths into an array and calculates how many cropped pages fits an A4 sized paper. Then the code sends that many pages for print at each print command and repeats the process. I think that is a way to handle the problem. Am I right? Is there a better or easier way? 

 

Any help, any idea, any piece of code is much appriciated.


 

Votes

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
Community Expert ,
Sep 15, 2022 Sep 15, 2022

Copy link to clipboard

Copied

LATEST

Yes, that should be possible, but each print command will have to be separate.

You should read the documentation of the PrintParams object to get started with this. It's not a trivial task, though.

Votes

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