Solved

VB Script and PDF Files

Posted on 2009-05-13
4
478 Views
Last Modified: 2012-05-06
I'm really just throwing a line out there, but can anybody recommend any software to me that I can use to script PDF files?  What I'm trying to do is create a script (prererably VB) that can merge two existing PDF files.  I can do this manually in acrobat, but I'm trying to figure out how to script it and I don't know how.  Can someone help?  Thanks so much!
0
Comment
Question by:tphelps19
  • 2
  • 2
4 Comments
 
LVL 21

Accepted Solution

by:
AmazingTech earned 500 total points
ID: 24377447
Use GhostScript.

Download from:

http://www.brothersoft.com/ghostscript-download-64547.html

The command line would be:

"C:\Program Files\gs\gs8.63\bin\gswin32c.exe" -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=c:\Merged\AllinOne.pdf "c:\Folder\Document1.pdf" "c:\Folder2\Document2.pdf" "etc..."

Of course you can put this in VBScript with

RunThis=Chr(34) & "C:\Program Files\gs\gs8.63\bin\gswin32c.exe" & chr(34) & " -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=c:\Merged\AllinOne.pdf c:\Folder\Document1.pdf c:\Folder2\Document2.pdf etc..."

Set objShell = CreateObject("Wscript.Shell")
a = objShell.run(RunThis, 0, True)
Set objShell = Nothing



0
 
LVL 2

Author Comment

by:tphelps19
ID: 24378516
That's awesome.  I don't think I've seen a more clear description of how to do something.  Why can't everyone be as descriptive as you?  ;)
Thanks again!
0
 
LVL 2

Author Closing Comment

by:tphelps19
ID: 31581088
AWESOME RESPONSE!
0
 
LVL 21

Expert Comment

by:AmazingTech
ID: 24379328
I usually try not to add alot of fluff as many people don't need it.

I show you what you need and how to do it. Sometimes I'll just post a script and say "Try this."

Of course some beginners may come back and ask more questions which is fine but if I tried to explain every little detail everytime sometimes it gets confusing.

For VBS you will need to add in some quotes for folders or files that contain spaces but more would already know that.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PaperPort is a popular document imaging/management product from Nuance Communications (http://www.nuance.com/). It is in widespread use by both individuals (http://www.nuance.com/for-individuals/by-product/paperport/index.htm) and businesses (http:/…
The Adobe PDF proprietary file format is recognized as secure and formulated. But these PDF files are also prone to corruption and any external threat like virus attacks, improper storage can hit PDF file integrity.This type of damages can make cruc…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question