wnerbun
asked on
Merge two pdf documents using Ghostscript
I have just installed Ghostscript 8.54. It works great. Does anyone know of a way to use ghostscript to merge the printed document with another pdf document on file (eg. C:\Temp\test.pdf)? I am using the email function to attach the created document to the Outlook Message form that opens.
ASKER
I've tried both of the following as an event procedure to merge two files (15100.pdf and eSurvey.pdf) and neither work:
gswin32 -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=Merged.pdf -dBATCH 15100.pdf eSurvey.pdf
or
pdftk 15100.pdf eSurvey.pdf cat output merged.pdf
I've tried adding the path to the statement and that does not seem to help. Any ideas as to what I'm doing wrong?
gswin32 -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=Merged.pdf -dBATCH 15100.pdf eSurvey.pdf
or
pdftk 15100.pdf eSurvey.pdf cat output merged.pdf
I've tried adding the path to the statement and that does not seem to help. Any ideas as to what I'm doing wrong?
ASKER
evidently my Ghostscript and pdftk programs are "not registered" because when I run the command line from Start\Run, I get the following message: "Windows cannot find pdfgk." (or gswin32). How do I register the program with windows?
ASKER
ok, I registered the program and can now run it from the Start\Run window, but now I'm trying to figure out how to get it to execute from a Command Button on my form. Anyone know the proper syntax??
Hi wnerbun,
I dont have Ghostscript hence the link supplied
Regarding the code however, that I can do
Now, how do u determine what pdf files u want merging?
I dont have Ghostscript hence the link supplied
Regarding the code however, that I can do
Now, how do u determine what pdf files u want merging?
ASKER
file #1 path=C:\VendorPDFs\[Vendor ].pdf (e.g., 15100.pdf)
file #2 path=C:\VendorPDFs\eSurvey .pdf
merged file name and path=C:\VendorPDFs\VendorS urvey.pdf
file #2 path=C:\VendorPDFs\eSurvey
merged file name and path=C:\VendorPDFs\VendorS
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The following statement works:
gswin32 -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE="C:\VendorPDF s\Merged.p df" -dBATCH C:\VendorPDFs\15100.pdf C:\VendorPDFs\eSurvey.pdf
I will try your shell command today.
gswin32 -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE="C:\VendorPDF
I will try your shell command today.
ASKER
Eureka! Kudos! Bravo Zulu! You've solved my problem! Points to you!!!
and according to this, u can use ghostscript and run it as a dos command
gswin32 -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=Merged.pdf -dBATCH 1.pdf 2.pdf 3.pdf
taken from
https://www.cs.tcd.ie/Shane.OConchuir/Misc/MergingPDFs.html