Native PDF: Print requirement for multiples of 4 pages | Community
Skip to main content
Level 2
September 24, 2024
Solved

Native PDF: Print requirement for multiples of 4 pages

  • September 24, 2024
  • 1 reply
  • 616 views

Where PDFs will be printed there is a requirement to generate output PDFs with a page count which is a multiple of 4.

 

Is there a way to count and add pages, if required? I know we can run a JavaScript script post pagination  - does this give us access to the page information which would allow us to expand the number of pages, if required?

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Surbhi_Maheshwari

Hi Mike,

Yes, you can achieve this. I have tried with attached JavaScript and it works fine. It automatically fills your document with blank pages so that the total page count is divisible by four. In you page layout of PDF Template, you can add this:

 

 

<div data-region="content"> <script src="divisibleby4.js" type="text/javascript"></script> <script>autoFillPages({ multiple: 4 });</script> </div>

 

Whatever value you give in multiple above, that is honoured. If you give 5 then total page count will be divisible by 5.

Note: You will need to upload this js file in your template folder.

Please give it a try and let us know if it works for you.

 

Thanks and Regards,
Surbhi Maheshwari

1 reply

Surbhi_MaheshwariAdobe EmployeeAccepted solution
Adobe Employee
September 26, 2024

Hi Mike,

Yes, you can achieve this. I have tried with attached JavaScript and it works fine. It automatically fills your document with blank pages so that the total page count is divisible by four. In you page layout of PDF Template, you can add this:

 

 

<div data-region="content"> <script src="divisibleby4.js" type="text/javascript"></script> <script>autoFillPages({ multiple: 4 });</script> </div>

 

Whatever value you give in multiple above, that is honoured. If you give 5 then total page count will be divisible by 5.

Note: You will need to upload this js file in your template folder.

Please give it a try and let us know if it works for you.

 

Thanks and Regards,
Surbhi Maheshwari