4

I'm trying to send an IPP print job using the ipptool. Using the sample .test files, I can send commands to the printer, but I am unable to successfully use the print-job.test file.

Here's an example using ipptool.

c:\...>ipptool -v ipp://name.local.:631/ipp/printer print-job.test
ipptool: Filename "$filename" on line 21 cannot be read.
ipptool: Filename mapped to "".

It looks like it's failing resolving the variable $filename within the test file so I attempted to hardcode this value in the test file. In this case I get no error, but still no print.

Does anybody have any experience using ipptool to test ipp printing?

4 Answers 4

2

Edit a copy of your print-job.test file and save it as senloe---print-job.test.

Your edit should replace the variables in the following two lines with hard-coded values:

ATTR mimeMediaType document-format $filetype
FILE $filename

Replace them, for example with:

ATTR mimeMediaType document-format text/plain
FILE senloe---print-job.test

This should send your file senloe---print-job.test as a plain text file to printers.

You'll need to use the following command line (assuming you have CUPS installed locally):

ipptool -v -t ipp://localhost:631/printers/your-real-printername \
       ./senloe---print-job.test

You should see something like the following output:

"./senloe---print-job.test":
   Print-Job:
       attributes-charset (charset) = utf-8
       attributes-natural-language (naturalLanguage) = en
       printer-uri (uri) = ipp://localhost:631/printers/ubuquitech
       requesting-user-name (nameWithoutLanguage) = senloe
       document-format (mimeMediaType) = text/plain
       copies (integer) = 1
   Print file using Print-Job                                      [PASS]
       RECEIVED: 171 bytes in response
       status-code = successful-ok (successful-ok)
       attributes-charset (charset) = utf-8
       attributes-natural-language (naturalLanguage) = en
       job-uri (uri) = ipp://localhost:631/jobs/24
       job-id (integer) = 24
       job-state (enum) = pending
       job-state-reasons (keyword) = none

If this works, the following should also work, now using the original test file print-job.test (which contains the variables) again, and using your edited senloe---print-job.test as the file to be printed:

ipptool -v -t -f senloe---print-job.test                  \
       ipp://localhost:631/printers/your-real-printername \
       ./print-job.test
1

Try this line:

c:\...>ipptool -vt -f [name of your URF file] ipp://name.local.:631/ipp/printer print-job.test

and have the URF file in the same location as your .test file. Also, it is recommended to have the ipptool in the same location as well.

1

A while ago I created an AppImage of the IPP Sample Software which now includes not only ipptool, but also ippserver which can emulate a virtual IPP Printer in your local network.

(What's an AppImage? That is the package of a software consisting of multiple files -- even multiple different tools, apps or utilities -- bundled into a single compressed file. Just make it executable and run it from any location, on any Linux x86_64 distro.)

I also created an ASCIInema movie which demonstrates the usage of the ippsample bundle and the usage of ipptool:

asciicast

0
ipptool -v -tf /path/to/your.pdf  -d filetype=application/octet-stream -I http://printer-url/ipp /usr/share/cups/ipptool/print-job.test
1
  • You could add some explanations.
    – Toto
    Feb 12, 2018 at 19:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .