xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mandar Nimbkar <Mandar.Nimb...@igate.com>
Subject Migration from FOP 1.0 to 2.0
Date Tue, 03 Nov 2015 11:29:01 GMT
Hi,

I am migrating from FOP 1.0 to FOP 2.0

I have made the required Java code changes as per the changed API.

There are PNG images used in the report generated using PDF renderer..

Here is the FOP config

<?xml version="1.0" encoding="utf-8"?>

<!-- NOTE: This is the version of the configuration -->
<fop version="1.0">

  <!-- Strict user configuration -->
  <strict-configuration>false</strict-configuration>

  <!-- Strict FO validation -->
  <strict-validation>false</strict-validation>

  <!-- Base URL for resolving relative URLs -->
                <base>.</base>

  <!-- Font Base URL for resolving relative font URLs -->
                <!-- <font-base>./fontMetrics</font-base> -->

  <!-- Source resolution in dpi (dots/pixels per inch) for determining the size of pixels
in SVG and bitmap images, default: 72dpi -->
  <source-resolution>200</source-resolution>
  <!-- Target resolution in dpi (dots/pixels per inch) for specifying the target resolution
for generated bitmaps, default: 72dpi -->
  <target-resolution>200</target-resolution>

 <renderers>
   <renderer mime="application/pdf">
      <fonts>
                      <referenced-fonts>
                        <match font-family="Courier"/>
                        <match font-family="Helvetica"/>
                        <match font-family="Times"/>
                        <match font-family="Symbol"/>
                        <match font-family="ZapfDingbats"/>
                      </referenced-fonts>
                   <!-- The windows path for desktop testing. -->
                   <!--<font  kerning="yes"
                        embed-url="file:///c:/windows/fonts/wqy-zenhei.ttc" sub-font="WenQuanYi
Zen Hei">
                         <font-triplet name="ZYSong" style="normal" weight="normal"/>
                       </font>
                       <font  kerning="yes"
                         embed-url="file:///c:/windows/fonts/kochi-gothic.ttf">
                          <font-triplet name="Gothic" style="normal" weight="normal"/>
                       </font> -->

                                 <!-- Linux path for production system -->
                                   <font  kerning="yes"
                        embed-url="file:/usr/share/fonts/zh_CN/TrueType/wqy-zenhei.ttc" sub-font="WenQuanYi
Zen Hei">
                         <font-triplet name="ZYSong" style="normal" weight="normal"/>
                       </font>
                       <font  kerning="yes"
                         embed-url="file:/usr/share/fonts/ja/TrueType/kochi-gothic.ttf">
                          <font-triplet name="Gothic" style="normal" weight="normal"/>
                       </font>
         </fonts>
   </renderer>
</renderers>

 <fonts>
  <substitutions>
   <substitution>
    <from font-family="Symbol" font-weight="700..900"/>
    <to font-family="Symbol" font-weight="400"/>
   </substitution>
   <substitution>
    <from font-family="ZapfDingbats" font-weight="700..900"/>
    <to font-family="ZapfDingbats" font-weight="400"/>
   </substitution>
  </substitutions>
</fonts>

  <image-loading>
    <penalty value="-10000"
        class="org.apache.xmlgraphics.image.loader.impl.ImageLoaderRawPNG"/>
    <penalty value="INFINITE"
        class="org.apache.xmlgraphics.image.loader.impl.ImageLoaderPNG"/>
  </image-loading>
</fop>

--------------------------------

I am getting following exception gets thrown in FOP 2.0

