determine if block is before page-break

2005-09-27 Thread Prakash R
I have the following fo:

fo:block123/fo:block
fo:blockxyz/fo:block
fo:blockfo:leader//fo:block
fo:blockabc/fo:block
fo:blockdef/fo:block

I want to put the leader only if it is not followed by
a page break. Is there a way to determine if fo:leader
is followed by page break?

Thank you.
Prakash



__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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



Rép. : Re: FOP improvement up to 30 00%.

2005-09-27 Thread Willy Reinhardt
Hi,

I follow-up the discussion with interest and I also made a little test. 
So I use:
- Fop in command line with debug parameter version 0.20.5
- Xerces 2.6.2
or
- Crimson 1.1.3
- JDK 1.4.2
- fo file of 2.74 Mo (~50400 lines)
- OS Windows / CPU Intel 2.8GHz

I call for each parser 10 times the transformation results are:

Xerces:
135 ms/page
120 ms/page
119 ms/page
119 ms/page
117 ms/page
117 ms/page
116 ms/page
116 ms/page
117 ms/page
Average=120 ms/page

Crimson
114 ms/page
114 ms/page
114 ms/page
114 ms/page
114 ms/page
114 ms/page
114 ms/page
114 ms/page
114 ms/page
Average=114 ms/page

We can see Xerces optimize the transformation but the difference is only 5% 
faster for Crimson.

Willy

PS. To swap parser I change jar into endorsed directory of my JDK.


 [EMAIL PROTECTED]  
I share Jay's view here. It's unclear under which conditions the
measurements were taken.

I think it's difficult to tell which one is faster. I've found
benchmarks on the net which make Xerces the winner:
http://piccolo.sourceforge.net/bench.html
http://www.devsphere.com/xml/benchmark/summary.html#xml_parsers_xerces_versus_crimson

But there is also one by Sun which shows the opposite but never in the
area of factor 30. Since in the FOP use case only SAX parsing is
important, it could very well be that Crimson is faster. Validation may
influence the performance, too. Difficult to say.

Does anyone want to do a FOP benchmark with different combinations of
XML parser and XSLT processor and put that on the FOP Wiki? There are
lots of little aspects that influence the overall performance. I think that
would be cool. 

On 23.09.2005 16:55:43 JBryant wrote:
 Were the conditions of the two runs exactly the same? For example, if you 
 were timing the first run of the Xerces parser and the second run of the 
 Crimson parser, caching could account for much of the difference.
 
 Also, such items as configuration differences can have a large impact. If 
 you were using the default amount of memory, perhaps Xerces would benefit 
 from a change in that setting while Crimson may be more efficient in its 
 use of memory and not suffer from using the default. Thus, changing 
 configuration could account for at least some of the difference. Your 
 mention that This library give very poor performance where xml file is 
 large makes me think memory may be part of the difference.
 
 I'm sure other issues could factor into it as well.
 
 Of course, Crimson may simply be a much faster parser. I have heard good 
 things about Crimson from a number of quarters.
 
 Jay Bryant
 Bryant Communication Services
 (presently consulting at Synergistic Solution Technologies)
 
 
 
 
 
 Xaus, Jaume [EMAIL PROTECTED] 
 09/23/2005 05:50 AM
 Please respond to
 fop-users@xmlgraphics.apache.org
 
 
 To
 fop-users@xmlgraphics.apache.org
 cc
 
 Subject
 FOP improvement up to 3000%.
 
 
 
 
 
 
 
 
 
 
 
  
 Dear friends,
  
 We are using FOP api in order to build PDF documents from large Xml files.
  
 The FOP package distribution contains Xerces as xml parser. ([Debug] Using 
 org.apache.xerces.parsers.SAXParser as SAX2 Parser)
  
 This library give very poor performance where xml file is large.
  
 We improved up to 3000% the performance simplement changin Xerces for 
 Crimson library.([Debug] Using org.apache.crimson.parser.XMLReaderImpl as 
 SAX2 Parser)
  
 Does anyone know the reason off this performance difference ?
 Thanks  
  
 
 
 
 Jaume Xaus
 Director Departament Java
 [EMAIL PROTECTED]
 
 
 “La confianza, como el arte, nunca proviene de tener todas las respuestas, 
 sino de estar abierto a todas la preguntas.† 
 Earl Gray Stevens.
  
 
 
  
 
  
 
 --
 No virus found in this outgoing message.
 Checked by AVG Anti-Virus.
 Version: 7.0.344 / Virus Database: 267.11.5/110 - Release Date: 22/09/2005
