Solved

Using pdftk.exe from ASP.NET application

Posted on 2013-02-06
4
1,028 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

*Adobe Acrobat 9 was used for this article.  Particular steps may vary depending on software versions. Adobe Acrobat has many, many variables that my be utilized to customize your forms for clarity and ease of use. The Form Editing Tool will be y…
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.
The viewer will learn how to count occurrences of each item in an array.
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 …

772 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

10 Experts available now in Live!

Get 1:1 Help Now