16:38:20.992 53425 [ReportFormatService-0] ERROR AreaTreeModel  - Error while rendering page
1
java.lang.RuntimeException: Error processing transparency channel:
       at org.apache.fop.render.pdf.ImageRawPNGAdapter.setup(ImageRawPNGAdapter.java:148)
       at org.apache.fop.pdf.PDFDocument.addImage(PDFDocument.java:872)
       at org.apache.fop.render.pdf.AbstractPDFImageHandler.handleImage(AbstractPDFImageHandler.java:46)
       at org.apache.fop.render.pdf.PDFImageHandlerRawPNG.handleImage(PDFImageHandlerRawPNG.java:35)
       at org.apache.fop.render.intermediate.AbstractIFPainter.drawImage(AbstractIFPainter.java:249)
       at org.apache.fop.render.intermediate.AbstractIFPainter.drawImage(AbstractIFPainter.java:205)
       at org.apache.fop.render.intermediate.AbstractIFPainter.drawImageUsingImageHandler(AbstractIFPainter.java:170)
       at org.apache.fop.render.intermediate.AbstractIFPainter.drawImageUsingURI(AbstractIFPainter.java:292)
       at org.apache.fop.render.pdf.PDFPainter.drawImage(PDFPainter.java:173)
       at org.apache.fop.render.intermediate.IFRenderer.drawImage(IFRenderer.java:1295)
       at org.apache.fop.render.intermediate.IFRenderer.renderImage(IFRenderer.java:1282)
       at org.apache.fop.render.AbstractRenderer.renderInlineViewport(AbstractRenderer.java:858)
       at org.apache.fop.render.AbstractPathOrientedRenderer.renderInlineViewport(AbstractPathOrientedRenderer.java:832)
       at org.apache.fop.render.intermediate.IFRenderer.renderInlineViewport(IFRenderer.java:863)
       at org.apache.fop.render.AbstractRenderer.renderInlineArea(AbstractRenderer.java:715)
       at org.apache.fop.render.intermediate.IFRenderer.renderInlineArea(IFRenderer.java:927)
       at org.apache.fop.render.AbstractRenderer.renderLineArea(AbstractRenderer.java:690)
       at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:572)
       at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
       at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:999)
       at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
       at org.apache.fop.render.AbstractPathOrientedRenderer.renderReferenceArea(AbstractPathOrientedRenderer.java:757)
       at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:600)
       at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:999)
       at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
       at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
       at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:999)
       at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
       at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
       at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:999)
       at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
       at org.apache.fop.render.AbstractPathOrientedRenderer.renderReferenceArea(AbstractPathOrientedRenderer.java:757)
       at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:600)
       at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:999)
       at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
       at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
       at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:999)
       at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
       at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
       at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:999)
       at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
       at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
       at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:999)
       at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
       at org.apache.fop.render.AbstractRenderer.renderFlow(AbstractRenderer.java:457)
       at org.apache.fop.render.AbstractPathOrientedRenderer.renderFlow(AbstractPathOrientedRenderer.java:785)
       at org.apache.fop.render.AbstractRenderer.renderMainReference(AbstractRenderer.java:434)
       at org.apache.fop.render.AbstractRenderer.renderBodyRegion(AbstractRenderer.java:358)
       at org.apache.fop.render.AbstractRenderer.renderRegionViewport(AbstractRenderer.java:305)
       at org.apache.fop.render.intermediate.IFRenderer.renderRegionViewport(IFRenderer.java:738)
       at org.apache.fop.render.AbstractRenderer.renderPageAreas(AbstractRenderer.java:278)
       at org.apache.fop.render.AbstractRenderer.renderPage(AbstractRenderer.java:243)
       at org.apache.fop.render.intermediate.IFRenderer.renderPage(IFRenderer.java:586)
       at org.apache.fop.area.RenderPagesModel.addPage(RenderPagesModel.java:123)
       at org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.finishPage(AbstractPageSequenceLayoutManager.java:315)
       at org.apache.fop.layoutmgr.PageSequenceLayoutManager.finishPage(PageSequenceLayoutManager.java:216)
       at org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.makeNewPage(AbstractPageSequenceLayoutManager.java:286)
       at org.apache.fop.layoutmgr.PageSequenceLayoutManager.makeNewPage(PageSequenceLayoutManager.java:176)
       at org.apache.fop.layoutmgr.PageBreaker.handleBreakTrait(PageBreaker.java:601)
       at org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:170)
       at org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:158)
       at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:384)
       at org.apache.fop.layoutmgr.PageBreaker.doLayout(PageBreaker.java:112)
       at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:138)
       at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:267)
       at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:130)
       at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:360)
       at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:190)
       at com.guidant.framework.utility.report.ContentHandlerSplitter.endElement(ContentHandlerSplitter.java:235)
       at org.apache.xml.serializer.ToXMLSAXHandler.endElement(ToXMLSAXHandler.java:263)
       at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1401)
       at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395)
       at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178)
       at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
       at org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:141)
       at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
       at com.guidant.framework.utility.report.extension.WithinContainerElement.process(WithinContainerElement.java:155)
       at com.guidant.framework.utility.report.extension.XalanTransformExtensionElement.withinContainer(XalanTransformExtensionElement.java:241)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:483)
       at org.apache.xalan.extensions.ExtensionHandlerJavaClass.processElement(ExtensionHandlerJavaClass.java:517)
       at org.apache.xalan.templates.ElemExtensionCall.execute(ElemExtensionCall.java:234)
       at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
       at com.guidant.framework.utility.report.extension.ForEachReportElement.process(ForEachReportElement.java:119)
       at com.guidant.framework.utility.report.extension.XalanTransformExtensionElement.forEachReport(XalanTransformExtensionElement.java:71)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:483)
       at org.apache.xalan.extensions.ExtensionHandlerJavaClass.processElement(ExtensionHandlerJavaClass.java:517)
       at org.apache.xalan.templates.ElemExtensionCall.execute(ElemExtensionCall.java:234)
       at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
       at com.guidant.framework.utility.report.extension.WithinNewStackFrameElement.process(WithinNewStackFrameElement.java:102)
       at com.guidant.framework.utility.report.extension.XalanTransformExtensionElement.withinNewStackFrame(XalanTransformExtensionElement.java:128)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:483)
       at org.apache.xalan.extensions.ExtensionHandlerJavaClass.processElement(ExtensionHandlerJavaClass.java:517)
       at org.apache.xalan.templates.ElemExtensionCall.execute(ElemExtensionCall.java:234)
       at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395)
       at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178)
       at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
       at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
       at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395)
       at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178)
       at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
       at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2272)
       at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1358)
       at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:711)
       at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1275)
       at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1253)
       at com.guidant.framework.utility.report.AbstractReportFormatter.formatReport(AbstractReportFormatter.java:221)
       at com.guidant.framework.viewcontroller.ReportFormatService.format(ReportFormatService.java:286)
       at com.guidant.framework.viewcontroller.ReportFormatService.access$2(ReportFormatService.java:246)
       at com.guidant.framework.viewcontroller.ReportFormatService$FormatOperation.logic(ReportFormatService.java:412)
       at com.guidant.framework.core.activeComponent.OperationRequest.execute(OperationRequest.java:287)
       at com.guidant.framework.core.activeComponent.ExecutionThread.run(ExecutionThread.java:192)
