Fog Creek Software
Discussion Board

Welcome! and rules

Joel on Software

Running a program to create a pdf

I want to port some existing powerbuilder reports to the web. I have a powerbuilder app that takes a command line argument of the report name and creates a pdf file. I want to have the user select the report to run from an page run the report and send back the pdf.

My app runs the program retrieves the data but gets an error when it tries to print to the pdf file.  If I run the powerbuilder app from a dos command line it works fine.

Any ideas?

John McQuilling
Thursday, November 27, 2003

Because ASP.NET app is running as the ASPNET user which most likely doesn't have the "PDF printer" (or whatever it is) in its user profile. Secondly if it's creating files somewhere, the ASPNET account needs write permissions to whatever directory it's using. Basically, ASPNET needs to be granted the permissions/rights to do whatever it needs to do. Another approach would be to have ASP.NET run under a different user account that can do these things. See:

Duncan Smart
Thursday, November 27, 2003

are you creating your pdf reports by printing to a pdfprinter?

Friday, November 28, 2003


yes I am

Monday, December 1, 2003

It appears that Acrobat will not run in a server environment (this is from the Adobe website) and apparently ASP.NET qualifies as a server environment. 

I found another tool pdf995 ( that creates pdf files and it will run in an server environment.

It has an adware mode  or you can pay about $20 US to turn off the ads.

Thanks for the help

John McQuilling
Sunday, December 7, 2003

I solved exactly this problem on a project a while back, using a PDF printer driver from Black Ice Software. (I remember discussing it on the main message board about a year ago.)

It comes with an API interface for capturing printer messages and acting on them, which is invaluable in a server environment. The interface is available as an (old-school) unmanaged DLL and a COM interface, plus the registered version comes with some sample C# and VB.NET apps showing how to use it.

The only thing I'd watch out for is when you use a PDF printer, the generated files are merely a marked-up snapshot, whereas PDFs created via Adobe can contain a combination of images and text. Depending on what your content is, you could pay a performance penalty in file size.

See for more info.

Better Than Being Unemployed...
Tuesday, December 9, 2003

bulent f. cavan dnm123

bulent f. cavan
Tuesday, February 10, 2004

*  Recent Topics

*  Fog Creek Home