Giter VIP home page Giter VIP logo

ipp-client-kotlin's Introduction

ipp-client v3.1

A client implementation of the ipp protocol for java and kotlin. RFCs 8010, 8011, 3995 and 3996

License: MIT Build Quality Gate Status Sonar Coverage Maven Central

Usage

You may use ippfind or other ZeroConf tools for printer discovery. The CupsClient supports printer lookup by queue name. Repository ipp-samples contains examples how to use jmDNS.

implementation("de.gmuth:ipp-client:3.1")

README.md for version 2.x is still available.

// Initialize printer connection and log printer attributes
val ippPrinter = IppPrinter(URI.create("ipp://colorjet.local/ipp/printer"))
ippPrinter.log(logger)

// Marker levels
ippPrinter.markers.forEach { println(it) }
println("black: ${ippPrinter.marker(BLACK).levelPercent()} %")

// Print file
val file = File("A4-ten-pages.pdf")
val job = ippPrinter.printJob(
    file,
    copies(2),
    numberUp(2),
    jobPriority(30),
    jobName(file.name),
    DocumentFormat.PDF,
    pageRanges(2..3, 8..10),
    finishings(Punch, Staple),
    printerResolution(300, DPI),
    Sides.TwoSidedLongEdge,
    ColorMode.Monochrome,
    PrintQuality.High,
    Media.ISO_A4,
    mediaColWithSource("tray-1"),
    notifyEvents = listOf("job-state-changed", "job-stopped", "job-completed") // CUPS
)
job.subscription?.pollAndHandleNotifications { println(it) }

// Print remote file, make printer pull document from remote server
val remoteFile = URI.create("http://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf")
ippPrinter.printUri(remoteFile)

// Create job and send document
val job = ippPrinter.createJob(jobName(file.name))
job.sendDocument(FileInputStream(file))
job.waitForTermination()

// Manage jobs
ippPrinter.getJobs().forEach { println(it) }
ippPrinter.getJobs(WhichJobs.Completed)

val job = ippPrinter.getJob(4)
job.hold()
job.release()
job.cancel()
job.cupsGetDocuments() // CUPS only

// Print operator
ippPrinter.pause()
ippPrinter.resume()
ippPrinter.sound() // identify printer

// Subscribe and handle/log events (e.g. from CUPS) for 5 minutes
ippPrinter
    .createPrinterSubscription(notifyLeaseDuration = Duration.ofMinutes(5))
    .pollAndHandleNotifications() { event -> ... }

// Find supported media by size
ippPrinter
    .getMediaColDatabase() // PWG 5100.7 Job Extensions v2.0
    .findMediaBySize(ISO_A4)

// Media size supported? ready? which source?
ippPrinter.isMediaSizeSupported(ISO_A3)
ippPrinter.isMediaSizeReady(ISO_A4)
ippPrinter.sourcesOfMediaSizeReady(ISO_A4) // e.g. [tray-1, auto]

IppPrinter checks, if attribute values are supported by looking into '...-supported' printer attributes.

DocumentFormat("application/pcl")

WARN: according to printer attributes value 'application/pcl' is not supported.
document-format-supported (1setOf mimeMediaType) = application/pdf,application/postscript

To get to know a new printer and its supported features, you can run the inspection workflow of IppInspector. IPP traffic is saved to directory inspected-printers. The workflow will try to print a PDF.

// need an IPP server? https://openprinting.github.io/cups/doc/man-ippeveprinter.html
IppInspector.inspect(URI.create("ipp://ippeveprinter:8501/ipp/print"))

Exchange IppRequest for IppResponse

val uri = URI.create("ipp://colorjet.local/ipp/printer")
val file = File("A4-blank.pdf")

val ippClient = IppClient()
val request = IppRequest(IppOperation.PrintJob, uri).apply {
    // Constructor adds 'attributes-charset', 'attributes-natural-language' and 'printer-uri'
    operationGroup.attribute("document-format", IppTag.MimeMediaType, "application/pdf")
    documentInputStream = FileInputStream(file)
}
val response = ippClient.exchange(request)
println(response.jobGroup["job-id"])

Use the CupsClient to connect to a CUPS server. If you want to access a cups queue you can construct an IppPrinter from its uri.

// Connect to default ipp://localhost:631
val cupsClient = CupsClient()

// Credentials (e.g. for remote connections)
cupsClient.basicAuth("admin", "secret")

// List all queues
cupsClient.getPrinters().forEach {
    println("${it.name} -> ${it.printerUri}")
}

// List all completed jobs for queue
cupsClient.getPrinter("ColorJet_HP")
    .getJobs(WhichJobs.Completed)
    .forEach { println(it) }

// Default printer
val defaultPrinter = cupsClient.getDefault()

// Check capability
if (defaultPrinter.hasCapability(Capability.CanPrintInColor)) {
    println("${defaultPrinter.name} can print in color")
}

// Get canceled jobs and save documents
cupsClient.getJobsAndSaveDocuments(WhichJobs.Canceled)

// Setup IPP Everywhere Printer
cupsClient.setupIppEverywherePrinter(
    "myprinter",
    URI.create("ipp://myprinter.local:631/ipp/print"),
    "My description",
    "My location"
)

Print jpeg to 2" label printer

val printer = IppPrinter(URI.create("ipp://192.168.2.64"))
val jpegFile = File("label.jpeg")
val image = javax.imageio.ImageIO.read(jpegFile)
val width = 2540 * 2 // hundreds of mm

printer.printJob(
    jpegFile,
    DocumentFormat.JPEG,
    MediaCollection(
        MediaSize(width, width * image.height / image.width),
        MediaMargin(300) // 3 mm
    )
)

IANA Registrations

Section 2 and 6 registrations are available as Maps and can be queried:

// List media attributes and show syntax
IppRegistrationsSection2.attributesMap.values
    .filter { it.name.contains("media") }
    .sortedBy { it.collection }
    .forEach { println(it) }

// Lookup tag for attribute job-name
IppRegistrationsSection2.tagForAttribute("job-name") // IppTag.NameWithoutLanguage

It's not recommended to use IppRegistrations on the happy path of your control flow. You should rather e.g. lookup the correct tag during development and then use it in your code. Only when the library detects IPP issues through response codes, it consults the IppRegistrations to help identifying the issue.

This library implements a different concept then jipp. jipp seems very strict about IPP syntax and is not designed to cope with illegal IPP responses. My IPP library in contrast is designed for resilience. E.g. it accepts messages and attributes that use wrong IPP tags. I've not yet seen any IPP server implementation without a single encoding bug. IppInputStream for example includes workarounds for illegal responses of my HP and Xerox printers. From my experience this approach works better in real life projects than blaming the manufacturers firmware.

Logging

From version 3.0 onwards the library uses Java Logging - configure as you like. Tests can use Logging.configure() to load logging.properties from test/resources. The behaviour of my previously used ConsoleLogger is now implemented by StdoutHandler and SimpleClassNameFormatter. I moved all of my custom logging code to its own repository logging-kotlin.

Sources

To build the jar make sure you have JDK 11 installed. The default tasks build the jar in build/libs.

./gradlew

To install the artifact to your local maven repository run

./gradlew publishToMavenLocal

The build produces the jar, sources and javadoc artifacts. This software has no dependencies to javax.print, CUPS or ipptool. Operation has mostly been tested for target jvm. Android is supported since v1.6.

Package de.gmuth.ipp.core contains the usual encoding and decoding operations. RFC 8010 is fully supported. Package de.gmuth.ipp.client contains the IppClient and implementations of higher level IPP objects like IppPrinter, IppJob, IppSubscription and IppEventNotification.

IPP is based on the exchange of binary messages via HTTP. For reading and writing binary data DataInputStream and DataOutputStream are used. For message transportation IppClient uses HttpURLConnection.

Only Java runtimes (including Android) provide implementations of these classes. The Java standard libraries also provide support for SSL/TLS .

ipp-client-kotlin's People

Contributors

gmuth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ipp-client-kotlin's Issues

copies error

Because setting the number of copies through copies of ipp-client will cause multiple copies of a certain page to be printed before starting the next one, which is inconsistent with my expectation of finishing one copy and then printing the second copy, so I chose to use a for loop. The method calls multiple print tasks, but an error is reported
image
image

Can print PDF to BROTHER DCP-L2540DW but not to BROTHER HL-L2305

I am printing via a Kotlin app using the below code.

