Re: Working with multi-page PDF files and automatically labeling and later extracting select pages
Damn email wasn't plain text! The lines with asterisks on either end were just bold (copied from the forum page here: http://www.quickpdf.org/forum/topic3731_post14882.html#14882) and are NOT commented lines. On 8/19/2019 10:11 PM, MB Software Solutions, LLC wrote: Got it working with this code (which assumes the object was already instantiated): * _screen.oQuickPDF.ClearFileList("MyList")* lcPath = ADDBS(ALLTRIM(_screen.cRepository)) + "temp\" IF NOT DIRECTORY(lcPath) THEN MKDIR (lcPath) ENDIF SELECT tmpSelected SCAN SCATTER NAME loFile lcFile = ADDBS(lcPath)+FORCEEXT("File_" + ALLTRIM(STR(tmpSelected.iFileLinkID)) + "_" + ALLTRIM(STR(tmpSelected.iDocLinkID)) + "_" + TTOC(DATETIME(),1) + SYS(2015),'PDF') *_screen.oQuickpdf.ExtractFilePagesEx(ADDBS(ALLTRIM(loFile.cPath))+ALLTRIM(loFile.cfilename),'',lcFile,ALLTRIM(loFile.cRange),3)* *_screen.oQuickPDF.AddToFileList("MyList",lcFile)* ENDSCAN * now put the page outputs from the temp files all into the final PDF lcFile = lcPath + "MyOutput.pdf" *_screen.oQuickPDF.MergeFileListFast("MyList",lcFile)* LaunchFile(lcFile) USE IN SELECT('tmpSelected') On 8/1/2019 4:19 PM, MB Software Solutions, LLC wrote: Customer has a single PDF ("document") with several pages in it (let's say 12 pages). The document is made up of several scanned files, each a different file type or "component." Customer wants to extract certain pages from this single PDF into later email to other parties. They cannot mail the entire document because some content isn't intended for recipients (like invoices) but they want to be able to send other selected "component" parts and that file attached to the email deliverable would be a SINGLE file. Example: MyPDF.PDF Page 1: Invoice ("A") Page 2-3: Bill of lading ("B") Page 4-6: Fuel slips ("C" Page 7-10: Something else ("D") Page 11-12: Yada yada yada ("E") Eventually, components B, C, and E will be emailed to somebody. Given this scenario, what do you recommend? tia, --Mike --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus [excessive quoting removed by server] ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: https://leafe.com/archives This message: https://leafe.com/archives/byMID/e2e471b6-088d-ec3f-c6a8-7bb8dba09...@mbsoftwaresolutions.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Re: Working with multi-page PDF files and automatically labeling and later extracting select pages
Got it working with this code (which assumes the object was already instantiated): * _screen.oQuickPDF.ClearFileList("MyList")* lcPath = ADDBS(ALLTRIM(_screen.cRepository)) + "temp\" IF NOT DIRECTORY(lcPath) THEN MKDIR (lcPath) ENDIF SELECT tmpSelected SCAN SCATTER NAME loFile lcFile = ADDBS(lcPath)+FORCEEXT("File_" + ALLTRIM(STR(tmpSelected.iFileLinkID)) + "_" + ALLTRIM(STR(tmpSelected.iDocLinkID)) + "_" + TTOC(DATETIME(),1) + SYS(2015),'PDF') *_screen.oQuickpdf.ExtractFilePagesEx(ADDBS(ALLTRIM(loFile.cPath))+ALLTRIM(loFile.cfilename),'',lcFile,ALLTRIM(loFile.cRange),3)* *_screen.oQuickPDF.AddToFileList("MyList",lcFile)* ENDSCAN * now put the page outputs from the temp files all into the final PDF lcFile = lcPath + "MyOutput.pdf" *_screen.oQuickPDF.MergeFileListFast("MyList",lcFile)* LaunchFile(lcFile) USE IN SELECT('tmpSelected') On 8/1/2019 4:19 PM, MB Software Solutions, LLC wrote: Customer has a single PDF ("document") with several pages in it (let's say 12 pages). The document is made up of several scanned files, each a different file type or "component." Customer wants to extract certain pages from this single PDF into later email to other parties. They cannot mail the entire document because some content isn't intended for recipients (like invoices) but they want to be able to send other selected "component" parts and that file attached to the email deliverable would be a SINGLE file. Example: MyPDF.PDF Page 1: Invoice ("A") Page 2-3: Bill of lading ("B") Page 4-6: Fuel slips ("C" Page 7-10: Something else ("D") Page 11-12: Yada yada yada ("E") Eventually, components B, C, and E will be emailed to somebody. Given this scenario, what do you recommend? tia, --Mike --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus [excessive quoting removed by server] ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: https://leafe.com/archives This message: https://leafe.com/archives/byMID/2cf4b0c3-d999-6283-acf1-7e2c92b7e...@mbsoftwaresolutions.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
QuickPDF super simple example (was Re: Working with multi-page PDF files and automatically labeling and later extracting select pages)
Got QuickPDF working from the command window: ox = CREATEOBJECT("DebenuPDFLibraryAX1613.PDFLibrary") WAIT WINDOW ox.UnlockKey('mykey') ox.LoadFromFile(GETFILE(),'') ox.ExtractFilePages('E:\dev\somerset\downloads\594227.pdf','','C:\CRAP\test1.pdf',"1,11-12") And that's ittell it the Source.PDF, Target.PDF, and pages you want to extract. Done. I ran the GhostScript example Ricardo provided and for some reason, it kept getting a file access denied on one of the pages it generated when it was spitting them out one by one in the leadup to the final pdf. Odd. On 8/7/2019 10:12 AM, Eric Selje wrote: I'm sorry I couldn't dig up any sample code to share but the documentation for QuickPDF is pretty good and has a lot. There's nothing I wanted to do with PDFs that it couldn't handle. Creating/Editing/Merging/Manipulating...all very good. I'm desperately trying to wrap things up before I take a week off here. Sorry! Eric On Tue, Aug 6, 2019 at 1:32 PM MB Software Solutions, LLC < mbsoftwaresoluti...@mbsoftwaresolutions.com> wrote: Thanks for the lead, Eric. Got any sample source code to share? On 8/6/2019 10:02 AM, Eric Selje wrote: I use (and really like) QuickPDF ( https://www.debenu.com/products/development/debenu-pdf-library/). Eric On Fri, Aug 2, 2019 at 11:39 AM Frank Cazabon wrote: I've never merged or split PDFs with it but I've used it to fill in a PDF form. Basically I create a script to run the pdftk command, store it in a batch file and execute the batch file STRTOFILE(m.lcFDFFile, m.lcFolder + "source.fdf") m.lcCommand = [pdftk "] + m.lcBlankForm + [" fill_form "] + m.lcFolder + [source.fdf" output "] + m.lcFilledForm +[" flatten drop_xfa] * store the command in a batch file due to the 240 character limit for run commands m.lcBatchFile = m.lcFolder + "fillpdf.bat" STRTOFILE(m.lcCommand, m.lcBatchFile) *!* maybe use shellexecute RUN "" IF FILE(m.lcFilledForm) m.lcFileName = JUSTFNAME(m.lcFilledForm) IF MESSAGEBOX('The file ' + m.lcFileName + CHR(13) + 'was successfully created.' + CHR(13) +; 'Would you like to open it now?',36,'PDF Merge Successful') = 6 X8ShellExecute(m.lcFilledForm) ENDIF ELSE MESSAGEBOX("The system encountered a problem creating the PDF.",64,"Problem Encountered") ENDIF Frank. Frank Cazabon On 02/08/2019 11:40 AM, MB Software Solutions, LLC wrote: That looks great, Frank. Got any source code to share with me?!??? On 8/2/2019 8:32 AM, Frank Cazabon wrote: This is the PDF Toolkit I have used: https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ which allows you to merge and split (and more) PDFs Frank. Frank Cazabon On 02/08/2019 08:02 AM, MB Software Solutions, LLC wrote: Ideally, these would be the tables: MyComponents.dbf * iid int autoinc PK * cLabel v(50) (e.g., INVOICE, FUEL RECEIPT, BILL OF LADING, etc.) * tAdded t MyPDFs.dbf * iid int autoinc PK * cFilename v(50) * tAdded t MyPages.dbf * iid int autoinc PK * iFileID int (backlink to MyPDFs.dbf) * nStartPage int * nEndPage int * iLabelID (backlink to MyComponents.dbf) And then on demand, I could generate a new deliverable PDF containing multiple components, selectable by the user ahead of time to put it together. From the original post: "B, C, and E" -- all in one PDF file. On 8/1/2019 4:29 PM, Frank Cazabon wrote: PDF toolkit might let you split a PDF into separate PDFs. But it really sounds like you should keep the original PDFs as separate entities and deal with each component as you wish. On 1 August 2019 16:19:10 GMT-04:00, "MB Software Solutions, LLC" wrote: Customer has a single PDF ("document") with several pages in it (let's say 12 pages). The document is made up of several scanned files, each a different file type or "component." Customer wants to extract certain pages from this single PDF into later email to other parties. They cannot mail the entire document because some content isn't intended for recipients (like invoices) but they want to be able to send other selected "component" parts and that file attached to the email deliverable would be a SINGLE file. Example: MyPDF.PDF Page 1: Invoice ("A") Page 2-3: Bill of lading ("B") Page 4-6: Fuel slips ("C" Page 7-10: Something else ("D") Page 11-12: Yada yada yada ("E") Eventually, components B, C, and E will be emailed to somebody. Given this scenario, what do you recommend? tia, --Mike --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus [excessive quoting removed by server] ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: https://leafe.com/archives This
Re: Working with multi-page PDF files and automatically labeling and later extracting select pages
I'm sorry I couldn't dig up any sample code to share but the documentation for QuickPDF is pretty good and has a lot. There's nothing I wanted to do with PDFs that it couldn't handle. Creating/Editing/Merging/Manipulating...all very good. I'm desperately trying to wrap things up before I take a week off here. Sorry! Eric On Tue, Aug 6, 2019 at 1:32 PM MB Software Solutions, LLC < mbsoftwaresoluti...@mbsoftwaresolutions.com> wrote: > Thanks for the lead, Eric. Got any sample source code to share? > > > On 8/6/2019 10:02 AM, Eric Selje wrote: > > I use (and really like) QuickPDF ( > > https://www.debenu.com/products/development/debenu-pdf-library/). > > > > Eric > > > > > > On Fri, Aug 2, 2019 at 11:39 AM Frank Cazabon > > wrote: > > > >> I've never merged or split PDFs with it but I've used it to fill in a > >> PDF form. Basically I create a script to run the pdftk command, store it > >> in a batch file and execute the batch file > >> > >> STRTOFILE(m.lcFDFFile, m.lcFolder + "source.fdf") > >> > >> m.lcCommand = [pdftk "] + m.lcBlankForm + [" fill_form "] + > >> m.lcFolder + [source.fdf" output "] + m.lcFilledForm +[" flatten > drop_xfa] > >> > >> * store the command in a batch file due to the 240 character limit > >> for run commands > >> m.lcBatchFile = m.lcFolder + "fillpdf.bat" > >> STRTOFILE(m.lcCommand, m.lcBatchFile) > >> > >> *!* maybe use shellexecute > >> RUN "" > >> > >> IF FILE(m.lcFilledForm) > >> m.lcFileName = JUSTFNAME(m.lcFilledForm) > >> IF MESSAGEBOX('The file ' + m.lcFileName + CHR(13) + 'was > >> successfully created.' + CHR(13) +; > >> 'Would you like to open it now?',36,'PDF Merge > >> Successful') = 6 > >> X8ShellExecute(m.lcFilledForm) > >> ENDIF > >> ELSE > >> MESSAGEBOX("The system encountered a problem creating the > >> PDF.",64,"Problem Encountered") > >> ENDIF > >> > >> > >> Frank. > >> > >> Frank Cazabon > >> > >> On 02/08/2019 11:40 AM, MB Software Solutions, LLC wrote: > >>> That looks great, Frank. Got any source code to share with me?!??? > >>> > >>> > >>> On 8/2/2019 8:32 AM, Frank Cazabon wrote: > This is the PDF Toolkit I have used: > > https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ > > which allows you to merge and split (and more) PDFs > > Frank. > > Frank Cazabon > > On 02/08/2019 08:02 AM, MB Software Solutions, LLC wrote: > > Ideally, these would be the tables: > > > > MyComponents.dbf > > > > * iid int autoinc PK > > * cLabel v(50) (e.g., INVOICE, FUEL RECEIPT, BILL OF LADING, etc.) > > * tAdded t > > > > MyPDFs.dbf > > > > * iid int autoinc PK > > * cFilename v(50) > > * tAdded t > > > > MyPages.dbf > > > > * iid int autoinc PK > > * iFileID int (backlink to MyPDFs.dbf) > > * nStartPage int > > * nEndPage int > > * iLabelID (backlink to MyComponents.dbf) > > > > And then on demand, I could generate a new deliverable PDF > > containing multiple components, selectable by the user ahead of time > > to put it together. From the original post: "B, C, and E" -- all in > > one PDF file. > > > > > > On 8/1/2019 4:29 PM, Frank Cazabon wrote: > >> PDF toolkit might let you split a PDF into separate PDFs. But it > >> really sounds like you should keep the original PDFs as separate > >> entities and deal with each component as you wish. > >> > >> On 1 August 2019 16:19:10 GMT-04:00, "MB Software Solutions, LLC" > >> wrote: > >>> Customer has a single PDF ("document") with several pages in it > >>> (let's > >>> say 12 pages). The document is made up of several scanned files, > >>> each > >>> a > >>> different file type or "component." > >>> > >>> Customer wants to extract certain pages from this single PDF into > >>> later > >>> > >>> email to other parties. They cannot mail the entire document > because > >>> some content isn't intended for recipients (like invoices) but they > >>> want > >>> to be able to send other selected "component" parts and that file > >>> attached to the email deliverable would be a SINGLE file. > >>> > >>> Example: > >>> > >>> MyPDF.PDF > >>> > >>> Page 1: Invoice ("A") > >>> Page 2-3: Bill of lading ("B") > >>> Page 4-6: Fuel slips ("C" > >>> Page 7-10: Something else ("D") > >>> Page 11-12: Yada yada yada ("E") > >>> > >>> > >>> Eventually, components B, C, and E will be emailed to somebody. > >>> > >>> > >>> Given this scenario, what do you recommend? > >>> > >>> tia, > >>> --Mike > >>> > >>> > >>> > >>> --- > >>> This email has been checked for viruses by Avast antivirus > software. > >>> https://www.avast.com/antivirus > >>> >
Re: Working with multi-page PDF files and automatically labeling and later extracting select pages
Another option available is Ghostscript. It has an exe that you can call from the command line. I used it once to extract text from a PDF but it can also split/merge. Here's something I knocked up to get you started: https://gist.github.com/medalark/31eb67305f0fec81cae1ba4a75407ac4 You need to change the four variables at the start of the program. Also, you might need to change the reference to the Ghostscript exe. I used the 64 bit version. Ricardo On Thu, 1 Aug 2019 at 21:19, MB Software Solutions, LLC < mbsoftwaresoluti...@mbsoftwaresolutions.com> wrote: > Customer has a single PDF ("document") with several pages in it (let's > say 12 pages). The document is made up of several scanned files, each a > different file type or "component." > > Customer wants to extract certain pages from this single PDF into later > email to other parties. They cannot mail the entire document because > some content isn't intended for recipients (like invoices) but they want > to be able to send other selected "component" parts and that file > attached to the email deliverable would be a SINGLE file. > > Example: > > MyPDF.PDF > > Page 1: Invoice ("A") > Page 2-3: Bill of lading ("B") > Page 4-6: Fuel slips ("C" > Page 7-10: Something else ("D") > Page 11-12: Yada yada yada ("E") > > > Eventually, components B, C, and E will be emailed to somebody. > > > Given this scenario, what do you recommend? > > tia, > --Mike > > > > --- > This email has been checked for viruses by Avast antivirus software. > https://www.avast.com/antivirus > > [excessive quoting removed by server] ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: https://leafe.com/archives This message: https://leafe.com/archives/byMID/CAJeZx3=F=cphmuts0f4zcumfe6rupppfxtoho3euqygg3lk...@mail.gmail.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Re: Working with multi-page PDF files and automatically labeling and later extracting select pages
Thanks for the lead, Eric. Got any sample source code to share? On 8/6/2019 10:02 AM, Eric Selje wrote: I use (and really like) QuickPDF ( https://www.debenu.com/products/development/debenu-pdf-library/). Eric On Fri, Aug 2, 2019 at 11:39 AM Frank Cazabon wrote: I've never merged or split PDFs with it but I've used it to fill in a PDF form. Basically I create a script to run the pdftk command, store it in a batch file and execute the batch file STRTOFILE(m.lcFDFFile, m.lcFolder + "source.fdf") m.lcCommand = [pdftk "] + m.lcBlankForm + [" fill_form "] + m.lcFolder + [source.fdf" output "] + m.lcFilledForm +[" flatten drop_xfa] * store the command in a batch file due to the 240 character limit for run commands m.lcBatchFile = m.lcFolder + "fillpdf.bat" STRTOFILE(m.lcCommand, m.lcBatchFile) *!* maybe use shellexecute RUN "" IF FILE(m.lcFilledForm) m.lcFileName = JUSTFNAME(m.lcFilledForm) IF MESSAGEBOX('The file ' + m.lcFileName + CHR(13) + 'was successfully created.' + CHR(13) +; 'Would you like to open it now?',36,'PDF Merge Successful') = 6 X8ShellExecute(m.lcFilledForm) ENDIF ELSE MESSAGEBOX("The system encountered a problem creating the PDF.",64,"Problem Encountered") ENDIF Frank. Frank Cazabon On 02/08/2019 11:40 AM, MB Software Solutions, LLC wrote: That looks great, Frank. Got any source code to share with me?!??? On 8/2/2019 8:32 AM, Frank Cazabon wrote: This is the PDF Toolkit I have used: https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ which allows you to merge and split (and more) PDFs Frank. Frank Cazabon On 02/08/2019 08:02 AM, MB Software Solutions, LLC wrote: Ideally, these would be the tables: MyComponents.dbf * iid int autoinc PK * cLabel v(50) (e.g., INVOICE, FUEL RECEIPT, BILL OF LADING, etc.) * tAdded t MyPDFs.dbf * iid int autoinc PK * cFilename v(50) * tAdded t MyPages.dbf * iid int autoinc PK * iFileID int (backlink to MyPDFs.dbf) * nStartPage int * nEndPage int * iLabelID (backlink to MyComponents.dbf) And then on demand, I could generate a new deliverable PDF containing multiple components, selectable by the user ahead of time to put it together. From the original post: "B, C, and E" -- all in one PDF file. On 8/1/2019 4:29 PM, Frank Cazabon wrote: PDF toolkit might let you split a PDF into separate PDFs. But it really sounds like you should keep the original PDFs as separate entities and deal with each component as you wish. On 1 August 2019 16:19:10 GMT-04:00, "MB Software Solutions, LLC" wrote: Customer has a single PDF ("document") with several pages in it (let's say 12 pages). The document is made up of several scanned files, each a different file type or "component." Customer wants to extract certain pages from this single PDF into later email to other parties. They cannot mail the entire document because some content isn't intended for recipients (like invoices) but they want to be able to send other selected "component" parts and that file attached to the email deliverable would be a SINGLE file. Example: MyPDF.PDF Page 1: Invoice ("A") Page 2-3: Bill of lading ("B") Page 4-6: Fuel slips ("C" Page 7-10: Something else ("D") Page 11-12: Yada yada yada ("E") Eventually, components B, C, and E will be emailed to somebody. Given this scenario, what do you recommend? tia, --Mike --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus [excessive quoting removed by server] ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: https://leafe.com/archives This message: https://leafe.com/archives/byMID/01197738-594d-31cb-dbce-f2fedf763...@mbsoftwaresolutions.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Re: Working with multi-page PDF files and automatically labeling and later extracting select pages
I use (and really like) QuickPDF ( https://www.debenu.com/products/development/debenu-pdf-library/). Eric On Fri, Aug 2, 2019 at 11:39 AM Frank Cazabon wrote: > I've never merged or split PDFs with it but I've used it to fill in a > PDF form. Basically I create a script to run the pdftk command, store it > in a batch file and execute the batch file > > STRTOFILE(m.lcFDFFile, m.lcFolder + "source.fdf") > > m.lcCommand = [pdftk "] + m.lcBlankForm + [" fill_form "] + > m.lcFolder + [source.fdf" output "] + m.lcFilledForm +[" flatten drop_xfa] > > * store the command in a batch file due to the 240 character limit > for run commands > m.lcBatchFile = m.lcFolder + "fillpdf.bat" > STRTOFILE(m.lcCommand, m.lcBatchFile) > > *!* maybe use shellexecute > RUN "" > > IF FILE(m.lcFilledForm) > m.lcFileName = JUSTFNAME(m.lcFilledForm) > IF MESSAGEBOX('The file ' + m.lcFileName + CHR(13) + 'was > successfully created.' + CHR(13) +; > 'Would you like to open it now?',36,'PDF Merge > Successful') = 6 > X8ShellExecute(m.lcFilledForm) > ENDIF > ELSE > MESSAGEBOX("The system encountered a problem creating the > PDF.",64,"Problem Encountered") > ENDIF > > > Frank. > > Frank Cazabon > > On 02/08/2019 11:40 AM, MB Software Solutions, LLC wrote: > > That looks great, Frank. Got any source code to share with me?!??? > > > > > > On 8/2/2019 8:32 AM, Frank Cazabon wrote: > >> This is the PDF Toolkit I have used: > >> > >> https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ > >> > >> which allows you to merge and split (and more) PDFs > >> > >> Frank. > >> > >> Frank Cazabon > >> > >> On 02/08/2019 08:02 AM, MB Software Solutions, LLC wrote: > >>> Ideally, these would be the tables: > >>> > >>> MyComponents.dbf > >>> > >>> * iid int autoinc PK > >>> * cLabel v(50) (e.g., INVOICE, FUEL RECEIPT, BILL OF LADING, etc.) > >>> * tAdded t > >>> > >>> MyPDFs.dbf > >>> > >>> * iid int autoinc PK > >>> * cFilename v(50) > >>> * tAdded t > >>> > >>> MyPages.dbf > >>> > >>> * iid int autoinc PK > >>> * iFileID int (backlink to MyPDFs.dbf) > >>> * nStartPage int > >>> * nEndPage int > >>> * iLabelID (backlink to MyComponents.dbf) > >>> > >>> And then on demand, I could generate a new deliverable PDF > >>> containing multiple components, selectable by the user ahead of time > >>> to put it together. From the original post: "B, C, and E" -- all in > >>> one PDF file. > >>> > >>> > >>> On 8/1/2019 4:29 PM, Frank Cazabon wrote: > PDF toolkit might let you split a PDF into separate PDFs. But it > really sounds like you should keep the original PDFs as separate > entities and deal with each component as you wish. > > On 1 August 2019 16:19:10 GMT-04:00, "MB Software Solutions, LLC" > wrote: > > Customer has a single PDF ("document") with several pages in it > > (let's > > say 12 pages). The document is made up of several scanned files, > > each > > a > > different file type or "component." > > > > Customer wants to extract certain pages from this single PDF into > > later > > > > email to other parties. They cannot mail the entire document because > > some content isn't intended for recipients (like invoices) but they > > want > > to be able to send other selected "component" parts and that file > > attached to the email deliverable would be a SINGLE file. > > > > Example: > > > > MyPDF.PDF > > > > Page 1: Invoice ("A") > > Page 2-3: Bill of lading ("B") > > Page 4-6: Fuel slips ("C" > > Page 7-10: Something else ("D") > > Page 11-12: Yada yada yada ("E") > > > > > > Eventually, components B, C, and E will be emailed to somebody. > > > > > > Given this scenario, what do you recommend? > > > > tia, > > --Mike > > > > > > > > --- > > This email has been checked for viruses by Avast antivirus software. > > https://www.avast.com/antivirus > > > > [excessive quoting removed by server] ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: https://leafe.com/archives This message: https://leafe.com/archives/byMID/caawxvuk763lkqqqnrwqwsphcfq0gyclabfr+cfwugedeqoj...@mail.gmail.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Re: Working with multi-page PDF files and automatically labeling and later extracting select pages
I've never merged or split PDFs with it but I've used it to fill in a PDF form. Basically I create a script to run the pdftk command, store it in a batch file and execute the batch file STRTOFILE(m.lcFDFFile, m.lcFolder + "source.fdf") m.lcCommand = [pdftk "] + m.lcBlankForm + [" fill_form "] + m.lcFolder + [source.fdf" output "] + m.lcFilledForm +[" flatten drop_xfa] * store the command in a batch file due to the 240 character limit for run commands m.lcBatchFile = m.lcFolder + "fillpdf.bat" STRTOFILE(m.lcCommand, m.lcBatchFile) *!* maybe use shellexecute RUN "" IF FILE(m.lcFilledForm) m.lcFileName = JUSTFNAME(m.lcFilledForm) IF MESSAGEBOX('The file ' + m.lcFileName + CHR(13) + 'was successfully created.' + CHR(13) +; 'Would you like to open it now?',36,'PDF Merge Successful') = 6 X8ShellExecute(m.lcFilledForm) ENDIF ELSE MESSAGEBOX("The system encountered a problem creating the PDF.",64,"Problem Encountered") ENDIF Frank. Frank Cazabon On 02/08/2019 11:40 AM, MB Software Solutions, LLC wrote: That looks great, Frank. Got any source code to share with me?!??? On 8/2/2019 8:32 AM, Frank Cazabon wrote: This is the PDF Toolkit I have used: https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ which allows you to merge and split (and more) PDFs Frank. Frank Cazabon On 02/08/2019 08:02 AM, MB Software Solutions, LLC wrote: Ideally, these would be the tables: MyComponents.dbf * iid int autoinc PK * cLabel v(50) (e.g., INVOICE, FUEL RECEIPT, BILL OF LADING, etc.) * tAdded t MyPDFs.dbf * iid int autoinc PK * cFilename v(50) * tAdded t MyPages.dbf * iid int autoinc PK * iFileID int (backlink to MyPDFs.dbf) * nStartPage int * nEndPage int * iLabelID (backlink to MyComponents.dbf) And then on demand, I could generate a new deliverable PDF containing multiple components, selectable by the user ahead of time to put it together. From the original post: "B, C, and E" -- all in one PDF file. On 8/1/2019 4:29 PM, Frank Cazabon wrote: PDF toolkit might let you split a PDF into separate PDFs. But it really sounds like you should keep the original PDFs as separate entities and deal with each component as you wish. On 1 August 2019 16:19:10 GMT-04:00, "MB Software Solutions, LLC" wrote: Customer has a single PDF ("document") with several pages in it (let's say 12 pages). The document is made up of several scanned files, each a different file type or "component." Customer wants to extract certain pages from this single PDF into later email to other parties. They cannot mail the entire document because some content isn't intended for recipients (like invoices) but they want to be able to send other selected "component" parts and that file attached to the email deliverable would be a SINGLE file. Example: MyPDF.PDF Page 1: Invoice ("A") Page 2-3: Bill of lading ("B") Page 4-6: Fuel slips ("C" Page 7-10: Something else ("D") Page 11-12: Yada yada yada ("E") Eventually, components B, C, and E will be emailed to somebody. Given this scenario, what do you recommend? tia, --Mike --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus [excessive quoting removed by server] ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: https://leafe.com/archives This message: https://leafe.com/archives/byMID/08dc0f9a-03cc-adbc-f27d-26558ef01...@gmail.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Re: Working with multi-page PDF files and automatically labeling and later extracting select pages
That looks great, Frank. Got any source code to share with me?!??? On 8/2/2019 8:32 AM, Frank Cazabon wrote: This is the PDF Toolkit I have used: https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ which allows you to merge and split (and more) PDFs Frank. Frank Cazabon On 02/08/2019 08:02 AM, MB Software Solutions, LLC wrote: Ideally, these would be the tables: MyComponents.dbf * iid int autoinc PK * cLabel v(50) (e.g., INVOICE, FUEL RECEIPT, BILL OF LADING, etc.) * tAdded t MyPDFs.dbf * iid int autoinc PK * cFilename v(50) * tAdded t MyPages.dbf * iid int autoinc PK * iFileID int (backlink to MyPDFs.dbf) * nStartPage int * nEndPage int * iLabelID (backlink to MyComponents.dbf) And then on demand, I could generate a new deliverable PDF containing multiple components, selectable by the user ahead of time to put it together. From the original post: "B, C, and E" -- all in one PDF file. On 8/1/2019 4:29 PM, Frank Cazabon wrote: PDF toolkit might let you split a PDF into separate PDFs. But it really sounds like you should keep the original PDFs as separate entities and deal with each component as you wish. On 1 August 2019 16:19:10 GMT-04:00, "MB Software Solutions, LLC" wrote: Customer has a single PDF ("document") with several pages in it (let's say 12 pages). The document is made up of several scanned files, each a different file type or "component." Customer wants to extract certain pages from this single PDF into later email to other parties. They cannot mail the entire document because some content isn't intended for recipients (like invoices) but they want to be able to send other selected "component" parts and that file attached to the email deliverable would be a SINGLE file. Example: MyPDF.PDF Page 1: Invoice ("A") Page 2-3: Bill of lading ("B") Page 4-6: Fuel slips ("C" Page 7-10: Something else ("D") Page 11-12: Yada yada yada ("E") Eventually, components B, C, and E will be emailed to somebody. Given this scenario, what do you recommend? tia, --Mike --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus [excessive quoting removed by server] ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: https://leafe.com/archives This message: https://leafe.com/archives/byMID/0b055947-3f8a-edc5-8dfa-480350f85...@mbsoftwaresolutions.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Re: Working with multi-page PDF files and automatically labeling and later extracting select pages
This is the PDF Toolkit I have used: https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ which allows you to merge and split (and more) PDFs Frank. Frank Cazabon On 02/08/2019 08:02 AM, MB Software Solutions, LLC wrote: Ideally, these would be the tables: MyComponents.dbf * iid int autoinc PK * cLabel v(50) (e.g., INVOICE, FUEL RECEIPT, BILL OF LADING, etc.) * tAdded t MyPDFs.dbf * iid int autoinc PK * cFilename v(50) * tAdded t MyPages.dbf * iid int autoinc PK * iFileID int (backlink to MyPDFs.dbf) * nStartPage int * nEndPage int * iLabelID (backlink to MyComponents.dbf) And then on demand, I could generate a new deliverable PDF containing multiple components, selectable by the user ahead of time to put it together. From the original post: "B, C, and E" -- all in one PDF file. On 8/1/2019 4:29 PM, Frank Cazabon wrote: PDF toolkit might let you split a PDF into separate PDFs. But it really sounds like you should keep the original PDFs as separate entities and deal with each component as you wish. On 1 August 2019 16:19:10 GMT-04:00, "MB Software Solutions, LLC" wrote: Customer has a single PDF ("document") with several pages in it (let's say 12 pages). The document is made up of several scanned files, each a different file type or "component." Customer wants to extract certain pages from this single PDF into later email to other parties. They cannot mail the entire document because some content isn't intended for recipients (like invoices) but they want to be able to send other selected "component" parts and that file attached to the email deliverable would be a SINGLE file. Example: MyPDF.PDF Page 1: Invoice ("A") Page 2-3: Bill of lading ("B") Page 4-6: Fuel slips ("C" Page 7-10: Something else ("D") Page 11-12: Yada yada yada ("E") Eventually, components B, C, and E will be emailed to somebody. Given this scenario, what do you recommend? tia, --Mike --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus [excessive quoting removed by server] ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: https://leafe.com/archives This message: https://leafe.com/archives/byMID/e1abf2ad-06f3-9615-97a6-684327dc3...@gmail.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Re: Working with multi-page PDF files and automatically labeling and later extracting select pages
Ideally, these would be the tables: MyComponents.dbf * iid int autoinc PK * cLabel v(50) (e.g., INVOICE, FUEL RECEIPT, BILL OF LADING, etc.) * tAdded t MyPDFs.dbf * iid int autoinc PK * cFilename v(50) * tAdded t MyPages.dbf * iid int autoinc PK * iFileID int (backlink to MyPDFs.dbf) * nStartPage int * nEndPage int * iLabelID (backlink to MyComponents.dbf) And then on demand, I could generate a new deliverable PDF containing multiple components, selectable by the user ahead of time to put it together. From the original post: "B, C, and E" -- all in one PDF file. On 8/1/2019 4:29 PM, Frank Cazabon wrote: PDF toolkit might let you split a PDF into separate PDFs. But it really sounds like you should keep the original PDFs as separate entities and deal with each component as you wish. On 1 August 2019 16:19:10 GMT-04:00, "MB Software Solutions, LLC" wrote: Customer has a single PDF ("document") with several pages in it (let's say 12 pages). The document is made up of several scanned files, each a different file type or "component." Customer wants to extract certain pages from this single PDF into later email to other parties. They cannot mail the entire document because some content isn't intended for recipients (like invoices) but they want to be able to send other selected "component" parts and that file attached to the email deliverable would be a SINGLE file. Example: MyPDF.PDF Page 1: Invoice ("A") Page 2-3: Bill of lading ("B") Page 4-6: Fuel slips ("C" Page 7-10: Something else ("D") Page 11-12: Yada yada yada ("E") Eventually, components B, C, and E will be emailed to somebody. Given this scenario, what do you recommend? tia, --Mike --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus [excessive quoting removed by server] ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: https://leafe.com/archives This message: https://leafe.com/archives/byMID/f3337087-6486-8959-2754-cf667061a...@mbsoftwaresolutions.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Re: Working with multi-page PDF files and automatically labeling and later extracting select pages
PDF toolkit might let you split a PDF into separate PDFs. But it really sounds like you should keep the original PDFs as separate entities and deal with each component as you wish. On 1 August 2019 16:19:10 GMT-04:00, "MB Software Solutions, LLC" wrote: >Customer has a single PDF ("document") with several pages in it (let's >say 12 pages). The document is made up of several scanned files, each >a >different file type or "component." > >Customer wants to extract certain pages from this single PDF into later > >email to other parties. They cannot mail the entire document because >some content isn't intended for recipients (like invoices) but they >want >to be able to send other selected "component" parts and that file >attached to the email deliverable would be a SINGLE file. > >Example: > >MyPDF.PDF > >Page 1: Invoice ("A") >Page 2-3: Bill of lading ("B") >Page 4-6: Fuel slips ("C" >Page 7-10: Something else ("D") >Page 11-12: Yada yada yada ("E") > > >Eventually, components B, C, and E will be emailed to somebody. > > >Given this scenario, what do you recommend? > >tia, >--Mike > > > >--- >This email has been checked for viruses by Avast antivirus software. >https://www.avast.com/antivirus > > [excessive quoting removed by server] ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: https://leafe.com/archives This message: https://leafe.com/archives/byMID/9b9d754f-2169-4c88-a4ee-7e3f8edb6...@gmail.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Working with multi-page PDF files and automatically labeling and later extracting select pages
Customer has a single PDF ("document") with several pages in it (let's say 12 pages). The document is made up of several scanned files, each a different file type or "component." Customer wants to extract certain pages from this single PDF into later email to other parties. They cannot mail the entire document because some content isn't intended for recipients (like invoices) but they want to be able to send other selected "component" parts and that file attached to the email deliverable would be a SINGLE file. Example: MyPDF.PDF Page 1: Invoice ("A") Page 2-3: Bill of lading ("B") Page 4-6: Fuel slips ("C" Page 7-10: Something else ("D") Page 11-12: Yada yada yada ("E") Eventually, components B, C, and E will be emailed to somebody. Given this scenario, what do you recommend? tia, --Mike --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: https://leafe.com/archives This message: https://leafe.com/archives/byMID/7cb84274-e133-aed6-432e-038a7e6be...@mbsoftwaresolutions.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.