cs.apache.org
For additional commands, e-mail: [EMAIL PROTECTED]



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



FOP and OC4J

2005-09-27 Thread George Mardale

Hi everybody,

I developed an application that generated PDF documents using FOP. I 
deployed the application on Tomcat and it worked ok. After that, I tried 
to deploy it on Oracle's OC4J and I got the following exception when 
trying to generate the PDF files:


XSL-1000: (Fatal Error) Error while parsing XSL file (Start of root element 
expected.).


Do you have an idea why this happens? I assume it's related to the xml 
parsers, but the xml-related jars bundled in the applications are the 
same on Tomcat and on OC4J.


Thank you for your time,
George.

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



generating PDF: in tomcat ok, bot not in OC4J

2005-09-27 Thread Thomas Koch






hello !i have a problem to generate pdf's on the a OC4J.in tomcat everything works fine.- so we get the stylesheet from database and generating pdf's.if i do the same on the OC4J i get following error:Servlet error: Error on pdf generation : XSL-1000: (Fatal Error) Errorwhile parsing XSL file (Start of root element expected.).org.apache.fop.apps.TraxInputHandler.initTransformer(TraxInputHandler.java:108)org.apache.fop.apps.TraxInputHandler.init(TraxInputHandler.java:100)i made a string out of the xslResourceStream in both cases and give it intothe exception-message (so i can see it in OC4J).i get a valid stylesheet every time.also if i read a minimal stylesheet like this following, i get the error.xsl:stylesheet version=1.1 xmlns:xsl=http://www.w3.org/1999/XSL/Transform xmlns:fo=http://www.w3.org/1999/XSL/Format xsl:template match=/ test /xsl:template/xsl:stylesheethave anybody experiences or ideas ?best regards










Re: determine if block is before page-break

2005-09-27 Thread JBryant
There's no way to detect it, but there is a way to prevent it from 
happening: Wrap those middle three blocks in a table, with each block 
going into its own row (and cell). Then specify keep-together on all the 
rows. Depending on your XSLT code, this can take some extra effort. 
Sometimes, you'll need to use predicates such as [position()=last()] to 
get the blocks you want to put in the table.

I understand that the upcoming version will support keeps on blocks, which 
will provide a simpler solution.

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Services)




Prakash R [EMAIL PROTECTED] 
09/27/2005 04:07 AM
Please respond to
fop-users@xmlgraphics.apache.org


To
fop-users@xmlgraphics.apache.org
cc

Subject
determine if block is before page-break






I have the following fo:

fo:block123/fo:block
fo:blockxyz/fo:block
fo:blockfo:leader//fo:block
fo:blockabc/fo:block
fo:blockdef/fo:block

I want to put the leader only if it is not followed by
a page break. Is there a way to determine if fo:leader
is followed by page break?

Thank you.
Prakash


 
__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.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]



more than one fo:flow in fo:page-sequence

2005-09-27 Thread Matthias Treitler
Hey guys!

I have had a problem with the latest fop a few days ago. I found out that only 
one fo:flow is permitted in the fo:page-sequence tag, but the Antenna House 
FO Parser allows more than one fo:flows! I also think this is the standard 
made by the W3C!

But then: What is if i have a region-before, region-body and maybe a 
region-after on one sheet (not a static-context)?!?  

Is this a bug, or a missing feature?

Best regards,
Matthias

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



Re: more than one fo:flow in fo:page-sequence

2005-09-27 Thread Andreas L Delmelle

On Sep 27, 2005, at 20:56, Matthias Treitler wrote:

Hi,

