Solved

Using pdftk.exe from ASP.NET application

Posted on 2013-02-06
4
1,139 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
[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
  • 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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Sometimes we receive PDF files that are in the wrong orientation. They may be sideways or even upside down. This most commonly happens with scanned or faxed documents. It is possible to rotate the view of these PDFs with the free Adobe Reader produc…

632 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