Solved

Using pdftk.exe from ASP.NET application

Posted on 2013-02-06
4
1,067 Views
Last Modified: 2013-02-26
I have a web app that has a grid and you can select multpile PDFs from the grid and hit a button and pdftk.exe will run and merge these files and display them within a browser. I have this working when I test it on my local machine but when I publish and hit the button, with multple PDFs selected, it times out.  I have error handling and it does not fall into it and I am also writing a log file and it is stopping on the line of code where the pdftk.exe tool is executing. Here is the line that it hangs at.,..

Dim p As New ProcessStartInfo(HttpContext.Current.Server.MapPath("..\bin")
 & "\pdftk.exe", rstr.ToString)
            HttpContext.Current.Server.MapPath("..\bin")
            'process
            p.UseShellExecute = False
            p.WindowStyle = ProcessWindowStyle.Hidden
            Process.Start(p)  ------HANGS HERE

Can someone please help me with this because the metowrk guy is of no help at all and I need to get this out to production
0
Comment
Question by:jknj72
  • 2
4 Comments
 
LVL 1

Expert Comment

by:JamieTownsend
ID: 38860388
Is the version of pdftk you have running locally the same version on the box you "published" and are running it from ?
0
 

Author Comment

by:jknj72
ID: 38860759
yes it is inlcuded it in the application.
And p.UseShellExecute = False is set to True, I was just trying to test if that was the issue but when False nothing happened.
0
 
LVL 26

Accepted Solution

by:
Alan Warren earned 500 total points
ID: 38866113
Try providing a virtual path for MapPath()
Server.MapPath Method
Dim p As New ProcessStartInfo(System.Web.HttpContext.Current.Server.MapPath("~/") & "bin\"
 & "pdftk.exe", rstr.ToString)
            System.Web.HttpContext.Current.Server.MapPath("~/") & "bin\"
            'process 
            p.UseShellExecute = False
            p.WindowStyle = ProcessWindowStyle.Hidden
            Process.Start(p)  ------HANGS HERE

Open in new window

Alan
0
 

Author Closing Comment

by:jknj72
ID: 38930242
thanks
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Suggested Solutions

Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

839 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