Re: Certain fonts cause FOP to crash

2012-01-25 Thread Marcin Tustin
To answer my own question, this problem does not occur with the fop
nightly jar + the batik nightly source built to jar (with the caveat
that under Java 7 one must delete the batik Tiff classes, because they
rely on com.sun.* classes).

On Wed, Jan 25, 2012 at 13:15, Marcin Tustin  wrote:
> Hi all,
>
> I'm new to FOP. I'm using it to format documents to PCL.
>
> The issue I've encountered is that certain fonts cause FOP to crash,
> with the errors below (there is far more debug output, but this is the
> stuff that seems most relevant). Is this a known issue? Is there a
> workaround or solution?
>
> I am performing the output by adapting the
> org.docx4j.convert.out.pdf.viaXSLFO.Conversion class. I have attached
> my code for completeness. This works just fine for documents with
> certain other fonts.
>
> 24404 [main] DEBUG org.apache.fop.render.pcl.PCLDocumentHandler  -
> Don't know how to handle extension object. Ignoring:
> org.apache.xmlgraphics.xmp.Metadata@5e10
> 11d8 (org.apache.xmlgraphics.xmp.Metadata)
> 24407 [main] DEBUG org.apache.fop.render.pcl.PCLDocumentHandler  -
> page size: java.awt.Dimension[width=595276,height=841890]
> 24407 [main] DEBUG org.apache.fop.render.pcl.PCLDocumentHandler  -
> logical page: java.awt.Rectangle[x=17040,y=0,width=561120,height=841680]
> 24441 [main] DEBUG org.apache.xmlgraphics.image.loader.ImageManager  -
> Chosen pipeline: null
> 24472 [main] ERROR org.apache.fop.apps.FOUserAgent  - Error while
> rendering page 1. Reason: java.lang.RuntimeException:
> org.apache.fop.render.intermediate.IFExc
> eption: Error while painting marks using a bitmap
> Exception in thread "main"
> org.docx4j.openpackaging.exceptions.Docx4JException: FOP issues
>        at 
> org.docx4j.convert.out.pdf.viaXSLFO.PclConversion.output(PclConversion.java:236)
>        at CreatePcl.main(CreatePcl.java:110)
> Caused by: java.lang.RuntimeException:
> org.apache.fop.render.intermediate.IFException: Error while painting
> marks using a bitmap
>        at 
> org.apache.fop.render.intermediate.IFRenderer.handleIFException(IFRenderer.java:189)
>        at 
> org.apache.fop.render.intermediate.IFRenderer.access$200(IFRenderer.java:105)
>        at 
> org.apache.fop.render.intermediate.IFRenderer$TextUtil.flush(IFRenderer.java:1149)
>        at 
> org.apache.fop.render.intermediate.IFRenderer.renderText(IFRenderer.java:1020)
>        at 
> org.apache.fop.render.AbstractRenderer.renderInlineArea(AbstractRenderer.java:620)
>        at 
> org.apache.fop.render.intermediate.IFRenderer.renderInlineArea(IFRenderer.java:912)
>        at 
> org.apache.fop.render.AbstractRenderer.renderInlineParent(AbstractRenderer.java:711)
>        at 
> org.apache.fop.render.intermediate.IFRenderer.renderInlineParent(IFRenderer.java:929)
>        at 
> org.apache.fop.render.AbstractRenderer.renderInlineArea(AbstractRenderer.java:628)
>        at 
> org.apache.fop.render.intermediate.IFRenderer.renderInlineArea(IFRenderer.java:912)
>        at 
> org.apache.fop.render.AbstractRenderer.renderLineArea(AbstractRenderer.java:609)
>        at 
> org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:544)
>        at 
> org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:581)
>        at 
> org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:976)
>        at 
> org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:534)
>        at 
> org.apache.fop.render.AbstractRenderer.renderFlow(AbstractRenderer.java:432)
>        at 
> org.apache.fop.render.AbstractPathOrientedRenderer.renderFlow(AbstractPathOrientedRenderer.java:665)
>        at 
> org.apache.fop.render.AbstractRenderer.renderMainReference(AbstractRenderer.java:411)
>        at 
> org.apache.fop.render.AbstractRenderer.renderBodyRegion(AbstractRenderer.java:345)
>        at 
> org.apache.fop.render.AbstractRenderer.renderRegionViewport(AbstractRenderer.java:292)
>        at 
> org.apache.fop.render.intermediate.IFRenderer.renderRegionViewport(IFRenderer.java:731)
>        at 
> org.apache.fop.render.AbstractRenderer.renderPageAreas(AbstractRenderer.java:265)
>        at 
> org.apache.fop.render.AbstractRenderer.renderPage(AbstractRenderer.java:230)
>        at 
> org.apache.fop.render.intermediate.IFRenderer.renderPage(IFRenderer.java:580)
>        at 
> org.apache.fop.area.RenderPagesModel.renderPage(RenderPagesModel.java:183)
>        at 
> org.apache.fop.area.RenderPagesModel.checkPreparedPages(RenderPagesModel.java:164)
>        at 
> org.apache.fop.area.RenderPagesModel.addPage(RenderPagesModel.java:137)
>        at 
> org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.finishPage(AbstractPageSequenceLayoutManager.java:312)
>        at 
> org.apache.fop.layoutmgr.PageSequenceLayoutManager.finishPage(PageSequenceLayoutManager.java:167)
>        at 
> org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:109)
>        at 
> org.apache.fop.ar

