permaculture playing cards*
The moose likes XML and Related Technologies and the fly likes XHTML to PDF Transformation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XHTML to PDF Transformation" Watch "XHTML to PDF Transformation" New topic
Author

XHTML to PDF Transformation

Prakash Dwivedi
Ranch Hand

Joined: Sep 28, 2002
Posts: 452
Hello Friends,
I am using cocoons to transform xhtml to pdf, but my problem is that it requires xsl file for transformation. Is there any already available xls file which can do that for me. That is match all the xhtml tags to corresponding xsl-fo tags.
Thanks


Prakash Dwivedi (SCJP2, SCWCD, SCBCD)
"Failure is not when you fall down, Its only when you don't get up again"
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
I'm using FOP (xml to pdf )for the past few monthns and to my knowledge the answer is NO.
Axel Janssen
Ranch Hand

Joined: Jan 08, 2001
Posts: 2164
just curious:
Does cocoon use fop or do they have their own mechanism?
I am working for 1.5 weeks now with fop. Not easy but o.k.
Important when you embed larger images: Set jvm heap size up with -Xmx -Xms option! This one drove me nuts yesterday.
Axel
Prakash Dwivedi
Ranch Hand

Joined: Sep 28, 2002
Posts: 452
Hello friends,
thanx for the response. can you plz tell me from where can i learn writing xsl-fo tags(as there is no other option i think).
Also I need to convert xml/xhtml document to pdf as well as in rtf formats. exapmle of how to convert xml to pdf is available in cocoon page. but i could not find any example of how to convert xml to rtf(using coccoon).
Thanx in advance
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by Axel Janssen:
just curious:
Does cocoon use fop or do they have their own mechanism?
Axel

Yes Cocoon is using apache fop only, if you look at the lib folder of cocoon, you can see the jar file.
I still haven't received my Cocoon 2 Programming: Web Publishing with XML and Java book from Javaranch, once I have it I can tell you for sure
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by Prakash Dwivedi:
Hello friends,
where can i learn writing xsl-fo tags(as there is no other option i think).
how to convert xml to rtf.
Thanx in advance

there is lot of tutorial available in internet now, search in google with keyword "Fop Tutorial"
u can try this tutorial http://www.ibiblio.org/xml/books/bible2/chapters/ch18.html or the best option is to download the fop package and start running the examples by modifying them a little by little, IBM is also having also a tutorial on FOP(forgot the link)
Some live fop examples were hosted on this site http://www.webappcore.com/fop/pages/welcome.jsp
Axel Janssen
Ranch Hand

Joined: Jan 08, 2001
Posts: 2164
There is a specialiced book about xsl-fo, I have put in one of the slots of my O'Reilly safari bookshelf.
I used the examples and the free chapter of xml-bible more often than the book. Book goes often too deep for my taste. It might be more usefull if you allready got the basics of xsl-fo.
Axel
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by Axel Janssen:

Important when you embed larger images: Set jvm heap size up with -Xmx -Xms option! This one drove me nuts yesterday.
Axel

Another important things
1. Don't scale down the image sixe in xsl:fo, avoid resizing image size: orginal size:10x20, xsl:fo size 5x10, will create processing cost, better create a new original with 5x10 size.
2. Use PNG images than jpg or gif or bmp etc., requires little jar configuraition.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: XHTML to PDF Transformation
 
Similar Threads
Getting error in XSL Transformation
how to transform mixed xml+html file?
how to see the result of XSL-FO Document
Sample Questions
[XSL/FO] displaying date in pdf file