Solved

Using Command line with ASP/VB

Posted on 2004-08-29
9
261 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
[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
  • 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
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!

 
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

623 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