3

I'm trying to find a solution to split PDFs I'm receiving in my email in order to start OCR (invoices). The script is working well but only for 1-2pages document, so I tried to figure out how to manage multiple pages PDFs and decided to looking for a code to split big PDF into multiple PDF with one page...

I get this topic : Merge Multiple PDF's into one PDF And tried something based on this script : link @pokyCoder (line 484)

Results are pretty good but the script is not working on landscape PDF with multiple pages. The script make every slide to portrait, and those are uncomplete to read then.

How could I get the script to work with landscape? Or at least, how can I detect the layout orientation before the autostart?

Any help appreciated :)

Waxim Corp
  • 657
  • 4
  • 16
  • Isn't the script by @PokyCoder to merge pdfs? Have you modified it to split pdfs? – TheMaster Oct 06 '20 at 15:32
  • 1
    @TheMaster Yes, but there is a splitPdf function also, starting line 484. Sorry I forgot to mention it – Waxim Corp Oct 06 '20 at 15:40
  • Consider adding a link to this question to pokyCoder's answer. – TheMaster Oct 06 '20 at 20:34
  • Actually I can't because not enough reputation – Waxim Corp Oct 07 '20 at 05:52
  • 1
    As side note, add your star to this [feature request for Apps Script in Issue Tracker](https://issuetracker.google.com/36753526). – iansedano Oct 07 '20 at 07:34
  • Although I'm not sure about your actual situation, is this information useful? https://medium.com/google-cloud/exporting-specific-pages-from-a-pdf-as-a-new-pdf-using-google-apps-script-2f22d07b4618 and https://github.com/tanaikech/PDFApp#exportpages If this was not useful, I apologize. – Tanaike Aug 27 '23 at 12:33

1 Answers1

0

I decided to do another way due to multiple version of PDF decoding/encoding and complexity to have uniform results...

I'm still using OCR, but not on very large document. And the result is handling by a buffer to avoid too big results at once

Waxim Corp
  • 657
  • 4
  • 16