Re: ERROR: endElement() for fo:root where there is no current element

2012-01-25 Thread Chris Bowditch

On 23/01/2012 17:27, Nathan Schoenroth wrote:
I am getting the following error when trying to run fop on an xsl-fo 
template



Full Trace:



[xmlserver] [INFO] [XMLConnectionHandler] Processed XML document.
[xmlserver] [INFO] [XMLConnectionHandler] Sending preview.
[xmlserver] [INFO] [XMLConnectionHandler] Sent preview.
[xmlserver] [INFO] [XMLConnectionHandler] Job completed.
[xmlserver] [WARN] [FOTreeBuilder] Mismatch: table-body 
(http://www.w3.org/1999/

XSL/Format) vs. table (http://www.w3.org/1999/XSL/Format)
[xmlserver] [WARN] [FOTreeBuilder] Mismatch: table 
(http://www.w3.org/1999/XSL/F

ormat) vs. table-body (http://www.w3.org/1999/XSL/Format)
[xmlserver] [WARN] [FOTreeBuilder] Mismatch: block 
(http://www.w3.org/1999/XSL/F

ormat) vs. table (http://www.w3.org/1999/XSL/Format)
[xmlserver] [WARN] [FOTreeBuilder] Mismatch: flow 
(http://www.w3.org/1999/XSL/Fo

rmat) vs. block (http://www.w3.org/1999/XSL/Format)
[xmlserver] [WARN] [FOTreeBuilder] Mismatch: page-sequence 
(http://www.w3.org/19

99/XSL/Format) vs. flow (http://www.w3.org/1999/XSL/Format)
[xmlserver] [WARN] [BreakingAlgorithm] Line 1 of a paragraph overflows 
the avail

able area. (fo:block, "?")
[xmlserver] [WARN] [FOTreeBuilder] Mismatch: root 
(http://www.w3.org/1999/XSL/Fo

rmat) vs. page-sequence (http://www.w3.org/1999/XSL/Format)


Have you seen this FAQ on the website?

http://xmlgraphics.apache.org/fop/faq.html#saxexception-mismatch

The error means that something went wrong during the XSLT stage. Run 
your XML+XSLT using xalan directly instead of FOP to diagnose what goes 
wrong in your XSLT.


Thanks,

Chris


[xmlserver] [ERROR] [FOTreeBuilder] javax.xml.transform.
TransformerException: ja
va.lang.IllegalStateException: endElement() called for fo:root where 
there is no

 current element.
[xmlserver] [INFO] [XMLConnectionHandler] Processed XML document.
[xmlserver] [INFO] [XMLConnectionHandler] Job completed.
[xmlserver] SystemId Unknown; Line #0; Column #0; 
java.lang.IllegalStateExceptio

n: endElement() called for fo:root where there is no current element.


--
*Nathan*




-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Certain fonts cause FOP to crash

2012-01-25 Thread Marcin Tustin
Hi all,

I'm new to FOP. I'm using it to format documents to PCL.

The issue I've encountered is that certain fonts cause FOP to crash,
with the errors below (there is far more debug output, but this is the
stuff that seems most relevant). Is this a known issue? Is there a
workaround or solution?

I am performing the output by adapting the
org.docx4j.convert.out.pdf.viaXSLFO.Conversion class. I have attached
my code for completeness. This works just fine for documents with
certain other fonts.

24404 [main] DEBUG org.apache.fop.render.pcl.PCLDocumentHandler  -
Don't know how to handle extension object. Ignoring:
org.apache.xmlgraphics.xmp.Metadata@5e10
11d8 (org.apache.xmlgraphics.xmp.Metadata)
24407 [main] DEBUG org.apache.fop.render.pcl.PCLDocumentHandler  -
page size: java.awt.Dimension[width=595276,height=841890]
24407 [main] DEBUG org.apache.fop.render.pcl.PCLDocumentHandler  -
logical page: java.awt.Rectangle[x=17040,y=0,width=561120,height=841680]
24441 [main] DEBUG org.apache.xmlgraphics.image.loader.ImageManager  -
Chosen pipeline: null
24472 [main] ERROR org.apache.fop.apps.FOUserAgent  - Error while
rendering page 1. Reason: java.lang.RuntimeException:
org.apache.fop.render.intermediate.IFExc
eption: Error while painting marks using a bitmap
Exception in thread "main"
org.docx4j.openpackaging.exceptions.Docx4JException: FOP issues
at 
org.docx4j.convert.out.pdf.viaXSLFO.PclConversion.output(PclConversion.java:236)
at CreatePcl.main(CreatePcl.java:110)
Caused by: java.lang.RuntimeException:
org.apache.fop.render.intermediate.IFException: Error while painting
marks using a bitmap
at 
org.apache.fop.render.intermediate.IFRenderer.handleIFException(IFRenderer.java:189)
at 
org.apache.fop.render.intermediate.IFRenderer.access$200(IFRenderer.java:105)
at 
org.apache.fop.render.intermediate.IFRenderer$TextUtil.flush(IFRenderer.java:1149)
at 
org.apache.fop.render.intermediate.IFRenderer.renderText(IFRenderer.java:1020)
at 
org.apache.fop.render.AbstractRenderer.renderInlineArea(AbstractRenderer.java:620)
at 
org.apache.fop.render.intermediate.IFRenderer.renderInlineArea(IFRenderer.java:912)
at 
org.apache.fop.render.AbstractRenderer.renderInlineParent(AbstractRenderer.java:711)
at 
org.apache.fop.render.intermediate.IFRenderer.renderInlineParent(IFRenderer.java:929)
at 
org.apache.fop.render.AbstractRenderer.renderInlineArea(AbstractRenderer.java:628)
at 
org.apache.fop.render.intermediate.IFRenderer.renderInlineArea(IFRenderer.java:912)
at 
org.apache.fop.render.AbstractRenderer.renderLineArea(AbstractRenderer.java:609)
at 
org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:544)
at 
org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:581)
at 
org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:976)
at 
org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:534)
at 
org.apache.fop.render.AbstractRenderer.renderFlow(AbstractRenderer.java:432)
at 
org.apache.fop.render.AbstractPathOrientedRenderer.renderFlow(AbstractPathOrientedRenderer.java:665)
at 
org.apache.fop.render.AbstractRenderer.renderMainReference(AbstractRenderer.java:411)
at 
org.apache.fop.render.AbstractRenderer.renderBodyRegion(AbstractRenderer.java:345)
at 
org.apache.fop.render.AbstractRenderer.renderRegionViewport(AbstractRenderer.java:292)
at 
org.apache.fop.render.intermediate.IFRenderer.renderRegionViewport(IFRenderer.java:731)
at 
org.apache.fop.render.AbstractRenderer.renderPageAreas(AbstractRenderer.java:265)
at 
org.apache.fop.render.AbstractRenderer.renderPage(AbstractRenderer.java:230)
at 
org.apache.fop.render.intermediate.IFRenderer.renderPage(IFRenderer.java:580)
at 
org.apache.fop.area.RenderPagesModel.renderPage(RenderPagesModel.java:183)
at 
org.apache.fop.area.RenderPagesModel.checkPreparedPages(RenderPagesModel.java:164)
at 
org.apache.fop.area.RenderPagesModel.addPage(RenderPagesModel.java:137)
at 
org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.finishPage(AbstractPageSequenceLayoutManager.java:312)
at 
org.apache.fop.layoutmgr.PageSequenceLayoutManager.finishPage(PageSequenceLayoutManager.java:167)
at 
org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:109)
at 
org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:238)
at 
org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:120)
at 
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:349)
at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:177)
at 
org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerIdentityImpl.java:1102)
at 
com.sun

