Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

APEX PDF Print (XSL-FO) via APEX_UTIL.GET_PRINT_DOCUMENT produces a corrupt PDF

prieschrMar 6 2018 — edited May 8 2018

Hi,

I have spent hours reviewing the support documents (replacing characters, enableoldfop, ..) and testing but I did not get a correct PDF document when using APEX_UTIL.GET_PRINT_DOCUMENT. The manual print using the same query and layout works fine.

I have tested with following environments:

   Oracle 11.2.0.4 / Apex 4.2.0.6 with APEX Listener 2.0.10.289 and Glassfish 4

   Oracle 12.2.0.1 / Apex 5.1.3.05 with APEX Listener 2.0.10.289 and Glassfish 5

The problem occurs with the customized xlst and an empty xlst (generated with Altova Stylevision) and also with the general layout.

I am using the sample code from one of the knowledge base entries:

DECLARE

l_id number;

l_document BLOB;

BEGIN

l_document := APEX_UTIL.GET_PRINT_DOCUMENT

(

p_application_id=>'2020',

p_report_query_name=>'CountrySheet',

p_report_layout_name=>'CountrySheet', 

p_report_layout_type=>'xsl-fo',

p_document_format=>'pdf'

);

l_id := APEX_MAIL.SEND

(

p_to => 'xxxx@xxx',

p_from => 'xxxx@xxx',

p_subj => 'sending PDF via print API',

p_body => 'Please review the attachment.',

p_body_html => 'Please review the attachment.'

);

APEX_MAIL.ADD_ATTACHMENT

(

p_mail_id => l_id,

p_attachment => l_document,

p_filename => 'mydocument.pdf',

p_mime_type => 'application/pdf'

);

END;

An email with a corrupt PDF is delivered!

I am using the WE8MSWIN1252 characterset in the database due to compatibity with an old legacy application.

Thank you in advance for your help.

Regards,

Reinhard

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 5 2018
Added on Mar 6 2018
23 comments
3,207 views