Solved

Using Command line with ASP/VB

Posted on 2004-08-29
9
248 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
 
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 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

19 Experts available now in Live!

Get 1:1 Help Now