Output Charts to PDF using FOP

Does anybody know is it possible to output ones charts to PDF format using the FOP??

Hello,
You could use something like the Report to FOP howto and by posting the SVG source get a PDF. I have never done that but in theory it should work.
I have taken the source by hand and rendered FOP and that works, the only issue was the styles and class's had to be all put into the custom CSS section of the Chart attributes.
Carl

Similar Messages

  • Convert smartform output in to PDF using CONVERT_OTF function  how to do it

    Hi Anil , and  Hi All
             I am trying to display smartforms output in java webdynpro
             for that i have got the following code in sdn.
               can anybody please clarify these doubts in the  below code
               1) What are the mandatory input and output parameters
                   I have to pass here in this code to my application
               2) please check my previous post also in this regards please
       . Please reply at the very earliest. Check the below code
    Convert smartform output in to PDF using CONVERT_OTF function module and you can write pdf using parameter 'binfile' of this function in WebDynpro using the following code:
    It is copied from my prg. I hope you understand it.
    public void onActionGetQuote(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
    //@@begin onActionGetQuote(ServerEvent)
    wdThis.wdGetOppt_QwriterCustController().executeZquote_Writer_Input();
    String fileName = wdContext.currentZquote_Writer_InputElement().getOrder().toString().trim() + System.currentTimeMillis() + ".pdf";
    String pdfOutput = new String(wdContext.currentOutputElement().getBinfile());
    if (pdfOutput != null)
    try
    String pdfResoucePath = WDURLGenerator.getResourcePath(wdComponentAPI.getDeployableObjectPart(), fileName);
    FileOutputStream fileOutputStream = new FileOutputStream(new File(pdfResoucePath));
    PrintStream ps = new PrintStream(fileOutputStream);
    ps.print(pdfOutput);
    ps.close();
    //Display the PDF to the browser
    String fileURL = WDURLGenerator.getAbsoluteWebResourceURL(wdComponentAPI.getDeployableObjectPart(), fileName);
    IWDWindow window = wdComponentAPI.getWindowManager().createExternalWindow(fileURL, "Pdf Browser", false);
    window.removeWindowFeature(WDWindowFeature.ADDRESS_BAR);
    window.removeWindowFeature(WDWindowFeature.MENU_BAR);
    window.removeWindowFeature(WDWindowFeature.STATUS_BAR);
    window.removeWindowFeature(WDWindowFeature.TOOL_BAR);
    window.open();
    // To collect all the file created in the server by user
    quoteFiles.add(quoteFiles.size(), pdfResoucePath);
    } catch (Exception e)
    throw new WDRuntimeException(e);
    //@@end

    Hi
        ABAPers prepared a BAPI function module which calls Smart form , how can i execute it from java Webdynpro, so that I can display the smart form in Webdynpro. Pleas reply at the very earliest.  Every answer will be rewarded.
    regards
    jalandhar

  • Cannot generate chart in PDF using BI Publisher

    I have a java program to generate chart in PDF using BI publisher. In some platforms the chart cannot be generated. Get the following exception.
    [061812_075947838][][ERROR] java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at oracle.apps.xdo.template.rtf.img.RTFChartUtil.invokeMethod(Unknown Source)
    at oracle.apps.xdo.template.rtf.img.RTFChartUtil.generateChartAsBase64(Unknown Source)
    at oracle.apps.xdo.template.rtf.XSLTFunctions.chart_svg(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at oracle.xdo.parser.v2.XSLExtFunctions.callStaticMethod(XSLExtFunctions.java:111)
    at oracle.xdo.parser.v2.XPathExtFunction.evaluateMethod(XPathExtFunction.java:307)
    at oracle.xdo.parser.v2.XPathExtFunction.evaluate(XPathExtFunction.java:226)
    at oracle.xdo.parser.v2.XSLValueOf.processAction(XSLValueOf.java:101)
    at oracle.xdo.parser.v2.XSLNode.processChildren(XSLNode.java:417)
    at oracle.xdo.parser.v2.XSLResultElement.processAction(XSLResultElement.java:180)
    at oracle.xdo.parser.v2.XSLNode.processChildren(XSLNode.java:417)
    at oracle.xdo.parser.v2.XSLResultElement.processAction(XSLResultElement.java:180)
    at oracle.xdo.parser.v2.XSLNode.processChildren(XSLNode.java:417)
    at oracle.xdo.parser.v2.XSLResultElement.processAction(XSLResultElement.java:180)
    at oracle.xdo.parser.v2.XSLNode.processChildren(XSLNode.java:417)
    at oracle.xdo.parser.v2.XSLResultElement.processAction(XSLResultElement.java:180)
    at oracle.xdo.parser.v2.XSLNode.processChildren(XSLNode.java:417)
    at oracle.xdo.parser.v2.XSLTemplate.processAction(XSLTemplate.java:191)
    at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:512)
    at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:489)
    at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:271)
    at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:155)
    at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at oracle.apps.xdo.common.xml.XSLT10gR1.invokeProcessXSL(Unknown Source)
    at oracle.apps.xdo.common.xml.XSLT10gR1.transform(Unknown Source)
    at oracle.apps.xdo.common.xml.XSLT10gR1.transform(Unknown Source)
    at oracle.apps.xdo.common.xml.XSLTWrapper.transform(Unknown Source)
    at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
    at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
    at oracle.apps.xdo.template.FOProcessor.createFO(Unknown Source)
    at oracle.apps.xdo.template.FOProcessor.generate(Unknown Source)
    at com.edocs.common.reporting.batch.BatchEventHandler.generatePDFFile(BatchEventHandler.java:327)
    at com.edocs.common.reporting.batch.BatchEventHandler.processBatchRequest(BatchEventHandler.java:252)
    at com.edocs.common.reporting.batch.BatchEventHandler.service(BatchEventHandler.java:136)
    at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.executeInternal(BatchReportProcessorTask.java:126)
    at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.doProcessTask(BatchReportProcessorTask.java:46)
    at com.edocs.pwc.tasks.CommonTask.processTask(CommonTask.java:166)
    at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.__WL_invoke(Unknown Source)
    at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
    at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.processTask(Unknown Source)
    at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:85)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
    at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: java.lang.NoSuchMethodError: oracle.dss.util.CustomStyle.<init>(Ljava/io/InputStream;)V
    at oracle.dss.graph.CommonGraph.setStyleStream(CommonGraph.java:10774)
    at oracle.dss.graph.CommonGraph.setStylePath(CommonGraph.java:10743)
    at oracle.dss.graph.CommonGraph.setStylePathXML(CommonGraph.java:12138)
    at oracle.dss.graph.CommonGraph.setXML(CommonGraph.java:13348)
    at oracle.dss.graph.CommonGraph._setXML(CommonGraph.java:15821)
    at oracle.dss.graph.CommonGraph.setXML(CommonGraph.java:14751)
    at oracle.dss.graph.Graph.setXML(Graph.java:5243)
    ... 60 more
    In office word bi publisher plugin, load the xml, the chart can be generated.
    The above exception only occurs in some linux and solaris platforms, but never occurs in windows.
    The following plateform throws exception.
    Oracle Linux Server release 5.6 + java version "1.6.0_25"
    The following plateform doesn't throw exception.
    Enterprise Linux Enterprise Linux Server release 5.4 (Carthage) + java version "1.6.0_05"
    The strange thing is in those platforms which can throw exception, if the code is not running in EJB, the chart still can be generated.
    In other words, if the normal web or standalone app invokes that program; the chart can be generated.
    The java code is as below.
         public static void generate(String inputXML, String pdfTempPath, String outputPDF) {
              Reader reader = null;
              try {
                   File xmlFile = new File(inputXML);
         reader = new BufferedReader(new InputStreamReader(new FileInputStream(xmlFile), "UTF-8"));               
              ByteArrayOutputStream tmpXSL = new ByteArrayOutputStream();           
              RTFProcessor rtfProcessor = new RTFProcessor(pdfTempPath);
                   rtfProcessor.setOutput(tmpXSL);
                   rtfProcessor.process();           
              ByteArrayInputStream in = new ByteArrayInputStream(tmpXSL.toByteArray());
              FOProcessor processor = new FOProcessor();
              processor.setData(reader);
              processor.setTemplate(in);
              processor.setOutput(outputPDF);
              processor.setOutputFormat(FOProcessor.FORMAT_PDF);           
              processor.generate();
              catch(Exception e) {
                   e.printStackTrace();
              finally {
                   try {
                        if(reader!=null) {
                             reader.close();
                   } catch (Exception e) {
    Can anyone explain why this exception is thrown?
    Thanks a lot.

    Hello Tux Dueñas,
    I think you need to have ACL's setup in Oracle 11g in order to be able to connect to the BI Publisher server. Check the following link on how to setup ACL's in 11g...
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28300/afterup.htm#BABFCBJI
    Thanks,
    Machaan
    Edited by: Machaan on Jan 25, 2011 11:49 AM

  • Converting xml file with arabic content to pdf using FOP

    Hello all
    I am trying to convert a dynamically generated xml file in which most of the data comes from the oracle database with arabic content, to pdf using FOP. I have used "Windows-1256" encoding for the xml. If i open the xml generated with the internet explorer the arabic content displays properly but the pdf is not generated and the acrobat reader shows the file as corrupted or not supported. Please help me. Its very urgent.
    Thanks & Regards
    Gurpreet Singh

    There is no direct support for importing RTF from an XML extract. Perhaps feature 1514 "Mapping formatted XML data into multiline field" will be of some use. This was released in 11.0, I believe.
    Essentially you can establish paragraph and certain text formatting like bold and underline when you include the proper token information in the data. I believe this is similar to simple HTML tokens.
    Example: &lt;FIELD>&lt;P>First paragraph of data.&lt;/P>&lt;P>New paragraph with &lt;B>&lt;U>bold and underline text&lt;/U>&lt;/B>. Rest of paragraph normal.&lt;/P>&lt;/FIELD>
    The result is something like this:
    <P>First paragraph of data.</P><P>New paragraph with <B><U>bold and underline text</U></B>. Rest of paragraph normal.</P>

  • Arabic pdf using FOP

    hello all ..
    i m able to generate the pdf in arabic format using FOP 0.20.4 but the problem is that the data that comes from database (arabic data in oracle database) is not displayed properly and the direction of the data is not correct. Please help me if someone has tried to generate the arabic pdf.
    thanks in advance
    gurpreet singh

    No i m not using iText. I m using FOP. But if u know
    the solution for iText then please help me as i tried
    to use that too but arabic data is not displayed.
    Gurpreet SinghKaaka, yeh dekho. http://itextdocs.lowagie.com/tutorial/#part3
    There are a number of examples using Unicode and fonts- they might be of some help.
    I am not too familiar with iText, so you may want to ask specific questions over there.
    Here is a link for FOP:
    http://www.javaranch.com/journal/200409/CreatingMultipleLanguagePDFusingApacheFOP.html

  • Including image in FO fille to generate PDF using FOP

    Hi, we are trying out generating PDF files in JDK1.1.7 environment by using FOP.
    While we are testing we are encountering problem with writing images.
    In .fo file if the image is included, it is giving the following exception.
    We are of no clue regarding this. If any one can help in this regard, please help us out.
    Help of any kind is greatly appreciated.
    Following is the Exception:
    java.lang.UnsatisfiedLinkError: parseImage
    at sun.awt.image.GifImageDecoder.readImage(GifImageDecoder.java:558)
    at sun.awt.image.GifImageDecoder.produceImage(Compiled Code)
    at sun.awt.image.InputStreamImageSource.doFetch(Compiled Code)
    at sun.awt.image.ImageFetcher.fetchloop(Compiled Code)
    at sun.awt.image.ImageFetcher.run(Compiled Code)
    Error while creating area : Error while loading image file:/C:\fop1.4\src\xml_fe
    ather.gif : class java.lang.Exception - Image error
    Hisun.awt.image.URLImageSource
    Regards
    Ramavardhan.

    java.lang.UnsatisfiedLinkError: parseImage
    means that a native library is missing (ie .dll on windows, .so on most unix, .sl on other unix). The default behaviour is to try and load librarys from the CLASSPATH variable, but apps can try to locate them in other ways.
    asjf

  • Output Photobooks to PDF using Lightroom vs Aperture

    Hello,
    I have been using Lightroom since it was first launched and I love it. However, now I need to find a good way to create and layout my own photobook and output it to PDF so I can publish it on Lulu.com and it looks like Lightroom lacks a feature like this, while Aperture offers a pretty good way for users to create their own books and export to PDF.
    Is that really so ? Are there any plans for Lightroom to offer this feature as well ? I do not want to pay $200 on Aperture just for that when I am so happy with Lightroom.
    Please advise !
    Thanks !
    celso.

    Is layout flexibility the key issue for you? For example, you could generate PDFs of sections from Lightroom's Print workspace, then upload them. I've tried this - though I would add that it's not as easy as it should be (luckily I also have InDesign). What are your key issues?
    John

  • Generate multiple PDFs using FOP

    Hello,
    please take a look to the following code snipplet it is intended for the generation of a PDF document. The PDF-content is written to an OutputStream which works quite well.
    The problem is that I want to append some more PDF content to the OutpuStream, but these seams to be impossible. Is there anybody who merged several PDF-Streams to one "big OutputStream" ?
    try
    driver.setOutputStream(pdf);
    //Setup XSLT
    TransformerFactory factory = TransformerFactory.newInstance();
    Transformer transformer = factory.newTransformer(new StreamSource(xslt));
    //Setup input for XSLT transformation
    Source src = new StreamSource(xml);
    //Resulting SAX events (the generated FO) must be piped through to FOP
    Result res = new SAXResult(driver.getContentHandler());
    //Start XSLT transformation and FOP processing
    transformer.transform(src, res);
    System.out.println("first transformation...");
    finally
    pdf.close();
    }

    Hang on, your thread title suggests you want to generate multiple PDF documents from a single xml source, but the text is talking about combining pdf content.
    I'm not sure which one you really want so I'll the first one.
    I've recently had to generate multiple pdf documents from a single xml source. I used the following (hoping the tags render okay):
                   <xsl:result-document href="{$filename}" format="html">
                        <!-- document root here -->
                        <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
                             <xsl:call-template name="masterSet"/>
                             <!-- Apply the ID template to this instance of the ID element -->
                             <xsl:apply-templates select="."/>
                        </fo:root>
                   </xsl:result-document>I used the Saxon engine to split the xml into multiple .fo documents and then ran FOP over each of these.
    The 'xsl:result-document href="{$filename}" format="html"' element does the splitting. Obviously, the filename variable defines the path to the outpute file. You'll no doubt define that within some kind of for-each loop.

  • Printing PDF documents using FOP

    Hi,
    I seem to be getting the following error when printing to PDF using FOP:
    report error:
    ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1186
    ORA-12571: TNS:packet writer failure
    I've set up PDF printing by following the (FOP) instructions in the following link:
    http://www.oracle.com/technology/products/database/application_express/html/configure_printing.html
    I've verified that my OC4J container and the jsp page apex_fop.jsp is running as it should as I can get PDF documents back if I call the jsp page outside of APEX (by sending in my own template and xml request parameters).
    I've also verified that I do hit the apex_fop.jsp page when trying to print from within the APEX application. The problem is that the two parameters template and xml are both null when trying to print PDF from APEX.
    It appears as though APEX is not sending in the template and xml request parameters.
    My test case is to create a simply report query in shared components, use a generic layout, select the pdf option and click on Test Report. The result is the error shown above.
    Any ideas? I know I'm close!
    btw, I'm using 10g and APEX 3.1
    Sanjeev

    thanks Dimitri ..
    I have progress... I went back and reconfig'd my oc4j, since Ihad donethat a long time ago.
    Now I am getting the 500 Internal Server Error
    Servlet eror: ... The current application deployment descriptors do not allow for including it in this response. Please consult the application log for details.
    The application.log give me a dump ...
    09/01/20 18:55:29.515 10.1.3.4.0 Started
    09/01/20 18:55:29.718 fop: 10.1.3.4.0 Started
    09/01/20 19:00:45.906 fop: Servlet error
    oracle.xml.parser.v2.XMLParseException: Start of root element expected.
    at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:320)
    at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:341)
    at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:303)
    at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:320)
    at oracle.xml.xslt.XSLProcessor.newXSLStylesheet(XSLProcessor.java:713)
    at oracle.xml.xslt.XSLStylesheet.<init>(XSLStylesheet.java:321)
    at oracle.xml.parser.v2.XSLStylesheet.<init>(XSLStylesheet.java:114)
    at apex_fop._jspService(_apex__fop.java:71)
    at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.4.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
    at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:724)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:414)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher
    .java:713)
    at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher
    .java:370)
    at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler
    .java:871)
    at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler
    .java:453)
    at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler
    .java:221)
    at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
    at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
    at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
    at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:234)
    at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:29)
    at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:879)
    at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor
    .java:303)
    at java.lang.Thread.run(Thread.java:619)
    Not sure what to make of this, but it does give the xact same error each time.
    For what it's worth, I can successfully call a test page per Marc Sewtz's blog, so conceptually something is working, which is progress. I'll keep at it, but suggestions are welcome. Thanks for the direction.
    Karen

  • Problem with number-fields in PDF Output Using FOP

    When generating PDF Output using FOP as described in the utilitiy provided in the HTMLDB Studio http://htmldb.oracle.com/pls/otn/f?p=18326:44:12104450162492733947::::P44_ID:1522
    formatted numbers over 1,000 are resolved as characters (because of the comma) and are therefore right justified. This results in alignment issues for numeric columns.
    Does anyone have any ideas on how to work around this.
    Thanks,
    David

    Hello,
    Your probably going to have to edit the xslt to get the result either by stripping out the comma or by setting that column to explicitly align the way you want it.
    Carl

  • Report Output in PDF using htmldb_example.xslt yields blank page; commas

    I am able to generate a PDF file from a given region using FOP (Formatting Objects Processor). The file that is produced in the Adobe reader produces a nice report with a header and footer region. However, there is always a blank page (containing the header and footer information only). Also, the report produced contains mixed data (text, dates MM-MON-RR and numbers (1.00 3.00 named Hours and Days) and totals. For certain reports, the total lines for the 2 number columns could get into the thousands (1,996.54 284.52). When the comma in the number is introduced, the total row will no longer align with the detail rows.
    I know that htmldb_example.xslt is only an example, but has anybody experienced this behavior?
    Of note, the example file "hr_employees.pdf" that is downloaded from Oracle also has a blank page.

    Code changed in htmldb_example.xslt to fix comma/number format and extra page:
    <!--Some FOP processers require a block element within a table cell to render correctly-->
    <fo:block font-size="8pt">
    <xsl:choose>
    <xsl:when test=".=translate(.,translate(.,'0123456789+-,.',''),'')">
    <xsl:attribute name="text-align">end</xsl:attribute>
    </xsl:when>
    <xsl:when test="string(number(.))='NaN'">
    <xsl:attribute name="text-align">start</xsl:attribute>
    </xsl:when>
    <xsl:otherwise>
    <xsl:attribute name="text-align">end</xsl:attribute>
    </xsl:otherwise>
    </xsl:choose>
    <xsl:value-of select="."/>
    </fo:block
    Page break code, before:
    <fo:table break-after="page" font-family="Helvetica">
    after, (no extra page):
    <fo:table font-family="Helvetica">
    <!--break-after="page" causes page break after the report ends-->

  • Sync Text alignment in HTMLEditor and a PDF generated using FOP

    Hi,
    How to sync text alignment in HTMLEditor and a PDF generated using FOP ?
    I tried setting the dimensions of HTMLEditor and PDF in pixels by calculating the size in Pixels for A4 paper size with a particular dpi value.
    Have done the font settings as well. The problem is I see uneven line cuts in the PDF as compared to HTMLEditor.
    Thanks.

    It's not a realistic expectation. You are expecting the PDF produced by whoever provided your FOP implementation to observe exactly the same typographical rules as HTMLEditor. Basically it won't, and there is no way to enforce it. Line breaking/hyphenation/word spacing algorithms can be of great complexity. You are expecting two systems that aren't specified to agree, to agree.

  • 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

  • How to use PO message type to output 'Form' as PDF file

    Dear experts,
      I am working for a topic of how to use PO message type to output 'Form' as 'PDF file', and save to external file system automatically.
      Any one familiar to this topic, please kindly give me some guide, thank you!
    Regards,
    Joyce

    Hi,
       Go through the program RSTXPDFT4 (Converting SAPscript (OTF) or ABAP List Spool Job to PDF), you will get some idea.  Using this program you can convert spool into PDF file.
    -Alpesh

  • XSQL-022 error on using FOP - serializer class not found; urgent!

    Hi all,
    currently using XDK 9.2.0.1.0. On trying to invoke Apache FOP serializer I just get the following error message:
    XSQL-022: Cannot load serializer class oracle.xml.xsql.serializers.fopserializer
    and I really don't know why....
    Running XSQL Servlet within Tomcat 4 Engine, but error pops up using both, Tomcat way and/or just the commandline invoker xsql.bat.
    Generally XSQL Servlet is working correctly.
    My classpath setting contains:
    xmlparserv2.jar; batik.jar; classes12.jar; fop.jar; fopserializer.jar; oraclexsql.jar; sax2.jar; xalan-2.0.0.jar; xalanj1compat.jar; xerces-1.2.3.jar; xschema.jar; XSQLConfig.jar; xsu12.jar
    The serializer being redefined in XSQLConfig is just:
    <serializer>
    <name>FOP203</name>
    <class>oracle.xml.xsql.serializers.fopserializer</class>
    </serializer>
    This is because of using FOP 0.20.3, so having my own serializer class due to API change in FOP 0.20.x; my fopserializer is looking like that:
    package oracle.xml.xsql.serializers;
    import org.w3c.dom.Document;
    import java.io.PrintWriter;
    import oracle.xml.xsql.*;
    import org.apache.fop.messaging.MessageHandler;
    import org.apache.fop.apps.*;
    import java.io.*;
    // FOP 0.20.3 Serializer implementation for XSQL
    public class fopserializer implements XSQLDocumentSerializer
    private static final String PDFMIME="application/pdf";
    public void serialize(Document doc, XSQLPageRequest req) throws Throwable
    try
    Driver FOPDriver = new Driver();
    FOPDriver.setRenderer(FOPDriver.RENDER_PDF);
    MessageHandler.setOutputMethod(MessageHandler.NONE);
    FOPDriver.setupDefaultMappings();
    req.setContentType(PDFMIME);
    FOPDriver.setOutputStream(req.getOutputStream());
    FOPDriver.render(doc);
    catch (Exception e)
    e.printStackTrace(System.err);
    In my XSQL file I'm using the following PI:
    <?xml-stylesheet type="text/xsl" href="listemps.fo" serializer="FOP203"?>
    Any suggestions what is wrong in here ?
    Can't use the original xsqlserializer.jar either - same error.
    Thanks in advance
    Jochen

    Hi Jochen,
    I'm working with Tomcat 4.0.3, FOP 20.0.3 and XDK 9.2.0.1.0, too.
    I've copied all the jar-files into tomcat/common/lib. I think that you can't use the MessageHandler in fop20.0.3. I'm using the following serializer:
    package diva.xml.xsql.serializers;
    import org.w3c.dom.Document;
    import java.io.PrintWriter;
    import oracle.xml.xsql.*;
    import org.apache.fop.apps.*;
    import org.apache.log.*;
    import org.apache.log.format.*;
    import org.apache.log.output.io.*;
    import org.apache.avalon.*;
    import java.io.*;
    public class XSQLFOP203Serializer implements XSQLDocumentSerializer {
    private static final String PDFMIME = "application/pdf";
    private static final String CONFPATH = "/usr/local/fop/conf/userconfig.xml";
    public void serialize(Document doc, XSQLPageRequest env) throws Throwable {
    try {
    // Open user config file
    File userConfigFile = new File(CONFPATH);
    Options options = new Options(userConfigFile);
    // First make sure we can load the driver
    Driver FOPDriver = new Driver();
    // Setup logging
    Hierarchy hierarchy = Hierarchy.getDefaultHierarchy();
    PatternFormatter formatter = new PatternFormatter("[%{priority}]: %{message}\n%{throwable}" );
    LogTarget target = null;
    target = new StreamTarget(System.out, formatter);
    hierarchy.setDefaultLogTarget(target);
    Logger log = hierarchy.getLoggerFor("fop");
    log.setPriority(Priority.INFO);
    FOPDriver.setLogger(log);
    // Then set the content type before getting the reader/
    env.setContentType(PDFMIME);
    FOPDriver.setRenderer(FOPDriver.RENDER_PDF);
    FOPDriver.setOutputStream(env.getOutputStream());
    FOPDriver.render(doc);
    catch (Exception e) {
    // Cannot write PDF output for the error anyway.
    // So maybe this stack trace will be useful info
    e.printStackTrace(System.err);
    Hope this helps
    Uwe

Maybe you are looking for

  • I cannot see text when in a chat session

    I started an online class that has chat sessions. I could enter the chat room, but could not see my text or anyone else's. I could see that I had successfully entered the chat room. I was using java applet.

  • Viewing calendar in ipad mini

    Have a new ipad mini (refurb) and love it. One annoying problem is the view on the calendar month and the inability of inserting a new event in the "search" view, which took the place of the "list" view in the update. I used the "List" view exclusive

  • XML Date Mappings

    I am trying to map an XML Date type to java.util.Date. The type is defined as follows in my WSDL: <xsd:element name="ExpectedShipDate" nillable="true" type="xsd:date"/> And, the generated attribute in my Java object is: public java.util.Date Expected

  • Posing invoice t-code- miro

    Dear CONS materials are used in various deptt in our plant. The price difference amount of these materials are charged into one cost center. As per the user the cost center is automatically choosen during invoice verification. The user should have th

  • Current iTunes upgrade kills ALL internet connection to computer

    I'm using iTunes on Windows XP SP3.  Previous versions were not a problem.  I upgraded to the current version (11.0.2) and lost all internet connectivity, not just to the iTunes store, but to ALL applications; my computer reported that NO internet co