XSL-FO causing Fop 0.94 to go into an infinite Loop (Urgent)

2007-11-15 Thread Ankur Narain Bhardwaj ,Gurgaon

Hi

 

Attached here is an XSL-FO that causes the FOP 0.94 to go into an infinite 
loop. This is causing serious problems in our application. I narrowed down the 
problem to an fo:block /fo:block  element placed within the footnote. 
This block element contains the character Â. This character may be the cause 
for the FOP 0.94 to go into an infinite loop depending on certain data in the 
XSL-FO. When fo:block /fo:block is removed from the footnote the PDF will 
generate. However I am baffled as to why this FOP 0.94 goes into an infinite 
loop. Whatever the issue, FOP 0.94 shouldn't go into an infinite loop. It 
should throw an exception if it has problems with the XSL-FO. It appears to be 
a serious issue or Bug with FOP 0.94. Can some apache FOP developer confirm 
whether this is a problem or not? This is urgent.

 

Regards

Ankur 



DISCLAIMER:
---

The contents of this e-mail and any attachment(s) are confidential and intended 
for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. 
Any views or opinions presented in 
this email are solely those of the author and may not necessarily reflect the 
opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, 
distribution and / or publication of 
this message without the prior written consent of the author of this e-mail is 
strictly prohibited. If you have 
received this email in error please delete it and notify the sender 
immediately. Before opening any mail and 
attachments please check them for viruses and defect.

---

debug.fo
Description: debug.fo
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

How to omitt a sequence

2007-11-15 Thread MichaelNie

I have the following setup:

1. sequence for index page
2. sequence for the toc
3. sequence for the content

Now when the content doesn't contain any element XY I don't want the toc
page to be created at all.
I surrounded the toc sequence like that:

xsl:if test=count(XY)  0
  fo:page-sequence master-reference=PageMaster
  fo:flow flow-name=xsl-region-body   
fo:block
  xsl:call-template name=toc /
/fo:block
  /fo:flow
  /fo:page-sequence
/xsl:if

If at least on XY element exists the toc is generated properly but that's
not the case a blank page is put between the index page and the content. I
don't know what causes this blank page.

regards Michael
-- 
View this message in context: 
http://www.nabble.com/How-to-omitt-a-sequence-tf4811012.html#a13765117
Sent from the FOP - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



font problem ugrading from 0.93 to 0.94

2007-11-15 Thread Alexander Lohse

Hi,

I am having trouble upgrading from 0.93 to 0.94.

Is there any significant change regarding font handling in 0.94?

I get a  java.lang.RuntimeException: Cannot load font. No font URIs  
available.


I use a handrolled URIResolver, which shows no problems reading the  
fonts from the config-xml, and nicely delivers StreamSource from  
InputStream from JAR.


Is there a way to display a more verbose error message, maybe  
containing a font name, which URI is missing?


From my config-xml:

[SNIPPET]

fop version=1.0

base.//base

font-base.//font-base

source-resolution72/source-resolution
target-resolution72/target-resolution
renderers

renderer mime=application/pdf
  fonts

!-- Bauhaus --
font metrics-url=file:font/bauhaus/ITCBAUHH.xml  
kerning=yes embed-url=file:font/bauhaus/ITCBAUHH.PFB
font-triplet name=Bauhaus style=normal  
weight=900 /!-- Heavy --

/font


...

[/SNIPPET]

Thank you in advance,

Alex
__

Alexander Lohse • Entwicklungsleitung  Projektmanagement
Tel +49 38374 752 11 • Fax +49 38374 752 23
http://www.humantouch.de

Human Touch Medienproduktion GmbH
Am See 1 • 17440 Klein Jasedow • Deutschland

Geschäftsführung:
Lara Mallien, Nele Hybsier, Alexander Lohse, Johannes Heimrath (Senior)
Handelsregister Stralsund • HRB 4192 • USt-IdNr. DE128367684



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: XSL-FO causing Fop 0.94 to go into an infinite Loop (Urgent)

2007-11-15 Thread Vincent Hennebert
Hi,

Ankur Narain Bhardwaj ,Gurgaon wrote:
 Hi
 
 Attached here is an XSL-FO that causes the FOP 0.94 to go into an infinite 
 loop. This is causing serious problems in our application. I narrowed down 
 the problem to an fo:block /fo:block  element placed within the 
 footnote. This block element contains the character Â. This character may be 
 the cause for the FOP 0.94 to go into an infinite loop depending on certain 
 data in the XSL-FO. When fo:block /fo:block is removed from the 
 footnote the PDF will generate. However I am baffled as to why this FOP 0.94 
 goes into an infinite loop. Whatever the issue, FOP 0.94 shouldn't go into an 
 infinite loop. It should throw an exception if it has problems with the 
 XSL-FO. It appears to be a serious issue or Bug with FOP 0.94. Can some 
 apache FOP developer confirm whether this is a problem or not? This is urgent.

