YaHP Converter (Yet another Html to Pdf converter) v1.2.11 (11/05/2007)
YaHP is a java library which permits to convert an html document into a pdf document.
YaHP is licensed under the LGPL (GNU).
YaHP use a pluggable renderer system. It has currently 3 renderer, each of them carrying advantages and disadvantages.
- The swing renderer, most stable, good rendering, can set header/footer, choose page size.
- The OpenOffice.org renderer, average rendering, cannot set header footer nor page size.(worst renderer)
- The firefox renderer, best rendering, can set header/footer, choose page size, must patch and compile a version of firefox, tested only on linux. Download pre-compiled version of the patched firefox (compiled on ubuntu dapper)mozila-print.tar.gz (08/04/2006)
To use the openoffice.org renderer, you must first launch openoffice in listen mode like this:
oowriter "-accept=socket,port=8100;urp;"
(with the quotes), then set the correct properties (see CSimpleConversion.java).
To use the firefox renderer, you must first download the firefox source : firefox-1.5.0.1-source.tar.bz2 at http://www.mozilla.org/ , then patch it with the files "layout.printing.nsPrintEngine.diff" and "layout.printing.nsPrintEngineH.diff", then compile it by issuing :
"./configure --prefix=/yourchoosenpath/mozilla-print/ --disable-logging --disable-tests --disable-oji --disable-view-source --disable-accessibility --disable-composer --disable-ldap --enable-canvas --disable-gnomeui --enable-application=browser --with-user-appdir=.print.mozilla --enable-system-cairo", then "make install"
Copy the sh script "fireprint" in /yourchoosenpath/mozilla-print/, modify the path inside the script, then set the correct properties (see CSimpleConversion.java). --script refer to the path /yourchoosenpath/mozilla-print/fireprint.
You also need ps2pdf installed and in the path.
Sample pdf with pagebreaks
Sample html with pagebreaks (use to generate the previous pdf)
Sample pdf with listing tables with automatic row break
Sample html with listing tables with automatic row break (use to generate the previous pdf)
Sample pdf 1
Sample pdf 2
Sample pdf 3
Sample pdf 4 (This page)
Sample pdf 5 (javadoc)
Sample pdf 6 (widget)
Sample pdf 7 (Google in chinese)
Sample pdf 8 (OpenOffice.org renderer)
Sample pdf 9 (OpenOffice.org renderer)
Sample pdf 10 (OpenOffice.org renderer)
Sample pdf 11 (This page) (OpenOffice.org renderer)
Sample pdf 12 (Google in chinese) (OpenOffice.org renderer)
Sample pdf 13 (Firefox renderer)
Sample pdf 14 (Firefox renderer)
Sample pdf 15 (Firefox renderer)
Sample pdf 16 (Firefox renderer)
Sample pdf 17 (Google in chinese) (Firefox renderer)
Sample pdf 18 (Firefox renderer)
Sample pdf 19 (This page) (Firefox renderer)
Javadoc
!! Download v1.2.11 (tar.gz) - 11/05/2007 !!
Changes:
- Updated classloader.
- Use current DPI screen settings to calculate page size.
Download v1.2.10 (tar.gz) - 26/04/2007
Changes:
- Updated parser to ShaniXmlParser-v1.4.16.
- Updated xalan.
Download v1.2.9 (tar.gz) - 24/04/2007
Changes:
- Updated parser to ShaniXmlParser-v1.4.15.
- The swing renderer can now render fieldset and legend tags.
Download v1.2.8 (tar.gz) - 19/04/2007
Changes:
- Updated parser to ShaniXmlParser-v1.4.14.
Download v1.2.7 (tar.gz) - 13/04/2007
Changes:
- v1.2.6 was broken in application server environment.
v1.2.6 (tar.gz) - 13/04/2007 (NUKED)
Changes:
- Use FOP 0.93.
- Can now embed automatically TrueType font by giving a path where TTF files are located with the yahp parameter IHtmlToPdfTransformer.FOP_TTF_FONT_PATH.
- The page-break <yahp:pb> works again.
- Updated samples PDF for the swing renderer.
- Updated javadoc.
Download v1.2.5 (tar.gz) - 12/04/2007
Changes:
- Corrected PageSize class where bottom margin was set incorrectly in CM.
- Corrected support for accentuated letters.
- Updated classloading mechanism.
- Corrected incorrect page count on some html.
Download v1.2.4 (tar.gz) - 11/04/2007
Changes:
- Remove infinite loop in the css parser.
- Tidyfy html before sending to rendering.
- Corrected a class cast exception in the swing border helper.
- If base url not set, take base tag as base url if found.
Download v1.2.3 (tar.gz) - 09/04/2007
Changes:
- Updated xml/html parser.
- Default charset to utf-8.
Download v1.2.2 (tar.gz) - 16/03/2007
Changes:
- Correct errors with commons-logging under tomcat on windows.
Download v1.2.1 (tar.gz) - 05/01/2007
Changes:
- Ignore attribute's case on image tag.
Download v1.2 (tar.gz) - 07/12/2006
Changes:
- Corrected rendering of elements with size set in percent.
Download v1.1beta2 (tar.gz) - 10/08/2006
Changes:
- Rendering of CSS border in the swing renderer.
- Better memory usage.
- Use Shani xml parser v1.4.6.
Download v1.0 (tar.gz) - 21/07/2006
Changes:
- Corrected non rendering of table row on edge of pages in the swing renderer.
- Better memory usage.
- Use Shani xml parser v1.4.2.
Download v0.99 (tar.gz) - 05/07/2006
Changes:
- Corrected dissapearance of header/footer in the swing renderer.
- Better memory usage when css style is put on the document.
Download v0.98 (tar.gz) - 05/07/2006 (N/A)
Changes:
- Huge memory usage improvement.
- Use Shani xml parser v1.3.8.
Download v0.97 (tar.gz) - 23/06/2006
Changes:
- Add intelligent and automatic table rows break in the swing renderer.
Download v0.96 (tar.gz) - 19/06/2006
Changes:
- Fix incorrect alignment with embedded fonts in the swing renderer.
- Javadoc updated.
Download v0.95 (tar.gz) - 17/06/2006
Changes:
- Corrected incorrect right alignment of text in pdf generated by the swing renderer.
- Javadoc updated.
Download v0.94 (tar.gz) - 08/06/2006
Changes:
- The swing renderer now has a pagebreak tag which permits to cut one document in several pages.
- Possibility to embed font with the yahp-fop-config.xml file.
- Javadoc updated.
- Sample application updated.
Download v0.93 (tar.gz) - 15/04/2006
Changes:
- Better rendering of forms components (button, field, ...) in the swing renderer. (see widget.pdf)
- List box are now rendered with the swing renderer.
- Javadoc updated.
- Swing renderer samples files updated.
Download v0.92 (tar.gz) - 14/04/2006
Changes:
- Rendering of forms components (button, field, ...) is now custom made in the swing renderer.
- The swing renderer is two times faster.
- Correct rendering of scaled page with the swing renderer.
- Rendering of the content of input field and textarea with the swing renderer.
- Sample application updated.
- Javadoc updated.
- Swing renderer samples files updated.
Download v0.91 (tar.gz) - 11/04/2006
Changes:
- Can sign a document with a certificate.
- Code cleanup.
- Sample application updated.
- Javadoc updated.
Download v0.90 (tar.gz) - 08/04/2006
Changes:
- Corrected "drawing error" occuring in acrobat reader of samples pdf generated with the firefox renderer by using latest ghostscript and not ghostscript eps.
- Ensure all buttons/combo/textfield are painted with the swing renderer.
- Sample application updated.
- Javadoc updated.
- All samples files updated.
Download v0.20 (tar.gz) - 07/04/2006
Changes:
- Support header/footer in utf-8 with the firefox renderer.
- Support concurrent rendering with the firefox renderer.
- Better rendering of comboboxes and buttons with the swing renderer, they are painted as vector instead of bitmap.
- Sample application updated.
- Javadoc updated.
- All samples files updated.
Download v0.19 (tar.gz) - 05/04/2006
Changes:
- Can set header/footer and page size with the firefox renderer.
- Recompiled iText to work on 1.4 JVM and corrected a LinkageError on 1.4 JVM.
- Sample application updated to use all the new properties.
- Javadoc updated.
- Firefox samples files updated.
Download v0.18 (tar.gz) - 02/04/2006
Changes:
- Added a new renderer which use firefox as html renderer.
- Sample application updated to use all the new properties.
- Javadoc updated.
- Samples files updated.
Download v0.17 (tar.gz) - 30/03/2006
Changes:
- Renderers are now pluggable.
- Added a new renderer which use OpenOffice.org writer as pdf generator.
- Sample application updated to use all the new properties.
- Refactoring and cleanup of code.
- Does not copy yahpxxx.jar in the temp directory anymore.
- Javadoc updated.
- Samples files updated.
Download v0.16 (tar.gz) - 24/03/2006
Changes:
- Added handling of pdf encryption.
- Added several properties in IHtmlToPdfTransformer interface, see javadoc.
- Cleanup of code.
- Updated the javadoc.
- Updated to the new ShaniXmlParser 1.3.6.
- All samples files updated.
Download v0.15 (tar.gz) - 23/03/2006
Changes:
- Correct rendering of page containing chinese characters.
- Better rendering of button/checkbox components.
- Updated to the new ShaniXmlParser 1.3.6-pre.
- Samples files updated.
Download v0.14 (tar.gz) - 20/03/2006
Changes:
- Intelligent cutting of pages.
- Better rendering of page footer.
Download v0.13 (tar.gz) - 17/03/2006
Changes:
- Detect if rendering in the event thread and avoid calling SwingUtilities invokeAndWait in this case.
- Ensure synchronized rendering of image inside the document.
- Updated to the new ShaniXmlParser 1.3.5.
Download v0.12 (tar.gz) - 16/11/2005
Changes:
- Use SwingUtilities.InvokeAndWait to synchronize with the swing paint thread.
- Better rendering of page header. (page footer still rendered as image)
- Samples files updated.
Download v0.11 (tar.gz) - 07/11/2005
Changes:
- Add property "FAST_TRANSFORM" default to true, which permits to have faster transformation, but will produce black background on transparent gif under kpdf (only so far).
- Circumvent a NullPointerException in JDK ParagraphView class under jdk 1.4.2
Download v0.10 (tar.gz) - 02/11/2005
Changes:
- Set the org.apache.commons.logging.Log System property to force the use log4j instead of setting wrongly with a LogFactoryImplementation.
Download v0.9 (tar.gz) - 28/10/2005
Changes:
- Correct rendering of comboboxes.
- Correct rendering of images with transparent zone (no more black background)
- Set the org.apache.commons.logging.Log System property to force the use of the default logger inside the Yahp context.
- Samples files updated.
- Javadoc updated
Download v0.8 (tar.gz) - 26/10/2005
Changes:
- Corrected a memory leak in the classloader due to commons logging.
- Destroy the classloader on finalization.
- Added the META-INF/services/org.apache.commons.logging.LogFactory file to force the use of the default logger inside the Yahp context.
Download v0.7 (tar.gz) - 23/10/2005
Changes:
- Remove not selected option tag from DOM.
- Updated xml parser.
Download v0.6 (tar.gz) - 24/09/2005
Changes:
- Better rendering quality.
- Render directly in the pdfgraphics2d and dot not use an offscreen buffer which had bad rendering quality.
- Fonts are now vectorized and not as bitmap.
- Samples updated.
- Javadoc updated.
Download v0.5 (tar.gz) - 23/09/2005 (modified, first 0.5 has still buttons display problem, consider the first 0.5 as nuked ;)
Changes:
- Force HTMLEditorKit on the JTextPane used for rendering. (prevent source display)
- Remove the doctype node if any before giving the source to the JTextPane
- Now render correclty the Text field, buttons, combobox, ... (before was blank)
Download v0.4 (tar.gz) - 22/09/2005
Changes:
- Remove the use of TimeoutException in the CMutex clas because this exception only exists in JDK 1.5
- Set the thread context classloader to prevent Duplicate Class.
Download v0.3 (tar.gz) - 21/09/2005
Changes:
- Document/javadoc
- Set antialiasing on the graphics2d object.
- handle '../' in css and image links.
Download v0.2 (tar.gz)
Changes:
- Use a specialised classloader to load inner jar.
- Compile FOP for jdk1.4 instead of 1.5.
Download v0.1 (tar.gz)
Contact : quentin.anciaux@advalvas.be