0

I writeing printing web application which simulate printer behavior. It uses IPP protocol to receive document within printing request. I can obtain some information about print job from IPP attribute code 0x42 in IPP headers:

  • filename - full file path (it's my aim) in case of Notepad++ and only filename if I print document from MS Word
  • user name - from OS

Can I obtain full file path from IPP independent from application? May be I can achieve this with additional request?

Sergei Bubenshchikov
  • 5,275
  • 3
  • 33
  • 60

1 Answers1

0

0x42 specifies just the value type - in this case it probably represents type nameWithoutLanguage.

Filename

Short answer: There is no standard way to obtain the file path from ipp headers.

Depending on the ipp client implementation (e.g. the windows printer driver) you might be able to use some other attributes. There are various options how a driver could submit a print job.

  • Jobs sent via the ipp operation PRINT_JOB (0x0002)

The file is being added as stream of bytes (formatted in a specific print-job-language like postscript or pdf) . Most implementations set the job attribute job-name to the name of the original filename or filepath.

  • Jobs sent via the ipp operation PRINT_URI (0x0003)

This method is rarely used but would provide a URI where the printer would have to load the file or data to print from. The URI includes a path.

Username

As for the username there is a standard ipp attribute available: requesting-user-name. It is the ipp clients (e.g. windows printer driver) responsibility to set the this value. RFC 2911 Section 3.2.1.1 Print-Job-Request says:

The "requesting-user-name" (name(MAX)) attribute SHOULD be supplied by the client as described in section 8.3.

Community
  • 1
  • 1
IPP Nerd
  • 992
  • 9
  • 25
  • Thanks for reply, Peter. Can you suggest some PS driver for Windows, which send `PRINT_URI (0x0003)`? May be with another attribute with file path string – Sergei Bubenshchikov Nov 30 '17 at 08:23
  • I am unix guy and have little knowledge about windows. It is very unlikely you find a windows driver that uses the PRINT_URI operation. Printers or print servers don't have to implement this operation because it is not a required operation. Therefore drivers usually use standard operations. Our Java implementation is capable to use the PRINT_URI operation, but that is not much help for your use case. – IPP Nerd Nov 30 '17 at 23:18
  • Peter, you said: _Our Java implementation is capable_. It's open source project? – Sergei Bubenshchikov Dec 01 '17 at 05:59
  • No, the java source is disclosed so far. What programming language do you use for your implementation? please send a personal mail (see profile for contact information) for further discussion. – IPP Nerd Dec 02 '17 at 08:38
  • I'm using Java. I have seen email in your profile. I think will be better if we shall discuss questions using Stack Overflow to share our knowledge with community :) – Sergei Bubenshchikov Dec 02 '17 at 08:53