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!

Printing Custom PDF within APEX, using APEX Listener and XSL-FO from BI Publisher

tbockertSep 14 2016 — edited Oct 11 2016

I'm looking for some help.  My goal is to get a customer PDF to popup within APEX to allow printing of a record but within a template that is designed to populate fields within a form that'll be printed and mailed to other organizations.

I found this white paper and have used it exclusively for trying to resolve this scenario:

http://www.oracle.com/technetwork/developer-tools/apex/learnmore/custom-pdf-reports-1953918.pdf

  1. The white paper talks about different methods for configuring PDF Printing in APEX (Apache FOP, BI Publisher, and APEX listener).  I opted to use and configure the APEX listener as the print server, page 7-8, to avoid any licensing fees with the other products.
  2. On page 9 it shows steps for testing it by printing a simple classic report as a PDF.  I followed these steps and it worked fine, I'm alble to generate a PDF in APEX using a generic classic report.  So far so good.
  3. Page 10 it starts to discuss creating a custom PDF using a XSL-FO layout and mentions a couple products that can be used, Altova Stylevision or Stylus Studio.  Again I'm trying to avoid licensing fees so I used the download from Oracle for the BI Publisher plugin to Microsoft Word.

Steps for creating the template.

  1. I created a classic report in APEX with my data fields.
  2. I changed the print options to XML and saved the results into a .xml file.
  3. I created the template in Word and under the BI Publisher tab clicked Sample XML.  Imported my file, clicked fields and was able to insert them into my word document.
  4. I then clicked preview PDF from my word document and it displays the PFD, brings in the XML data and inserts it into the places I need in my custom form.  So far still looking good.
  5. I then click export and select XSL-FO Stylesheet.  This spits out into a browser the stylesheet xml which I copy into wordpad and name the file <name>.xslt-fo.
  6. Using the white paper instructions on page 16. I import the .xsl-fo stylesheet into the Report Layouts and I configure my report that originally spit out my XML I used in BI Publisher to now do PDF output format and I select the report layout I imported.
  7. This is where it goes wrong.  When I click print it comes up with an error saying "File does not begin with '%PDF-', Local\EWH-5472-0.
  8. I assume it is talking about the file I'm importing in, it's the only thing that I have control the file name of, I've tried calling it PDF-Test.xslt-fo, PDF-Test.xsl-fo, and even PDF-TEST.pfd.  It always gets the same error, whether I have PDF in the name or not.

I assume it has something to do with the stylesheet and how I'm naming it?

Any help would be appreciated, I assume someone has tried to do something similar to what I've done.

Thanks,

Thomas Bockert

Meredith Corporation

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 8 2016
Added on Sep 14 2016
10 comments
7,840 views