Chinese Charcters in PDF using Apache FOP

Hi,
I am creating a PDF using Apache FOP.
This data contains Chinese characters.
On APEX 3.1, I couldn't contain Chinese characters in PDF.
On APEX 3.2, is it possible?
Is there any way that I don't have to use BI Publisher?
Please advise on this.
Thanks

Hi, Karthik
Think here how to save pdf in APEX 3.0 you can find more information about this
Michael

Similar Messages

  • PDF Creation and Saving in Database using Apache FOP

    Hi,
    I read lot of topics in this forum about using Apache FOP for creating PDF documents and I have configured the same and works fine.
    When user clicks a button, the PDF file is generated and it downloads the document. How can I make the PDF document save in the database.
    I would like to provide a interactive report with a link and they can download the document later.
    Thanks
    Karthik

    Hi, Karthik
    Think here how to save pdf in APEX 3.0 you can find more information about this
    Michael

  • Providing security to the PDF file using apache FOP in java

    I am working on PDF file generation using Apache FOP, I have security concerns which are
    1. PDF file will be placed in a folder after generation and that should not be copied to other locations.
    2. PDF file should only have an option print nothing else. The save/save as options should never be enabled.
    3. PDF expiry date is required, so that PDF file will get expire after duration.

    HI,
    I did that too, with too much experiments.
    Code snippet for reference.
    PdfReader reader = new PdfReader(getOutputFilePath());
    PdfStamper stamper = new PdfStamper(reader, new FileOutputStream("my-new-file.pdf"));
    stamper.setDuration(1,1);
    int permissions = PdfWriter.HideMenubar & PdfWriter.HideToolbar & PdfWriter.HideWindowUI & ~( PdfWriter.AllowCopy | PdfWriter.AllowModifyAnnotations | PdfWriter.AllowFillIn | PdfWriter.AllowAssembly | PdfWriter.AllowModifyContents | PdfWriter.AllowScreenReaders);
    stamper.setEncryption(null, null,
    permissions, PdfWriter.STRENGTH40BITS);
    stamper.setFormFlattening(true);
    System.out.println(stamper.getMoreInfo());
    stamper.close();
    I am able to disable the save button, but I am unable to disable the save as option.
    It would be great help, if you can give some inputs on this.

  • Printing XLS, HTML, or RTF using Apache FOP

    Hi,
    Is it possible to print XLS, HTML, or RTF reports using Apache FOP? If not, is there another open source or free print server that will do this?
    Thank you.
    Martin

    Hello,
    >>
    Your going to want to study the Cocoon sitemap concept to see how to pipeline the xml and xsl to the right output.
    >>
    To get this working correctly you need to understand the Cocoon sitemap concept and how to read data out of the XML file your posting in order to pipeline it to the right rendering format. It's pretty much a hands on affair so it depends on what your trying to do, sorry there is no easier way to do it.
    In a future versions it will be easier to do this as you will be able to select specific end points per report.
    Regards,
    Carl
    blog : http://carlback.blogspot.com/
    apex examples : http://apex.oracle.com/pls/otn/f?p=11933:5

  • PDF PRINTING using Apache FOP and Oracle Containers for J2EE

    Hi,
    I am having major confusion about the pdf printing in Oracle XE and Apex 3.1.2.00.02
    It clearly states that this is an available option on the Oracle website.
    According to Apex there are two options for printing report regions.
    Standard - which is free
    Advanced - which uses BI and requires a licence
    Standard requires me to have Apache FOP (which is provided by Oracle in the Apex release) and Oracle Containers for J2EE (OC4J)
    Where my understanding of all this falls down is the part where I am downloading the Oracle Containers for J2EE and the license agreement states this cannot be used in a production system (only as a protptype). Can anyone clarify this? This is surely a required componenet and for the standard report printing which is supposed to be free.
    My problem is that I need to have a database system on a laptop that will go off site for a number of weeks. We need report printing options.
    Can anyone help with this. im desperate.
    Kind regards
    colin mclay

    no not yet with Application Server.
    I have tried to compare the settings to another installation with a separeted oc4j as described in the howto. But at the moment i found no mistakes.
    If i call the url adresse like:
    http://localhost:18101/fop/apex_fop.jsp
    i get:
    500 Internal Server Error
    Servlet error: java.lang.ClassNotFoundException: fop.apex__fop
    I installed it another time with these settings:
    Web Anwendung= .../fop.war (selected war file from apex install directory)
    Anwendungsname= fop
    URL zuordnen= /fop
    I would like to know if its possible to use the fop.war out of apex install directory with the Application server? In the standalone version (as described in howto) it works. But if you install it there you don't need to define an URL.
    Is the URL /fop correct or what do i have to insert there?

  • LOGO in PDF file (Apache FOP)

    Hi all...I'm using the Apache FOP PDF printing option with the jsp packaged in the AppEx 3.0.1 install. I would like to put a logo in the header of the generated PDF file. I made a compy of the default generic columns layout and added this to the header section in Page Template:
    <fo:block>
    Test Header Changes
    <fo:external-graphic src="file:///tmp/FastenalLogo.png"/>
    </fo:block>
    The following error is then generated in the logs:
    07/10/31 10:50:44 [INFO] Using oracle.xml.parser.v2.SAXParser as SAX2 Parser
    07/10/31 10:50:44 [INFO] building formatting object tree
    07/10/31 10:50:44 [INFO] setting up fonts
    07/10/31 10:50:51 [INFO] [1]
    07/10/31 10:50:51 [WARNING] table-layout=auto is not supported, using fixed!
    07/10/31 10:50:53 [ERROR] Error while creating area : Error creating FopImage ob ject (file:/tmp/FastenalLogo.png) : Jimi image library not available
    07/10/31 10:50:54 [INFO] [2]
    07/10/31 10:50:55 [ERROR] Error while creating area : Error creating FopImage ob ject (file:/tmp/FastenalLogo.png) : Jimi image library not available
    07/10/31 10:50:55 [INFO] [3]
    07/10/31 10:50:55 [ERROR] Error while creating area : Error creating FopImage ob ject (file:/tmp/FastenalLogo.png) : Jimi image library not available
    07/10/31 10:50:56 [INFO] Parsing of document complete, stopping renderer
    I also tried using a URL (with appropriate syntax), but that generated these errors:
    07/10/31 10:44:14 [ERROR] Error while creating area : No ImageReader for this ty pe of image (http://epsilon.fastenal.com:7784/i/FastenalLogo.jpg)
    07/10/31 10:44:14 [INFO] [3]
    07/10/31 10:44:15 [ERROR] Could not load external SVG: http://epsilon.fastenal.c om:7784/i/FastenalLogo.jpg<Line 1, Column 50>: XML-20190: (Fatal Error) Whitespa ce required.
    07/10/31 10:44:15 [ERROR] Error while creating area : No ImageReader for this ty pe of image (http://epsilon.fastenal.com:7784/i/FastenalLogo.jpg)
    07/10/31 10:44:15 [INFO] Parsing of document complete, stopping renderer
    Is it not possible to import an external image file into a PDF rendered by the Apache FOP? Any help would be greatly appreciated.
    Thanks,
    Leigh

    Hi Carl --
    I changed the image source to this:
    <xsl:variable name="_SECTION_NAME" select="string('master0')"/>
    <fo:static-content flow-name="region-header">
    <fo:block>
    Test Header Changes
    <fo:external-graphic src="http://epsilon.fastenal.com:7784/i/FastenalLogo.jpg" />
    </fo:block>
    <fo:block xsl:use-attribute-sets="text text_2 text_0 #PAGE_HEADER_ALIGNMENT#">
    <fo:inline xsl:use-attribute-sets="page-header">#PAGE_HEADER#</fo:inline>
    </fo:block>
    </fo:static-content>
    I can access the image through my web browser using the URL, but my log is throwing these errors:
    07/10/31 13:01:18 [WARNING] table-layout=auto is not supported, using fixed!
    07/10/31 13:01:20 [ERROR] Could not load external SVG: http://epsilon.fastenal.com:7784/i/FastenalLogo.jpg<Line 1, Column 50>: XML-20190: (Fatal Error) Whitespace required.
    07/10/31 13:01:20 [ERROR] Error while creating area : No ImageReader for this type of image (http://epsilon.fastenal.com:7784/i/FastenalLogo.jpg)
    07/10/31 13:01:20 [INFO] [2]
    07/10/31 13:01:21 [ERROR] Could not load external SVG: http://epsilon.fastenal.com:7784/i/FastenalLogo.jpg<Line 1, Column 50>: XML-20190: (Fatal Error) Whitespace required.
    07/10/31 13:01:21 [ERROR] Error while creating area : No ImageReader for this type of image (http://epsilon.fastenal.com:7784/i/FastenalLogo.jpg)
    07/10/31 13:01:21 [INFO] Parsing of document complete, stopping renderer
    Could the fo block be in the wrong place in the document? I'm not very familiar with XSL-FO and may have just placed it wrong.
    One other thing I just noticed. The webserver is actually using SSL, which on windows systems results in a pop-up about security. If I change the URL to https using the SSL port, I receive a message about security certificates.
    Thanks,
    Leigh
    Message was edited by:
    ljohnson74

  • Do I need to use Apache FOP ?

    Hi,
    I am configuring Oracle BI Publisher with APEX following the instructions in http://www.oracle.com/technology/products/database/application_express/html/configure_printing.html .
    After completing step *3 Installing and Configuring Oracle BI Publisher on Windows* I am able to print reports in desired PDF, DOC, XLS format etc from APEX and all the functionalities seem to be available.
    So my question is why should I follow step *5 Installing and Configuring Apache FOP* ? Is there any other extra benefit of doing that ? Am I missing anything here ?
    Please advise,
    Thanks
    Ashish Agarwal (PMP, OCM & OCP)
    http://www.dbcon.com.sg

    Hi Ashish,
    Sure, not a problem, please see my answers below:
    1) correct, you either use BI Publisher or Apache FOP or other XSL-FO processing engines as stated under #6
    2) the main advantage of using BI Publisher over Apache FOP is that BI Publisher allows for WYSIWYG report layout creation using the MS Word plug-in, and then using these templates as RTF based report layouts in Application Express. With Apache FOP or other XSL-FO processing engines you can't use RTF layouts, so you would have to design your report layouts using XSL-FO, which if done manually isn't exactly easy. There are other third-party visual design tools available though that provide help with that, just google for "xsl-fo design". Also, BI Publisher of course provides several advanced reporting capabilities when using this product directly, that are not available with the APEX / BI Publisher integration.
    3) BI Publisher Desktop, i.e. the MS Word Plug-In is part of the BI Publisher product, it's not a stand-alone product. So if you're a licensed BI Publisher user, you're also licensed to use BI Publisher Desktop. And BI Publisher Desktop doesn't provide much value if used stand-alone without the server.
    Regards,
    Marc

  • Problems with PDF printing, using Apache FOP!

    When I click on "print" link I reseive an empty file!
    I done each step that was described in manual.
    I don't know what to do.
    Best Regards, Kostya Proskudin!

    Ok, let me describe all my actions:
    1. I download from http://archive.apache.org/dist/xmlgraphics/fop/source/ file fop-0.20.5-src.zip.
    2. I extract it.
    3. go to $ORACLE_HOME/oc4j/j2ee and copied folder fop-0.20.5.
    ($ORACLE_HOME - means DB home, is it right?)
    4. Then I add to the end of file $ORACLE_HOME/oc4j/j2ee/home/config/application.xml
    <!-- libraries below added for FOP support -->
    <library path="../../../j2ee/fop-0.20.5/build/fop.jar"/>
    <library path="../../../j2ee/fop-0.20.5/lib/batik.jar"/>
    <library path="../../../j2ee/fop-0.20.5/lib/avalon-framework-cvs-20020806.jar" />
    <!-- above libraries added for FOP support -->
    5. Go to $ORACLE_HOME/oc4j/j2ee/home/default-web-app and copied there apex_for_render.jsp.
    6. Open my apex_dmin .... and fill host (my DB host 10.10.10.4), port (DB port 1521 the same as tns has, is it right?) at least script "/apex_fop_render.jsp" (with "/")
    Thank you!

  • APEX 4.1 - APACHE FOP PDF generation problem.

    Hi all,
    I'm having problem with PDF generation using APACH FOP on OC4J.
    When I test my print server as described here:
    http://marcsewtz.blogspot.com/2008/06/heres-another-posting-on-pdf-printing.html
    everything works without problem. But when I upload my Layout to APEX and try to generate PDF from apex I'm getting error:
    oracle.xml.parser.v2.XMLParseException: Unexpected EOF.
         at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:320)
         at oracle.xml.parser.v2.XMLReader.popXMLReader(XMLReader.java:549)
         at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1375)
         at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:362)
         at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:308)
         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:337)
         at oracle.xml.xslt.XSLProcessor.newXSLStylesheet(XSLProcessor.java:714)
         at oracle.xml.xslt.XSLStylesheet.<init>(XSLStylesheet.java:322)
         at oracle.xml.parser.v2.XSLStylesheet.<init>(XSLStylesheet.java:114)
         at apex_fop._jspService(_apex__fop.java:71)
         [SRC:/apex_fop.jsp:21]
    I could see similar post here:
    Handling Special characters in call to apex_util.download_print_document
    But it doesn't explain my case as it's crashing even when I generate empty pdf(no data so no special characters, only empty XML file with no data should be sent to print server)
    Is there any way to see what xml is sent do print server for processing? That could eventually show where is a problem.
    Palo

    My mistake, there was really an "&" character in my template. now when I replaced it with %26 it works.
    However I would be still interested if there is a way to see what data is APEX engine sending to print server cause it will help me to find this kind of errors.
    Palo

  • PDF printing by Apache FOP : what are the prerequisites ?

    Hello,
    I'm actually looking for a way to print reports, and I've 2 questions :
    1) If I'm not wrong there are three means : BI Publisher, Apache FOP and an other XSL-FO like Cocoon...
    -> For budgetary reasons, we can't use BI Publisher.
    -> Besides, my company owns the Oracle Standard Edition, so I'm not even sure we can use Apache FOP : in every documentation FOP is deployed in App Server or Enterprise Manager, and we don't have those. OC4J seems installed on our server but it may not work without Application Server...
    -> So is Cocoon the solution ?
    2) We're about installing Apex 4.0. We want to be able to print interactive reports, with aggregations and sums. Does it possible and are there differences between report engines ?
    Thanks a lot !
    Fanny

    Hi Fanny,
    I stand to be corrected, but my understanding regarding OC4J licensing is this.
    OC4J can be downloaded and installed in standalone configuration from OTN under the OTN license, which is fairly restrictive and means that it cannot be used for production or commercial purposes. This applies whether it is installed on the database server or on a separate server. In order to license it you need to buy an OAS or Weblogic license. This is in contrast to Oracle's HTTP server, which can be installed standalone and is included in the database server license provided it is installed on the same server as the database. If the HTTP server is installed on a separate server to the database then it too requires an OAS or Weblogic license.
    My guess for this anomally is that the HTTP server is based on Apache, an open source product and it was originally installed as part of the database up until version 9i. After that it was separated out as a companion product. Where as OC4J is based on a proprietary product called Onion, which Oracle acquired. Commercially going forward, Oracle is pushing Weblogic. If you want a free app server then you can opt for the free version of Glassfish, an Oracle product or Tomcat.
    If you do need a supported environment you can also get Standard One versions of Weblogic and OAS which are considerably cheaper than the Enterprise versions and you can get a supported version of Glasfish for around the same cost.
    You should also note that Oracle BI plus OAS or Weblogic is a complete development and deployment product for business intelligence reporting, whereas Apache FOP and an app server is purely a deployment environment. If you wish to do something more sophisticated than the standard PDF option available in Apex, which is pretty basic, you will need to acquire some sort of XSL-FO production tool. As alluded to previously, Java4less produce a minimally priced one, but there are others in the market place.
    Regards
    Andre

  • Apache FOP not displaying Cyrillic properly

    Hi,
    I am using apache FOP to generate pdfs' in Russian. I have embedded the fonts into the application but the output is being displayed as html numerical codes.
    The html numerical codes are stored in the database but I am unable to render them properly. I know the fonts are embedded correctly because when I apply the fonts to English text, Russian characters are displayed in the pdf correctly.
    e.g the Russian characters are displayed like this:
    &#1087;&#1088;&#1086;&#1076;... etc
    Why are my codes not displaying properly ? I'm a bit lost at this point.
    thanks in advance

    Hi,
    thanks for the reply.
    To clarify things a bit. My web page is submitting Russian text which is being stored in an Oracle database. This text is being stored in the &#xxxx; format. This formatting is displayed properly in a web browser but I am using Apache FOP to produce a pdf and the Russian text is not being displayed as the Russian characters but as the relative &#xxxx; codes. So these codes are not being translated back into their Russian Cyrillic symbols.
    I have configured FOP and embedded the Cyrillic TTF but these codes are still not displayed. I can apply the Cyrillic font style to English text and Russian characters are displayed so it seems that that cyrillic TTF is embedded properly.
    I am not generating an serialized xml file but rather creating a javax.xml.transform.dom.DOMSource object and with my xsl file I create the pdf code snippet below:
    thanks
    Paul
              //Setup a buffer to obtain the content length
              ByteArrayOutputStream out = new ByteArrayOutputStream();
              // add fonts for Russian and Chinese certificates
              String fontConfig = path + "fonts/fontcfg.xml";
           FopFactory fopFactory = FopFactory.newInstance();
           fopFactory.setUserConfig(fontConfig);
           FOUserAgent foAgent = fopFactory.newFOUserAgent();
              //Setup FOP
              Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,foAgent , out);
              //Setup Transformer
              Source xsltSrc = new StreamSource(new File(xslFile));
              TransformerFactory tFactory = TransformerFactory.newInstance();
              Transformer transformer = tFactory.newTransformer(xsltSrc);
              //Make sure the XSL transformation's result is piped through to FOP
              Result res = new SAXResult(fop.getDefaultHandler());
              //Setup input
              Source domSrc = new DOMSource(xmlDom);         
           //Start the transformation and rendering process
              transformer.transform(domSrc, res);
              //Prepare response
              response.setContentType("application/pdf");
              response.setContentLength(out.size());
              //Send content to Browser
              response.getOutputStream().write(out.toByteArray());
              response.getOutputStream().flush();

  • Apache FOP Capabilities

    Hi all,
    When using Apache FOP, is it possible to achieve any of the following :
    1. Enable printing at the page level rather than at reports region ?
    2. If the report contains some images is it possible that these appear in the PDF output as well?
    3. Is it possible to produce XSL-FO files on the APEX server and then transfer these files to a reporting engine (Business Objects Xi) to create PDF files for printing.
    Thank you and Kind Regards,
    Ana-Maria

    Hi Luis,
    You can create some incredibly complex and rich reports using the BI Publisher (BIP) integration that APEX allows. In your report template (using the BIP plugins) you can use conditional logic to make colour columns/rows etc depending on certain criteria.
    It is possible to do this yourself using the (free) Apache FOP solution, however it involves a great deal of hand-crafting the XSL-FO code yourself (not a task to be taken lightly, but entirely possible).
    If you have the budget for it (or your requirement is urgent), then I highly recommend using BIP, if you don't have the budget then I recommend Apache FOP and a bottomless coffee pot and ready access to a local bakery (you're going to need the caffeine and sugar to get you through the manual XSL-FO coding).
    Another possibility is to investigate PL/PDF (www.plpdf.com) which might suit your needs.
    Hope this helps,
    John.

  • Apache FOP Problem with column width

    We are using Apache FOP to generate simple pdf documents out of reports.
    My problem is that the table in the pdf is as standard filled in with columns of same length.
    Further on the content of some table fields is to large or sometimes there is to much room.
    is there any possiblity to let fop react like html?
    The smallest table field size should be like the content. I don't want to adjust all my reports, cause there are really many reports with pdf printing.
    anyone an idea how to solve this with FOP?
    i have no BI pubisher or other reporting engines for this problem
    thx so far

    Oliver,
    I think what you're looking for is having your column width automatically adjusted based on the content of your column values. That is not possible with the built-in, generic XSL-FO template. What you can do is manually adjusting the column width to appropriate values on the print attributes page.
    Regards,
    Marc

  • Apache FOP config Question

    Hi all,
    I have APEX version 3.0.1 and I use F&R Services version 10.1.2.0.2. I wanted to use Apache Fop in order to have PDF Printing facilities.
    However in http://www.oracle.com/technology/products/database/application_express/html/configure_printing.html#05
    I saw that the OC4j version needed should be a minimum of 10.1.3.2 version. So I decided to use the OC4j from JDev 10.1.3.3.
    Step 1 from the document above went ok, then when I try to configure FOP in APEX I cannot find "Instance Settings", under Manage Service, even though I am logged in as ADMIN.
    Has anybody any suggestions on this?
    Kind Regards,
    Ana-Maria

    Hi all,
    found the problem. I needed to connect as admin to APEX in order to do this: http://hostname:portno/pls/apex/apex_admin.
    Thank you,
    Ana-Maria

  • Apache FOP Examples

    Hi,
    I am interested in using Apache FOP & Apex for PDF creation as are multiple others, can anyone post some finished example PDF's for those of us considering this method to look at?
    Thanks!

    I believe that this <xsl:value-of select="$ITEMS/LIST_ITEMS/ITEMS/def"/> will not work. You need to derive the value stored in ITEMS using $ITEMS and then concatentate the rest of the text to construct the path...
    Try this: 
    <xsl:value-of select="concat($ITEMS, '/LIST_ITEMS/ITEMS/def')"/>
    Thanks,
    Bipuser

Maybe you are looking for