Solved

VB Script and PDF Files

Posted on 2009-05-13
4
480 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

*Adobe Acrobat 9 was used for this article.  Particular steps may vary depending on software versions. Adobe Acrobat has many, many variables that my be utilized to customize your forms for clarity and ease of use. The Form Editing Tool will be y…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

734 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