HttpURLConnectionClient.log.logLevel = Logging.LogLevel.TRACE
val printer = IppPrinter(URI.create("ipp://$printerAddress/ipp/print"), httpConfig = Http.Config(debugLogging = true))
printer.attributes.logDetails()

// create job and send document
val job = printer.createJob(
                jobName(file.name),
                IppPrintQuality.Normal,
                IppColorMode.Monochrome,
)
job.sendDocument(FileInputStream(file))
job.logDetails()
job.waitForTermination()

The L2540DW prints just fine. I have tried adding in the port like ipp://$printerAddress:631/ipp/print and various other alternatives with and without /ipp/print and every time the L2540DW prints. But the HL-L2305 just starts kicking out blank page after blank page and never stops (I let it go to about 10 pages and then pulled the tray). I updated firmware on the printer but that didnt change anything. I verified the IPP is enabled via the printer web console but nothing seems to work. What else can I try?

Bought a new HP Smart Tank Wireless 515, still same issue

I've tried to get an AirPrint printer, even their website says PDF is supported. When i try to print it via IPP (ipp-client-kotlin), still prints out garbage information like the earlier EPSON.

The only difference is that printer attributes show when i use ipptool.

I'm at a lost because i had been spending too much money on printers.

โ•ฐโ”€$ ipptool -tv ipp://192.168.1.7/ipp/printer get-printer-attributes.test
"/usr/share/cups/ipptool/get-printer-attributes.test":
    Get-Printer-Attributes:
        attributes-charset (charset) = utf-8
        attributes-natural-language (naturalLanguage) = en
        printer-uri (uri) = ipp://192.168.1.7:631/ipp/printer
        requested-attributes (1setOf keyword) = all,media-col-database
    Get printer attributes using get-printer-attributes                  [PASS]
        RECEIVED: 77642 bytes in response
        status-code = successful-ok (successful-ok)
        attributes-charset (charset) = utf-8
        attributes-natural-language (naturalLanguage) = en
        printer-uri-supported (1setOf uri) = ipp://192.168.1.7/ipp/print,ipps://192.168.1.7:631/ipp/print
        uri-security-supported (1setOf keyword) = none,tls
        uri-authentication-supported (1setOf keyword) = requesting-user-name,requesting-user-name
        printer-settable-attributes-supported (keyword) = none
        printer-name (nameWithoutLanguage) = HPE2D6D5
        printer-location (textWithoutLanguage) = 
        printer-more-info (uri) = http://192.168.1.7/#hId-pgAirPrint
        printer-info (textWithoutLanguage) = HP Smart Tank 510 series \[E2D6D5]
        printer-dns-sd-name (nameWithoutLanguage) = HP Smart Tank 510 series \[E2D6D5]
        printer-make-and-model (textWithoutLanguage) = HP Smart Tank 510 series
        printer-state (enum) = idle
        printer-state-reasons (keyword) = none
        printer-state-message (textWithoutLanguage) = 
        ipp-versions-supported (1setOf keyword) = 1.0,1.1,2.0
        operations-supported (1setOf enum) = Print-Job,Validate-Job,Cancel-Job,Cancel-My-Jobs,Get-Job-Attributes,Get-Jobs,Get-Printer-Attributes,Create-Job,Send-Document,Set-Printer-Attributes,0x4029,0x402a,Print-URI,Send-URI,Close-Job,Identify-Printer
        charset-configured (charset) = utf-8
        charset-supported (charset) = utf-8
        natural-language-configured (naturalLanguage) = en
        generated-natural-language-supported (1setOf naturalLanguage) = en,zh-cn,zh-tw,fr,de,es,it,pt,nl,da,sv,no,fi,ar,ru,tr,pl,el,cs,hu,sk,ro,sl,bg,hr
        printer-strings-languages-supported (1setOf naturalLanguage) = en,zh-cn,zh-tw,fr,de,es,it,pt,nl,da,sv,no,fi,ar,ru,tr,pl,el,cs,hu,sk,ro,sl,bg,hr
        printer-strings-uri (uri) = http://192.168.1.7/ipp/files/en.strings
        document-format-default (mimeMediaType) = application/octet-stream
        document-format-supported (1setOf mimeMediaType) = application/vnd.hp-PCL,image/jpeg,image/urf,image/pwg-raster,application/PCLm,application/octet-stream
        document-format-version-supported (1setOf textWithoutLanguage) = PCL3GUI,PCL3,PJL,Automatic,JPEG,AppleRaster,PWGRaster,PCLM
        document-format-details-default (collection) = {document-format=application/octet-stream}
        printer-is-accepting-jobs (boolean) = true
        queued-job-count (integer) = 0
        pdl-override-supported (keyword) = attempted
        printer-up-time (integer) = 52704
        printer-current-time (dateTime) = 1970-01-01T15:04:48Z
        compression-supported (1setOf keyword) = none,deflate,gzip
        color-supported (boolean) = true
        job-creation-attributes-supported (1setOf keyword) = copies,finishings,finishings-col,job-pages-per-set,sides,orientation-requested,media,print-quality,printer-resolution,output-bin,media-col,output-mode,print-content-optimize,pclm-source-resolution,print-color-mode,ipp-attribute-fidelity,job-name,page-ranges,multiple-document-handling,job-mandatory-attributes,print-rendering-intent,print-scaling
        reference-uri-schemes-supported (1setOf uriScheme) = http,https
        printer-device-id (textWithoutLanguage) = MFG:HP;MDL:Smart Tank 510 series;CMD:PCL3GUI,PCL3,PJL,Automatic,JPEG,AppleRaster,PWGRaster,PCLM,DW-PCL,802.11,DESKJET,DYN;CLS:PRINTER;DES:1TJ09A;CID:HPIJVIPAV7;LEDMDIS:USB#FF#04#01,USB#FF#CC#00;SN:CN23M4M041;S:038808C484000001006c2400000c140000004400064054000640640006401400064;Z:05000008000008000001000001000001000001,12000,17000000000000000000000000000000000000,180;
        printer-alert (1setOf octetString) = code=unknown;severity=warning;group=other,code=unknown;severity=other;group=other,code=unknown;severity=other;group=other,code=unknown;severity=other;group=other,code=unknown;severity=other;group=other,code=unknown;severity=other;group=other,code=unknown;severity=other;group=other,code=unknown;severity=other;group=other,code=unknown;severity=other;group=other,code=unknown;severity=other;group=other,code=unknown;severity=other;group=other,code=unknown;severity=other;group=other,code=unknown;severity=other;group=other
        printer-alert-description (1setOf textWithoutLanguage) = ,,,,,,,Genuine HP Cartridge Installed,Genuine HP Cartridge Installed,Genuine HP Cartridge Installed,Genuine HP Cartridge Installed,,Sleep Mode
        printer-uuid (uri) = urn:uuid:817e4140-3016-5657-0c93-4bf473f6a116
        landscape-orientation-requested-preferred (enum) = 5
        job-constraints-supported (collection) = {resolver-name=fullbleed-sizes media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media=na_executive_7.25x10.5in,na_legal_8.5x14in,na_invoice_5.5x8.5in,iso_b5_176x250mm,na_monarch_3.875x7.5in,na_number-10_4.125x9.5in,iso_dl_110x220mm,iso_c5_162x229mm,iso_c6_114x162mm,na_a2_4.375x5.75in,na_personal_3.625x6.5in,jpn_chou3_120x235mm,jpn_chou4_90x205mm,na_foolscap_8.5x13in}
        job-resolvers-supported (collection) = {resolver-name=fullbleed-sizes media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296}
        ipp-features-supported (1setOf keyword) = airprint-1.8,ipp-everywhere
        which-jobs-supported (1setOf keyword) = completed,not-completed,all
        job-ids-supported (boolean) = true
        requesting-user-uri-supported (boolean) = true
        multiple-operation-time-out-action (keyword) = abort-job
        printer-geo-location (unknown) = unknown
        mopria-certified (textWithoutLanguage) = 2.0
        preferred-attributes-supported (boolean) = false
        printer-config-change-date-time (dateTime) = 2014-01-01T00:00:19Z
        printer-config-change-time (integer) = 0
        printer-state-change-date-time (dateTime) = 2014-01-01T00:00:19Z
        printer-state-change-time (integer) = 0
        document-password-supported (integer) = 0
        printer-kind (1setOf keyword) = document,envelope,photo,postcard
        media-supported (1setOf keyword) = na_executive_7.25x10.5in,na_letter_8.5x11in,na_legal_8.5x14in,na_govt-letter_8x10in,na_invoice_5.5x8.5in,iso_a5_148x210mm,iso_a4_210x297mm,iso_b5_176x250mm,jis_b5_182x257mm,jpn_hagaki_100x148mm,iso_a6_105x148mm,na_index-3x5_3x5in,na_index-4x6_4x6in,om_small-photo_100x150mm,na_5x7_5x7in,na_index-5x8_5x8in,na_monarch_3.875x7.5in,na_number-10_4.125x9.5in,iso_dl_110x220mm,iso_c5_162x229mm,iso_c6_114x162mm,na_a2_4.375x5.75in,na_personal_3.625x6.5in,jpn_chou3_120x235mm,jpn_chou4_90x205mm,oe_photo-l_3.5x5in,jpn_photo-2l_127x177.8mm,na_foolscap_8.5x13in,oe_photo_4x5in,oe_photo_4x12in,custom_min_3x5in,custom_max_8.5x14in
        media-default (keyword) = iso_a4_210x297mm
        media-col-supported (1setOf keyword) = media-type,media-size,media-top-margin,media-left-margin,media-right-margin,media-bottom-margin,media-source,media-size-name
        media-col-default (collection) = {media-size={x-dimension=21000 y-dimension=29700} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery}
        media-col-database (1setOf collection) = {media-size={x-dimension=18415 y-dimension=26670} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=18415 y-dimension=26670} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=18415 y-dimension=26670} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=18415 y-dimension=26670} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=18415 y-dimension=26670} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=21590 y-dimension=27940} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=21590 y-dimension=27940} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery},{media-size={x-dimension=21590 y-dimension=27940} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=21590 y-dimension=27940} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=photographic-glossy},{media-size={x-dimension=21590 y-dimension=27940} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=21590 y-dimension=27940} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=21590 y-dimension=27940} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=21590 y-dimension=27940} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=21590 y-dimension=27940} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=21590 y-dimension=27940} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=21590 y-dimension=35560} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=21590 y-dimension=35560} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=21590 y-dimension=35560} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=21590 y-dimension=35560} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=21590 y-dimension=35560} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=20320 y-dimension=25400} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=20320 y-dimension=25400} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery},{media-size={x-dimension=20320 y-dimension=25400} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=20320 y-dimension=25400} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=photographic-glossy},{media-size={x-dimension=20320 y-dimension=25400} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=20320 y-dimension=25400} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=20320 y-dimension=25400} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=20320 y-dimension=25400} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=20320 y-dimension=25400} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=20320 y-dimension=25400} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=13970 y-dimension=21590} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=13970 y-dimension=21590} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=13970 y-dimension=21590} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=13970 y-dimension=21590} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=13970 y-dimension=21590} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=14800 y-dimension=21000} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=14800 y-dimension=21000} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery},{media-size={x-dimension=14800 y-dimension=21000} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=14800 y-dimension=21000} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=photographic-glossy},{media-size={x-dimension=14800 y-dimension=21000} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=14800 y-dimension=21000} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=14800 y-dimension=21000} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=14800 y-dimension=21000} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=14800 y-dimension=21000} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=14800 y-dimension=21000} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=21000 y-dimension=29700} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=21000 y-dimension=29700} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery},{media-size={x-dimension=21000 y-dimension=29700} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=21000 y-dimension=29700} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=photographic-glossy},{media-size={x-dimension=21000 y-dimension=29700} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=21000 y-dimension=29700} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=21000 y-dimension=29700} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=21000 y-dimension=29700} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=21000 y-dimension=29700} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=21000 y-dimension=29700} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=17600 y-dimension=25000} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=17600 y-dimension=25000} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=17600 y-dimension=25000} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=17600 y-dimension=25000} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=17600 y-dimension=25000} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=18200 y-dimension=25700} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=18200 y-dimension=25700} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery},{media-size={x-dimension=18200 y-dimension=25700} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=18200 y-dimension=25700} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=photographic-glossy},{media-size={x-dimension=18200 y-dimension=25700} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=18200 y-dimension=25700} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=18200 y-dimension=25700} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=18200 y-dimension=25700} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=18200 y-dimension=25700} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=18200 y-dimension=25700} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=10000 y-dimension=14800} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=10000 y-dimension=14800} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery},{media-size={x-dimension=10000 y-dimension=14800} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=10000 y-dimension=14800} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=photographic-glossy},{media-size={x-dimension=10000 y-dimension=14800} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=10000 y-dimension=14800} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=10000 y-dimension=14800} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=10000 y-dimension=14800} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=10000 y-dimension=14800} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=10000 y-dimension=14800} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=10500 y-dimension=14800} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=10500 y-dimension=14800} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery},{media-size={x-dimension=10500 y-dimension=14800} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=10500 y-dimension=14800} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=photographic-glossy},{media-size={x-dimension=10500 y-dimension=14800} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=10500 y-dimension=14800} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=10500 y-dimension=14800} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=10500 y-dimension=14800} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=10500 y-dimension=14800} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=10500 y-dimension=14800} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=7620 y-dimension=12700} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=7620 y-dimension=12700} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery},{media-size={x-dimension=7620 y-dimension=12700} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=7620 y-dimension=12700} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=photographic-glossy},{media-size={x-dimension=7620 y-dimension=12700} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=7620 y-dimension=12700} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=7620 y-dimension=12700} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=7620 y-dimension=12700} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=7620 y-dimension=12700} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=7620 y-dimension=12700} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=10160 y-dimension=15240} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=10160 y-dimension=15240} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery},{media-size={x-dimension=10160 y-dimension=15240} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=10160 y-dimension=15240} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=photographic-glossy},{media-size={x-dimension=10160 y-dimension=15240} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=10160 y-dimension=15240} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=10160 y-dimension=15240} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=10160 y-dimension=15240} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=10160 y-dimension=15240} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=10160 y-dimension=15240} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=10000 y-dimension=15000} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=10000 y-dimension=15000} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery},{media-size={x-dimension=10000 y-dimension=15000} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=10000 y-dimension=15000} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=photographic-glossy},{media-size={x-dimension=10000 y-dimension=15000} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=10000 y-dimension=15000} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=10000 y-dimension=15000} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=10000 y-dimension=15000} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=10000 y-dimension=15000} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=10000 y-dimension=15000} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=12700 y-dimension=17780} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=12700 y-dimension=17780} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery},{media-size={x-dimension=12700 y-dimension=17780} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=12700 y-dimension=17780} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=photographic-glossy},{media-size={x-dimension=12700 y-dimension=17780} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=12700 y-dimension=17780} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=12700 y-dimension=17780} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=12700 y-dimension=17780} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=12700 y-dimension=17780} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=12700 y-dimension=17780} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=12700 y-dimension=20320} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=12700 y-dimension=20320} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery},{media-size={x-dimension=12700 y-dimension=20320} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=12700 y-dimension=20320} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=photographic-glossy},{media-size={x-dimension=12700 y-dimension=20320} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=12700 y-dimension=20320} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=12700 y-dimension=20320} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=12700 y-dimension=20320} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=12700 y-dimension=20320} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=12700 y-dimension=20320} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=9842 y-dimension=19050} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=9842 y-dimension=19050} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=9842 y-dimension=19050} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=9842 y-dimension=19050} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=9842 y-dimension=19050} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=10477 y-dimension=24130} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=10477 y-dimension=24130} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=10477 y-dimension=24130} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=10477 y-dimension=24130} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=10477 y-dimension=24130} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=11000 y-dimension=22000} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=11000 y-dimension=22000} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=11000 y-dimension=22000} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=11000 y-dimension=22000} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=11000 y-dimension=22000} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=16200 y-dimension=22900} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=16200 y-dimension=22900} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=16200 y-dimension=22900} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=16200 y-dimension=22900} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=16200 y-dimension=22900} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=11400 y-dimension=16200} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=11400 y-dimension=16200} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=11400 y-dimension=16200} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=11400 y-dimension=16200} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=11400 y-dimension=16200} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=11112 y-dimension=14605} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=11112 y-dimension=14605} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=11112 y-dimension=14605} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=11112 y-dimension=14605} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=11112 y-dimension=14605} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=9207 y-dimension=16510} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=9207 y-dimension=16510} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=9207 y-dimension=16510} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=9207 y-dimension=16510} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=9207 y-dimension=16510} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=12000 y-dimension=23500} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=12000 y-dimension=23500} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=12000 y-dimension=23500} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=12000 y-dimension=23500} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=12000 y-dimension=23500} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=9000 y-dimension=20500} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=9000 y-dimension=20500} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=9000 y-dimension=20500} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=9000 y-dimension=20500} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=9000 y-dimension=20500} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=8890 y-dimension=12700} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=8890 y-dimension=12700} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery},{media-size={x-dimension=8890 y-dimension=12700} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=8890 y-dimension=12700} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=photographic-glossy},{media-size={x-dimension=8890 y-dimension=12700} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=8890 y-dimension=12700} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=8890 y-dimension=12700} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=8890 y-dimension=12700} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=8890 y-dimension=12700} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=8890 y-dimension=12700} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=12700 y-dimension=17780} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=12700 y-dimension=17780} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery},{media-size={x-dimension=12700 y-dimension=17780} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=12700 y-dimension=17780} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=photographic-glossy},{media-size={x-dimension=12700 y-dimension=17780} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=12700 y-dimension=17780} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=12700 y-dimension=17780} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=12700 y-dimension=17780} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=12700 y-dimension=17780} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=12700 y-dimension=17780} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=21590 y-dimension=33020} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=21590 y-dimension=33020} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=21590 y-dimension=33020} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=21590 y-dimension=33020} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=21590 y-dimension=33020} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=10160 y-dimension=12700} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=10160 y-dimension=12700} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery},{media-size={x-dimension=10160 y-dimension=12700} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=10160 y-dimension=12700} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=photographic-glossy},{media-size={x-dimension=10160 y-dimension=12700} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=10160 y-dimension=12700} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=10160 y-dimension=12700} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=10160 y-dimension=12700} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=10160 y-dimension=12700} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=10160 y-dimension=12700} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=10160 y-dimension=30480} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=10160 y-dimension=30480} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery},{media-size={x-dimension=10160 y-dimension=30480} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=photographic-glossy},{media-size={x-dimension=10160 y-dimension=30480} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=photographic-glossy},{media-size={x-dimension=10160 y-dimension=30480} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=10160 y-dimension=30480} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-glossy},{media-size={x-dimension=10160 y-dimension=30480} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=10160 y-dimension=30480} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=com.hp.specialty-matte},{media-size={x-dimension=10160 y-dimension=30480} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery-lightweight},{media-size={x-dimension=10160 y-dimension=30480} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery-lightweight}
        finishings-col-database (no-value) = no-value
        media-left-margin-supported (1setOf integer) = 296,0
        media-right-margin-supported (1setOf integer) = 296,0
        media-top-margin-supported (1setOf integer) = 296,0
        media-bottom-margin-supported (1setOf integer) = 296,0
        media-source-supported (keyword) = main
        media-type-supported (1setOf keyword) = stationery,photographic-glossy,com.hp.specialty-glossy,com.hp.specialty-matte,stationery-lightweight
        media-size-supported (1setOf collection) = {x-dimension=18415 y-dimension=26670},{x-dimension=21590 y-dimension=27940},{x-dimension=21590 y-dimension=35560},{x-dimension=20320 y-dimension=25400},{x-dimension=13970 y-dimension=21590},{x-dimension=14800 y-dimension=21000},{x-dimension=21000 y-dimension=29700},{x-dimension=17600 y-dimension=25000},{x-dimension=18200 y-dimension=25700},{x-dimension=10000 y-dimension=14800},{x-dimension=10500 y-dimension=14800},{x-dimension=7620 y-dimension=12700},{x-dimension=10160 y-dimension=15240},{x-dimension=10000 y-dimension=15000},{x-dimension=12700 y-dimension=17780},{x-dimension=12700 y-dimension=20320},{x-dimension=9842 y-dimension=19050},{x-dimension=10477 y-dimension=24130},{x-dimension=11000 y-dimension=22000},{x-dimension=16200 y-dimension=22900},{x-dimension=11400 y-dimension=16200},{x-dimension=11112 y-dimension=14605},{x-dimension=9207 y-dimension=16510},{x-dimension=12000 y-dimension=23500},{x-dimension=9000 y-dimension=20500},{x-dimension=8890 y-dimension=12700},{x-dimension=12700 y-dimension=17780},{x-dimension=21590 y-dimension=33020},{x-dimension=10160 y-dimension=12700},{x-dimension=10160 y-dimension=30480},{x-dimension=7620-21590 y-dimension=12700-35560}
        media-ready (keyword) = iso_a4_210x297mm
        media-col-ready (1setOf collection) = {media-size={x-dimension=21000 y-dimension=29700} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=21000 y-dimension=29700} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery}
        finishings-col-ready (no-value) = no-value
        finishings-col-supported (keyword) = finishing-template
        printer-finisher (octetString) = 
        printer-finisher-description (octetString) = 
        pages-per-minute (integer) = 11
        pages-per-minute-color (integer) = 7
        jpeg-k-octets-supported (rangeOfInteger) = 0-16384
        jpeg-x-dimension-supported (rangeOfInteger) = 0-16384
        jpeg-y-dimension-supported (rangeOfInteger) = 1-16384
        pdf-versions-supported (keyword) = none
        urf-supported (1setOf keyword) = CP1,MT1-2-8-9-10-11,PQ3-4-5,RS300-600,SRGB24,OB9,OFU0,W8-16,DEVW8-16,DEVRGB24-48,ADOBERGB24-48,IS1,V1.4,FN3
        marker-names (1setOf nameWithoutLanguage) = cyan cartridge,magenta cartridge,yellow cartridge,black cartridge
        marker-colors (1setOf nameWithoutLanguage) = #00FFFF,#FF00FF,#FFFF00,#000000
        marker-types (1setOf keyword) = ink-cartridge,ink-cartridge,ink-cartridge,ink-cartridge
        marker-low-levels (1setOf integer) = 2,2,2,2
        marker-high-levels (1setOf integer) = 100,100,100,100
        marker-levels (1setOf integer) = 100,100,100,100
        printer-supply (1setOf octetString) = type=inkCartridge;maxcapacity=100;level=100;class=supplyThatIsConsumed;unit=percent;colorantname=cyan;,type=inkCartridge;maxcapacity=100;level=100;class=supplyThatIsConsumed;unit=percent;colorantname=magenta;,type=inkCartridge;maxcapacity=100;level=100;class=supplyThatIsConsumed;unit=percent;colorantname=yellow;,type=inkCartridge;maxcapacity=100;level=100;class=supplyThatIsConsumed;unit=percent;colorantname=black;
        printer-supply-description (1setOf textWithoutLanguage) = Cyan Cartridge,Magenta Cartridge,Yellow Cartridge,Black Cartridge
        printer-firmware-name (nameWithoutLanguage) = POSPPWPP1N001.2036A.00
        printer-firmware-string-version (textWithoutLanguage) = POSPPWPP1N001.2036A.00
        printer-firmware-version (octetString) = POSPPWPP1N001.2036A.00
        printer-input-tray (octetString) = type=sheetFeedAutoNonRemovable;dimunit=micrometers;mediafeed=297000;mediaxfeed=210000;maxcapacity=-2;level=-2;unit=percent;status=0;name=Tray\ 1
        printer-output-tray (octetString) = type=unknown;maxcapacity=-2;remaining=-2;status=5;stackingorder=unknown;pagedelivery=faceUp;name=OutputTray1
        copies-default (integer) = 1
        finishings-default (enum) = none
        finishings-col-default (no-value) = no-value
        orientation-requested-default (enum) = portrait
        print-quality-default (enum) = normal
        printer-resolution-default (resolution) = 600dpi
        sides-default (keyword) = one-sided
        output-bin-default (keyword) = face-up
        output-mode-default (keyword) = auto
        print-color-mode-default (keyword) = auto
        multiple-document-handling-default (keyword) = separate-documents-uncollated-copies
        number-up-default (integer) = 1
        presentation-direction-number-up-default (keyword) = toright-tobottom
        print-rendering-intent-default (keyword) = auto
        print-scaling-default (keyword) = auto
        job-account-id-default (nameWithoutLanguage) = 
        job-accounting-user-id-default (nameWithoutLanguage) = 
        copies-supported (rangeOfInteger) = 1-99
        finishings-supported (enum) = none
        job-pages-per-set-supported (boolean) = true
        orientation-requested-supported (enum) = portrait
        print-quality-supported (1setOf enum) = draft,normal,high
        printer-resolution-supported (1setOf resolution) = 300dpi,600dpi,1200dpi
        sides-supported (keyword) = one-sided
        output-bin-supported (keyword) = face-up
        output-mode-supported (1setOf keyword) = auto,auto-monochrome,monochrome,color
        print-color-mode-supported (1setOf keyword) = auto,auto-monochrome,monochrome,color,process-monochrome
        page-ranges-supported (boolean) = true
        multiple-document-handling-supported (1setOf keyword) = separate-documents-uncollated-copies,separate-documents-collated-copies
        number-up-supported (integer) = 1
        presentation-direction-number-up-supported (keyword) = toright-tobottom
        print-rendering-intent-supported (1setOf keyword) = auto,perceptual
        print-scaling-supported (1setOf keyword) = auto,auto-fit,fill,fit,none
        printer-icons (1setOf uri) = http://192.168.1.7/images/printer-small.png,http://192.168.1.7/images/printer.png,http://192.168.1.7/images/printer-large.png
        printer-supply-info-uri (uri) = http://192.168.1.7/#hId-pgConsumables
        print-content-optimize-default (keyword) = auto
        print-content-optimize-supported (1setOf keyword) = auto,photo,graphics,text,text-and-graphics
        job-account-id-supported (boolean) = false
        job-accounting-user-id-supported (boolean) = false
        pwg-raster-document-sheet-back (keyword) = rotated
        pwg-raster-document-type-supported (1setOf keyword) = sgray_8,srgb_8,adobe-rgb_8,sgray_16,srgb_16,adobe-rgb_16,rgb_8,rgb_16
        pwg-raster-document-resolution-supported (1setOf resolution) = 300dpi,600dpi
        epcl-version-supported (textWithoutLanguage) = 1.0
        manual-duplex-supported (boolean) = false
        pclm-source-resolution-supported (1setOf resolution) = 300dpi,600dpi
        pclm-source-resolution-default (resolution) = 600dpi
        pclm-strip-height-supported (integer) = 32
        pclm-strip-height-preferred (integer) = 32
        pclm-raster-back-side (keyword) = rotated
        pclm-compression-method-preferred (1setOf keyword) = jpeg,flate,rle
        document-format-varying-attributes (keyword) = copies
        printer-get-attributes-supported (keyword) = document-format
        printer-organization (textWithoutLanguage) = 
        printer-organizational-unit (textWithoutLanguage) = 
        identify-actions-default (keyword) = display
        identify-actions-supported (keyword) = display
        limit-operations-supported (enum) = 10
        multiple-operation-time-out (integer) = 120
        multiple-document-jobs-supported (boolean) = false
        jpeg-features-supported (1setOf keyword) = arithmetic,cmyk,progressive

