I have a web site that dynamically generates certificates for green power purchasers. It works fine on our test server but on the production web server, whenever it generates and downloads a PDF, I get an error window with the Adobe Acrobat title, that says "File does not begin with '%PDF-'. When I click OK, it just gives me a blank page. Both web servers are IIS 6.0. The production web server has another site on it that generates PDF's also and that one works fine. Any ideas about how to fix the issue? The paths to the web sites are the same on both servers. The license is entered in the web.config file which gets published to both servers. What is the root cause of this error?
Thx, Steve W.
File does not begin with %PDF message
Re: File does not begin with %PDF message
Support · Dec 1, 2008Hello Steve,
The likely problem is that some contents are getting added before the PDF stream gets created. Try doing a Response.Write("--Test--") before calling the DrawToWeb() method and see if he PDF starts with %PDF or not.
Thanks,
ceTe Software Support Team
Re: File does not begin with %PDF message
Forum member · Dec 1, 2008It turned out to be a bad connection string. This particular site uses content from a database to create the PDF's and if the query fails, the PDF is not constructed properly. THX.