Error when opening PDF attachment
Hi,
I generate a PDF with attachments, in this case a PDF.
...
Report.PDFSettings.Attachments.Add( lFile );
...
With acrobat reader, it shows an error when I try to open the attached pdf.
"Error opening document, problem reading document"
With Firefox, the attachment is displayed correctly.
This occurs when the pdf generated with the attachment has been made on a server without a pdf reader.
I have two servers, one with a default PDF reader (Acrobat) and the other without a default reader.
When I open the generated pdfs with a text editor i have observed these labels
Server with a default PDF reader:
<< /Type /EmbeddedFile
/Subtype /application#2Fpdf
Server without a default PDF reader:
<< /Type /EmbeddedFile
/Subtype /application/octet-stream
If I change the subtype to /application#2Fpdf it works.
Does it depend on the default pdf reader?
Is there any way to change it?
Thanks.
I generate a PDF with attachments, in this case a PDF.
...
Report.PDFSettings.Attachments.Add( lFile );
...
With acrobat reader, it shows an error when I try to open the attached pdf.
"Error opening document, problem reading document"
With Firefox, the attachment is displayed correctly.
This occurs when the pdf generated with the attachment has been made on a server without a pdf reader.
I have two servers, one with a default PDF reader (Acrobat) and the other without a default reader.
When I open the generated pdfs with a text editor i have observed these labels
Server with a default PDF reader:
<< /Type /EmbeddedFile
/Subtype /application#2Fpdf
Server without a default PDF reader:
<< /Type /EmbeddedFile
/Subtype /application/octet-stream
If I change the subtype to /application#2Fpdf it works.
Does it depend on the default pdf reader?
Is there any way to change it?
Thanks.
Comments
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
To avoid this scenario, MIME sniffing has been enabled by default for the API call which will look at the file contents and try to determine a valid type. If this fails, a hard-coded list has been added to ReportBuilder which includes numerous commonly used MIME types as a fall-back option.
These enhancements will be added for the next release of ReportBuilder.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Is there any option to get a patch and not wait for next release?
Thanks
A patch with MIME sniffing enabled for the API call has already been sent. The other changes require interface changes so will need to wait for the next release.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com