Symptoms:

When accessing pdf documents linked on your site, users get the following error messages:

* A blank white screen in the browser (Intermittent*).
* Adobe PDF error message indicating “Adobe reader could not open the file ‘XXX.fdf’ because it is either not a supported file type or because the file has been corrupted (for example it has been sent as an email attachment and wasn’t correctly decoded)”
* Adobe PDF error message indicating “The created pdf is corrupted and cannot be opened”.
* Adobe PDF error message indicating “The file is damaged and could not be repaired”.

CAUSE

* Stray HTML text or data being output to the output stream before or after the PDF code

OR

* Using HTTP Post to the page creating the PDF

RESOLUTION

.Net

* Get rid of all the HTML tags from your aspx page after <%@ Page… %> tag’s or try adding a Response.End() directly after the DrawToWeb() method.
* Change the HTTP POST to the page creating the PDF to HTTP GET.

Java

* Get rid of all the white spaces and try to have all your JSP code within one block or try adding a sOut.flush() directly after the drawToWebPage() method.
* Change the HTTP POST to the page creating the PDF to HTTP GET.

COM

* Get rid of all the stray HTML being output to the output stream or try adding a Response.End() directly after the DrawToASP() method.

REMARKS
* Different versions of Acrobat behave differently using the same code. Some versions of Acrobat would output the pdf correctly while some versions would produce a blank white screen

Advertisements