I have had a problem with the latest fop a few days ago. I found out 
that only
one fo:flow is permitted in the fo:page-sequence tag, but the Antenna 
House
FO Parser allows more than one fo:flows! I also think this is the 
standard

made by the W3C!


Sorry, but I disagree. The content-model of fo:page-sequence is:

(title?,static-content*,flow)

Which is to be read as:

- one or no fo:title
- zero or more fo:static-contents
- exactly one fo:flow

If it had been 'one or more flows', it would have been 'flow+'.

My best guess is that AntennaHouse allows this as a feature... Either 
that or the AH developers have grossly misinterpreted the XSL-FO Rec.




But then: What is if i have a region-before, region-body and maybe a
region-after on one sheet (not a static-context)?!?  


I'm sorry, I can't parse this question... Please clarify.


Cheers,

Andreas


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



Re: more than one fo:flow in fo:page-sequence

2005-09-27 Thread Andreas L Delmelle

On Sep 27, 2005, at 21:05, Andreas L Delmelle wrote:


On Sep 27, 2005, at 20:56, Matthias Treitler wrote:

Hi,

I have had a problem with the latest fop a few days ago. I found out 
that only
one fo:flow is permitted in the fo:page-sequence tag, but the Antenna 
House
FO Parser allows more than one fo:flows! I also think this is the 
standard

made by the W3C!


Sorry, but I disagree. The content-model of fo:page-sequence is:

(title?,static-content*,flow)


Or maybe you're referring to the XSL-FO 1.1 Rec, which FOP currently 
does not implement.


There indeed, more than one flow may be put inside a page-sequence, and 
mapped to the regions using fo:flow-map...


Sorry if I came across as rude. Should have checked this before I 
answered.



Cheers,

Andreas


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



Re: more than one fo:flow in fo:page-sequence

2005-09-27 Thread Andreas L Delmelle

On Sep 27, 2005, at 21:09, Andreas L Delmelle wrote:



Or maybe you're referring to the XSL-FO 1.1 Rec, which FOP currently 
does not implement.


Which isn't a 'Rec' yet either BTW... It's still a 'Working Draft'.


Where *is* my head at...? :-S


Cheers,

Andreas


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



Re: more than one fo:flow in fo:page-sequence

2005-09-27 Thread JBryant
 Where *is* my head at...? :-S

Where it belongs - in the code for the new version. :D

My 2 cents: Until 1.1 is a rec (rather than a draft), the FOP team should 
hold off on supporting it. So, until then, FOP should support only one 
flow per page sequence.

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)

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



Re: more than one fo:flow in fo:page-sequence

2005-09-27 Thread Matthias Treitler
Hi!

  But then: What is if i have a region-before, region-body and maybe a
  region-after on one sheet (not a static-context)?!?  

 I'm sorry, I can't parse this question... Please clarify.

Ok, i want to make a head, a body  and a foot part of my site! So i have to 
implement a xsl-region-before, xsl-region-body and xsl-region-after part on 
my site! You understand?!?
But i can only implement a fo:flow flow-name=xsl-region-before or  a 
fo:flow flow-name=xsl-region-body but not both! So what should i do in 
that case?!


Best regards,
Matthias

PS: Sorry for my bad english style!

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



Re: more than one fo:flow in fo:page-sequence

2005-09-27 Thread Glen Mazza

Andreas L Delmelle wrote:


Sorry, but I disagree. The content-model of fo:page-sequence is:

(title?,static-content*,flow)



Or maybe you're referring to the XSL-FO 1.1 Rec, which FOP currently 
does not implement.


There indeed, more than one flow may be put inside a page-sequence, and 
mapped to the regions using fo:flow-map...




I think the XSL WG will be increasing the amount of documentation in the 
1.1 WD that describes how multiple flows and flow-maps will work.


Alongside multiple fo:flows, in the 1.1 WD, fo:simple-page-master has 
been expanded to allow multiple fo:region-bodies (although perhaps it 
would have been nicer if they kept fo:s-p-m unchanged and created a new 
fo:page-master that would have this advanced functionality.)  I am 
guessing an fo:flow-map would not really be needed for multiple flows; 
just have one fo:flow refer to one fo:region-body and a second fo:flow 
refer to another fo:region-body within the fo:s-p-m.


