Solved

Using pdftk.exe from ASP.NET application

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Widget to get customer remakrs in our website. 3 44
Registering DLL 5 43
Syntax Error 2 44
Wrapper for APPs 9 31
Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

911 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

20 Experts available now in Live!

Get 1:1 Help Now