Add blank page based on maximum number of pages in PDF

New Here ,
Nov 16, 2018 Nov 16, 2018

Copy link to clipboard

Copied

I have a large PDF file that contains data for invoices. I'm using a pdf splitter, but it will only split based on the number of pages of the invoice, so each invoice must be the same number of pages. Is there a way to scan through the pdf, looking for a specific word then count how many pages there are in each invoice looking for the invoice with the most number of pages and then add blank pages to the invoices that don't have meet that maximum?

TOPICS
Acrobat SDK and JavaScript

Views

150

Likes

translate

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
Most Valuable Participant ,
Nov 16, 2018 Nov 16, 2018

Copy link to clipboard

Copied

Yes, this is possible using a script, but it's not a simple task. Do you have any experience with Acrobat JavaScript? Are you planning on writing this code yourself, or are you interested in someone doing it for you (for a fee, most likely)?

Likes

translate

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
New Here ,
Nov 16, 2018 Nov 16, 2018

Copy link to clipboard

Copied

I haven't used Acrobat Javascript in a few years, so some guidance would be appreciated.

Likes

translate

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
Most Valuable Participant ,
Nov 16, 2018 Nov 16, 2018

Copy link to clipboard

Copied

You can get the words in the file using the getPageNthWord method. Then when you find it save the page number to an array and continue to the next match. At the end of that process you'll have an array with the first page numbers of all the invoices (the last item in that array should be the last page in the file). Deduct the values from one another to get the length of each invoice. The largest value is the one to use. Then go back and insert the blank pages (using the newPage method) where needed.

Likes

translate

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
Most Valuable Participant ,
Nov 16, 2018 Nov 16, 2018

Copy link to clipboard

Copied

If finally you would prefer to hire someone to do it for you, feel free to contact me privately (try6767 at gmail.com), to discuss it further.

Likes

translate

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