File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other JSE/JEE APIs and the fly likes Problem with html pdf converter api YaHP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Problem with html pdf converter api YaHP" Watch "Problem with html pdf converter api YaHP" New topic

Problem with html pdf converter api YaHP

michael yue
Ranch Hand

Joined: Nov 20, 2003
Posts: 204

I am currently trying on a html to pdf converter called YaHP at

I tried to build the sample provided and its ok. Problem is when running it comes out error below:
before conversion
Apr 4, 2006 11:26:49 AM renderToPDF
INFO: begin pdf render page 1/1
log4j:WARN No appenders could be found for logger (org.apache.fop.pdf.PDFObject).
log4j:WARN Please initialize the log4j system properly.
Apr 4, 2006 11:26:51 AM renderToPDF
INFO: end pdf render page 1/1 time : 1656ms.
An error occurs while converting 'file:///D:/s.html' to 'D:/to1.pdf'. Cause : com/lowagie/text/pdf/PdfDocument$PdfCatalog
java.lang.NoClassDefFoundError: com/lowagie/text/pdf/PdfDocument$PdfCatalog
at org.allcolor.yahp.converter.CYaHPConverter.convertToPdf(
at org.allcolor.yahp.sample.CSimpleConversion.main(

Has anyone tried this converter before? I know that this not very popular api but its worth a shot asking here. By the way I am using windows machine to build this and the api is developed in unix platform. But this shouldnt' pose any problems. I have even use the latest iText lib but still same problem here.
Paul Clapham

Joined: Oct 14, 2005
Posts: 19848

Looks like you don't have the iText PDF library in your classpath. I went to the trouble of looking at the download. It has a "lib" directory with about a dozen jar files in it. I don't see any installation or setup instructions but it's pretty clear to me that those jar files are all supposed to go in your classpath.
michael yue
Ranch Hand

Joined: Nov 20, 2003
Posts: 204
Thanks for the reply. I have already included the whole bunch of jars into the path. I am using eclipse to run it and still its same problem. Whether I build it from the sample or compile using the source code. Seems that the source of the error is from the file
michael yue
Ranch Hand

Joined: Nov 20, 2003
Posts: 204
Hi again

Got the thing working. The author of the program just uploaded a new version 0.19 that works on jvm1.4 . I think thats the problem I have been facing all along. Check out the website and download the new version. But still got a little error coming out on the log4j part but the things working anyway.
I agree. Here's the link:
subject: Problem with html pdf converter api YaHP
It's not a secret anymore!