Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.
SOLVED

Native PDF: Print requirement for multiples of 4 pages

Avatar

Level 2

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?

 

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Employee

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

View solution in original post

1 Reply

Avatar

Correct answer by
Employee

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