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
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" mbsoftwaresolutions@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]
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" mbsoftwaresolutions@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]
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" mbsoftwaresolutions@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]
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" mbsoftwaresolutions@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]
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 "&lcBatchFile"
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" mbsoftwaresolutions@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]
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 frank.cazabon@gmail.com 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 limitfor run commands m.lcBatchFile = m.lcFolder + "fillpdf.bat" STRTOFILE(m.lcCommand, m.lcBatchFile)
*!* maybe use shellexecute RUN "&lcBatchFile"
IF FILE(m.lcFilledForm) m.lcFileName = JUSTFNAME(m.lcFilledForm) IF MESSAGEBOX('The file ' + m.lcFileName + CHR(13) + 'wassuccessfully 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" mbsoftwaresolutions@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]
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 frank.cazabon@gmail.com 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 limitfor run commands m.lcBatchFile = m.lcFolder + "fillpdf.bat" STRTOFILE(m.lcCommand, m.lcBatchFile)
*!* maybe use shellexecute RUN "&lcBatchFile"
IF FILE(m.lcFilledForm) m.lcFileName = JUSTFNAME(m.lcFilledForm) IF MESSAGEBOX('The file ' + m.lcFileName + CHR(13) + 'wassuccessfully 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" mbsoftwaresolutions@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]
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 < mbsoftwaresolutions@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 frank.cazabon@gmail.com 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 limitfor run commands m.lcBatchFile = m.lcFolder + "fillpdf.bat" STRTOFILE(m.lcCommand, m.lcBatchFile)
*!* maybe use shellexecute RUN "&lcBatchFile"
IF FILE(m.lcFilledForm) m.lcFileName = JUSTFNAME(m.lcFilledForm) IF MESSAGEBOX('The file ' + m.lcFileName + CHR(13) + 'wassuccessfully 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" > mbsoftwaresolutions@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]
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 it....tell 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 < mbsoftwaresolutions@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 frank.cazabon@gmail.com 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 limitfor run commands m.lcBatchFile = m.lcFolder + "fillpdf.bat" STRTOFILE(m.lcCommand, m.lcBatchFile)
*!* maybe use shellexecute RUN "&lcBatchFile"
IF FILE(m.lcFilledForm) m.lcFileName = JUSTFNAME(m.lcFilledForm) IF MESSAGEBOX('The file ' + m.lcFileName + CHR(13) + 'wassuccessfully 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" >> mbsoftwaresolutions@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]
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 < mbsoftwaresolutions@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]
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]
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]