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

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

373

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 ,
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)?

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
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.

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 ,
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.

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

Copy link to clipboard

Copied

LATEST

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.

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