× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On Wed, Aug 19, 2015 at 1:35 PM, Dean Eshleman
<Dean.Eshleman@xxxxxxxxxxxx> wrote:
I have started to look at HTML reports, but ultimately I want a PDF. I was looking at using iText to do the conversion from HTML to PDF, but since my Java is quite limited, I'm struggling with how to go about that.

There are plenty of folks in the same boat (i.e. with the same needs
but not exactly comfortable with Java). Try Googling around. There are
a number of articles and Q&A posts which cover this. I used the search
terms "convert html to pdf using itext" (without the quotes).

Since Python is now supported on the IBM I, I was curious if Python had a method for converting HTML to a PDF. Apparently it does, based on some internet searches I've done. As always though, the devil is in the details.

The details are pretty devilish. Crucially, most if not all of the
full-featured Python packages that do this conversion have
dependencies on C code. Which means you can do this in Linux no
problem, and probably without too much trouble on Mac. But it's
completely up in the air whether those dependencies are easily
compiled on the i. (See my recent post to this list on that very
topic. I would have written that one even if you hadn't brought it
up.) Incidentally, while Windows doesn't come with a C compiler,
prebuilt binaries are available for the more popular packages, so in
practice it's usually not a problem on Windows.

On a side note, I wonder if Python will outperform Java on the IBM i. Everyone usually talks about the overhead of starting the JVM for each job, I wonder if Python has similar overhead. Maybe John Yeung will chime in with his thoughts.

Properly written applications will not be starting the JVM over and
over. So the cost of starting it up shouldn't be an issue (one would
hope). When warmed up, the JVM is reasonably fast. On other platforms,
Python (implemented in C) is competitive with Java in the areas for
which Python is optimized. Python is significantly slower than Java in
other areas. For typical applications, Python will be "slower than
Java, but plenty fast enough".

Note that a lot of folks on this list don't write Java themselves but
write RPG code that interfaces with existing Java code using IBM's
JNI. Probably the most common case of this is working with Excel files
using RPG wrappers for Apache's POI. Without proper care, this style
of "Java-based application" can be quite slow indeed, slower than an
equivalent pure-Python implementation.

John Y.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.