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