Caused by: java.io.EOFException: Unexpected end of ZLIB input stream
       at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:240)
       at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
       at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:122)
       at java.io.FilterInputStream.read(FilterInputStream.java:83)
       at org.apache.fop.render.pdf.ImageRawPNGAdapter.setup(ImageRawPNGAdapter.java:137)
       ... 119 more

Pls help

Regards,
Mandar

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Disclaimer~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Information contained and transmitted by this e-mail is confidential and proprietary to IGATE
and its affiliates and is intended for use only by the recipient. If you are not the intended
recipient, you are hereby notified that any dissemination, distribution, copying or use of
this e-mail is strictly prohibited and you are requested to delete this e-mail immediately
and notify the originator or mailadmin@igate.com <mailto:mailadmin@igate.com>. IGATE
does not enter into any agreement with any party by e-mail. Any views expressed by an individual
do not necessarily reflect the view of IGATE. IGATE is not responsible for the consequences
of any actions taken on the basis of information provided, through this email. The contents
of an attachment to this e-mail may contain software viruses, which could damage your own
computer system. While IGATE has taken every reasonable precaution to minimise this risk,
we cannot accept liability for any damage which you sustain as a result of software viruses.
You should carry out your own virus checks before opening an attachment. To know more about
IGATE please visit www.igate.com <http://www.igate.com>.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Mime
View raw message