Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with html pdf converter api YaHP

 
michael yue
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am currently trying on a html to pdf converter called YaHP at
http://freshmeat.net/projects/yahpconverter/?branch_id=60569&release_id=222614

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 org.allcolor.yahp.cl.converter.swing.CSwingHtmlRenderer 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 org.allcolor.yahp.cl.converter.swing.CSwingHtmlRenderer 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.cl.converter.swing.CSwingHtmlRenderer.renderToPDF(CSwingHtmlRenderer.java:271)
at org.allcolor.yahp.cl.converter.CHtmlToPdfSwingTransformer.transform(CHtmlToPdfSwingTransformer.java:76)
at org.allcolor.yahp.converter.CYaHPConverter.convertToPdf(CYaHPConverter.java:146)
at org.allcolor.yahp.sample.CSimpleConversion.main(CSimpleConversion.java:153)

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
Sheriff
Posts: 21297
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 204
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 org.allcolor.yahp.cl.converter.swing.CSwingHtmlRenderer.renderToPDF.
 
michael yue
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic