apple / cups

Apple CUPS Sources
https://www.cups.org
Apache License 2.0
1.91k stars 462 forks source link

question: what's the image/urf #4888

Closed yorkie closed 7 years ago

yorkie commented 7 years ago

Hey @michaelrsweet I encountered a problem when using the IPP, and think the answer should be in cups.

I bought the wireless printer HP DeskJet 4538, and opened the IPP option of it, then:

Then the problem that I'm opening this issue is what's the format "image/urf", after having googles on this keyword, few informations about that, just get knows that is a mime type introduced by Apple, Inc, I guess it's CUPS precisely.

Sorry about troubling you guys here maybe not the correct place, but I'm really looking forward how is this format, and how could we convert pdf or image files to image/urf.

Thanks.

michaelrsweet commented 7 years ago

image/urf is an Apple raster format used for AirPrint. It is not publicly documented at this time, and CUPS does not support it out of the box. (macOS includes support for it in the CoreGraphics-based filters we use)

yorkie commented 7 years ago

Okay @michaelrsweet thanks for your quick reply, so if we used CUPS at Linux or Windows, the output format will not be the image/urf?

michaelrsweet commented 7 years ago

Correct.

yorkie commented 7 years ago

The last question, could you guide me where the CUPS source is handling this, like where to use the CoreGraphics-based filters in the codebase, thanks so much :)

michaelrsweet commented 7 years ago

The CoreGraphics filters are part of macOS and not CUPS. There is no public source code for them...

yorkie commented 7 years ago

Ah, I mean how CUPS converts like application/pdf to image/urf, because I tried CUPS in my MacBook, and logged my printer jobs and see every job's mime type is image/urf :)

michaelrsweet commented 7 years ago

CUPS uses its filter chain (see the online documentation) to choose program(s) that will convert a PDF file to image/urf (or image/pwg-raster, or application/vnd.cups-raster, etc.)

On macOS the cgpdftoraster filter handles converting PDF files into image/urf, image/pwg-raster,or application/vnd.cups-raster as needed.

yorkie commented 7 years ago

Thank you @michaelrsweet that helps me so much :)

zkewal commented 6 years ago

I have an EPSON printer which supports image/urf, application/octet-stream & image/jpeg MIME types. And I am trying to print a pdf using IPP protocol from Nodejs. This is not successful. Is there any way I can convert PDF to one of the above MIME types?

michaelrsweet commented 6 years ago

@zkewal There is nothing in Nodejs to do this conversion. Aside from the CUPS filters provided on Linux and macOS, the IPP Sample Code project includes a program called "ipptransform" that can do this for you (and submit the job to the printer).

jhcloos commented 6 years ago

Epson provides a gpl-licensed raster->escp filter which works with cups.

On Debian and its derivitives the package is called printer-driver-escpr.

On Gentoo it is called net-print/epson-inkjet-printer-escpr.

I'm sure it exists on all of the linux and bsd distributions.

Esc/pr is what the printer expects as application/octet-stream.

With that and the normal pdf->raster filter installed you can just send the pdf to cups to print to their printers.

It works well.

zkewal commented 6 years ago

Are there any alternatives for windows?

michaelrsweet commented 6 years ago

@zkewal I am not aware of any alternatives for Windows - very little development is done on Windows for free software printing, and Microsoft currently does not support open standards like IPP Everywhere.

zkewal commented 6 years ago

@michaelrsweet Can I use ipptransform on Windows or Linux? How does it install?

michaelrsweet commented 6 years ago

@zkewal I don't know about Windows (we don't currently provide a Visual Studio project for it, but I think MuPDF will build there), but on Linux it is just a matter of using the snap package or doing the usual ./configure; make to get the ipptransform binary.