This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing 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
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Converting a jsp page to PDF using JTidy

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I am trying to convert a jsp page to pdf using Jtidy and I am using Itex-2.0.8, When I try to run my code I am getting an exception

Exception in thread "main" java.lang.NullPointerException
at org.xhtmlrenderer.pdf.ITextRenderer.createPDF(ITextRenderer.java:288)

at org.xhtmlrenderer.pdf.ITextRenderer.createPDF(ITextRenderer.java:246)

at FirstDoc.main(FirstDoc.java:85)

I am using the following code

can anyone help me to resolve the Issue.

Thanks in advance
 
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

In the future, please UseCodeTags when posting code of any length. It's unnecessarily hard to read the code as it is, making it less likely that people will bother to do so. I have added those for you here.
 
Sheriff
Posts: 24654
58
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It appears this is a question about this Itex product. I don't particularly see anything about XML in the question. So let's move it to a more appropriate forum.
 
Ulf Dittmer
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, I think it's neither about iText, nor JTidy, but about the FlyingSaucer library (which comes as org.xhtmlrenderer.*)

Have you checked that the output of JTidy is a proper representation of the web page you're trying to render? And is still so after you add the CSS element?
 
Paul Clapham
Sheriff
Posts: 24654
58
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, right, I didn't recognize "Itex" as meaning "iText". (Excuse: it's early in the morning. ) But at any rate the FlyingSaucer library is open source, so this is still the right forum.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

Think you forgot renderer.layout(); Here's my version (modified end of your sample lines):


regards
Edy
 
grapes are vegan food pellets. Eat this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!