Javascript to recognize paper size of each page in pdf and print to certain size.

New Here ,
Aug 02, 2018

Copy link to clipboard

Copied

Hi all,

I have a question. I only know a bit of VBA, so Javascript is still a bit of a mistery to me.

What I need is a program like this:

If papersize = A4 or A3 Then

Printsize = A4

Else

Printsize = A3

This way, all our big drawings (A2-A0) will be printed on A3. The rest on A4. (Our A3 drawings are perfectly readable on A4 and that saves a lot of paper in the end.)

I don't mind if this means that for a document of 20 pages, there will be 20 printjobs.

thanks

TOPICS
Acrobat SDK and JavaScript

Views

390

Likes

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

Javascript to recognize paper size of each page in pdf and print to certain size.

New Here ,
Aug 02, 2018

Copy link to clipboard

Copied

Hi all,

I have a question. I only know a bit of VBA, so Javascript is still a bit of a mistery to me.

What I need is a program like this:

If papersize = A4 or A3 Then

Printsize = A4

Else

Printsize = A3

This way, all our big drawings (A2-A0) will be printed on A3. The rest on A4. (Our A3 drawings are perfectly readable on A4 and that saves a lot of paper in the end.)

I don't mind if this means that for a document of 20 pages, there will be 20 printjobs.

thanks

TOPICS
Acrobat SDK and JavaScript

Views

391

Likes

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
Aug 02, 2018 0
Most Valuable Participant ,
Aug 02, 2018

Copy link to clipboard

Copied

You can't dictate the specific page size that is going to be used by the printer using a script. The only thing you can do is tell it to select the paper tray that matches the PDF page size, but then all A3 pages will be printed on A3 paper, of course.

I would try to scale the A3 pages to A4, and then all the rest of the pages to A3, then you would be able to achieve what you described.

Likes

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
Reply
Loading...
Aug 02, 2018 0
New Here ,
Aug 02, 2018

Copy link to clipboard

Copied

That will not be possible sadly. (resizing the pages)

Likes

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
Reply
Loading...
Aug 02, 2018 0
try67 LATEST
Most Valuable Participant ,
Aug 02, 2018

Copy link to clipboard

Copied

The only other way I can think of doing it within Acrobat is if you have a separate printer name for each paper size. In that case it should be possible to compose a list of all A3/A4 pages and send them to the A4 printer, and all other pages can be sent to the A3 printer.

Likes

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
Reply
Loading...
Aug 02, 2018 0
Most Valuable Participant ,
Aug 02, 2018

Copy link to clipboard

Copied

You could identify a list of PDFs based on some measure (bear in mind each page in a PDF could have a different size, so it's a page property, not a document property). Then you could use an external app to queue for printing by a list after setting the default printer attributes manuall.

Likes

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
Reply
Loading...
Aug 02, 2018 0