Solved

Using Command line with ASP/VB

Posted on 2004-08-29
9
257 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Get hold of longitude and latitude in iframe string 11 48
Index on a Table 6 25
key press alert 2 32
return false must be hit after calling certain command 10 32
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
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…

856 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