The fo:flow-map (again, my guess), is for when you want the contents of 
one fo:flow to flow from one fo:region-body to another within the same 
fo:simple-page-master.  Anyway, this will be fun 1.1 stuff for the FOP 
team and user community.


Glen

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



Re: more than one fo:flow in fo:page-sequence

2005-09-27 Thread JBryant
Ok, i want to make a head, a body  and a foot part of my site! So i have 
to 
implement a xsl-region-before, xsl-region-body and xsl-region-after part 
on 
my site! You understand?!?
But i can only implement a fo:flow flow-name=xsl-region-before or  a 
fo:flow flow-name=xsl-region-body but not both! So what should i do in 

that case?!

---

Here's how (a trimmed down portion of one of my XSL files that I use to 
produce a data dictionary):

  xsl:template match=/
fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
  fo:layout-master-set
fo:simple-page-master master-name=first
  fo:region-body region-name=first /
/fo:simple-page-master
fo:simple-page-master master-name=contents
  fo:region-body region-name=contents margin-top=1in 
margin-bottom=1in /
  fo:region-before region-name=header-contents extent=1in /
  fo:region-after region-name=footer-contents extent=1in /
/fo:simple-page-master
  /fo:layout-master-set
  fo:page-sequence master-reference=first
fo:flow flow-name=first
  fo:block xsl:use-attribute-sets=doctitle
!-- Title and legal page blocks go here --
  /fo:block
/fo:flow
  /fo:page-sequence
  fo:page-sequence master-reference=contents 
initial-page-number=1 format=i
fo:static-content flow-name=header-contents
  fo:block xsl:use-attribute-sets=body
!-- header stuff goes here --
  /fo:block
/fo:static-content 
fo:static-content flow-name=footer-contents
  fo:block xsl:use-attribute-sets=footercenter
!-- footer stuff goes here --
  /fo:block
/fo:static-content 
fo:flow flow-name=contents
  fo:block xsl:use-attribute-sets=pagetitle1 id=contents
Contents
  /fo:block
  fo:block xsl:use-attribute-sets=contents1
  fox:outline internal-destination=contents
fox:labelContents/fox:label
  /fox:outline
  xsl:apply-templates mode=contents /
/fo:flow
  /fo:page-sequence
  fo:page-sequence master-reference=main initial-page-number=1
fo:static-content flow-name=header-main
  fo:block xsl:use-attribute-sets=body
!-- header stuff goes here --
  /fo:block
/fo:static-content 
fo:static-content flow-name=footer-main
  fo:block xsl:use-attribute-sets=footercenter
!-- footer stuff goes here --
  /fo:block
/fo:static-content 
fo:flow flow-name=xsl-region-body
  !-- build the bookmarks --
  xsl:apply-templates mode=bookmark /
  !-- build the body content --
  xsl:apply-templates /
/fo:flow
  /fo:page-sequence
!-- and so on --

Notice the ways names map from the simple-page-masters to the named 
portions within page-sequences.

HTH

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)

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



Font embedding FOP dev

2005-09-27 Thread Dirk Bromberg

Hi,

i wants to test to switch my project from 20.5 to dev.

Now i want to embedd my ttf fonts via the fop.xconf.
There i've these entrys:
font metrics-url=ArialUNI.xml kerning=yes embed-url=ARIALUNI.TTF
   font-triplet name=ArialUNI style=normal weight=normal/
/font

Now i call:

File userConfigFile = new File(basePath+/confdir/fop.xconf);
fop.getUserAgent().setUserConfig(new 
DefaultConfigurationBuilder().buildFromFile(userConfigFile));


but i always get the exception D:\mypath_to_run\ArialUNI.xml 
FileNotFoundException  the Path is not relative to the xconf! it is 
relative to my running directory.


How can i set the right directory? I've tried to set the 
D:\mypath_to_run\confdir as basePath via the  
fop.getUserAgent().setBaseURL(...) but there was no change...


How to do?

Thanks

Dirk

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



Re: more than one fo:flow in fo:page-sequence

