Forum How do I...?

Can't read a PDF with Adobe

Nexion
Hi,

First of all, I want to apologize if there is any error in my English. I'm French so I'll try to make my post as understandable as I can.

We are currently testing your server in my company to see if we will use it or not and we face a new problem.

We have made a lot of test the past few weeks without any problem until yesterday. All of the PDF we generate can't be read by Adobe Reader.

We've got this error (it's an approximative translation) :
Adobe Reader can't read open xxx.pdf, because the filetype is incorrect or the file is damaged (it has been sent as an attachment and wasn't correctly decode, for example)

Original message:
[spoiler]Adobe Reader n'a pas pu ouvrir xxx.pdf, car le type de fichier n'est pas pris en charge ou le fichier est endommagé (il a été envoyé en tant que pièce-jointe et n'a pas été décodé correctement)[/spoiler]

We tried:
- GMail reader: Fail
- XP with Adobe Reader : Fail
- 7 with Adobe Reader: Fail
- 7 with Architect PDF: Success
- Mac OS X with Adobe Reader: Fail
- Mac OS X with default viewer: Success
- Ubuntu with default viewer: Success
- Debian with default viewer: Success

Furthermore, if we save (save as...) a PDF generated by PrinceXML with some other tools (like Architect PDF), it becomes readable by Adobe Reader.

Is there a case where PrinceXML generates non-compliants PDF for Adobe Reader?

There is an example of report attached to this post.

Corentin LEFEVRE.
  1. report(1).pdf60.6 kB
mikeday
If you open the PDF file in a text editor you will see that it begins with this markup:
<link rel="stylesheet" type="text/css" media="all" href="http://assets.formadev.loc/components/com_formaeva/js/lib/calendar-win2k-cold-1.css" title="win2k-cold-1"><script language="JavaScript" src="http://assets.formadev.loc/components/com_formaeva/js/report-1.15.js"></script>
<script language="JavaScript" src="http://assets.formadev.loc/components/com_formaeva/js/form_utils-1.3.js"></script>
...

This is not generated from Prince, and must be emitted by your web application before it outputs the PDF file. You need to change your web application to make sure that it only outputs the PDF file and no other text content, otherwise the generated PDF will confuse Acrobat.