Project import not load

I tried to implement this lib on an Android project in the gradle app file with :
implementation 'de.gmuth.ipp:ipp-client-kotlin:1.4'
But it seems that it's not recognized :

Failed to resolve: de.gmuth.ipp:ipp-client-kotlin:1.4

Is this project still up ? How I can import it properly ?

de.gmuth.ipp.client.IppExchangeException: missing content-type in http response (application/ipp required)

import de.gmuth.ipp.client.IppPrinter

class Print {
    fun getInfo(): String {
        val host = "192.168.31.244"
//        val host = "HP40B034DCD84F.local"
        val url = "ipp://$host:631/ipp/print"
        val printer = IppPrinter(url)    // The line report error
        val buffer = StringBuilder()
        for (attribute in printer.attributes) {
            try {
                val key = attribute.key
                val value = attribute.value
                buffer.appendLine("$key: $value")
            } catch (e: Exception) {
                buffer.appendLine("err: $e")
            }
        }
        return buffer.toString()
    }
}

logs:

IPP-Client: Version: 2.3, Build: 20220627, MIT License, (c) 2020-2022 Gerhard Muth
IppClient                 INFO  ipp-server: HP HTTP Server; HP DeskJet 4530 series - F0V66B; Serial Number: TH7324D114068F; Built:Wed Jun 03, 2020 07:52:31AM {CCP1FN2023BR}
IppConfig                 INFO  userName: caijinglong
IppConfig                 INFO  ippVersion: 1.1
IppConfig                 INFO  charset: utf-8
IppConfig                 INFO  naturalLanguage: en
IppConfig                 INFO  getPrinterAttributesOnInit: true
IppMessage                INFO  158 raw ipp bytes
IppMessage                INFO  version = 1.1
IppMessage                INFO  Get-Printer-Attributes
IppMessage                INFO  request-id = 1
IppAttributesGroup        INFO  operation-attributes-tag
IppAttributesGroup        INFO    attributes-charset (charset) = utf-8
IppAttributesGroup        INFO    attributes-natural-language (naturalLanguage) = en
IppAttributesGroup        INFO    printer-uri (uri) = ipp://192.168.31.244:631/ipp/print
IppAttributesGroup        INFO    requesting-user-name (nameWithoutLanguage) = caijinglong
IppPrinter                ERROR missing content-type in http response (application/ipp required)
IppPrinter                ERROR failed to get printer attributes on init
IppClient                 INFO  ipp-server: HP HTTP Server; HP DeskJet 4530 series - F0V66B; Serial Number: TH7324D114068F; Built:Wed Jun 03, 2020 07:52:31AM {CCP1FN2023BR}
IppConfig                 INFO  userName: caijinglong
IppConfig                 INFO  ippVersion: 1.1
IppConfig                 INFO  charset: utf-8
IppConfig                 INFO  naturalLanguage: en
IppConfig                 INFO  getPrinterAttributesOnInit: true
IppMessage                INFO  158 raw ipp bytes
IppMessage                INFO  version = 1.1
IppMessage                INFO  Get-Printer-Attributes
IppMessage                INFO  request-id = 2
IppAttributesGroup        INFO  operation-attributes-tag
IppAttributesGroup        INFO    attributes-charset (charset) = utf-8
IppAttributesGroup        INFO    attributes-natural-language (naturalLanguage) = en
IppAttributesGroup        INFO    printer-uri (uri) = ipp://192.168.31.244:631/ipp/print
IppAttributesGroup        INFO    requesting-user-name (nameWithoutLanguage) = caijinglong
2022-11-24 21:29:16.810 [eventLoopGroupProxy-4-1] ERROR ktor.application - Unhandled: GET - /print
de.gmuth.ipp.client.IppExchangeException: missing content-type in http response (application/ipp required)
	at de.gmuth.ipp.client.IppClient.httpPostRequest(IppClient.kt:132)
	at de.gmuth.ipp.client.IppPrinter.fetchRawPrinterAttributes(IppPrinter.kt:521)
	at de.gmuth.ipp.client.IppPrinter.<init>(IppPrinter.kt:40)
	at de.gmuth.ipp.client.IppPrinter.<init>(IppPrinter.kt:21)
	at de.gmuth.ipp.client.IppPrinter.<init>(IppPrinter.kt:53)
	at top.kikt.Print.getInfo(Print.kt:10)

