This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

HTML to PDF using Apache FOP

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All

I am using Apache FOP technology to convery an HTML document into a PDF. Since the day this functionality was developed, it is broken and I found out that if generated HTML contains "nbsp;" Pdf generation fails and I get the message that the file is damaged.

I am using xhtml2fo.xsl for rendering of the FO elements which is an open source tool for rendering onto PDF document.

I think I have to customize the xsl but I dont know how to do that. Can anyone suggest a way to achieve that? Are any other tools available in the market? Howz iText in converting HTML to PDF?

Let me know if you need more details from my side.

Thanks,
Pankaj
 
Sheriff
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm just guessing here, because you didn't post any error messages. And you didn't tell us what you were using to parse the HTML either. Or what version of HTML it was. So all I can suggest is that you use a proper HTML parser instead of an XML parser (if that's what you are doing) or make sure your parser accesses the DTD properly (the one which contains the definitions of all the HTML entities).
 
Pankaj Upadhyay
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul

I am using iFrame's DesignMode property to show an editor. User performs some operation which generates default HTML elements. I just add HTML and BODY tage beafore and after the content and then use Tidy to verify my HTML and then use FOP.

Hope I am clear, if not let me know what else info you require.

Regards,
Pankaj
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!