This project contains:
jipp-core
, the core IPP parser/builder for IPP packets.jipp-pdls
, which converts raster format docs to common page description languages (PCLm and PWG-Raster).jprint
, a sample app showing howjipp-core
can be used to send a document to a printer.jrender
, a sample app showing howjipp-pdl
can be used to convert a PDF to PCLm or PWG-Raster.
jipp-core
features:
- Supports construction of IPP servers, clients, routers, gateways, etc.
- Common operations and attributes are defined and ready to use.
- Can be extended to support new operations and attributes.
- Can be used over any transport (typically HTTP).
- Includes a pretty-printer for human-readable IPP packet display.
- Kotlin users can access a type-safe packet building DSL
What could I do with this?
- Scan and show available printers on your network to your users.
- Implement an Android Print Service.
- Test IPP clients or IPP printers in interesting ways.
- Experiment with alternative IPP transports.
- Implement a cloud-based print server or client.
The API is fully Java-compatible but is actually implemented in Kotlin. JavaDoc is available for the Java-facing API.
In short:
- Add the current version of JIPP to your project
dependencies {
compile 'com.hp.jipp:jipp-core:0.6.19'
compile 'com.hp.jipp:jipp-pdl:0.6.19' // Only needed if transforming PDLs
}
- Create an
IppClientTransport
orIppServerTransport
(see exampleHttpIppClientTransport.java
) - Use the transport to send and receive
IppPacket
objects, e.g.:
URI uri = URI.create("http://192.168.1.100:631/ipp/print");
IppPacket printRequest = new IppPacket(Operation.printJob, 123,
groupOf(operationAttributes,
attributesCharset.of("utf-8"),
attributesNaturalLanguage.of("en"),
printerUri.of(uri),
requestingUserName.of("user"),
documentFormat.of("application/octet-stream")));
transport.sendData(uri, new IppPacketData(printRequest, new FileInputStream(inputFile)));
A very basic use case is demonstrated by the jprint
sample app. To run it:
# build the app
./gradlew jprint:build
# unzip in the current directory
unzip -o ./sample/jprint/build/distributions/jprint-*.zip
# Use IPP to print a file to the supplied HTTP/IPP endpoint.
# (The printer must natively support the file type.)
jprint-*/bin/jprint "ipp://192.168.1.102:631/ipp/print" sample.pdf
An example of rendering a PDF to PWG-Raster or PCLm. To run it:
# build the app
./gradlew jrender:build
# unzip in the current directory
unzip -o ./sample/jrender/build/distributions/jrender-*.zip
# Convert a PDF-file to PWG-Raster.
jrender-*/bin/jrender sample.pdf sample.pwg
# Convert a PDF-file to PCLm.
jrender-*/bin/jrender sample.pdf sample.pclm
Until 1.0, APIs may still be changed in non-backwards-compatible ways.
See HISTORY.md for more details.
jipp-core
's only dependencies are JDK 6+ and the current Kotlin runtime.
./gradlew build
A full build of this project requires python
(2.x) and dot
to generate dependency graphs
javax.print
(JSR6) - Standard Java printing APIs. IPP 1.1 only, client-side only. API is not supported by Android.- Cups4J - LGPL licensed, with a port to Android.
- JSPI