Comments (8)
oh i forgot to mention when i send the same file through ios it works fine
from jipp.
Try using 'documentFormat.of("application/octet-stream")' which is telling the printer to auto-detect. I have experienced some printers only accept that document format.
from jipp.
il test again but i have already tried this. thanks
from jipp.
Ok tested with
var transport = HttpIppClientTransport(true) val uri = URI.create("ipps://8C2279000000.local:631/ipp/print") println("Print job sent to $uri") val printRequest = IppPacket.printJob(uri) .putOperationAttributes(documentFormat.of("application/octet-stream")) .build() transport.sendData(uri, IppPacketData(printRequest, FileInputStream(filePath)))
Same issue blank page
from jipp.
Ok tried on a seccond printer and still not luck. This printer is a brother printer. again i can print from ios but not android
from jipp.
@dustin-auby What is the mimetype of file being sent via sendData ? is it a pdf file or jpeg file?
Since the printer does not support application/pdf document format, it cannot handle the pdf file. Even though the print job request is valid, so a job is created but the print is not able to handle data received via the sendData request hence the blank page.
The printer would require the client to render the pdf into a supported format like PWG raster and send it to printer via a send-document operation.
from jipp.
@dustin-auby What is the mimetype of file being sent via sendData ? is it a pdf file or jpeg file?
Since the printer does not support application/pdf document format, it cannot handle the pdf file. Even though the print job request is valid, so a job is created but the print is not able to handle data received via the sendData request hence the blank page.
The printer would require the client to render the pdf into a supported format like PWG raster and send it to printer via a send-document operation.
I have tried sending Jpeg (image/jpeg) with a jpg image, application/octet-stream with a jpg,png and pdf and i have now also tried PWG raster . none of them work on either printer.
i have also tried the sample scripts for print and render and get the same results. surely one of those formats would work on at least one printer ?
from jipp.
Hi @dustin-auby Are you getting any IPP error code as part of the printer response? Can you try like below and check and provide the request and response packets?
I am using the code below and haven't encountered any issues when testing it with some HP printers.
@Test
fun documentFormatTest() {
val transport = HttpIppClientTransport(true)
val uri = URI.create("ipps://192.168.5.38:443/ipp/print")
println("Print job sent to $uri")
val printRequest = IppPacket.printJob(uri)
.putOperationAttributes(Types.documentFormat.of("image/jpeg")) // or "application/octet-stream" also works
.build()
val path = javaClass.classLoader.getResource("sample.jpg")?.path ?: Assert.fail("Resource not found")
println(path)
println("Sending ${printRequest.prettyPrint(100, " ")}")
val response = transport.sendData(uri, IppPacketData(printRequest, FileInputStream(path as String)))
println("Received: ${response.packet.prettyPrint(100, " ")}")
}
the printer targeted above supports the below attributes for document-format
document-format-default = "application/octet-stream" (mimeMediaType),
document-format-supported = [
"application/vnd.hp-PCL" (mimeMediaType),
"image/jpeg" (mimeMediaType),
"application/PCLm" (mimeMediaType),
"image/urf" (mimeMediaType),
"image/pwg-raster" (mimeMediaType),
"application/octet-stream" (mimeMediaType) ],
You can also try not putting any operation attributes because in that case printer suppose to use the default which is "application/octet-stream" , same as in your printer as well.
so like val printRequest = IppPacket.printJob(uri).build();
"image/jpeg" or "application/octet-stream" should work directly, like this code, but for PCLm or pwg-raster we need to render and generate separate pclm or pwg streams.
from jipp.
Related Issues (20)
- Fix genType script to handle IPP registration xml released on 2022-11-28 HOT 3
- overrides appears to be ignored HOT 3
- Adding utility methods HOT 1
- How to add 'PageOrderReceived' job attribute? HOT 2
- Roam encountered an issue while parsing response of a create-job request HOT 2
- Collect data for JIPP release HOT 1
- Spike: Look into better test framework for JIPP HOT 1
- How to set IppPacket version number in Java HOT 1
- Validating IppPacket
- Serializing and Deserializing IppPacket to JSON using Jackson mapper HOT 1
- what's the magic numbers in the render sample
- Kotlin lib upgrade HOT 1
- How to add custom types/attributes to a group for GetPrinterAttributes? HOT 1
- EOF exception during load test
- LaserJet Enterprise M407[client-error-bad-request] HOT 4
- PWG decoder fails with monochrome pwg from windows 11 (112dpi, custom page size)
- DPI pdf page size
- Address changes in IPP registrations release 2023-11-27
- Update copyright information in model files
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jipp.