Sending a print job but nothing happens

Hi,

I am getting this following issue. i send a print job to the printer and is says success but nothing happens. i have tried the same url from an iPhone and it works fine its just android with this plugin that has the issue. here are the logs that i receive.

D/TrafficStats(23100): tagSocket(148) with statsTag=0xffffffff, statsUid=-1
I/IppJob  (23100): Wait for termination of job #19
I/IppJob  (23100): Job #19, state=processing (reasons=job-printing), uri=ipp://10.0.2.159/jobs?19
I/IppJob  (23100): Job #19, state=completed (reasons=job-completed-successfully), name=Test, impressions-completed=0, originating-host-name=10.0.2.159, originating-user-name=root, 1 documents, 
printer-uri=ipp://10.0.2.159/ipp/print, uri=ipp://10.0.2.159/jobs?19

pageRanges

Hi

I found out pageRanges allows multiple IntRange, for example 1..2,2..3 - for hardcoding, it would be okay but for programmatic use of the library i would have to use List<IntRange> and an IntRange of 1..2,2..3 is not valid.

Is it possible we fix this to use String or List ? Example: String: "1..2,3..4,6..6" or List [1..2,3..4,5..6]

Programmatically 1..2,2..3 is not a valid IntRange

Example code:

     val pages: String? = "1,2,3,4,5"
     val pagesArray = pages?.split(",")
     val range: List<IntRange>? = pagesArray?.map { it.toInt()..it.toInt() }
     
     ippPrinter.printJob(
       file,
       copies(numCopies),
       IppColorMode.Monochrome,
       pageRanges(range)
     )