RE: FOP 1.0 support for 'page-postion=only'

2012-01-25 Thread Amick, Eric
The original was certainly over-specified, but I would have expected it to 
work. Unless I've misunderstood, "only" is true only when "first" and "last" 
are both true, and "rest" is true only when neither "first" nor "last" is true, 
so putting "last" at the end should have been OK.

Eric Amick   Systems Engineer II
Legislative Computer Systems


> -Original Message-
> From: Pascal Sancho [mailto:pascal.san...@takoma.fr]
> Sent: Wednesday, January 25, 2012 3:42
> To: fop-users@xmlgraphics.apache.org
> Subject: Re: FOP 1.0 support for 'page-postion=only'
> 
> Hi,
> 
> "only" works as expected.
> 
> Note that fo:conditional-page-master-reference order is taken into
> account within the fo:repeatable-page-master-alternatives.
> (this is a sequential test).
> 
> if you need a "only" master, you have to put it in 1st position,
> otherwise another one can be used.
> Same thing about "last" master, witch is probably more what you need in
> this case.


Re: FOP 1.0 support for 'page-postion=only'

2012-01-25 Thread Pascal Sancho
Hi,

"only" works as expected.

Note that fo:conditional-page-master-reference order is taken into
account within the fo:repeatable-page-master-alternatives.
(this is a sequential test).