2005-09-27 Thread Glen Mazza

Matthias Treitler wrote:


Ok, i want to make a head, a body  and a foot part of my site! So i have to 
implement a xsl-region-before, xsl-region-body and xsl-region-after part on 
my site! You understand?!?
But i can only implement a fo:flow flow-name=xsl-region-before or  a 
fo:flow flow-name=xsl-region-body but not both! So what should i do in 
that case?!




(site = Seite = page?)  I don't understand why you just don't use 
fo:static-content for your header and footer.  I guess I'm missing 
something from your problem that Jay is apparently picking up.


Glen

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



Re: Font embedding FOP dev

2005-09-27 Thread Andreas L Delmelle

On Sep 27, 2005, at 22:27, Dirk Bromberg wrote:


i wants to test to switch my project from 20.5 to dev.

Now i want to embedd my ttf fonts via the fop.xconf.

snip /
but i always get the exception D:\mypath_to_run\ArialUNI.xml 
FileNotFoundException  the Path is not relative to the xconf! it 
is relative to my running directory.


Ouch! The user-configuration functionality is not fully ported yet, 
especially the baseURL bit... Sorry. The entry is present in fop.xconf, 
but currently serves no purpose.


Since I do need to finish up a few things in that area of the code, 
most likely I'll be able to squeeze it in during the weekend.


How can i set the right directory? I've tried to set the 
D:\mypath_to_run\confdir as basePath via the  
fop.getUserAgent().setBaseURL(...) but there was no change...


The only way I see that might --note: not 100% sure-- temporarily solve 
your problem is to include the full pathnames in the font-triplet 
(possibly even as full 'file://' URLs to avoid them from being 
interpreted as a relative URLs)


Why the baseURL isn't taken into account when building the font-list, 
I'm not certain, but this does mean that even if I complete the 
user-configurable baseURL, it still won't work as it did before...


For now, try out with absolute URLs in the triplets. As far as I 
understand the related code, that should do the trick.


If not, don't hesitate to report back.

HTH!

Cheers,

Andreas


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



Re: Font embedding FOP dev

2005-09-27 Thread Manuel Mall
On Wed, 28 Sep 2005 05:07 am, Andreas L Delmelle wrote:
 On Sep 27, 2005, at 22:27, Dirk Bromberg wrote:
  i wants to test to switch my project from 20.5 to dev.
 
  Now i want to embedd my ttf fonts via the fop.xconf.

 snip /

  but i always get the exception D:\mypath_to_run\ArialUNI.xml
  FileNotFoundException  the Path is not relative to the xconf!
  it is relative to my running directory.

 Ouch! The user-configuration functionality is not fully ported yet,
 especially the baseURL bit... Sorry. The entry is present in
 fop.xconf, but currently serves no purpose.

 Since I do need to finish up a few things in that area of the code,
 most likely I'll be able to squeeze it in during the weekend.

  How can i set the right directory? I've tried to set the
  D:\mypath_to_run\confdir as basePath via the
  fop.getUserAgent().setBaseURL(...) but there was no change...

 The only way I see that might --note: not 100% sure-- temporarily
 solve your problem is to include the full pathnames in the
 font-triplet (possibly even as full 'file://' URLs to avoid them from
 being interpreted as a relative URLs)

 Why the baseURL isn't taken into account when building the font-list,
 I'm not certain, but this does mean that even if I complete the
 user-configurable baseURL, it still won't work as it did before...

 For now, try out with absolute URLs in the triplets. As far as I
 understand the related code, that should do the trick.


This is a known problem with the trunk code (see 
http://issues.apache.org/bugzilla/show_bug.cgi?id=36729). I had a look 
at fixing it but it involves changes to the font subsystem. That area 
of code is currently being completely rewritten (integration of a 3rd 
party font system) and I would expect this to be fixed as part of that 
work. However, this may not happen in a real hurry.

For the time being you have to use absolute paths or to be more correct 
full URLs in your font definition files, that is everything must start 
with file:// as Andreas suggested and be fully qualified.

 If not, don't hesitate to report back.

 HTH!

 Cheers,

 Andreas

Manuel

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