Initial connection fails

Screen Shot 2021-07-20 at 3 35 27 PM
I was having an issue connecting the IppPrinter, it keeps crashing.

Screen Shot 2021-07-21 at 1 48 51 PM

Do you have any idea about this error?
I just found the ippPrinter using the terminal command 'ippfind'.

I'm using this code :
val ippPrinter = IppPrinter(URI.create("ipp://BRWD812655BA041.local:631/ipp/print"))

Thank you.

Epson L3250 failed to decode ipp response

response output based in issueNo3.kt test file
decoding_ipp_response.zip

Error trace

IppConfig                 INFO  userName: zaihan
IppConfig                 INFO  ippVersion: 1.1
IppConfig                 INFO  charset: utf-8
IppConfig                 INFO  naturalLanguage: en
IppConfig                 INFO  getPrinterAttributesOnInit: true
IssueNo3Kt                INFO  open ipp connection to ipps://192.168.1.7:631/ipp/print
HttpURLConnectionClient   DEBUG HttpURLConnectionClient created
IppPrinter                DEBUG create IppPrinter for ipps://192.168.1.7:631/ipp/print
IppOutputStream           DEBUG version = 1.1
IppOutputStream           DEBUG code = 11 (Get-Printer-Attributes)
IppOutputStream           DEBUG requestId = 1
IppOutputStream           DEBUG --- operation-attributes-tag ---
IppOutputStream           DEBUG attributes-charset (charset) = utf-8
IppOutputStream           DEBUG attributes-natural-language (naturalLanguage) = en
IppOutputStream           DEBUG printer-uri (uri) = ipps://192.168.1.7:631/ipp/print
IppOutputStream           DEBUG requesting-user-name (nameWithoutLanguage) = zaihan
IppOutputStream           DEBUG --- end-of-attributes-tag ---
IppMessage                DEBUG wrote 151 raw bytes
IppMessage                DEBUG consumed documentInputStream
HttpURLConnectionClient   TRACE Keep-Alive = [timeout=30]
HttpURLConnectionClient   TRACE null = [HTTP/1.1 200 OK]
HttpURLConnectionClient   TRACE Cache-Control = [no-cache]
HttpURLConnectionClient   TRACE Server = [Epson_IPP-Server/2.0.0]
HttpURLConnectionClient   TRACE Connection = [Keep-Alive]
HttpURLConnectionClient   TRACE Pragma = [no-cache]
HttpURLConnectionClient   TRACE Content-Length = [7452]
HttpURLConnectionClient   TRACE Content-Type = [application/ipp]
IppInputStream            DEBUG version = 1.1
IppInputStream            DEBUG code = 0 (successful-ok)
IppInputStream            DEBUG requestId = 1
IppInputStream            DEBUG --- operation-attributes-tag ---
IppInputStream            DEBUG attributes-charset (charset) = utf-8
IppInputStream            DEBUG attributes-natural-language (naturalLanguage) = en
IppInputStream            DEBUG --- printer-attributes-tag ---
IppInputStream            DEBUG copies-default (integer) = 1
IppInputStream            DEBUG copies-supported (rangeOfInteger) = 1-99
IppInputStream            DEBUG finishings-default (1setOf enum) = none
IppInputStream            DEBUG finishings-supported (1setOf enum) = none
IppInputStream            DEBUG sides-default (keyword) = one-sided
IppInputStream            DEBUG sides-supported (1setOf keyword) = one-sided
IppInputStream            DEBUG orientation-requested-default (enum) = portrait
IppInputStream            DEBUG orientation-requested-supported (1setOf enum) = portrait
IppInputStream            DEBUG media-default (keyword) = iso_a4_210x297mm
IppInputStream            DEBUG media-supported (1setOf keyword) = iso_a4_210x297mm
IppInputStream            DEBUG  (keyword) = na_index-4x6_4x6in
IppInputStream            DEBUG  (keyword) = na_5x7_5x7in
IppInputStream            DEBUG  (keyword) = na_govt-letter_8x10in
IppInputStream            DEBUG  (keyword) = om_hivision_101.6x180.6mm
IppInputStream            DEBUG  (keyword) = iso_a5_148x210mm
IppInputStream            DEBUG  (keyword) = iso_a6_105x148mm
IppInputStream            DEBUG  (keyword) = na_legal_8.5x14in
IppInputStream            DEBUG  (keyword) = na_letter_8.5x11in
IppInputStream            DEBUG  (keyword) = jis_b5_182x257mm
IppInputStream            DEBUG  (keyword) = jis_b6_128x182mm
IppInputStream            DEBUG  (keyword) = oe_photo-l_3.5x5in
IppInputStream            DEBUG  (keyword) = jpn_hagaki_100x148mm
IppInputStream            DEBUG  (keyword) = na_number-10_4.125x9.5in
IppInputStream            DEBUG  (keyword) = iso_c6_114x162mm
IppInputStream            DEBUG  (keyword) = iso_dl_110x220mm
IppInputStream            DEBUG  (keyword) = na_index-5x8_5x8in
IppInputStream            DEBUG  (keyword) = na_foolscap_8.5x13in
IppInputStream            DEBUG  (keyword) = om_16k_195x270mm
IppInputStream            DEBUG  (keyword) = om_indian-legal_215x345mm
IppInputStream            DEBUG  (keyword) = custom_min_54x86mm
IppInputStream            DEBUG  (keyword) = custom_max_215.9x1200mm
IppInputStream            DEBUG printer-resolution-default (resolution) = 360 dpi
IppInputStream            DEBUG printer-resolution-supported (1setOf resolution) = 360 dpi
IppInputStream            DEBUG  (resolution) = 1440x720 dpi
IppInputStream            DEBUG print-quality-default (enum) = normal
IppInputStream            DEBUG print-quality-supported (1setOf enum) = normal
IppInputStream            DEBUG  (enum) = 5
IppInputStream            DEBUG output-bin-default (keyword) = face-up
IppInputStream            DEBUG output-bin-supported (1setOf keyword) = face-up
IppInputStream            DEBUG media-col-supported (1setOf keyword) = media-size
IppInputStream            DEBUG  (keyword) = media-top-margin
IppInputStream            DEBUG  (keyword) = media-left-margin
IppInputStream            DEBUG  (keyword) = media-right-margin
IppInputStream            DEBUG  (keyword) = media-bottom-margin
IppInputStream            DEBUG  (keyword) = media-type
IppInputStream            DEBUG  (keyword) = media-source
IppInputStream            DEBUG media-col-default (collection) = {media-size={x-dimension=21000 y-dimension=29700} media-top-margin=300 media-left-margin=300 media-right-margin=300 media-bottom-margin=300 media-type=stationery media-source=main}
IppInputStream            DEBUG print-color-mode-default (keyword) = auto
IppInputStream            DEBUG print-color-mode-supported (1setOf keyword) = color
IppInputStream            DEBUG  (keyword) = monochrome
IppInputStream            DEBUG  (keyword) = auto-monochrome
IppInputStream            DEBUG  (keyword) = process-monochrome
IppInputStream            DEBUG  (keyword) = auto
IppInputStream            DEBUG print-content-optimize-default (keyword) = auto
IppInputStream            DEBUG print-content-optimize-supported (1setOf keyword) = auto
IppInputStream            DEBUG print-scaling-default (keyword) = auto
IppInputStream            DEBUG print-scaling-supported (1setOf keyword) = auto
IppInputStream            DEBUG  (keyword) = auto-fit
IppInputStream            DEBUG  (keyword) = fill
IppInputStream            DEBUG  (keyword) = fit
IppInputStream            DEBUG  (keyword) = none
IppInputStream            DEBUG media-size-supported (1setOf collection) = {x-dimension=21000 y-dimension=29700}
IppInputStream            DEBUG  (collection) = {x-dimension=10160 y-dimension=15240}
IppInputStream            DEBUG  (collection) = {x-dimension=12700 y-dimension=17780}
IppInputStream            DEBUG  (collection) = {x-dimension=20320 y-dimension=25400}
IppInputStream            DEBUG  (collection) = {x-dimension=10160 y-dimension=18060}
IppInputStream            DEBUG  (collection) = {x-dimension=14800 y-dimension=21000}
IppInputStream            DEBUG  (collection) = {x-dimension=10500 y-dimension=14800}
IppInputStream            DEBUG  (collection) = {x-dimension=21590 y-dimension=35560}
IppInputStream            DEBUG  (collection) = {x-dimension=21590 y-dimension=27940}
IppInputStream            DEBUG  (collection) = {x-dimension=18200 y-dimension=25700}
IppInputStream            DEBUG  (collection) = {x-dimension=12800 y-dimension=18200}
IppInputStream            DEBUG  (collection) = {x-dimension=8890 y-dimension=12700}
IppInputStream            DEBUG  (collection) = {x-dimension=10000 y-dimension=14800}
IppInputStream            DEBUG  (collection) = {x-dimension=10477 y-dimension=24130}
IppInputStream            DEBUG  (collection) = {x-dimension=11400 y-dimension=16200}
IppInputStream            DEBUG  (collection) = {x-dimension=11000 y-dimension=22000}
IppInputStream            DEBUG  (collection) = {x-dimension=12700 y-dimension=20320}
IppInputStream            DEBUG  (collection) = {x-dimension=21590 y-dimension=33020}
IppInputStream            DEBUG  (collection) = {x-dimension=19500 y-dimension=27000}
IppInputStream            DEBUG  (collection) = {x-dimension=21500 y-dimension=34500}
IppInputStream            DEBUG  (collection) = {x-dimension=5400..21590 y-dimension=8600..120000}
IppInputStream            DEBUG media-type-supported (1setOf keyword) = stationery
IppInputStream            DEBUG  (keyword) = photographic-high-gloss
IppInputStream            DEBUG  (keyword) = photographic
IppInputStream            DEBUG  (keyword) = photographic-semi-gloss
IppInputStream            DEBUG  (keyword) = photographic-glossy
IppInputStream            DEBUG  (keyword) = photographic-matte
IppInputStream            DEBUG  (keyword) = stationery-coated
IppInputStream            DEBUG  (keyword) = envelope
IppInputStream            DEBUG media-source-supported (1setOf keyword) = main
IppInputStream            DEBUG media-top-margin-supported (1setOf integer) = 0
IppInputStream            DEBUG  (integer) = 300
IppInputStream            DEBUG media-left-margin-supported (1setOf integer) = 0
IppInputStream            DEBUG  (integer) = 300
IppInputStream            DEBUG media-right-margin-supported (1setOf integer) = 0
IppInputStream            DEBUG  (integer) = 300
IppInputStream            DEBUG media-bottom-margin-supported (1setOf integer) = 0
IppInputStream            DEBUG  (integer) = 300
IppInputStream            DEBUG charset-configured (charset) = utf-8
IppInputStream            DEBUG charset-supported (1setOf charset) = utf-8
IppInputStream            DEBUG color-supported (boolean) = true
IppInputStream            DEBUG compression-supported (1setOf keyword) = none
IppInputStream            DEBUG  (keyword) = gzip
IppInputStream            DEBUG document-format-default (mimeMediaType) = application/octet-stream
IppInputStream            DEBUG document-format-supported (1setOf mimeMediaType) = application/octet-stream
IppInputStream            DEBUG  (mimeMediaType) = image/pwg-raster
IppInputStream            DEBUG  (mimeMediaType) = application/vnd.epson.escpr
IppInputStream            DEBUG generated-natural-language-supported (1setOf naturalLanguage) = en
IppInputStream            DEBUG ipp-versions-supported (1setOf keyword) = 1.0
IppInputStream            DEBUG  (keyword) = 1.1
IppInputStream            DEBUG  (keyword) = 2.0
IppInputStream            DEBUG natural-language-configured (naturalLanguage) = en
IppInputStream            DEBUG operations-supported (1setOf enum) = Print-Job
IppInputStream            DEBUG  (enum) = 4
IppInputStream            DEBUG  (enum) = 5
IppInputStream            DEBUG  (enum) = 6
IppInputStream            DEBUG  (enum) = 8
IppInputStream            DEBUG  (enum) = 9
IppInputStream            DEBUG  (enum) = 10
IppInputStream            DEBUG  (enum) = 11
IppInputStream            DEBUG  (enum) = 59
IppInputStream            DEBUG  (enum) = 60
IppInputStream            DEBUG pages-per-minute (integer) = 4
IppInputStream            DEBUG pages-per-minute-color (integer) = 9
IppInputStream            DEBUG pdl-override-supported (keyword) = attempted
IppInputStream            DEBUG printer-alert (1setOf octetString) = code=other
IppInputStream            DEBUG printer-alert-description (1setOf textWithoutLanguage) = idle
IppInputStream            DEBUG printer-device-id (textWithoutLanguage) = MFG:EPSON;CMD:ESCPL2,BDC,D4,D4PX,ESCPR1,END4,GENEP,PWGRaster;MDL:L3250 Series;CLS:PRINTER;DES:EPSON L3250 Series;CID:EpsonRGB;FID:FXN,DPN,WFA,ETN,AFN,DAN,WRA;RID:50;DDS:022500;ELG:1163;
IppInputStream            DEBUG printer-info (textWithoutLanguage) = EPSON L3250 Series
IppInputStream            DEBUG printer-is-accepting-jobs (boolean) = true
IppInputStream            DEBUG printer-location (textWithoutLanguage) = 
IppInputStream            DEBUG printer-make-and-model (textWithoutLanguage) = EPSON L3250 Series
IppInputStream            DEBUG printer-more-info (uri) = http://192.168.1.7:80/PRESENTATION/
IppInputStream            DEBUG printer-name (nameWithoutLanguage) = ipp/print
IppInputStream            DEBUG printer-state (enum) = idle
IppInputStream            DEBUG printer-state-reasons (1setOf keyword) = none
IppInputStream            DEBUG printer-up-time (integer) = 24070
IppInputStream            DEBUG printer-uri-supported (1setOf uri) = ipps://192.168.1.7:631/ipp/print
IppInputStream            DEBUG  (uri) = ipp://192.168.1.7:631/ipp/print
IppInputStream            DEBUG queued-job-count (integer) = 0
IppInputStream            DEBUG uri-security-supported (1setOf keyword) = tls
IppInputStream            DEBUG  (keyword) = none
IppInputStream            DEBUG uri-authentication-supported (1setOf keyword) = none
IppInputStream            DEBUG  (keyword) = none
IppInputStream            DEBUG printer-geo-location (unknown) = no-value
IppInputStream            DEBUG identify-actions-default (1setOf keyword) = flash
IppInputStream            DEBUG identify-actions-supported (1setOf keyword) = flash
IppInputStream            DEBUG jpeg-k-octets-supported (rangeOfInteger) = 0-16384
IppInputStream            DEBUG jpeg-x-dimension-supported (rangeOfInteger) = 0-10200
IppInputStream            DEBUG jpeg-y-dimension-supported (rangeOfInteger) = 1-10200
IppInputStream            DEBUG pdf-versions-supported (1setOf keyword) = none
IppInputStream            DEBUG urf-supported (keyword) = 
IppInputStream            DEBUG job-creation-attributes-supported (1setOf keyword) = copies
IppInputStream            DEBUG  (keyword) = finishings
IppInputStream            DEBUG  (keyword) = ipp-attribute-fidelity
IppInputStream            DEBUG  (keyword) = job-name
IppInputStream            DEBUG  (keyword) = media
IppInputStream            DEBUG  (keyword) = media-col
IppInputStream            DEBUG  (keyword) = orientation-requested
IppInputStream            DEBUG  (keyword) = output-bin
IppInputStream            DEBUG  (keyword) = print-quality
IppInputStream            DEBUG  (keyword) = printer-resolution
IppInputStream            DEBUG  (keyword) = sides
IppInputStream            DEBUG  (keyword) = print-color-mode
IppInputStream            DEBUG  (keyword) = print-content-optimize
IppInputStream            DEBUG  (keyword) = print-scaling
IppInputStream            DEBUG  (keyword) = job-mandatory-attributes
IppInputStream            DEBUG marker-names (nameWithoutLanguage) = 
IppInputStream            DEBUG marker-colors (nameWithoutLanguage) = 
IppInputStream            DEBUG marker-types (keyword) = 
IppInputStream            WARN  0 unparsed bytes
IppMessage                DEBUG read 7452 raw bytes
IppMessage                INFO  saved: /var/folders/1q/70cvcdv51c9dz1zh2rblc5d40000gn/T/decoding_ipp_response_1_failed.request18252367558343606700.tmp
IppMessage                INFO  saved: /var/folders/1q/70cvcdv51c9dz1zh2rblc5d40000gn/T/decoding_ipp_response_1_failed.response7224328624350043788.tmp
IssueNo3Kt                ERROR failed to connect to ipps://192.168.1.7:631/ipp/print
de.gmuth.ipp.client.IppExchangeException: failed to decode ipp response
	at de.gmuth.ipp.client.IppClient.decodeIppResponse(IppClient.kt:135)
	at de.gmuth.ipp.client.IppClient.exchange(IppClient.kt:84)
	at de.gmuth.ipp.client.IppPrinter.exchange(IppPrinter.kt:384)
	at de.gmuth.ipp.client.IppPrinter.getPrinterAttributes(IppPrinter.kt:198)
	at de.gmuth.ipp.client.IppPrinter.getPrinterAttributes$default(IppPrinter.kt:197)
	at de.gmuth.ipp.client.IppPrinter.updateAllAttributes(IppPrinter.kt:201)
	at de.gmuth.ipp.client.IppPrinter.<init>(IppPrinter.kt:33)
	at de.gmuth.ipp.client.IppPrinter.<init>(IppPrinter.kt:20)
	at de.gmuth.ipp.client.IssueNo3Kt.main(issueNo3.kt:30)
	at de.gmuth.ipp.client.IssueNo3Kt.main(issueNo3.kt)
