You can use SpooledFileOutputStream from jt400 to write directly to a spooled file from your java.

http://javadoc.midrange.com/jtopen/com/ibm/as400/access/SpooledFileOutputStream.html

Most of the PDF creators I know will take an output stream as their output parameter. SpooledFileOutputStream extends java.io.OutputStream.

I've had great results with FlyingSaucer from lowagie. It takes XHTML as input to produce PDF. The PDF looks just like the web page. It reads your CSS stylesheets for rendering the XHTML elements. Look it up as XHTML Core Renderer. Core-renderer, in turn, uses iText. You can go directly to iText to format paragraphs and and include graphics.

I've used Zebra printers long ago, and at the time, they only handled zPCL. That's a weird language demarked with "^" which is an entirely different symbol in EBCDIC. Like "|__" upside down. It would not be too difficult to write a transformer from text PDF to zPCL (provided they've devised an image format for graphics) so I imagine someone has done so within a Windows printer driver.


-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Steve Richter
Sent: Friday, April 19, 2013 2:20 PM
To: Java Programming on and around the IBM i
Subject: Re: how does java print to a network attached printer?

the thing is the users receive fedex labels on their PC as PDF files. And then they print those labels on the zebra printer. I have not looked into exactly how it is done, but I assume zebra supplies a windows printer driver.



On Fri, Apr 19, 2013 at 2:57 PM, Charles Wilt <charles.wilt@xxxxxxxxx>wrote:

might start here
https://www.google.com/search?q=java+internet+printing+protocol

Should be easy to print to a printer that supports both PDF printing
and IPP.

ZPL is another story....I suppose as long as the print server support
IPP, you could get it to work since ZPL is character based. I don't
recall what it takes to do bitmaps in ZPL or if it is even possible.

Charles


On Fri, Apr 19, 2013 at 2:35 PM, Steve Richter
<stephenrichter@xxxxxxxxx
wrote:

can java code, running on the ibm I, print direct to a network
attached printer? We have java code that creates a PDF file using
iText . But to print the PDF, the PDF file has to be emailed to the
user where it is printed using the windows printer drivers.

Does Java supply printer drivers of its own?

In this specific case we print carton labels on a zebra printer
using TL Ashford from an RPG program via the spooled file route.

I am asking if a Java program could create a bitmap file containing
the label image and print that bitmap direct to a network attached
zebra
label
printer? How to do that?

Do Zebra printers only accept the zebra printer control language or
will they also print a bitmap image?

I would like to experiment with it but do not know much java. How
does a java program write to a network attached printer?

thanks,
--
This is the Java Programming on and around the IBM i (JAVA400-L)
mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at
http://archive.midrange.com/java400-l.


--
This is the Java Programming on and around the IBM i (JAVA400-L)
mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
http://archive.midrange.com/java400-l.


--
This is the Java Programming on and around the IBM i (JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-l.




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-2021 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.