Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
Want to create single PDF from multiple PDFs |
Post Reply |
Author | |
mbabcock
Beginner Joined: 16 Aug 19 Location: Maryland Status: Offline Points: 18 |
Post Options
Thanks(0)
Posted: 16 Aug 19 at 3:35PM |
Source is MySource1.PDF (4 pages) and MySource2.pdf (6 pages).
I want to create a new PDF using select pages from each of those source files. When I look at ExtractFilePages, it gives me the impression that it will overwrite with each call (rather than append). I'm going to test this but I was hoping somebody might steer me in the right direction before I get back to my testing. Thanks in advance, --Mike btw -- I'm using Visual FoxPro 9 SP2 for this and will be happy to share code to help others who might also be using VFP.
|
|
tfrost
Senior Member Joined: 06 Sep 10 Location: UK Status: Offline Points: 437 |
Post Options
Thanks(0)
|
You can overlay a captured page from one of your two existing documents onto each new blank page you add to your new document. There's an example you could adapt and convert to VFP in the sample scripts under Document Manipulation / Overlay...
|
|
mbabcock
Beginner Joined: 16 Aug 19 Location: Maryland Status: Offline Points: 18 |
Post Options
Thanks(0)
|
Scenario of documents to select (and range within it):
File: MyFile1.PDF, Range: 1 Comment: Invoice File: MyFile1.PDF, Range: 2-4 Comment: Bill of Lading File: MyFile2.PDF, Range: 1-3 Comment: Fuel Receipts File: MyFile2.PDF, Range: 4-5 Comment: Invoice File: MyFile3.PDF, Range: 1-2 Comment: Invoice File: MyFile3.PDF, Range: 3-12 Comment: Bill of Lading Goal: collect all of the Invoices into a single PDF. I'm wondering if it wouldn't be easier/better to export the file pages into their own PDFs using ExtractFilePagesEx("MyFile1.PDF","","MyTemp1.PDF","1",3) ExtractFilePagesEx("MyFile2.PDF","","MyTemp2.PDF","4-5",3) ExtractFilePagesEx("MyFile3.PDF","","MyTemp3.PDF","1-2",3) ...and then use AddToFileList and MergeFileList to take these 3 into the final MyOutput.PDF. This is all in theory; I haven't yet tried it. Your thoughts on that approach?
Edited by mbabcock - 19 Aug 19 at 8:59PM |
|
mbabcock
Beginner Joined: 16 Aug 19 Location: Maryland Status: Offline Points: 18 |
Post Options
Thanks(0)
|
THIS WORKED!!!!! I highlighted the QuickPDF lines to show the keys to successfully getting this working:
_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') Edited by mbabcock - 20 Aug 19 at 3:09AM |
|
mbabcock
Beginner Joined: 16 Aug 19 Location: Maryland Status: Offline Points: 18 |
Post Options
Thanks(0)
|
@TFrost -- do you see any drawbacks with my approach instead of the way you described?
|
|
tfrost
Senior Member Joined: 06 Sep 10 Location: UK Status: Offline Points: 437 |
Post Options
Thanks(1)
|
If it works and you understand it and document it, those are good criteria for success!
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store