Caused by: de.gmuth.ipp.core.IppException: failed to read attribute value of 'marker-low-levels' (integer)
	at de.gmuth.ipp.core.IppInputStream.readAttribute$ipp_client_kotlin(IppInputStream.kt:76)
	at de.gmuth.ipp.core.IppInputStream.readMessage(IppInputStream.kt:47)
	at de.gmuth.ipp.core.IppMessage.read(IppMessage.kt:97)
	at de.gmuth.ipp.client.IppClient.decodeIppResponse(IppClient.kt:133)
	... 9 more
Caused by: de.gmuth.ipp.core.IppException: expected value length of 4 bytes but found 0
	at de.gmuth.ipp.core.IppInputStream.readExpectedValueLength$ipp_client_kotlin(IppInputStream.kt:203)
	at de.gmuth.ipp.core.IppInputStream.readAttributeValue$ipp_client_kotlin(IppInputStream.kt:93)
	at de.gmuth.ipp.core.IppInputStream.readAttribute$ipp_client_kotlin(IppInputStream.kt:73)
	... 12 more

Process finished with exit code 0

Connect to a HP printer but fail to print out the file

Thanks in advance for your library.

        val uri = URI.create("ipp://192.168.1.30/ipp/printer")
        val file = File([email protected]().filesDir,"hello_kitty2.jpg")

        val ippClient = IppClient()
        val request = IppRequest(IppOperation.PrintJob, uri).apply {
            // constructor adds 'attributes-charset', 'attributes-natural-language' and 'printer-uri'
            operationGroup.attribute("document-format", IppTag.MimeMediaType, "image/urf")
            documentInputStream  = FileInputStream(file)
        }
        val response = ippClient.exchange(request)
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            response.jobGroup.forEach { t, u ->
                println(t + u.toString())
            }
        }