Please download the sources of FOP 0.94 and apply the attached patch 
from the root of the project. That should solve your particular problem 
although there are other problems related to footnotes. Please don’t use 
FOP Trunk as it is unstable ATM.

The problem is that there is not enough room for the footnote on the 
second page, so it has to be deferred to the third page, and without the 
attached patch FOP makes a computation error when trying to split the 
footnote (which can’t be split in this case, anyway), entering an 
infinite loop. This issue is not related to FOP 0.94 and probably exists 
since 0.90 alpha 1...

That said, the fact that the footnote will be deferred to the next page 
will lead to a visually unpleasant result that you will probably want to 
avoid, by somehow leaving place to the footnote.

HTH,
Vincent
Index: src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java
===
--- src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java	(revision 562946)
+++ src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java	(working copy)
@@ -550,6 +550,7 @@
 splitLength += element.getW();
 } else {
 // element is a penalty
+bPrevIsBox = false;
 if (element.getP()  KnuthElement.INFINITE) {
 // end of the sub-sequence
 index = noteListIterator.previousIndex();

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: How to omitt a sequence

2007-11-15 Thread Chris Bowditch

MichaelNie wrote:

snip/


xsl:if test=count(XY)  0
  fo:page-sequence master-reference=PageMaster
  fo:flow flow-name=xsl-region-body   
fo:block

  xsl:call-template name=toc /
/fo:block
  /fo:flow
  /fo:page-sequence
/xsl:if

If at least on XY element exists the toc is generated properly but that's
not the case a blank page is put between the index page and the content. I
don't know what causes this blank page.


The problem is caused not by the logic above, but by the default value 
for attribute force-page-count being auto on the fo:page-sequence element.


Specify force-page-count=no-force on fo:page-sequence and it should 
fix your problem.


Chris



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Attribute Extension

2007-11-15 Thread Jeremias Maerki
You can let FOP ignore your extension namespace by registering it in the
FopFactory:
FopFactory fopFactory = 
fopFactory.ignoreNamespace(http://foo.com/mynamespace;);

Or is this functionality you hacked into the old FOP and you have to
reimplement it now?

Jeremias Maerki



On 15.11.2007 14:27:09 mckacl wrote:
 
 Our software uses the old version of FOP,  and I am attempting to upgrade to
 the new version.  Unfortunately, several custom attributes were added to the
 xml.
 
 fo:block-container
  annotation 
  container-name
  overflow-to
  smallest-font-size
 
 fo:simple-page-master
  page-group
  
 
 
 
 
 Jeremias Maerki-2 wrote:
  
  Yes. If it's enough to handle your case, I don't know. What's your
  requirement?
  
  Jeremias Maerki
  
  
  
  On 14.11.2007 23:16:44 mckacl wrote:
  
  In the current version of FOP, is there a mechanism to handle custom
  attributes?
  
  Thanks
  -- 
  View this message in context:
  http://www.nabble.com/Attribute-Extension-tf4808374.html#a13757702
  Sent from the FOP - Users mailing list archive at Nabble.com.
  
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
 
 -- 
 View this message in context: 
 http://www.nabble.com/Attribute-Extension-tf4808374.html#a13767545
 Sent from the FOP - Users mailing list archive at Nabble.com.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Attribute Extension

2007-11-15 Thread mckacl

Our software uses the old version of FOP,  and I am attempting to upgrade to
the new version.  Unfortunately, several custom attributes were added to the
xml.

fo:block-container
 annotation 
 container-name
 overflow-to
 smallest-font-size

fo:simple-page-master
 page-group
 




Jeremias Maerki-2 wrote:
 
 Yes. If it's enough to handle your case, I don't know. What's your
 requirement?
 
 Jeremias Maerki
 
 
 
 On 14.11.2007 23:16:44 mckacl wrote:
 
 In the current version of FOP, is there a mechanism to handle custom
 attributes?
 
 Thanks
 -- 
 View this message in context:
 http://www.nabble.com/Attribute-Extension-tf4808374.html#a13757702
 Sent from the FOP - Users mailing list archive at Nabble.com.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Attribute-Extension-tf4808374.html#a13767545
Sent from the FOP - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: font problem ugrading from 0.93 to 0.94

2007-11-15 Thread Chris Bowditch

Alexander Lohse wrote:


Hi,

I am having trouble upgrading from 0.93 to 0.94.

Is there any significant change regarding font handling in 0.94?


Yes, Font autodetection was added which saw some major changes in the 
way Font Configuration works. There was also a change around the 
handling or URIs. See [1] for a full list of changes.




I get a  java.lang.RuntimeException: Cannot load font. No font URIs  
available.


The font-base looks wrong to me. If you change it to an absolute path 
does the problem go away?




I use a handrolled URIResolver, which shows no problems reading the  
fonts from the config-xml, and nicely delivers StreamSource from  
InputStream from JAR.


Is there a way to display a more verbose error message, maybe  
containing a font name, which URI is missing?


Not sure. perhaps someone else will know.

Chris

[1] http://xmlgraphics.apache.org/fop/changes.html#version_0.94





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Attribute Extension

2007-11-15 Thread mckacl

This is functionality that was hacked into the old framework.  Now I am stuck
cleaning up the mess.  I would like to implement all of the functionality
with extensions so we avoid this problem in the future.

I did see some conversations in the mail archive about attribute extensions. 
Are there plans to add additional support in the future?

Thanks for taking the time to answer my questions.



Jeremias Maerki-2 wrote:
 
 You can let FOP ignore your extension namespace by registering it in the
 FopFactory:
 FopFactory fopFactory = 
 fopFactory.ignoreNamespace(http://foo.com/mynamespace;);
 
 Or is this functionality you hacked into the old FOP and you have to
 reimplement it now?
 
 Jeremias Maerki
 
 
 
 On 15.11.2007 14:27:09 mckacl wrote:
 
 Our software uses the old version of FOP,  and I am attempting to upgrade
 to
 the new version.  Unfortunately, several custom attributes were added to
 the
 xml.
 
 fo:block-container
  annotation 
  container-name
  overflow-to
  smallest-font-size
 
 fo:simple-page-master
  page-group
  
 
 
 
 
 Jeremias Maerki-2 wrote:
  
  Yes. If it's enough to handle your case, I don't know. What's your
  requirement?
  
  Jeremias Maerki
  
  
  
  On 14.11.2007 23:16:44 mckacl wrote:
  
  In the current version of FOP, is there a mechanism to handle custom
  attributes?
  
  Thanks
  -- 
  View this message in context:
  http://www.nabble.com/Attribute-Extension-tf4808374.html#a13757702
  Sent from the FOP - Users mailing list archive at Nabble.com.
  
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
 
 -- 
 View this message in context:
 http://www.nabble.com/Attribute-Extension-tf4808374.html#a13767545
 Sent from the FOP - Users mailing list archive at Nabble.com.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Attribute-Extension-tf4808374.html#a13770282
Sent from the FOP - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Attribute Extension

2007-11-15 Thread Jeremias Maerki
Well, there are limits what can be done with extensions. At the moment,
it is mainly possible to access extension attributes from within the
existing code (built-in extensions). If your extensions affect the
workings of layout managers, for example, you might need to extend them
and register them within FOP. This should be possible although I don't
know if anyone tried it before. But to what extent such extensions are
possible remains to be seen. Sometimes it simply means we have to
improve FOP in certain areas to make it better.

Anyway, I would like to invite you to participate in the project as a
contributor. Subscribe to the fop-dev mailing list and work with us.
Maybe if you explained the extensions you need (i.e. provide short
specification for them), we can help you identify whether it makes sense
to have them at all or if there may not be better solutions. Maybe we
find that other people could use some of your ideas, too. That's how
open source is intended to work: Collaboratively develop software, share
development costs. Everyone profits from someone else's work. Everyone
is invited to help improve FOP. Obviously, what's been done until now at
your company wasn't the best way to protect investments. The project
actually needs people like you who want to make it better. Otherwise,
you're just at the mercy of some group of people who do what they (!)
need and when they (!) have time/resources.

Jeremias Maerki



On 15.11.2007 16:02:20 mckacl wrote:
 
 This is functionality that was hacked into the old framework.  Now I am stuck
 cleaning up the mess.  I would like to implement all of the functionality
 with extensions so we avoid this problem in the future.
 
 I did see some conversations in the mail archive about attribute extensions. 
 Are there plans to add additional support in the future?
 
 Thanks for taking the time to answer my questions.
 
 
 
 Jeremias Maerki-2 wrote:
  
  You can let FOP ignore your extension namespace by registering it in the
  FopFactory:
  FopFactory fopFactory = 
  fopFactory.ignoreNamespace(http://foo.com/mynamespace;);
  
  Or is this functionality you hacked into the old FOP and you have to
  reimplement it now?
  
  Jeremias Maerki
  
  
  
  On 15.11.2007 14:27:09 mckacl wrote:
  
  Our software uses the old version of FOP,  and I am attempting to upgrade
  to
  the new version.  Unfortunately, several custom attributes were added to
  the
  xml.
  
  fo:block-container
   annotation 
   container-name
   overflow-to
   smallest-font-size
  
  fo:simple-page-master
   page-group
   
  
  
  
  
  Jeremias Maerki-2 wrote:
   
   Yes. If it's enough to handle your case, I don't know. What's your
   requirement?
   
   Jeremias Maerki
   
   
   
   On 14.11.2007 23:16:44 mckacl wrote:
   
   In the current version of FOP, is there a mechanism to handle custom
   attributes?
   
   Thanks
   -- 
   View this message in context:
   http://www.nabble.com/Attribute-Extension-tf4808374.html#a13757702
   Sent from the FOP - Users mailing list archive at Nabble.com.
   
   
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   
   
   
  
  -- 
  View this message in context:
  http://www.nabble.com/Attribute-Extension-tf4808374.html#a13767545
  Sent from the FOP - Users mailing list archive at Nabble.com.
  
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
 
 -- 
 View this message in context: 
 http://www.nabble.com/Attribute-Extension-tf4808374.html#a13770282
 Sent from the FOP - Users mailing list archive at Nabble.com.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Fop layout question

2007-11-15 Thread Peter Coppens

Gentlepeople

Assume the following fo structure 

  fo:block-container width=600pt top=0pt  overflow=hidden
left=0.0pt 
height=280pt absolute-position=fixed

fo:block linefeed-treatment=ignore
  fo:block margin-top=aa text-align=left line-height=bb
   fo:inline color=rgb(11,51,60) font-family=a font font-size=cc
 Some test
   /fo:inline
  /fo:block
/fo:block

/fo:block-container

I am trying to figure where the base line (let's say) of the characters will
end up based on the values of margin-top, line-height and possibly the
relevant font properties

Would anyone have any pointers to information that would help me to get
started. I am sure it's in the fo spec, but i have not enough time to try
and get my brain around that document (assuming I would ever succeed).

Many thanks indeed!

Peter
-- 
View this message in context: 
http://www.nabble.com/Fop-layout-question-tf4815030.html#a13774821
Sent from the FOP - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Capturing FOP logging message event in an embedded application using FOP 0.94

2007-11-15 Thread Andreas L Delmelle

On Nov 14, 2007, at 13:24, Michael Tracey Zellmann wrote:

Hi

Sorry for the late reply...


Thanks for the response.

I am trying to think of a way to still succeed.

What I want to do is to send all logging messages from anything  
related to FOP to their own file.


In the logging.properties, I tried:
org.apache.fop.FileHandler = java.util.logging.FileHandler
org.apache.fop.FileHandler.pattern = logs/docgen.log
org.apache.fop.FileHandler.limit = 5000
org.apache.fop.FileHandler.formatter =  
java.util.logging.SimpleFormatter


Where does org.apache.fop.FileHandler come from? Is that a class of  
your own?
Note that changing logging.properties meddles with your global Java  
defaults.


FOP uses Jakarta Commons Logging [http://commons.apache.org/logging/]  
as a bridge to a specific logging implementation, which uses JDK  
logging by default.
The Log implementation to be used can only be changed by setting a  
system property, or by setting a configuration attribute on the  
LogFactory, named org.apache.commons.logging.Log


FOP uses the default JCL LogFactoryImpl, and obtains class-based  
Loggers that capture the log-output.


One way that /might/ work in an embedded context:
- implement an org.apache.fop.apps.FileLog
- set the above configuration attribute to match this implementation  
on the org.apache.commons.LogFactory prior to starting FOP


Although this could lead to trouble when running multiple Fop  
instances concurrently.
Since a lot (if not all) of FOP's loggers are statics, they are  
initialized when the class is loaded, so two threads will share the  
same loggers, and thus be writing to the same file. Make sure that  
access is synchronized, and you will still end up with log messages  
from different threads merged into the same file, unless you sort  
that out yourself.


Probably the better way for FOP (well, it's a start):
- implement a more generic org.apache.fop.apps.Log, that raises  
events on an associated Listener
- set the above config attribute on LogFactory prior to doing  
anything else, except

- offer the user a hook to plug in a custom event handler

The Log instance that raises the events should ideally be tied to the  
FOUserAgent.


Still unsure how to fit in the static loggers :/
Maybe, to minimize the amount of refactoring, FTM we could do:
- implement a simple org.apache.fop.apps.StaticLog
- initialize all static loggers in static blocks and call  
LogFactory.setAttribute() to use this type


The StaticLog.info() events and above, could get overloads that  
accept an instance-based logger (the one tied to the user agent) on  
which they register those events.
Should you decide to take steps in this direction, since this is  
becoming a rather pressing matter, IMO, I'm willing to invest some  
time in this as well.



HTH!

Cheers

Andreas

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]