Solved

VB Script and PDF Files

Posted on 2009-05-13
4
475 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Inserting page numbers in Portable Document Files not only enhances manageability but also makes them look professional. With numbered pages, the file appears more organized and it becomes easier to search for a particular page. The size and the vol…
This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In this second video of the Xpdf series, we discuss and demonstrate the PDFimages utility, which, in a single command, is able to extract all the images from a PDF file and save each one in a separate image file (PBM, PPM, or JPG). Download and inst…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now