or

        val ippPrinter = IppPrinter("ipp://192.168.1.30/ipp/printer")
        val width = 2540 * 2 // hundreds of mm
        val bitmap: Bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.hello_kitty);
        val stream = ByteArrayOutputStream()
        bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream)
        val byteArray = stream.toByteArray()
        val printJob = ippPrinter.printJob(
            byteArray,
            IppMedia.Collection(
                size = IppMedia.Size(width, width * 2),
                margins = IppMedia.Margins(0)
            )
        )
        printJob.logDetails()

I have tried different APIs, the job state is pending always as below.

2023-02-21 17:16:14.601 14767-14873/com.example.airprint I/System.out: job-urijob-uri (uri) = ipp://192.168.1.30/ipp/print/0208
2023-02-21 17:16:14.601 14767-14873/com.example.airprint I/System.out: job-idjob-id (integer) = 208
2023-02-21 17:16:14.601 14767-14873/com.example.airprint I/System.out: job-statejob-state (enum) = pending
2023-02-21 17:16:14.601 14767-14873/com.example.airprint I/System.out: job-state-reasonsjob-state-reasons (1setOf keyword) = none

This is the supported document format information. I wonder if is there any way to figure out what is wrong.

com.example.airprint I/System.out: IppAttributesGroup        INFO    document-format-supported (1setOf mimeMediaType) = image/urf,application/PCLm,application/octet-stream
dependencies {
    implementation("de.gmuth:ipp-client:2.3")
    implementation("com.github.jmdns:jmdns:3.5.8")
}

