Sounds pretty much like the install for the purchased PD4ML product except images don't need a qualified domain.
Like many things, getting a prototype to run is often straight forward enough. The devil is usually in the detail of an integration into existing production that performs well.
Be warned about running headless java in the same job that may need to load a PASE routine.
Peter
-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Aaron Bartell
Sent: Tuesday, 2 March 2010 6:54 a.m.
To: Web Enabling the AS400 / iSeries
Subject: [WEB400] html2pdf4i was-->Re: RPGCGI - Convert HTML page to PDF
Alrighty. I have something to share with the group based on the
conversations in this thread. I went the route of the xhtmlrenderer project
(
https://xhtmlrenderer.dev.java.net/) which does the majority of the work -
I just added a small wrapper. You can download everything you need at the
following URL:
http://mowyourlawn.com/files/html2pdf4i_v1.zip
Install instructions:
Create folder structure /java/html2pdf4i
Upload all the files in the zip file to the same named folder on the AS400
(if using FTP make sure to use binary as the transfer).
Then do the following from the command line:
1) strqsh
2) cd /java/html2pdf4i
3) java -Djava.awt.headless=true -cp
.:core-renderer-minimal.jar:core-renderer.jar:iText-2.0.8.jar:xml-apis-xerces-2.9.1.jar:HTML2PDF4i.jar
HTML2PDF4i music.html music.pdf
You should now have the following file: /java/html2pdf4i/music.pdf
Notes:
- Will cut off the page when converted to PDF if it is wider than a piece of
paper. This could probably be configured some how.
- Needs to be perfectly formed HTML, including all things needing to be
escaped (i.e. & needs to be &, must have closing tags for all open
tags). You can validate your HTML pages here:
http://validator.w3.org
- Resources need to be full qualified with the full domain so they can be
retrieved in the Java program. (i.e. invalid: src="/image1.jpg" valid:
src="
http://domain.com/image1.jpg")
BTW, this is one of those cases where I think employing Java is a reasonable
avenue because it meets a fringe business need that doesn't require you
fully understand EVERYTHING about Java on the IBMi vs. if you were running
order entry with Java, well, then you better have a pretty tight grip on the
language :-)
Let me know what you think,
Aaron Bartell
www.SoftwareSavesLives.com
On Thu, Feb 25, 2010 at 8:20 AM, Aaron Bartell <aaronbartell@xxxxxxxxx>wrote:
I have a customer that needs to take an auto insurance form that was built
with HTML and convert it to PDF so it can be emailed to the customer after
they write the policy. The HTML is created and now I have been tasked with
converting it to PDF.
The main requirement is that everything must run on the IBMi which means I
am looking for a Java tool to accomplish this most likely. There are a
number of tools out there (both free and commercial) and I am wondering if
others have attempted to do this and what you ended up choosing for a
solution. Here are some of the solutions I am looking at right now:
http://pd4ml.com - very simple API and very inexpensive (around $150 US
dollars)
http://today.java.net/pub/a/today/2007/06/26/generating-pdfs-with-flying-saucer-and-itext.html
http://www.allcolor.org/YaHPConverter/
Anybody have suggestions on what I have listed or other suggestions based
on your experience?
Aaron Bartell
www.SoftwareSavesLives.com
As an Amazon Associate we earn from qualifying purchases.