Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HTML to PDF using Apache FOP

 
Pankaj Upadhyay
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
 
Paul Clapham
Sheriff
Posts: 21416
33
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