URISyntaxException when using printer url with URI encoded whitespaces

When trying to connect to a ipp printer whose URI contains encoded whitespaces, e.g http://localhost/PDF%20Printer/.printer, the library throws an URISyntaxException when trying to sent the ipp request.
This is due to the IPPClients method toHttpUri using the getPath from java.net.URI which delivers the decoded path version.

fun toHttpUri(ippUri: URI) = with(ippUri) {
        val scheme = scheme.replace("ipp", "http")
        val port = if (port == -1) 631 else port
        URI.create("$scheme://$host:$port$rawPath")
 }

As a following result the call of URI.create("$scheme://$host:$port$path") throws the afformentioned exception.

As a solution one should use the java.net.URI::getRawPath

Get-Job-Attributes Failed: 'client-error-bad-request' after successful print from printer

Hi,

Running version 3.1 on an Android app written in Java.

Here is my print execution code:
`new Thread(() -> {
try {
DocumentFormat documentFormat = new DocumentFormat("application/vnd.hp-PCL");
File pclFile = new File(filepath);
String jobIdentifier = "Print job: " + externalId;
IppJob job = printer.printJob(
pclFile,
documentFormat,
jobName(jobIdentifier),
ColorMode.Auto,
Sides.OneSided
);

            getActivity().runOnUiThread(this::stopBlockingUI);
            job.waitForTermination();

        } catch (Exception e) {
            if (e.getMessage().equals("Get-Job-Attributes failed: 'client-error-bad-request'")) {
                ...
            } else if (e.getMessage().equals("timeout")) {
                ...
            } else {
                ...
            }
    }).start();`

I am printing to an HP printer.

I receive a client bad request error de.gmuth.ipp.client.IppExchangeException: Get-Job-Attributes failed: 'client-error-bad-request' every time I print this way even though my document has successfully printed in its entirety from my physical printer.

Here is the log from logcat:
image

This exception is raised half way through printing the terminal page of the document (tested with multipage document in addition to single page and for a multipage document, this error only raises while the last page of the document is printing).

I will also note this is happening when I pass .pcl files and .pwg (w/ DocumentFormat("image/pwg-raster")) files that are converted to their respective formats from PDF.

It is unclear to me what is causing the client-error-bad-request error to be thrown only when printing the terminal page (which prints successfully each time).

Lastly, I removed the call to job.waitForTermination() and caught errors in my catch block and I did not get the client-error-bad-request error raised. What are the risks of not calling this method when triggering a print job? My testing suggests that is IppPrinter.printJob(...) is a synchronous method that takes a few seconds to run, which I believe is how I caught errors in my catch block when I removed job.waitForTermination(). Does this method being synchronous negate the need to call job.waitForTermination() since that's where this mysterious client-error-bad-request is being surfaced? My first choice is to learn how to pinpoint the root cause of the client-error-bad-request issue, and then depending on risks of removing job.waitForTermination() will go that route if other error cannot be pinpointed with new leanings.

Thanks!

Unable to add the ipp network printer to cup server

Hi Team,

I would like to add the network printer to cups server using http call ( printer_host_name, port).

I couldn't find the way to add the printer to cupserver from cups api documentation.

Please share the cup api which allows to add ipp network printer into cups and share the different approaches to connect the printer.

Currently, I have connecting the cup server with cups4j library through java.

Additional Links :
OpenPrinting/cups#514
OpenPrinting/cups#516

Thanks

'application/pdf' is not supported

First of all Thank you for sharing good library!!

I success to print image using this library.
but When I try to print pdf, I failed.

According to log, my print seems not supported 'application/pdf'.

"document-format-supported (1setOf mimeMediaType) = application/octet-stream,image/pwg-raster,image/urf,image/jpeg"

Is there anyway to print pdf using ipp?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.