if you need a "only" master, you have to put it in 1st position,
otherwise another one can be used.
Same thing about "last" master, witch is probably more what you need in
this case.

See attached example, and try to change order, or comment some parts.

Le 24/01/2012 20:21, FPar a écrit :
> 
> You are indeed right, that works, thank you! For some reason it didn't occur
> to me to not include the page position attribute for the "all-but-last"
> layout.
> 
> Haven't retried the "only" page-position yet (I'm interested in confirming
> that this works.)
> 
> 
> 
> Amick, Eric wrote:
>>
>> I'm probably missing something, but won't this do what you want?
>>
>> 
>>  
>>  > master-reference="letter-last"/>
>>  > master-reference="letter-all-but-last"/>
>>   
>> 
>>
>> Eric Amick   Systems Engineer II
>> Legislative Computer Systems
>>
>>> -Original Message-
>>> From: FPar [mailto:francis.pars...@verizon.net]
>>> Sent: Tuesday, January 24, 2012 8:09
>>> To: fop-users@xmlgraphics.apache.org
>>> Subject: Re: FOP 1.0 support for 'page-postion=only'
>>>
>>>
>>> Hmm, OK. The compliance page seems to be for all versions. Do you have
>>> an
>>> example of something that should work? I have a letter where there is a
>>> signature section that should appear (in the footer) of the last page
>>> (I
>>> want to keep it fixed to the bottom to the page). However, if the page
>>> is
>>> only one page long, I also want that signature section to appear.
>>>
>>> This is what I had that didn't work:
>>>
>>> 
>>> 
>>> >> master-reference="letter-last"/>
>>> >> master-reference="letter-all-but-last"/>
>>> >> master-reference="letter-all-but-last"/>
>>> >> master-reference="letter-last"/>
>>>
>>>
>>> 
>>> 
>>>
>>> Does this look correct? Should this work? Thanks for any help with
>>> this!
>>>
>>>
>>>
>>> Pascal Sancho wrote:

 Hi,

 Page compliance says that partial support concerns only FOP 0.95.
>>> Latter
 versions have full support for this property.

 After SVN check, the "only" support was added in rev 698280, witch
>>> was
 prior to FOP 1.0.

 So, page compliance is up to date (regarding that feature), and FOP
>>> 1.0
 should implement it fully.

-- 
Pascal

http://www.w3.org/1999/XSL/Transform"; xmlns:fo="http://www.w3.org/1999/XSL/Format";>
  

  
  

   
  
  

   
  
  


  
  


  




  

  
  

  Only


  First


  Last


  Other


  page 1
  page 2
  page 3

  



-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org