• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HTML to PDF using Apache FOP

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Marshal
Posts: 28245
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
The moustache of a titan! The ad of a flea:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic