Solved

Using Command line with ASP/VB

Posted on 2004-08-29
9
258 Views
Last Modified: 2008-02-01
I have recently bought a program to help me merge pdf files (thanks to some EE help).  I am now faced with another situation.  I am sure this is an easy question, but I am at my witts end.  

I want to send the command via the command line.  The only instructions that I am given are the following:

To perform batch conversion or call conversion procedure from an automation script, you can use command line function in the PDF Split-Merge software, You can either run this tool directly from command line or call it from any script as well. The program supports the following command-line options:

PDF Split/Merge software v1.0
Copyright @2003-2004 www.verypdf.com Inc
arguments: file1 [file2 ...] destfile
arguments: burst C:\input.pdf C:\output
Example:
pdfpg C:\A.pdf,1,3 C:\merged.pdf
pdfpg C:\A.pdf,-20,50 C:\merged.pdf
pdfpg C:\A.pdf,1,3- C:\merged.pdf
pdfpg C:\A.pdf,1,2,3 C:\B.pdf,5,2,9 C:\merged.pdf
pdfpg C:\A.pdf,1,1-9 C:\B.pdf,5,2,9 C:\A.pdf,10 C:\merged.pdf
pdfpg burst C:\A.pdf C:\split



My question is...how do I access the command line?  I have tried several things, but to no avail.  Please let me know if you need further information from me to help me get this accomplished and of course I am pressed for time on this.

Thanks, J
0
Comment
Question by:Jbryant22
  • 6
  • 3
9 Comments
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 11926458
ARe you trying to run this from within an ASP page? To run command-line options, you need to use WScriptShell or ASPExec--however, I think that these command lines you refer are supposed to be entered directly into the Split/Merge software program

FtB
0
 

Author Comment

by:Jbryant22
ID: 11926472
I am trying to run this from within the ASP page.  I am working on getting it to run with the shell command.  According to the little directions that I was given, in a perfect world a developer should be able to combine the documents on the back end.

Right now I have:

Dim WshShell
Set WshShell = Server.CreateObject("WScript.Shell")
WshShell.Run  "C:\PDFSM\pdfpg c:\docs\a.pdf c:\docs\b.pdf c:\merged.pdf"
Set WshShell = Nothing

PDFSM being the folder I installed the software in.
but it doesnt seem to be working
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 11926473
To run the command line in ASP, try:

<html>
<body>
<Script language=vbscript runat="server">
    Dim objShell
Set objShell= CreateObject ("WSCript.shell")
objShell.run  "cmd /K CD C:\temp & pdftohtml.exe a.pdf & exit"
Set objShell= Nothing
     
</script>
</body>
</html>

Or try using the free ASPEXEC near the bottom of this page:

http://www.serverobjects.com/products.htm

FtB
0
Industry Leaders: 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!

 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 11926476
The next thing that you need to do is to give the IUSR_ and IWAM_ accounts READ/WRITE permissions to all of the directories where you will be working with your .pdf files.

FtB
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 11926478
Also, are you getting any errors or anything like that?

FtB
0
 

Author Comment

by:Jbryant22
ID: 11926487
nope, that is what is bugging me.  It acts like it is running correctly, but it is not creating the file.
0
 
LVL 46

Accepted Solution

by:
fritz_the_blank earned 500 total points
ID: 11926492
Okay, I am surprised that you aren't getting a permisssions error, but that is most likely what is happening here.

I would consider putting all of the .pdf files in the subdirectory of PDFSM like this:

C:\PDFSM\Source
C:\PDFSM\Merged

and then give liberal permissions to the PDFSM directory and the subdirectories.

FtB
0
 

Author Comment

by:Jbryant22
ID: 11926507
ok, now i have full permissions on the folder for everyone and I am getting a permission denied.

I will play around with it.  Thanks for all of your help.  If you were to think of anything else, please let me know.
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 11926519
Sure--keep in mind that the IUSR account may not be part of the everybody group for security reasons, so it is important to set that separately. Also, try running a simple .bat file to get that working first so that you know you have the permissions set correctly.

Good luck,

FtB

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

Title # Comments Views Activity
Hide Table in merge 3 40
Asp in script 6 44
Reg Exp to extract Url from string asp 12 35
Extracting nodes  using classical ASP 3 23
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

679 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