18 |
19 |
20 | //
21 | // Microsoft renames the POSIX functions to _name, and introduces
22 | // a broken compatibility layer using the original names. As a result,
23 | // random crashes can occur when, for example, strdup() allocates memory
24 | // from a different heap than used by malloc() and free().
25 | //
26 | // To avoid moronic problems like this, we #define the POSIX function
27 | // names to the corresponding non-standard Microsoft names.
28 | //
29 |
30 | #define access _access
31 | #define close _close
32 | #define fileno _fileno
33 | #define lseek _lseek
34 | #define lstat stat
35 | #define mkdir(d,p) _mkdir(d)
36 | #define open _open
37 | #define pclose _pclose
38 | #define popen _popen
39 | #define read _read
40 | #define rmdir _rmdir
41 | #define strdup _strdup
42 | #define unlink _unlink
43 | #define write _write
44 |
45 |
46 | // Microsoft "safe" functions use a different argument order than POSIX...
47 | #define gmtime_r(t,tm) gmtime_s(tm,t)
48 | #define localtime_r(t,tm) localtime_s(tm,t)
49 |
50 |
51 | // Map the POSIX strcasecmp() and strncasecmp() functions to the Win32
52 | // _stricmp() and _strnicmp() functions...
53 | #define strcasecmp _stricmp
54 | #define strncasecmp _strnicmp
55 |
56 |
57 | // Map the POSIX sleep() and usleep() functions to the Win32 Sleep() function...
58 | typedef unsigned long useconds_t;
59 | #define sleep(X) Sleep(1000 * (X))
60 | #define usleep(X) Sleep((X)/1000)
61 |
62 |
63 | // Map various parameters to Posix style system calls...
64 | # define F_OK 00
65 | # define W_OK 02
66 | # define R_OK 04
67 | # define X_OK 0
68 |
69 | # define O_RDONLY _O_RDONLY
70 | # define O_WRONLY _O_WRONLY
71 | # define O_CREAT _O_CREAT
72 | # define O_TRUNC _O_TRUNC
73 | # define O_CLOEXEC 0
74 | # define O_NOFOLLOW 0
75 |
76 | # define S_ISDIR(m) ((m) & _S_IFDIR)
77 | # define S_ISREG(m) (!((m) & _S_IFDIR))
78 |
79 |
80 | // Compiler stuff...
81 | #undef const
82 | #undef __CHAR_UNSIGNED__
83 |
84 |
85 | // Version number
86 | #define IPPSAMPLE_VERSION "2023.10"
87 |
88 |
89 | // PAM support
90 | /* #undef HAVE_LIBPAM */
91 | /* #undef HAVE_SECURITY_PAM_APPL_H */
92 | /* #undef HAVE_PAM_PAM_APPL_H */
93 |
94 |
95 | // CuraEngine path
96 | /* #undef CURAENGINE */
97 |
98 |
99 | #endif // !IPPSAMPLE_CONFIG_H
100 |
--------------------------------------------------------------------------------
/server/EXTENSIONS.md:
--------------------------------------------------------------------------------
1 | ippserver Extensions to IPP
2 | ===========================
3 |
4 | This file documents the `ippserver`-specific extensions to IPP. Each attribute
5 | uses the "smi2699-" prefix, where "2699" is the ISTO Printer Working Group's
6 | Private Enterprise Number.
7 |
8 |
9 | Model
10 | -----
11 |
12 | `ippserver` implements the IPP System Service, which defines a Create-Printer
13 | operation but no specific attributes or semantics for associating a Printer with
14 | an Output Device. The following additional Printer Description attributes are
15 | defined for this purpose:
16 |
17 | Attribute | Description
18 | ---------------------------------------|----------------------------
19 | smi2699-auth-print-group (name(MAX)) | Access group for print users
20 | smi2699-auth-proxy-group (name(MAX)) | Access group for proxy users
21 | smi2699-device-command (name(MAX)) | Print command for device
22 | smi2699-device-format (mimeMediaType) | Print format for device
23 | smi2699-device-name (name(MAX)) | Output device name
24 | smi2699-device-uri (uri) | Output device URI
25 |
26 | The supported values for these attributes are exposed by the following System
27 | Description attributes:
28 |
29 | Attribute | Description
30 | ---------------------------------------------------------|----------------------------
31 | smi2699-auth-group-supported (1setOf name(MAX)) | List of supported groups
32 | smi2699-device-command-supported (1setOf name(MAX)) | List of supported commands
33 | smi2699-device-format-supported (1setOf mimeMediaType) | List of supported device formats
34 | smi2699-device-uri-schemes-supported (1setOf uriScheme) | List of supported device URI schemes
35 |
36 |
37 | IANA Registration Template
38 | --------------------------
39 |
40 | ```
41 | https://github.com/istopwg/ippsample/blob/master/server/EXTENSIONS.md
42 |
43 |
44 | Printer Description attributes: Reference
45 | ------------------------------ ---------
46 | smi2699-auth-print-group (name(MAX)) [IPPSERVER]
47 | smi2699-auth-proxy-group (name(MAX)) [IPPSERVER]
48 | smi2699-device-command (name(MAX)) [IPPSERVER]
49 | smi2699-device-format (mimeMediaType) [IPPSERVER]
50 | smi2699-device-name (name(MAX)) [IPPSERVER]
51 | smi2699-device-uri (uri) [IPPSERVER]
52 |
53 | System Description attributes: Reference
54 | ------------------------------ ---------
55 | smi2699-auth-group-supported (1setOf name(MAX)) [IPPSERVER]
56 | smi2699-device-command-supported (1setOf name(MAX)) [IPPSERVER]
57 | smi2699-device-format-supported (1setOf mimeMediaType) [IPPSERVER]
58 | smi2699-device-uri-schemes-supported (1setOf uriScheme) [IPPSERVER]
59 | ```
60 |
--------------------------------------------------------------------------------
/xcode/ippsample.xcodeproj/xcshareddata/xcschemes/ippproxy.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
45 |
51 |
52 |
53 |
54 |
60 |
62 |
68 |
69 |
70 |
71 |
73 |
74 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/xcode/ippsample.xcodeproj/xcshareddata/xcschemes/ippdoclint.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
45 |
51 |
52 |
53 |
54 |
60 |
62 |
68 |
69 |
70 |
71 |
73 |
74 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/server/Dependencies:
--------------------------------------------------------------------------------
1 | auth.o: auth.c ippserver.h ../config.h ../libcups/cups/cups.h \
2 | ../libcups/cups/file.h ../libcups/cups/base.h ../libcups/cups/ipp.h \
3 | ../libcups/cups/http.h ../libcups/cups/array.h \
4 | ../libcups/cups/language.h ../libcups/cups/pwg.h \
5 | ../libcups/cups/thread.h
6 | client.o: client.c ippserver.h ../config.h ../libcups/cups/cups.h \
7 | ../libcups/cups/file.h ../libcups/cups/base.h ../libcups/cups/ipp.h \
8 | ../libcups/cups/http.h ../libcups/cups/array.h \
9 | ../libcups/cups/language.h ../libcups/cups/pwg.h \
10 | ../libcups/cups/thread.h printer-png.h printer3d-png.h
11 | conf.o: conf.c ippserver.h ../config.h ../libcups/cups/cups.h \
12 | ../libcups/cups/file.h ../libcups/cups/base.h ../libcups/cups/ipp.h \
13 | ../libcups/cups/http.h ../libcups/cups/array.h \
14 | ../libcups/cups/language.h ../libcups/cups/pwg.h \
15 | ../libcups/cups/thread.h ../libcups/cups/dir.h \
16 | ../libcups/cups/ipp-private.h
17 | device.o: device.c ippserver.h ../config.h ../libcups/cups/cups.h \
18 | ../libcups/cups/file.h ../libcups/cups/base.h ../libcups/cups/ipp.h \
19 | ../libcups/cups/http.h ../libcups/cups/array.h \
20 | ../libcups/cups/language.h ../libcups/cups/pwg.h \
21 | ../libcups/cups/thread.h
22 | ipp.o: ipp.c ippserver.h ../config.h ../libcups/cups/cups.h \
23 | ../libcups/cups/file.h ../libcups/cups/base.h ../libcups/cups/ipp.h \
24 | ../libcups/cups/http.h ../libcups/cups/array.h \
25 | ../libcups/cups/language.h ../libcups/cups/pwg.h \
26 | ../libcups/cups/thread.h
27 | job.o: job.c ippserver.h ../config.h ../libcups/cups/cups.h \
28 | ../libcups/cups/file.h ../libcups/cups/base.h ../libcups/cups/ipp.h \
29 | ../libcups/cups/http.h ../libcups/cups/array.h \
30 | ../libcups/cups/language.h ../libcups/cups/pwg.h \
31 | ../libcups/cups/thread.h
32 | log.o: log.c ippserver.h ../config.h ../libcups/cups/cups.h \
33 | ../libcups/cups/file.h ../libcups/cups/base.h ../libcups/cups/ipp.h \
34 | ../libcups/cups/http.h ../libcups/cups/array.h \
35 | ../libcups/cups/language.h ../libcups/cups/pwg.h \
36 | ../libcups/cups/thread.h
37 | main.o: main.c ippserver.h ../config.h ../libcups/cups/cups.h \
38 | ../libcups/cups/file.h ../libcups/cups/base.h ../libcups/cups/ipp.h \
39 | ../libcups/cups/http.h ../libcups/cups/array.h \
40 | ../libcups/cups/language.h ../libcups/cups/pwg.h \
41 | ../libcups/cups/thread.h
42 | printer.o: printer.c ippserver.h ../config.h ../libcups/cups/cups.h \
43 | ../libcups/cups/file.h ../libcups/cups/base.h ../libcups/cups/ipp.h \
44 | ../libcups/cups/http.h ../libcups/cups/array.h \
45 | ../libcups/cups/language.h ../libcups/cups/pwg.h \
46 | ../libcups/cups/thread.h
47 | resource.o: resource.c ippserver.h ../config.h ../libcups/cups/cups.h \
48 | ../libcups/cups/file.h ../libcups/cups/base.h ../libcups/cups/ipp.h \
49 | ../libcups/cups/http.h ../libcups/cups/array.h \
50 | ../libcups/cups/language.h ../libcups/cups/pwg.h \
51 | ../libcups/cups/thread.h
52 | subscription.o: subscription.c ippserver.h ../config.h \
53 | ../libcups/cups/cups.h ../libcups/cups/file.h ../libcups/cups/base.h \
54 | ../libcups/cups/ipp.h ../libcups/cups/http.h ../libcups/cups/array.h \
55 | ../libcups/cups/language.h ../libcups/cups/pwg.h \
56 | ../libcups/cups/thread.h
57 | transform.o: transform.c ippserver.h ../config.h ../libcups/cups/cups.h \
58 | ../libcups/cups/file.h ../libcups/cups/base.h ../libcups/cups/ipp.h \
59 | ../libcups/cups/http.h ../libcups/cups/array.h \
60 | ../libcups/cups/language.h ../libcups/cups/pwg.h \
61 | ../libcups/cups/thread.h
62 |
--------------------------------------------------------------------------------
/DOCKER.md:
--------------------------------------------------------------------------------
1 | Docker Support for IPP Sample Code
2 | ==================================
3 |
4 | This repository includes a sample Dockerfile for compiling and running
5 | `ippserver` in a Docker container, and a docker-compose.yml file for running
6 | commands via "docker compose".
7 |
8 |
9 | Building and Running on Docker
10 | ------------------------------
11 |
12 | From a shell prompt in the directory (on Windows 10|2016, macOS, or Linux)
13 | containing this docker file run:
14 |
15 | docker build -t ippsample .
16 |
17 | You now can run the container with a bash terminal and go to the
18 | `/root/ippsample` folder manually:
19 |
20 | docker run -it ippsample bash
21 |
22 | Similarly, you can run the ippsample test suite with:
23 |
24 | docker run -it ippsample make test
25 |
26 | You can also run one of the IPP binaries instead of the bash terminal, for
27 | example:
28 |
29 | docker run -it ippsample ipptool -tv ipp://example.local/ipp/print get-printer-attributes.test
30 |
31 |
32 | Building and Running with Docker Compose
33 | ----------------------------------------
34 |
35 | To start the IPP server:
36 |
37 | docker compose up ippserver
38 |
39 | Run the IPP Everywhere test:
40 |
41 | docker compose up ipptest
42 |
43 | To list all IPP printers:
44 |
45 | docker compose up ippfind
46 |
47 | To run the IPP proxy:
48 |
49 | docker compose up ippproxy
50 |
51 |
52 | Fixing The Builds / Debugging Docker Problems
53 | ---------------------------------------------
54 |
55 | If building from the Dockerfile is failing, you can debug it by running it in a
56 | shell. But you won't be able to use the tag since the build failed. So to run
57 | a shell in its container, you first need to look up the image number with the
58 | "ps" sub-command:
59 |
60 | docker ps -a
61 |
62 | Copy the latest image number from the list, then do a "docker run" specifying
63 | that image, and specify the container should be run with a shell like bash:
64 |
65 | docker run -it IMAGENUMBER bash
66 |
67 | Now you can "cd" into the folder and re-run the commands interactively, inspect
68 | the contents of the image, etc.
69 |
70 |
71 | Starting the IPP Server
72 | -----------------------
73 |
74 | Run the IPP server with all its arguments:
75 |
76 | docker run -it ippsample ippserver -M byMyself -l rightHere -m coolPrinter -n myHost -p 631 -s 72 -vvvv myPrintService
77 |
78 |
79 | *or* to run the server in debug mode using `gdb`:
80 |
81 | docker run -it ippsample gdb ippserver
82 | run -M byMyself -l rightHere -m coolPrinter -n myHost -p 631 -s 72 -vvvv myPrintService
83 |
84 |
85 | Running the IPP Client
86 | ----------------------
87 |
88 | First find all IPP printers from other Docker containers:
89 |
90 | docker run --rm ippsample ippfind
91 |
92 | > Note the URL returned, e.g., `ipp://f8a365cfc7ec.local:631/ipp/print`.
93 |
94 | Next run the IPP tool in a new container in the `/root/ippsample/examples`
95 | directory with the IPP Server running, run:
96 |
97 | docker run --rm -it -w /root/ippsample/examples ippsample ipptool [URL returned] identify-printer-display.test
98 |
99 | > Note the `IDENTIFY from 172.17.0.4: Hello, World!` message in stdout on the
100 | > `ippserver` container.
101 |
102 | To run the IPP everywhere tests on the IPP Client using setup from the previous
103 | commands, run:
104 |
105 | docker run --rm -it -w /root/ippsample/examples ippsample ipptool -V 2.0 -tf document-letter.pdf [URL returned] ipp-everywhere.test
106 |
--------------------------------------------------------------------------------
/SCRIPTING.md:
--------------------------------------------------------------------------------
1 | Scripting with ippserver
2 | ========================
3 |
4 | `ippserver` supports a simple (unauthenticated and totally insecure) REST
5 | interface for controlling the media and supply levels of printers. This
6 | interface is provided for scripted testing environments where you want to
7 | control these values for specific tests.
8 |
9 | The REST interface is implemented using HTTP GET requests with the (web form)
10 | variables passed in the URL. For example, if the printer URI is
11 | "ipp://example.local:8501/ipp/print" the corresponding REST URLs are
12 | "http://example.local:8501/ipp/print/media" for media requests and
13 | "http://example.local:8501/ipp/print/supplies" for supply requests. For "ipps"
14 | printer URIs use "https" for the REST URLs.
15 |
16 | Setting media and supply levels directly affects the corresponding printer
17 | attributes ("media-ready", "printer-supply", etc.) and indirectly affects the
18 | "printer-state-reasons" attribute.
19 |
20 |
21 | Controlling Media
22 | -----------------
23 |
24 | `ippserver` printers typically have a single media source called `main`, but can
25 | be configured with any number of sources using the "media-source-supported"
26 | attribute.
27 |
28 | The following variables are supported (where N starts at 0):
29 |
30 | - `sizeN`: The PWG media size name for the source, e.g., `na_letter_8.5x11in`.
31 | - `typeN`: The PWG media type name for the source, e.g., `stationery`.
32 | - `levelN`: The number of sheets remaining in the tray from 0 to 250.
33 |
34 | Omitting the size for a source will remove it from the "media-ready" and
35 | "media-col-ready" attributes. Setting the level to 0 will trigger the
36 | `media-empty` and (if a job is printing) `media-needed` state reasons. Setting
37 | the level from 1 to 25 will trigger the `media-low` state reason.
38 |
39 | For example, the following `curl` command will unload all media from the `main`
40 | tray and trigger the `media-empty` and `media-needed` state reasons:
41 |
42 | curl "http://example.local:8501/ipp/print/media?level0=0" >/dev/null
43 |
44 | While the following command loads 20 sheets of US Letter media and triggers the
45 | `media-low` state reason:
46 |
47 | curl "http://example.local:8501/ipp/print/media?size0=na_letter_8.5x11in&level0=20" >/dev/null
48 |
49 |
50 | Controlling Supply Levels
51 | -------------------------
52 |
53 | `ippserver` printers typically have two or five marker supplies: waste toner,
54 | black toner, cyan toner, magenta toner, and yellow toner. The color toners are
55 | only available when the printer supports color printing.
56 |
57 | The following variables are supported:
58 |
59 | - `level0`: The level for the waste toner bin, from 0 (empty) to 100 (full).
60 | - `level1`: The level for the black toner, from 0 (empty) to 100 (full).
61 | - `level2`: The level for the cyan toner, from 0 (empty) to 100 (full).
62 | - `level3`: The level for the magenta toner, from 0 (empty) to 100 (full).
63 | - `level4`: The level for the yellow toner, from 0 (empty) to 100 (full).
64 |
65 | Setting the waste toner level (`level0`) to 100 will trigger the
66 | `marker-waste-full` state reason, while setting it to 91-99 will trigger the
67 | `marker-waste-almost-full` state reason.
68 |
69 | Setting any of the toner levels (`level1` to `level4`) to 0 will trigger the
70 | `toner-empty` state reason, while setting it to 1-9 will trigger the
71 | `toner-low` state reason.
72 |
73 | For example, the following `curl` command will set the toner levels to 0 and
74 | trigger the `toner-empty` state reason:
75 |
76 | curl "http://example.local:8501/ipp/print/supplies?level1=0&level2=0&level3=0&level4=0" >/dev/null
77 |
--------------------------------------------------------------------------------
/xcode/ippsample.xcodeproj/xcshareddata/xcschemes/ippserver.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
44 |
46 |
52 |
53 |
54 |
55 |
58 |
59 |
62 |
63 |
66 |
67 |
68 |
69 |
75 |
77 |
83 |
84 |
85 |
86 |
88 |
89 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/examples/create-resource-strings.test:
--------------------------------------------------------------------------------
1 | #
2 | # Script to create a strings resource.
3 | #
4 | # Usage:
5 | #
6 | # ipptool -t -f filename.strings SYSTEM-URI create-resource-strings.test
7 | #
8 |
9 | {
10 | NAME "Create-Resource for $filename"
11 |
12 | OPERATION Create-Resource
13 | VERSION 2.0
14 |
15 | GROUP operation-attributes-tag
16 | ATTR charset attributes-charset utf-8
17 | ATTR naturalLanguage attributes-natural-language en
18 | ATTR uri system-uri $uri
19 | ATTR keyword resource-type static-strings
20 |
21 | GROUP resource-attributes-tag
22 | ATTR text resource-info "Sample message catalog."
23 | ATTR name resource-name $filename
24 |
25 | STATUS successful-ok
26 | DISPLAY resource-id
27 | EXPECT resource-id OF-TYPE integer DEFINE-VALUE resource-id
28 | EXPECT resource-id OF-TYPE integer
29 | DISPLAY resource-state
30 | EXPECT resource-state OF-TYPE enum
31 | DISPLAY resource-state-reasons
32 | EXPECT resource-state-reasons OF-TYPE keyword
33 | DISPLAY resource-uuid
34 | EXPECT resource-uuid OF-TYPE uri
35 | }
36 | {
37 | NAME "Send-Resource-Data for $filename"
38 |
39 | OPERATION Send-Resource-Data
40 | VERSION 2.0
41 |
42 | GROUP operation-attributes-tag
43 | ATTR charset attributes-charset utf-8
44 | ATTR naturalLanguage attributes-natural-language en
45 | ATTR uri system-uri $uri
46 | ATTR integer resource-id $resource-id
47 | ATTR mimeMediaType resource-format text/strings
48 |
49 | FILE $filename
50 |
51 | STATUS successful-ok
52 | DISPLAY resource-state
53 | EXPECT resource-state OF-TYPE enum
54 | DISPLAY resource-state-reasons
55 | EXPECT resource-state-reasons OF-TYPE keyword
56 | DISPLAY resource-uuid
57 | EXPECT resource-uuid OF-TYPE uri
58 | }
59 | {
60 | NAME "Install-Resource for $filename"
61 |
62 | OPERATION Install-Resource
63 | VERSION 2.0
64 |
65 | GROUP operation-attributes-tag
66 | ATTR charset attributes-charset utf-8
67 | ATTR naturalLanguage attributes-natural-language en
68 | ATTR uri system-uri $uri
69 | ATTR integer resource-id $resource-id
70 |
71 | STATUS successful-ok
72 | DISPLAY resource-state
73 | EXPECT resource-state OF-TYPE enum
74 | DISPLAY resource-state-reasons
75 | EXPECT resource-state-reasons OF-TYPE keyword
76 | DISPLAY resource-uuid
77 | EXPECT resource-uuid OF-TYPE uri
78 | }
79 | {
80 | NAME "Get-Resource-Attributes for $filename"
81 |
82 | OPERATION Get-Resource-Attributes
83 | VERSION 2.0
84 |
85 | GROUP operation-attributes-tag
86 | ATTR charset attributes-charset utf-8
87 | ATTR naturalLanguage attributes-natural-language en
88 | ATTR uri system-uri $uri
89 | ATTR integer resource-id $resource-id
90 |
91 | STATUS successful-ok
92 | DISPLAY resource-format
93 | EXPECT resource-format OF-TYPE mimeMediaType
94 | DISPLAY resource-id
95 | EXPECT resource-id OF-TYPE integer
96 | DISPLAY resource-info
97 | EXPECT resource-info OF-TYPE text
98 | DISPLAY resource-k-octets
99 | EXPECT resource-k-octets OF-TYPE integer
100 | DISPLAY resource-name
101 | EXPECT resource-name OF-TYPE name
102 | DISPLAY resource-state
103 | EXPECT resource-state OF-TYPE enum
104 | DISPLAY resource-state-reasons
105 | EXPECT resource-state-reasons OF-TYPE keyword
106 | DISPLAY resource-type
107 | EXPECT resource-type OF-TYPE keyword
108 | DISPLAY resource-uuid
109 | EXPECT resource-uuid OF-TYPE uri
110 | }
111 | {
112 | NAME "Cancel-Resource for $filename"
113 |
114 | OPERATION Cancel-Resource
115 | VERSION 2.0
116 |
117 | GROUP operation-attributes-tag
118 | ATTR charset attributes-charset utf-8
119 | ATTR naturalLanguage attributes-natural-language en
120 | ATTR uri system-uri $uri
121 | ATTR integer resource-id $resource-id
122 |
123 | STATUS successful-ok
124 | }
125 |
--------------------------------------------------------------------------------
/man/ippdoclint.1:
--------------------------------------------------------------------------------
1 | .\"
2 | .\" ippdoclint man page.
3 | .\"
4 | .\" Copyright © 2018-2019 by the Printer Working Group.
5 | .\"
6 | .\" Licensed under Apache License v2.0. See the file "LICENSE" for more
7 | .\" information.
8 | .\"
9 | .TH ippdoclint 1 "ippsample" "2019-05-17" "Apple Inc."
10 | .SH NAME
11 | ippdoclint \- check common document formats
12 | .SH SYNOPSIS
13 | .B ippdoclint
14 | [
15 | .B \-\-help
16 | ] [
17 | .B \-\-version
18 | ] [
19 | .B \-i
20 | .I input/format
21 | ] [
22 | .B \-o
23 | .I "name=value [... name=value]"
24 | ] [
25 | .B \-v
26 | ]
27 | .I filename
28 | .SH DESCRIPTION
29 | .B ippdoclint
30 | checks the input file for format errors and reports the number of impressions (sides), sheets, and (input) pages in the file.
31 | .SH OPTIONS
32 | The following options are recognized by
33 | .B ippdoclint:
34 | .TP 5
35 | .B \-\-help
36 | Shows program help.
37 | .TP 5
38 | .B \-\-version
39 | Shows program version.
40 | .TP 5
41 | .BI \-i \ input/format
42 | Specifies the MIME media type of the input file.
43 | Currently the "application/pdf" (PDF), "image/jpeg" (JPEG), "image/pwg-raster" (PWG Raster), and "image/urf" (Apple Raster) MIME media types are supported.
44 | .TP 5
45 | .BI \-o \ "name=value [... name=value]"
46 | Specifies one or more named options for the conversion.
47 | Currently the "copies", "page-ranges", "print-color-mode", and "sides" options are supported.
48 | See the NAMED OPTIONS section for more information.
49 | .TP 5
50 | .B \-v
51 | Increases the verbosity for any diagnostics.
52 | .SH NAMED OPTIONS
53 | The following named options are supported:
54 | .TP 5
55 | .B copies
56 | Specifies the number of copies that should be produced.
57 | .TP 5
58 | .B page-ranges
59 | Selects a single range of pages to check.
60 | For example, the value "5-12" selects pages 5 through 12.
61 | .TP 5
62 | .B print-color-mode
63 | Specifies the color mode as "auto" (automatic), "monochrome" (grayscale), or "color".
64 | .TP 5
65 | .B sides
66 | Specifies whether to do 1-sided printing ("one-sided") or 2-sided printing ("two-sided-long-edge" for portrait and "two-sided-short-edge" for landscape).
67 | .SH DIAGNOSTICS
68 | .B ippdoclint
69 | sends all messages to the standard error.
70 | Each message is prefixed with "ERROR", "INFO", or "DEBUG" depending on the level of verbosity.
71 | .B ippdoclint
72 | also sends "STATE" and "ATTR" messages corresponding to IPP "job-state-reasons" keywords and Job Status attributes.
73 | .SH EXIT STATUS
74 | The
75 | .B ippdoclint
76 | program returns 0 if the input file is correctly formatted and 1 otherwise.
77 | .SH ENVIRONMENT
78 | .B ippdoclint
79 | recognizes the following environment variables:
80 | .TP 5
81 | .B CONTENT_TYPE
82 | Specifies the MIME media type of the input file.
83 | .TP 5
84 | .B IPP_xxx
85 | Specifies the value of the "xxx" Job Template attribute, where "xxx" is converted to uppercase.
86 | For example, the "copies" Job Template attribute is stored as the "IPP_COPIES" environment variable.
87 | .TP 5
88 | .B IPP_xxx_DEFAULT
89 | Specifies the default value of the corresponding "xxx-default" Printer Description attribute, where "xxx" is converted to uppercase.
90 | For example, the "copies-default" Printer Description attribute is stored as the "IPP_COPIES_DEFAULT" environment variable.
91 | .TP 5
92 | .B SERVER_LOGLEVEL
93 | Specifies the log level (verbosity) as "error", "info", or "debug".
94 | .SH EXAMPLES
95 | Check a PDF file:
96 | .nf
97 |
98 | ippdoclint filename.pdf
99 | .fi
100 | .LP
101 | Check a JPEG file:
102 | .nf
103 |
104 | ippdoclint filename.jpg
105 | .fi
106 | .SH SEE ALSO
107 | .BR ipptransform (7),
108 | .BR ipptransform3d (7),
109 | PWG Internet Printing Protocol Workgroup (http://www.pwg.org/ipp)
110 | .SH COPYRIGHT
111 | Copyright \[co] 2018-2019 by the Printer Working Group.
112 |
--------------------------------------------------------------------------------
/examples/get-system-attributes.test:
--------------------------------------------------------------------------------
1 | {
2 | # The name of the test...
3 | NAME "Get-System-Attributes"
4 |
5 | # Always IPP/2.0
6 | VERSION 2.0
7 |
8 | # The operation to use
9 | OPERATION Get-System-Attributes
10 |
11 | # Attributes, starting in the operation group...
12 | GROUP operation-attributes-tag
13 | ATTR charset attributes-charset utf-8
14 | ATTR language attributes-natural-language en
15 | ATTR uri system-uri $uri
16 |
17 | # What statuses are OK?
18 | STATUS successful-ok
19 |
20 | # What attributes do we expect?
21 | EXPECT charset-configured IN-GROUP system-attributes-tag OF-TYPE charset COUNT 1
22 | EXPECT charset-supported IN-GROUP system-attributes-tag OF-TYPE charset
23 | EXPECT document-format-supported IN-GROUP system-attributes-tag OF-TYPE mimeMediaType
24 | EXPECT generated-natural-language-supported IN-GROUP system-attributes-tag OF-TYPE naturalLanguage
25 | EXPECT ipp-features-supported IN-GROUP system-attributes-tag OF-TYPE keyword
26 | EXPECT ipp-versions-supported IN-GROUP system-attributes-tag OF-TYPE keyword
27 | EXPECT natural-language-configured IN-GROUP system-attributes-tag OF-TYPE naturalLanguage COUNT 1
28 | EXPECT operations-supported IN-GROUP system-attributes-tag OF-TYPE enum
29 | EXPECT printer-creation-attributes-supported IN-GROUP system-attributes-tag OF-TYPE keyword
30 | EXPECT resource-format-supported IN-GROUP system-attributes-tag OF-TYPE mimeMediaType
31 | EXPECT resource-type-supported IN-GROUP system-attributes-tag OF-TYPE keyword
32 | EXPECT resource-settable-attributes-supported IN-GROUP system-attributes-tag OF-TYPE keyword
33 | EXPECT system-config-change-date-time IN-GROUP system-attributes-tag OF-TYPE dateTime COUNT 1
34 | EXPECT system-config-change-time IN-GROUP system-attributes-tag OF-TYPE integer COUNT 1
35 | EXPECT system-config-changes IN-GROUP system-attributes-tag OF-TYPE integer COUNT 1
36 | EXPECT system-configured-printers IN-GROUP system-attributes-tag OF-TYPE collection|no-value
37 | EXPECT system-configured-resources IN-GROUP system-attributes-tag OF-TYPE collection|no-value
38 | EXPECT system-current-time IN-GROUP system-attributes-tag OF-TYPE dateTime COUNT 1
39 | EXPECT system-default-printer-id IN-GROUP system-attributes-tag OF-TYPE integer|no-value COUNT 1
40 | EXPECT system-device-id IN-GROUP system-attributes-tag OF-TYPE text COUNT 1
41 | EXPECT system-geo-location IN-GROUP system-attributes-tag OF-TYPE uri|unknown COUNT 1
42 | EXPECT system-info IN-GROUP system-attributes-tag OF-TYPE text COUNT 1
43 | EXPECT system-location IN-GROUP system-attributes-tag OF-TYPE text COUNT 1
44 | EXPECT system-make-and-model IN-GROUP system-attributes-tag OF-TYPE text COUNT 1
45 | EXPECT system-mandatory-printer-attributes IN-GROUP system-attributes-tag OF-TYPE keyword
46 | EXPECT system-name IN-GROUP system-attributes-tag OF-TYPE name COUNT 1
47 | EXPECT system-owner-col IN-GROUP system-attributes-tag OF-TYPE collection COUNT 1
48 | EXPECT system-settable-attributes-supported IN-GROUP system-attributes-tag OF-TYPE keyword
49 | EXPECT system-state IN-GROUP system-attributes-tag OF-TYPE enum COUNT 1
50 | EXPECT system-state-change-date-time IN-GROUP system-attributes-tag OF-TYPE dateTime COUNT 1
51 | EXPECT system-state-change-time IN-GROUP system-attributes-tag OF-TYPE integer COUNT 1
52 | EXPECT system-state-message IN-GROUP system-attributes-tag OF-TYPE text COUNT 1
53 | EXPECT system-state-reasons IN-GROUP system-attributes-tag OF-TYPE keyword
54 | EXPECT system-up-time IN-GROUP system-attributes-tag OF-TYPE integer COUNT 1
55 | EXPECT system-uuid IN-GROUP system-attributes-tag OF-TYPE uri COUNT 1
56 | EXPECT system-xri-supported IN-GROUP system-attributes-tag OF-TYPE collection
57 | EXPECT xri-authentication-supported IN-GROUP system-attributes-tag OF-TYPE keyword
58 | EXPECT xri-security-supported IN-GROUP system-attributes-tag OF-TYPE keyword
59 | EXPECT xri-uri-scheme-supported IN-GROUP system-attributes-tag OF-TYPE uriScheme
60 | }
61 |
--------------------------------------------------------------------------------
/man/ippproxy.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Documentation
6 |
7 |
8 | ippproxy(8)
9 | Name
10 | ippproxy - a simple ipp proxy client
11 |
12 | Synopsis
13 | ippproxy
14 | [
15 | --help
16 | ] [
17 | --version
18 | ] [
19 | -d
20 | device-uri
21 | ] [
22 | -m
23 | mime/type
24 | ] [
25 | -p
26 | password
27 | ] [
28 | -u
29 | user
30 | ] [
31 | -v[vv]
32 | ]
33 | infrastructure-printer-uri
34 |
35 | Description
36 | ippproxy
37 | is a simple IPP proxy client conforming to the IPP Shared Infrastructure Extensions (INFRA) specification. It can be used to proxy access to a local IPP printer through an Infrastructure Printer such as
38 | ippserver (8).
39 |
40 |
41 | Options
42 | The following options are recognized by
43 | ippproxy:
44 |
45 | --help
46 | Show program help.
47 |
48 | --version
49 | Show program version.
50 |
51 | -d device-uri
52 | Specifies the local device using its URI.
53 | ippproxy
54 | supports "ipp", "ipps", and "socket" URIs.
55 |
56 | -m mime/types
57 | Specifies the output format as a MIME media type.
58 | ippproxy
59 | supports "application/vnd.hp-pcl" (HP PCL), "image/pwg-raster" (PWG Raster), and "image/urf" (Apple Raster).
60 | The default is to choose an output format automatically.
61 |
62 | -p password
63 | Specifies the password to use when authenticating with the Infrastructure Printer.
64 |
65 | -u user
66 | Specifies the user name to use when authenticating with the Infrastructure Printer.
67 |
68 | -v[vvv]
69 | Be (very) verbose when logging activity to the standard output.
70 |
71 | Exit Status
72 | The
73 | ippproxy
74 | program returns 1 if it is unable to process the command-line arguments or connect to either the infrastructure or local printers.
75 | Otherwise
76 | ippproxy
77 | will run continuously until terminated.
78 |
79 |
80 | The
81 | ippproxy
82 | program conforms to PWG Candidate Standard 5100.18: IPP Shared Infrastructure Extensions (INFRA).
83 |
84 | Example
85 | Run
86 | ippproxy
87 | with an infrastructure URI of "ipps://host.example.com/ipp/print" and a local URI of "ipp://10.0.1.42/ipp/print":
88 |
89 |
90 | ippproxy -d ipp://10.0.1.42/ipp/print ipps://host.example.com/ipp/print
91 |
92 | See Also
93 | ippserver (8),
94 |
95 | PWG Internet Printing Protocol Workgroup (http://www.pwg.org/ipp )
96 |
97 | Copyright
98 | Copyright © 2014-2018 by the Printer Working Group.
99 | Copyright © 2007-2018 by Apple Inc.
100 |
101 |
102 |
--------------------------------------------------------------------------------
/test/print3d/foo3d.conf:
--------------------------------------------------------------------------------
1 | Command ipptransform3d
2 | DeviceURI usbserial:///dev/ttyACM0
3 |
4 | Attr mimeMediaType document-format-default model/3mf
5 | Attr mimeMediaType document-format-supported model/3mf,application/vnd.pwg-safe-gcode
6 |
7 | Attr keyword job-creation-attributes-supported materials-col,platform-temperature,print-accuracy,print-base,print-quality,print-supports
8 |
9 | Attr integer material-diameter-supported 2850000
10 | Attr keyword material-purpose-supported all
11 | Attr rangeOfInteger material-rate-supported 1-24
12 | Attr keyword material-rate-units-supported ml_sec
13 | Attr rangeOfInteger material-shell-thickness-supported 0-2000000
14 | Attr rangeOfInteger material-temperature-supported 180-265
15 | Attr keyword material-type-supported pla,abs
16 |
17 | Attr collection materials-col-database {
18 | Member name material-name "Blue PLA"
19 | Member keyword material-key "pla-blue"
20 | Member keyword material-color "blue"
21 | Member integer material-diameter 285
22 | Member rangeOfInteger material-temperature 190-230
23 | Member keyword material-type "pla"
24 | },{
25 | Member name material-name "Red PLA"
26 | Member keyword material-key "pla-red"
27 | Member keyword material-color "red"
28 | Member integer material-diameter 285
29 | Member rangeOfInteger material-temperature 190-230
30 | Member keyword material-type "pla"
31 | },{
32 | Member name material-name "Natural PLA"
33 | Member keyword material-key "pla-natural"
34 | Member keyword material-color "white"
35 | Member integer material-diameter 285
36 | Member rangeOfInteger material-temperature 190-230
37 | Member keyword material-type "pla"
38 | }
39 | Attr collection materials-col-default {
40 | Member name material-name "Blue PLA"
41 | Member keyword material-key "pla-blue"
42 | Member keyword material-color "blue"
43 | Member integer material-diameter 285
44 | Member integer material-fill-density 50
45 | Member keyword material-purpose "all"
46 | Member integer material-shell-thickness 1000
47 | Member rangeOfInteger material-temperature 190-230
48 | Member keyword material-type "pla"
49 | }
50 | Attr collection materials-col-ready {
51 | Member name material-name "Blue PLA"
52 | Member keyword material-key "pla-blue"
53 | Member keyword material-color "blue"
54 | Member integer material-diameter 285
55 | Member rangeOfInteger material-temperature 190-230
56 | Member keyword material-type "pla"
57 | },{
58 | Member name material-name "Red PLA"
59 | Member keyword material-key "pla-red"
60 | Member keyword material-color "red"
61 | Member integer material-diameter 285
62 | Member rangeOfInteger material-temperature 190-230
63 | Member keyword material-type "pla"
64 | }
65 | Attr keyword materials-col-supported material-color,material-diameter,material-fill-density,material-key,material-name,material-purpose,material-shell-thickness,material-temperature,material-type
66 |
67 | Attr integer max-materials-col-supported 1
68 |
69 | Attr integer platform-temperature-default 60
70 | Attr rangeOfInteger platform-temperature-supported 50-100
71 |
72 | Attr keyword accuracy-units-supported nm,um,mm
73 | Attr collection print-accuracy-default {
74 | Member keyword accuracy-units um
75 | Member integer x-accuracy 100
76 | Member integer y-accuracy 100
77 | Member integer z-accuracy 100
78 | }
79 | Attr collection print-accuracy-supported {
80 | Member keyword accuracy-units um
81 | Member integer x-accuracy 20
82 | Member integer y-accuracy 20
83 | Member integer z-accuracy 20
84 | }
85 |
86 | Attr keyword print-base-default none
87 | Attr keyword print-base-supported none,brim,raft,skirt
88 |
89 | Attr enum print-quality-default 4
90 | Attr enum print-quality-supported 3,4,5
91 |
92 | Attr keyword print-supports-default none
93 | Attr keyword print-supports-supported none,standard
94 |
95 | Attr collection printer-volume-supported {
96 | Member integer x-dimension 22300
97 | Member integer y-dimension 22300
98 | Member integer z-dimension 20500
99 | }
100 |
--------------------------------------------------------------------------------
/examples/ipp-3d.scad:
--------------------------------------------------------------------------------
1 | /*
2 | * A 3D interpretation of the PWG IPP logo.
3 | *
4 | * Copyright © 2016 by Michael R Sweet.
5 | */
6 |
7 | /* Parameters */
8 | $finalwidth = 1.25 * 25.4;
9 | $scaling = $finalwidth / 20.0;
10 | $bumpout = 0.75 / $scaling;
11 |
12 | scale(v=[$scaling,$scaling,$scaling]) {
13 | /* COLOR: BLACK */
14 | color([0.25,0.25,0.25]) {
15 | /* Scanner head */
16 | linear_extrude(height=3) {
17 | polygon(points=[[-10,8],[-10,11],[-9-cos(22.5),11+sin(22.5)],[-9-cos(45),11+sin(45)],[-9-cos(67.5),11+sin(67.5)],[-9,12],[-2,12],[-1,10],[4,11],[10,10],[0,8]]);
18 | }
19 | /* Base for "3D" */
20 | linear_extrude(height=2) {
21 | polygon(points=[[-10,-16],[-10,-10],[10,-10],[10,-16],[9+cos(22.5),-16-sin(22.5)],[9+cos(45),-16-sin(45)],[9+cos(67.5),-16-sin(67.5)],[9,-17],[-9,-17],[-9-cos(67.5),-16-sin(67.5)],[-9-cos(45),-16-sin(45)],[-9-cos(22.5),-16-sin(22.5)]]);
22 | }
23 | /* Small wedge for "3D" */
24 | translate(v=[0,-10,2]) {
25 | rotate(a=[90,0,0]) {
26 | linear_extrude(height=7) {
27 | polygon(points=[[-5,0],[0,1.25],[5,0]]);
28 | }
29 | }
30 | }
31 | }
32 |
33 | /* COLOR: PWG BLUE */
34 | color([75/255,90/255,168/255]) {
35 | /* Center body */
36 | translate(v=[0,8,0]) {
37 | rotate(a=[90,0,0]) {
38 | linear_extrude(height=18) {
39 | polygon(points=[[-10,0],[-10,3],[-9-cos(22.5),3+sin(22.5)],[-9-cos(45),3+sin(45)],[-9-cos(67.5),3+sin(67.5)],[-9,4],[9,4],[9+cos(67.5),3+sin(67.5)],[9+cos(45),3+sin(45)],[9+cos(22.5),3+sin(22.5)],[10,3],[10,0]]);
40 | }
41 | }
42 | }
43 | }
44 |
45 | /* COLOR: WHITE */
46 | color([1,1,1]) {
47 | /* Activity light */
48 | translate(v=[0,0,4]) {
49 | linear_extrude(height=$bumpout) {
50 | polygon(points=[[-8,5.5],[-8,6.5],[-5,6.5],[-5,5.5]]);
51 | }
52 | }
53 | /* Top line */
54 | translate(v=[0,4,0]) {
55 | rotate(a=[90,0,0]) {
56 | linear_extrude(height=0.5) {
57 | $bottom = 3;
58 | $top = $bottom + $bumpout;
59 | polygon(points=[[-10,$bottom],[-10,$top],[-9-cos(22.5),$top+sin(22.5)],[-9-cos(45),$top+sin(45)],[-9-cos(67.5),$top+sin(67.5)],[-9,$top+1],[9,$top+1],[9+cos(67.5),$top+sin(67.5)],[9+cos(45),$top+sin(45)],[9+cos(22.5),$top+sin(22.5)],[10,$top],[10,$bottom],[9+cos(22.5),$bottom+sin(22.5)],[9+cos(45),$bottom+sin(45)],[9+cos(67.5),$bottom+sin(67.5)],[9,$bottom+1],[-9,$bottom+1],[-9-cos(67.5),$bottom+sin(67.5)],[-9-cos(45),$bottom+sin(45)],[-9-cos(22.5),$bottom+sin(22.5)]]);
60 | }
61 | }
62 | }
63 | /* Bottom line */
64 | translate(v=[0,-6,0]) {
65 | rotate(a=[90,0,0]) {
66 | linear_extrude(height=0.5) {
67 | $bottom = 3;
68 | $top = $bottom + $bumpout;
69 | polygon(points=[[-10,$bottom],[-10,$top],[-9-cos(22.5),$top+sin(22.5)],[-9-cos(45),$top+sin(45)],[-9-cos(67.5),$top+sin(67.5)],[-9,$top+1],[9,$top+1],[9+cos(67.5),$top+sin(67.5)],[9+cos(45),$top+sin(45)],[9+cos(22.5),$top+sin(22.5)],[10,$top],[10,$bottom],[9+cos(22.5),$bottom+sin(22.5)],[9+cos(45),$bottom+sin(45)],[9+cos(67.5),$bottom+sin(67.5)],[9,$bottom+1],[-9,$bottom+1],[-9-cos(67.5),$bottom+sin(67.5)],[-9-cos(45),$bottom+sin(45)],[-9-cos(22.5),$bottom+sin(22.5)]]);
70 | }
71 | }
72 | }
73 | /* "IPP" */
74 | translate(v=[0,-1.35,4]) {
75 | linear_extrude(height=$bumpout) {
76 | text("IPP", font="Helvetica Neue:style=Bold", size=6.5, halign="center", valign="center");
77 | }
78 | }
79 | /* "3D" */
80 | translate(v=[0,-13.5,3.25]) {
81 | rotate(a=[0,-14,0]) {
82 | linear_extrude(height=$bumpout) {
83 | text("3", font="Helvetica Neue:style=Bold+Italic", size=5, halign="right", valign="center");
84 | }
85 | }
86 | }
87 | translate(v=[0,-13.5,3.25]) {
88 | rotate(a=[0,14,0]) {
89 | linear_extrude(height=$bumpout) {
90 | text("D", font="Helvetica Neue:style=Bold+Italic", size=5, halign="left", valign="center");
91 | }
92 | }
93 | }
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/BUILD.md:
--------------------------------------------------------------------------------
1 | Build Instructions for the IPP Sample Code
2 | ==========================================
3 |
4 | This file describes how to compile and install the IPP sample code. For more
5 | information on the IPP sample code see the file called `README.md`. Changes are
6 | summarized in the file `CHANGES.md`.
7 |
8 | If you are building the sample code on Windows, skip to the bottom of this page
9 | to the section titled ["Building on Windows."](#building-on-windows)
10 |
11 |
12 | Prerequisites
13 | -------------
14 |
15 | You'll need a C99-compliant C compiler plus a POSIX-compliant make program and
16 | a POSIX-compliant shell (/bin/sh). The GNU compiler tools and Bash work well
17 | and we have tested the current IPP sample code against several versions of Clang
18 | and GCC with excellent results.
19 |
20 | The makefiles used by the project should work with most versions of make. BSD
21 | users should use GNU make (gmake) since BSD make does not support the POSIX
22 | "include" directive.
23 |
24 | Besides these tools you'll need the following libraries:
25 |
26 | - Avahi or mDNSResponder for mDNS/DNS-SD support
27 | - GNU TLS, LibreSSL, or OpenSSL for encryption support
28 | - ZLIB for compression support
29 | - CoreGraphics (macOS), Poppler, or Xpdf PDF rasterization support (optional)
30 | - CuraEngine for 3MF/STL slicing support (optional)
31 | - PAM for authentication support (optional)
32 |
33 | On a stock Debian/Ubuntu install, the following command will install all
34 | prerequisites:
35 |
36 | sudo apt-get install build-essential autoconf avahi-daemon avahi-utils \
37 | cura-engine libavahi-client-dev libnss-mdns libpam-dev libssl-dev \
38 | zlib1g-dev
39 |
40 |
41 | Configuration
42 | -------------
43 |
44 | The IPP sample code uses GNU autoconf, so you should find the usual `configure`
45 | script in the main source directory. To configure the code for your system,
46 | type:
47 |
48 | ./configure
49 |
50 | The default installation will put the software in the `/usr/local` directory on
51 | your system. Use the `--prefix` option to install the software in another
52 | location:
53 |
54 | ./configure --prefix=/some/directory
55 |
56 | To see a complete list of configuration options, use the `--help` option:
57 |
58 | ./configure --help
59 |
60 | If any of the dependent libraries are not installed in a system default location
61 | (typically `/usr/include` and `/usr/lib`) you'll need to set the CFLAGS,
62 | CPPFLAGS, CXXFLAGS, DSOFLAGS, and LDFLAGS environment variables prior to running
63 | configure:
64 |
65 | CFLAGS="-I/some/directory" \
66 | CPPFLAGS="-I/some/directory" \
67 | CXXFLAGS="-I/some/directory" \
68 | DSOFLAGS="-L/some/directory" \
69 | LDFLAGS="-L/some/directory" \
70 | ./configure ...
71 |
72 | Once you have configured things, just type:
73 |
74 | make ENTER
75 |
76 | to build the software.
77 |
78 |
79 | Installing the Software
80 | -----------------------
81 |
82 | Once you have built the software you need to install it. The `install` target
83 | provides a quick way to install the software on your local system:
84 |
85 | make install ENTER
86 |
87 | Use the BUILDROOT variable to install to an alternate root directory:
88 |
89 | make BUILDROOT=/some/other/root/directory install ENTER
90 |
91 |
92 | Getting Debug Logging
93 | ---------------------
94 |
95 | Pass the `--enable-debug` option to the configure script to enable debug logging
96 | support. The following environment variables are used to enable and control
97 | debug logging at run-time:
98 |
99 | - `CUPS_DEBUG_FILTER`: Specifies a POSIX regular expression to control which
100 | messages are logged.
101 | - `CUPS_DEBUG_LEVEL`: Specifies a number from 0 to 9 to control the verbosity of
102 | the logging. The default level is 1.
103 | - `CUPS_DEBUG_LOG`: Specifies a log file to use. Specify the name "-" to send
104 | the messages to stderr. Prefix a filename with "+" to append to an existing
105 | file. You can include a single "%d" in the filename to embed the current
106 | process ID.
107 |
108 |
109 | Building on Windows
110 | -------------------
111 |
112 | The IPP Sample Code includes a Visual Studio 2019+ solution file in the "vcnet"
113 | directory called "ippsample.sln". After opening the solution in Visual Studio
114 | (VS 2022 users will need to "upgrade" the projects), please do the following
115 | steps to ensure that the package dependencies are installed:
116 |
117 | 1. From the "Tools" menu select "Command-Line" and "Developer PowerShell" to
118 | open a PowerShell window in the "vcnet" directory.
119 |
120 | 2. Type the following commands:
121 |
122 | cd ..\libcups\vcnet
123 | nuget restore
124 | cd ..\pdfio
125 | nuget restore
126 |
127 | 3. You should then be able to build the solution (F7).
128 |
--------------------------------------------------------------------------------
/test/print/ippserver-data-type-test.conf:
--------------------------------------------------------------------------------
1 | #
2 | # PWG ippserver functional test :
3 | # configuration file with all claimed supported data types and values
4 | #
5 | # Copyright © 2017-2022 Printer Working Group
6 | #
7 |
8 | MAKE "PWG"
9 | MODEL "ippserver data type support test conf file"
10 |
11 | ##############################################
12 | # PWG ippserver basic types test attributes
13 | ##############################################
14 | #
15 | # These are PWG "vendor-specific" attribute definitions that should be definable
16 | # and representable by ippserver. If there are errors then something is broken.
17 | #
18 |
19 | #ATTR admin-define pwg-test-admin-define-type
20 | #ATTR admin-define pwg-test-admin-define-type-one-set
21 |
22 | ATTR boolean pwg-test-boolean-type true
23 | ATTR boolean pwg-test-boolean-type-one-set false,true
24 |
25 | ATTR charset pwg-test-charset-type utf-8
26 | ATTR charset pwg-test-charset-type-one-set us-ascii,utf-8,iso-8859-1
27 |
28 | ATTR collection pwg-test-collection-type
29 | {
30 | MEMBER integer pwg-member-integer 69
31 | MEMBER integer pwg-member-integer-set 69,42,99
32 | }
33 | ATTR collection pwg-test-collection-type-one-set
34 | {
35 | MEMBER integer pwg-member-integer 69
36 | MEMBER integer pwg-member-integer-set 69,42,99
37 | },
38 | {
39 | MEMBER integer pwg-member-integer 69
40 | MEMBER integer pwg-member-integer-set 69,42,99
41 | }
42 |
43 | ATTR dateTime pwg-test-dateTime-type 2016-03-07T13:55:30Z
44 | ATTR dateTime pwg-test-dateTime-type-one-set 2016-03-07T13:55:30Z,2017-06-05T14:14:49-0800
45 |
46 | # ATTR default pwg-test-default-type
47 | # ATTR default pwg-test-default-type-one-set
48 |
49 | # ATTR delete-attribute pwg-test-delete-attribute-type
50 | # ATTR delete-attribute pwg-test-delete-attribute-type-one-set
51 |
52 | ATTR enum pwg-test-enum-type 1
53 | ATTR enum pwg-test-enum-type-one-set 2,3,4
54 |
55 | ATTR integer pwg-test-integer-type 1234567
56 | ATTR integer pwg-test-integer-type-one-set -2147483648,-1,0,1,2147483647
57 |
58 | ATTR keyword pwg-test-keyword-type pwg-test-keyword-1
59 | ATTR keyword pwg-test-keyword-type-one-set pwg-test-keyword-2,pwg-test-keyword-3
60 |
61 | ATTR mimeMediaType pwg-test-mimeMediaType-type text/plain # "text/plain; charset = utf-8"
62 | ATTR mimeMediaType pwg-test-mimeMediaType-type-one-set image/pwg-raster,image/jpeg,text/plain
63 |
64 | # ATTR nameWithLanguage pwg-test-nameWithLanguage-type An unquoted name with spaces
65 | # ATTR nameWithLanguage pwg-test-nameWithLanguage-type-one-set
66 |
67 | ATTR nameWithoutLanguage pwg-test-nameWithoutLanguage-type "A quoted name with spaces"
68 | ATTR nameWithoutLanguage pwg-test-nameWithoutLanguage-type-one-set "A quoted name with spaces in a set","Another quoted name with spaces in a set"
69 |
70 | ATTR naturalLanguage pwg-test-naturalLanguage-type en-us
71 | ATTR naturalLanguage pwg-test-naturalLanguage-type-one-set fr,fr-ca,de,zh-cn
72 |
73 | ATTR no-value pwg-test-no-value-type # no value
74 | # ATTR no-value pwg-test-no-value-type-one-set
75 |
76 | ATTR not-settable pwg-test-not-settable-type # no value
77 | # ATTR not-settable pwg-test-not-settable-type-one-set
78 |
79 | ATTR octetString pwg-test-octetString-type code=unknown;severity=other;group=other
80 | ATTR octetString pwg-test-octetString-type-one-set code=unknown;severity=other;group=other,code=unknown;severity=other;group=other,code=unknown;severity=other;group=other,code=unknown;severity=otherother,code=unknown;severity=otherother,code=printerReadyToPrint;severity=other;group=generalPrinter,code=unknown;severity=other;group=other,code=unknown;severity=other;group=other
81 |
82 | ATTR rangeOfInteger pwg-test-rangeOfInteger-type 0-200
83 | ATTR rangeOfInteger pwg-test-rangeOfInteger-type-one-set -1100-2200,0-41502
84 |
85 | ATTR resolution pwg-test-resolution-type 600dpi
86 | ATTR resolution pwg-test-resolution-type-one-set 300dpi,600dpi
87 |
88 | # ATTR textWithLanguage pwg-test-textWithLanguage-type
89 | # ATTR textWithLanguage pwg-test-textWithLanguage-type-one-set
90 |
91 | ATTR textWithoutLanguage pwg-test-textWithoutLanguage-type "A quoted text blob with spaces"
92 | ATTR textWithoutLanguage pwg-test-textWithoutLanguage-type-one-set "A quoted text blob with spaces","Another quoted text blob with spaces"
93 |
94 | ATTR unknown pwg-test-unknown-type # no value
95 | # ATTR unknown pwg-test-unknown-type-one-set
96 |
97 | ATTR unsupported pwg-test-unsupported-type # no value
98 | # ATTR unsupported pwg-test-unsupported-type-one-set
99 |
100 | ATTR uri pwg-test-uri-type ipps://cloudprint.pwg.org/my-cool-printer
101 | ATTR uri pwg-test-uri-type-one-set https://www.pwg.org/ipp/everywhere.html,mailto:chair@pwg.org
102 |
103 | ATTR uriScheme pwg-test-uriScheme-type http
104 | ATTR uriScheme pwg-test-uriScheme-type-one-set http,https,mailto,ssh
105 |
--------------------------------------------------------------------------------
/examples/ipp-3d-with-grommet.scad:
--------------------------------------------------------------------------------
1 | /*
2 | * A 3D interpretation of the PWG IPP logo, with keychain grommet added.
3 | *
4 | * Copyright © 2016 by Michael R Sweet.
5 | */
6 |
7 | /* Parameters */
8 | $finalwidth = 1.25 * 25.4;
9 | $scaling = $finalwidth / 20.0;
10 | $bumpout = 0.75 / $scaling;
11 |
12 | scale(v=[$scaling,$scaling,$scaling]) {
13 | /* COLOR: BLACK */
14 | color([0.25,0.25,0.25]) {
15 |
16 | /* Keyring grommet */
17 | translate(v=[-5,13.75,0]) {
18 | difference() {
19 | cylinder(h=2, r=2.75, $fn=100);
20 | translate(v=[0,0,-1]) {
21 | cylinder(h=4, r=1.75, $fn=100);
22 | }
23 | }
24 | }
25 | /* Scanner head */
26 | linear_extrude(height=3) {
27 | polygon(points=[[-10,8],[-10,11],[-9-cos(22.5),11+sin(22.5)],[-9-cos(45),11+sin(45)],[-9-cos(67.5),11+sin(67.5)],[-9,12],[-2,12],[-1,10],[4,11],[10,10],[0,8]]);
28 | }
29 | /* Base for "3D" */
30 | linear_extrude(height=2) {
31 | polygon(points=[[-10,-16],[-10,-10],[10,-10],[10,-16],[9+cos(22.5),-16-sin(22.5)],[9+cos(45),-16-sin(45)],[9+cos(67.5),-16-sin(67.5)],[9,-17],[-9,-17],[-9-cos(67.5),-16-sin(67.5)],[-9-cos(45),-16-sin(45)],[-9-cos(22.5),-16-sin(22.5)]]);
32 | }
33 | /* Small wedge for "3D" */
34 | translate(v=[0,-10,2]) {
35 | rotate(a=[90,0,0]) {
36 | linear_extrude(height=7) {
37 | polygon(points=[[-5,0],[0,1.25],[5,0]]);
38 | }
39 | }
40 | }
41 | }
42 |
43 | /* COLOR: PWG BLUE */
44 | color([75/255,90/255,168/255]) {
45 | /* Center body */
46 | translate(v=[0,8,0]) {
47 | rotate(a=[90,0,0]) {
48 | linear_extrude(height=18) {
49 | polygon(points=[[-10,0],[-10,3],[-9-cos(22.5),3+sin(22.5)],[-9-cos(45),3+sin(45)],[-9-cos(67.5),3+sin(67.5)],[-9,4],[9,4],[9+cos(67.5),3+sin(67.5)],[9+cos(45),3+sin(45)],[9+cos(22.5),3+sin(22.5)],[10,3],[10,0]]);
50 | }
51 | }
52 | }
53 | }
54 |
55 | /* COLOR: WHITE */
56 | color([1,1,1]) {
57 | /* Activity light */
58 | translate(v=[0,0,4]) {
59 | linear_extrude(height=$bumpout) {
60 | polygon(points=[[-8,5.5],[-8,6.5],[-5,6.5],[-5,5.5]]);
61 | }
62 | }
63 | /* Top line */
64 | translate(v=[0,4,0]) {
65 | rotate(a=[90,0,0]) {
66 | linear_extrude(height=0.5) {
67 | $bottom = 3;
68 | $top = $bottom + $bumpout;
69 | polygon(points=[[-10,$bottom],[-10,$top],[-9-cos(22.5),$top+sin(22.5)],[-9-cos(45),$top+sin(45)],[-9-cos(67.5),$top+sin(67.5)],[-9,$top+1],[9,$top+1],[9+cos(67.5),$top+sin(67.5)],[9+cos(45),$top+sin(45)],[9+cos(22.5),$top+sin(22.5)],[10,$top],[10,$bottom],[9+cos(22.5),$bottom+sin(22.5)],[9+cos(45),$bottom+sin(45)],[9+cos(67.5),$bottom+sin(67.5)],[9,$bottom+1],[-9,$bottom+1],[-9-cos(67.5),$bottom+sin(67.5)],[-9-cos(45),$bottom+sin(45)],[-9-cos(22.5),$bottom+sin(22.5)]]);
70 | }
71 | }
72 | }
73 | /* Bottom line */
74 | translate(v=[0,-6,0]) {
75 | rotate(a=[90,0,0]) {
76 | linear_extrude(height=0.5) {
77 | $bottom = 3;
78 | $top = $bottom + $bumpout;
79 | polygon(points=[[-10,$bottom],[-10,$top],[-9-cos(22.5),$top+sin(22.5)],[-9-cos(45),$top+sin(45)],[-9-cos(67.5),$top+sin(67.5)],[-9,$top+1],[9,$top+1],[9+cos(67.5),$top+sin(67.5)],[9+cos(45),$top+sin(45)],[9+cos(22.5),$top+sin(22.5)],[10,$top],[10,$bottom],[9+cos(22.5),$bottom+sin(22.5)],[9+cos(45),$bottom+sin(45)],[9+cos(67.5),$bottom+sin(67.5)],[9,$bottom+1],[-9,$bottom+1],[-9-cos(67.5),$bottom+sin(67.5)],[-9-cos(45),$bottom+sin(45)],[-9-cos(22.5),$bottom+sin(22.5)]]);
80 | }
81 | }
82 | }
83 | /* "IPP" */
84 | translate(v=[0,-1.35,4]) {
85 | linear_extrude(height=$bumpout) {
86 | text("IPP", font="Helvetica Neue:style=Bold", size=6.5, halign="center", valign="center");
87 | }
88 | }
89 | /* "3D" */
90 | translate(v=[0,-13.5,3.25]) {
91 | rotate(a=[0,-14,0]) {
92 | linear_extrude(height=$bumpout) {
93 | text("3", font="Helvetica Neue:style=Bold+Italic", size=5, halign="right", valign="center");
94 | }
95 | }
96 | }
97 | translate(v=[0,-13.5,3.25]) {
98 | rotate(a=[0,14,0]) {
99 | linear_extrude(height=$bumpout) {
100 | text("D", font="Helvetica Neue:style=Bold+Italic", size=5, halign="left", valign="center");
101 | }
102 | }
103 | }
104 | }
105 | }
106 |
--------------------------------------------------------------------------------
/server/DESIGN.md:
--------------------------------------------------------------------------------
1 | # IPP Server Design Overview
2 |
3 | This version of ippserver is much more complete than the one provided in the original CUPS sources while being simpler and easier to modify than the CUPS scheduler (cupsd). It supports:
4 |
5 | - "Baked in" or file-based configuration;
6 | - Multiple persistent print services/queues, both direct print (to IPP/IPPS URI) and printing via proxies (IPP Shared Infrastructure Extensions);
7 | - Retained Jobs and Documents;
8 | - Authentication using Pluggable Authentication Modules (PAM);
9 | - Basic web interface (status monitoring only);
10 | - Basic Document transforms (JPEG and PDF to PWG Raster);
11 | - Hold/release;
12 | - Release printing/fan-out;
13 | - Local overrides of printer capabilities (ready media, duplex, color, etc.); and
14 | - Operation as an on-demand service via launchd, systemd, etc.
15 |
16 | The following are planned to be added as the corresponding specifications reach prototype quality:
17 |
18 | - IPP System Service
19 | - IPP 3D Printing Extensions
20 |
21 | ## Source Organization
22 |
23 | The server is composed of several source files roughly organized by object or function:
24 |
25 | - "ippserver.h": Common header file
26 | - "client.c": IPP Client request processing
27 | - "conf.c": Configuration file support
28 | - "device.c": Output device support
29 | - "ipp.c": IPP Printer request processing
30 | - "job.c": Job object and processing
31 | - "log.c": Logging
32 | - "main.c": Main entry
33 | - "printer.c": Printer object
34 | - "subscription.c": Subscription object and event processing
35 | - "transform.c": Document (format) transforms
36 |
37 | ## Configuration Files
38 |
39 | Configuration files are placed in a directory specified on the command-line. The "system.conf" configuration file specifies server-wide settings, for example:
40 |
41 | "system.conf":
42 | DefaultPrinter foo
43 | LogLevel debug
44 | LogFile stderr
45 |
46 | Print services (queues) are placed in a subdirectory called "print", for example:
47 |
48 | "print/foo.conf":
49 | DeviceURI ipp://foo.example.com/ipp/print
50 | Attr collection media-col-ready {media-size={x-dimension=21590 y-dimension=27940}},{media-size={x-dimension=21000 y-dimension=29700}}
51 | Attr keyword media-ready na_letter_8.5x11in,iso_a4_210x297mm
52 |
53 | "print/bar.conf":
54 | ProxyUser bar
55 | Attr keyword job-hold-until-default indefinite
56 |
57 | The first example ("print/foo.conf") creates a direct print queue at "ipp://servername:port/ipp/print/foo" that overrides the "media-col-ready" and "media-ready" attributes reported by the printer with US Letter and ISO A4 media.
58 |
59 | The second example ("print/bar.conf") creates a proxy print queue at "ipp://servername:port/ipp/print/bar" that overrides the "job-hold-until-default" attribute so that all jobs are held by default. Any Proxy that authenticates using user "bar" can register to pull print jobs from this queue.
60 |
61 | ## Job Commands
62 |
63 | Commands are used both to process (print) a job and to transform/filter a job into a printable format. Each command receives the source (print) file on the command-line, for example:
64 |
65 | mycommand /tmp/ippserver.12345/foo/1-mydocument.pdf
66 |
67 | The standard input is redirected from /dev/null. The standard output is directed to either /dev/null for printer commands or the destination file for transforms performed by ippserver. The standard error is directed back to ippserver over a pipe which allows the command to send messages that affect the printer and job state as well as messages for the server log.
68 |
69 | The environment is inherited from ippserver with the following additional variables:
70 |
71 | - "CONTENT_TYPE": The source file's MIME media type, for example "application/pdf".
72 | - "DEVICE_URI": The destination device URI such as "ipp://foo.example.com/ipp/print" or "socket://bar.example.com". For printer commands only.
73 | - "DOCUMENT_CHARSET": The source file's character set, if specified.
74 | - "DOCUMENT_LANGUAGE": The source file's natural language, if specified.
75 | - "DOCUMENT_NAME": The source file's name, if specified.
76 | - "DOCUMENT_PASSWORD": The source file's password, if any.
77 | - "IPP_name": Job attributes converted from "foo-bar" to "IPP_FOO_BAR". The value is a string version of the IPP attribute.
78 | - "JOB_PASSWORD": The password to use when submitting the job, if any. For printer commands only.
79 | - "JOB_PASSWORD_ENCRYPTION": The named hash to use when submitting the job, if any. For printer commands only.
80 | - "OUTPUT_ORDER": The order of output pages, either "first-to-last" or "last-to-first".
81 | - "OUTPUT_TYPE": The destination MIME media type, for example "image/pwg-raster".
82 | - "PRINTER_MEDIA_DEFAULT": The default media size.
83 | - "PRINTER_SIDES_DEFAULT": The default duplex setting.
84 | - "PWG_RASTER_DOCUMENT_RESOLUTION_SUPPORTED": The list of comma-delimited resolutions that are supported by the output device.
85 | - "PWG_RASTER_DOCUMENT_SHEET_BACK": The transform to apply to the back size image when producing duplex output.
86 | - "PWG_RASTER_DOCUMENT_TYPE_SUPPORTED": The color spaces and bit depths that are supported by the output device.
87 | - "SERVER_LOGLEVEL": The configured log level of the server.
88 |
--------------------------------------------------------------------------------
/man/ippdoclint.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Documentation
6 |
7 |
8 | ippdoclint(1)
9 | Name
10 | ippdoclint - check common document formats
11 |
12 | Synopsis
13 | ippdoclint
14 | [
15 | --help
16 | ] [
17 | --version
18 | ] [
19 | -i
20 | input/format
21 | ] [
22 | -o
23 | "name=value [... name=value]"
24 | ] [
25 | -v
26 | ]
27 | filename
28 |
29 | Description
30 | ippdoclint
31 | checks the input file for format errors and reports the number of impressions (sides), sheets, and (input) pages in the file.
32 |
33 | Options
34 | The following options are recognized by
35 | ippdoclint:
36 |
37 | --help
38 | Shows program help.
39 |
40 | --version
41 | Shows program version.
42 |
43 | -i input/format
44 |
45 | Specifies the MIME media type of the input file.
46 | Currently the "application/pdf" (PDF), "image/jpeg" (JPEG), "image/pwg-raster" (PWG Raster), and "image/urf" (Apple Raster) MIME media types are supported.
47 |
48 | -o "name=value [... name=value]"
49 |
50 | Specifies one or more named options for the conversion.
51 | Currently the "copies", "page-ranges", "print-color-mode", and "sides" options are supported.
52 | See the NAMED OPTIONS section for more information.
53 |
54 | -v
55 | Increases the verbosity for any diagnostics.
56 |
57 | Named Options
58 | The following named options are supported:
59 |
60 | copies
61 | Specifies the number of copies that should be produced.
62 |
63 | page-ranges
64 | Selects a single range of pages to check.
65 | For example, the value "5-12" selects pages 5 through 12.
66 |
67 | print-color-mode
68 | Specifies the color mode as "auto" (automatic), "monochrome" (grayscale), or "color".
69 |
70 | sides
71 | Specifies whether to do 1-sided printing ("one-sided") or 2-sided printing ("two-sided-long-edge" for portrait and "two-sided-short-edge" for landscape).
72 |
73 | Diagnostics
74 | ippdoclint
75 | sends all messages to the standard error.
76 | Each message is prefixed with "ERROR", "INFO", or "DEBUG" depending on the level of verbosity.
77 | ippdoclint
78 | also sends "STATE" and "ATTR" messages corresponding to IPP "job-state-reasons" keywords and Job Status attributes.
79 |
80 | Exit Status
81 | The
82 | ippdoclint
83 | program returns 0 if the input file is correctly formatted and 1 otherwise.
84 |
85 | Environment
86 | ippdoclint
87 | recognizes the following environment variables:
88 |
89 | CONTENT_TYPE
90 | Specifies the MIME media type of the input file.
91 |
92 | IPP_xxx
93 | Specifies the value of the "xxx" Job Template attribute, where "xxx" is converted to uppercase.
94 | For example, the "copies" Job Template attribute is stored as the "IPP_COPIES" environment variable.
95 |
96 | IPP_xxx_DEFAULT
97 | Specifies the default value of the corresponding "xxx-default" Printer Description attribute, where "xxx" is converted to uppercase.
98 | For example, the "copies-default" Printer Description attribute is stored as the "IPP_COPIES_DEFAULT" environment variable.
99 |
100 | SERVER_LOGLEVEL
101 | Specifies the log level (verbosity) as "error", "info", or "debug".
102 |
103 | Examples
104 | Check a PDF file:
105 |
106 |
107 | ippdoclint filename.pdf
108 |
109 | Check a JPEG file:
110 |
111 |
112 | ippdoclint filename.jpg
113 |
114 | See Also
115 | ipptransform (7),
116 |
117 | ipptransform3d (7),
118 |
119 | PWG Internet Printing Protocol Workgroup (http://www.pwg.org/ipp )
120 |
121 | Copyright
122 | Copyright © 2018-2019 by the Printer Working Group.
123 |
124 |
125 |
--------------------------------------------------------------------------------
/man/ipptransform3d.7:
--------------------------------------------------------------------------------
1 | .\"
2 | .\" ipptransform3d man page.
3 | .\"
4 | .\" Copyright © 2016-2019 by the Printer Working Group.
5 | .\" Copyright © 2016-2019 by Apple Inc.
6 | .\"
7 | .\" Licensed under Apache License v2.0. See the file "LICENSE" for more
8 | .\" information.
9 | .\"
10 | .TH ipptransform3d 7 "ippsample" "2019-05-17" "Apple Inc."
11 | .SH NAME
12 | ipptransform3d \- convert 3d document data to alternate formats
13 | .SH SYNOPSIS
14 | .B ipptransform3d
15 | [
16 | .B \-\-help
17 | ] [
18 | .B \-d
19 | .I device-uri
20 | ] [
21 | .B \-i
22 | .I input/format
23 | ] [
24 | .B \-m
25 | .I output/format;machine=name
26 | ] [
27 | .B \-o
28 | .I "name=value [... name=value]"
29 | ] [
30 | .B \-v
31 | ]
32 | .I filename
33 | .SH DESCRIPTION
34 | .B ipptransform3d
35 | converts the input file into the output format and optionally sends the output to a USB (serial) printer.
36 | .B ipptransform3d
37 | is normally run by
38 | .BR ippserver (8)
39 | to convert document data for printing.
40 | .SH OPTIONS
41 | The following options are recognized by
42 | .B ipptransform3d:
43 | .TP 5
44 | .B \-\-help
45 | Shows program help.
46 | .TP 5
47 | .BI \-d \ device-uri
48 | Specifies an output device as a URI.
49 | Currently only the "usbserial" URI scheme is supported, for example "usbserial:///dev/ttyACM0" to send print data to an attached USB printer on Linux.
50 | .TP 5
51 | .BI \-i \ input/format
52 | Specifies the MIME media type of the input file.
53 | Currently the "model/3mf" (3MF) and "application/sla" (STL) MIME media types are supported.
54 | .TP 5
55 | .BI \-m \ output/format;machine=name
56 | Specifies the MIME media type of the output file.
57 | Currently only the "application/g-code" (G-code) MIME media type is supported.
58 | The "machine=name" parameter specifies a machine-specific variant such as "ultimaker2".
59 | .TP 5
60 | .BI \-o \ "name=value [... name=value]"
61 | Specifies one or more named options for the conversion.
62 | Currently the "materials-col", "platform-temperature", "print-accuracy", "print-base", "print-quality", and "print-supports" options are supported.
63 | See the NAMED OPTIONS section for more information.
64 | .TP 5
65 | .B \-v
66 | Increases the verbosity for any diagnostics.
67 | .SH NAMED OPTIONS
68 | The following named options are supported:
69 | .TP 5
70 | .B materials-col
71 | Specifies the material(s) to use.
72 | Each value is surrounded by curley braces and contains a list of material properties and their values, e.g., '{material-diameter=285 material-type="pla" ...}'.
73 | The "material-diameter", "material-fill-density", "material-purpose", "material-rate", "material-rate-units", "material-shell-thickness", "material-temperature", and "material-type" properties are supported.
74 | .TP 5
75 | .B platform-temperature
76 | Specifies the temperature of the build platform in degrees Celsius.
77 | .TP 5
78 | .B print-accuracy
79 | Specifies the dimensional accuracy requirements for the print.
80 | For example, a horizontal accuracy of 0.1mm and vertical accuracy of 0.05mm is '{x-accuracy=100 y-accuracy=100 z-accuracy=50 accuracy-units=um}'.
81 | .TP 5
82 | .B print-base
83 | Specifies whether brims, rafts, or skirts should be printed.
84 | The values 'none', 'brim', 'raft', and 'skirt' are supported.
85 | .TP 5
86 | .B print-quality
87 | Specifies the print quality with value 3 (draft), 4 (normal), or 5 (high/best).
88 | .TP 5
89 | .B print-supports
90 | Specifies whether supports are printed.
91 | The values 'none', 'material', and 'standard' are supported.
92 | .SH DIAGNOSTICS
93 | .B ipptransform3d
94 | sends all messages to the standard error.
95 | Each message is prefixed with "ERROR", "INFO", or "DEBUG" depending on the level of verbosity.
96 | .SH EXIT STATUS
97 | The
98 | .B ipptransform3d
99 | program returns 0 if the input file is converted successfully and 1 otherwise.
100 | .SH ENVIRONMENT
101 | .B ipptransform3d
102 | recognizes the following environment variables:
103 | .TP 5
104 | .B CONTENT_TYPE
105 | Specifies the MIME media type of the input file.
106 | .TP 5
107 | .B DEVICE_URI
108 | Specifies the output device as a URI.
109 | .TP 5
110 | .B DOCUMENT_NAME
111 | Specifies the title of the input file.
112 | .TP 5
113 | .B IPP_xxx
114 | Specifies the value of the "xxx" Job Template attribute, where "xxx" is converted to uppercase.
115 | For example, the "materials-col" Job Template attribute is stored as the "IPP_MATERIALS_COL" environment variable.
116 | .TP 5
117 | .B IPP_xxx_DEFAULT
118 | Specifies the default value of the corresponding "xxx-default" Printer Description attribute, where "xxx" is converted to uppercase.
119 | For example, the "materials-col-default" Printer Description attribute is stored as the "IPP_MATERIALS_COL_DEFAULT" environment variable.
120 | .TP 5
121 | .B OUTPUT_TYPE
122 | Specifies the MIME media type of the output file.
123 | For 'application/g-code' the "flavor" media type parameter specifies the variant of G-code to produce: 'bfb', 'griffin', 'mach3', 'makerbot', 'reprap' (default), 'reprap-volumatric', and 'ultimaker' are currently supported.
124 | .TP 5
125 | .B SERVER_LOGLEVEL
126 | Specifies the log level (verbosity) as "error", "info", or "debug".
127 | .SH EXAMPLES
128 | Print a 3MF file to a G-code printer connected via USB on Linux using the default options:
129 | .nf
130 |
131 | ipptransform3d -d usbserial:///dev/usbACM0 -m application/g-code \\
132 | filename.3mf
133 | .fi
134 | .SH SEE ALSO
135 | .BR ippdoclint (7),
136 | .BR ippserver (8),
137 | .BR ipptool (1),
138 | .BR ipptransform (7)
139 | .SH COPYRIGHT
140 | Copyright \[co] 2016-2019 by the Printer Working Group.
141 | Copyright \[co] 2016-2019 by Apple Inc.
142 |
--------------------------------------------------------------------------------
/examples/pwg5100.11.test:
--------------------------------------------------------------------------------
1 | #
2 | #Check a printer for conformance with pwg5100.11
3 | #
4 | #
5 | #Usage:
6 | #
7 | # ./ipptool -f FILENAME printer-uri pwg5100.11.3.test
8 | #
9 |
10 | {
11 | # get printer attributes and check support for REQUIRED attributes
12 |
13 | NAME "Get printer attributes using Get-Printer-Attributes"
14 | OPERATION Get-Printer-Attributes
15 |
16 | GROUP operation-attributes-tag
17 | ATTR charset attributes-charset utf-8
18 | ATTR language attributes-natural-language en
19 | ATTR uri printer-uri $uri
20 |
21 | STATUS successful-ok
22 |
23 | EXPECT operations-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 0x0038 # Cancel-Jobs
24 | EXPECT operations-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 0x0039 # Cancel-My-Jobs
25 | EXPECT operations-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 0x003B # Close-Job
26 | EXPECT operations-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 0x003A # Resubmit-Job
27 | EXPECT operations-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 0x002C # Reprocess-Job
28 |
29 | EXPECT job-ids-supported OF-TYPE boolean IN-GROUP printer-attributes-tag WITH-VALUE "true" COUNT 1 # To check the job-ids operation-attribute support in Get-Jobs and Purge-Jobs
30 |
31 | EXPECT proof-print-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE proof-print-copies #
32 | EXPECT proof-print-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE media #
33 | # checking proof-print and related attributes.
34 | EXPECT proof-print-default OF-TYPE collection|no-value IN-GROUP printer-attributes-tag #
35 | #
36 | EXPECT which-jobs-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE completed #
37 | EXPECT which-jobs-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE not-completed #
38 | EXPECT which-jobs-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE saved #
39 |
40 | EXPECT ?job-hold-until-time-supported OF-TYPE rangeOfInteger IN-GROUP printer-attributes-tag DEFINE-MATCH HAVE_JOB_HOLD_UNTIL_TIME
41 | EXPECT ?job-delay-output-until-time-supported OF-TYPE rangeOfInteger IN-GROUP printer-attributes-tag DEFINE-MATCH HAVE_JOB_DELAY_OUTPUT_UNTIL_TIME
42 | EXPECT ?job-delay-output-until-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag DEFINE-MATCH HAVE_JOB_DELAY_OUTPUT_UNTIL
43 |
44 | EXPECT job-hold-until-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag IF-DEFINED HAVE_JOB_HOLD_UNTIL_TIME
45 | EXPECT job-hold-until-default OF-TYPE keyword|name IN-GROUP printer-attributes-tag WITH-VALUE-FROM job-hold-until-supported COUNT 1 IF-DEFINED HAVE_JOB_HOLD_UNTIL_TIME
46 | EXPECT operations-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 0x000C IF-DEFINED HAVE_JOB_HOLD_UNTIL_TIME # Hold-Job
47 | EXPECT operations-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 0x000D IF-DEFINED HAVE_JOB_HOLD_UNTIL_TIME # Release-Job
48 |
49 | EXPECT job-delay-output-until-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag IF-DEFINED HAVE_JOB_DELAY_OUTPUT_UNTIL_TIME
50 | EXPECT job-delay-output-until-default OF-TYPE keyword|name IN-GROUP printer-attributes-tag WITH-VALUE-FROM job-delay-output-until-supported COUNT 1 IF-DEFINED HAVE_JOB_DELAY_OUTPUT_UNTIL_TIME
51 | EXPECT operations-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 0x0014 IF-DEFINED HAVE_JOB_DELAY_OUTPUT_UNTIL_TIME # Set-job-attributes
52 |
53 | EXPECT operations-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 0x0014 IF-DEFINED HAVE_JOB_DELAY_OUTPUT_UNTIL # Set-job-attributes
54 | }
55 |
56 | {
57 | NAME "print-job with proof-print"
58 | OPERATION Print-Job
59 |
60 | GROUP operation-attributes-tag
61 | ATTR charset attributes-charset utf-8
62 | ATTR language attributes-natural-language en
63 | ATTR uri printer-uri $uri
64 | ATTR name requesting-user-name $user
65 | ATTR mimeMediaType document-format $filetype
66 |
67 | GROUP job-attributes-tag
68 | ATTR integer copies 1
69 | ATTR collection proof-print {
70 | MEMBER integer proof-print-copies 1
71 | MEMBER keyword media letterhead
72 | }
73 |
74 | FILE $filename
75 |
76 | STATUS successful-ok
77 |
78 | EXPECT job-id OF-TYPE integer IN-GROUP job-attributes-tag WITH-VALUE >0 COUNT 1
79 | EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1
80 | }
81 |
82 | # Wait for job to complete...
83 |
84 | {
85 | NAME "Get-Job-Attributes Until Job Complete"
86 | OPERATION Get-Job-Attributes
87 |
88 | GROUP operation-attributes-tag
89 | ATTR charset attributes-charset utf-8
90 | ATTR naturalLanguage attributes-natural-language en
91 | ATTR uri printer-uri $uri
92 | ATTR integer job-id $job-id
93 | ATTR name requesting-user-name $user
94 |
95 | STATUS successful-ok
96 |
97 | EXPECT proof-print OF-TYPE collection IN-GROUP job-attributes-tag COUNT 1
98 | EXPECT proof-print/proof-print-copies OF-TYPE integer WITH-VALUE 1 COUNT 1
99 | EXPECT proof-print/media OF-TYPE keyword WITH-VALUE letterhead COUNT 1
100 | EXPECT job-state OF-TYPE unknown|enum IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >6 REPEAT-NO-MATCH REPEAT-LIMIT 30
101 | DISPLAY job-state
102 | }
103 |
104 | {
105 | NAME "Resubmit proof-print job"
106 | OPERATION Resubmit-Job
107 |
108 | GROUP operation-attributes-tag
109 | ATTR charset attributes-charset utf-8
110 | ATTR language attributes-natural-language en
111 | ATTR uri printer-uri $uri
112 | ATTR integer job-id $job-id
113 | ATTR name requesting-user-name $user
114 |
115 | STATUS successful-ok
116 | }
--------------------------------------------------------------------------------
/test/print/ipp-everywhere-pdf.conf:
--------------------------------------------------------------------------------
1 | #
2 | #
3 |
4 | MAKE "PWG"
5 | MODEL "IPP Everywhere Basic Printer Simulator"
6 |
7 |
8 | #########
9 | # IPP Attributes
10 |
11 | ATTR uri printer-uuid "urn:uuid:deadbeef-0000-1111-2222-000000000002"
12 |
13 | ATTR keyword ipp-features-supported document-object,ipp-everywhere,infrastructure-printer,page-overrides
14 |
15 | #ATTR mimeMediaType document-format-supported image/jpeg,image/pwg-raster,application/pdf
16 | ATTR mimeMediaType document-format-supported image/jpeg,image/pwg-raster,application/pdf,application/octet-stream
17 | #ATTR mimeMediaType document-format-default image/pwg-raster
18 | ATTR mimeMediaType document-format-default application/octet-stream
19 |
20 | # IPP Everywhere Dependencies
21 | ATTR resolution pwg-raster-document-resolution-supported 300dpi,600dpi
22 | ATTR keyword pwg-raster-document-sheet-back rotated
23 | ATTR keyword pwg-raster-document-type-supported sgray_8,srgb_8,adobe-rgb_8,rgb_8
24 |
25 |
26 | ############################
27 | # Media Support
28 |
29 | ATTR keyword media-default na_letter_8.5x11in
30 | ATTR keyword media-supported na_letter_8.5x11in,iso_a4_210x297mm
31 | ATTR keyword media-type-default auto
32 | ATTR keyword media-type-supported auto,paper,photographic-glossy,com.hp.ecosmart-lite
33 | ATTR keyword media-col-supported media-type,media-size,media-top-margin,media-left-margin,media-right-margin,media-bottom-margin,media-source,duplex-supported
34 |
35 | #
36 | # media-col-database
37 | #
38 | ATTR collection media-col-database
39 | {
40 | MEMBER keyword media-type "auto"
41 | MEMBER keyword media-type auto
42 | MEMBER keyword media-source main
43 | MEMBER keyword media-color white
44 | MEMBER collection media-size
45 | {
46 | MEMBER integer x-dimension 21590
47 | MEMBER integer y-dimension 27940
48 | }
49 | MEMBER integer media-bottom-margin 500
50 | MEMBER integer media-left-margin 500
51 | MEMBER integer media-right-margin 500
52 | MEMBER integer media-top-margin 500
53 | },
54 | {
55 | MEMBER keyword media-type "auto"
56 | MEMBER keyword media-type auto
57 | MEMBER keyword media-source main
58 | MEMBER keyword media-color white
59 | MEMBER collection media-size
60 | {
61 | MEMBER integer x-dimension 21000
62 | MEMBER integer y-dimension 29700
63 | }
64 | MEMBER integer media-bottom-margin 500
65 | MEMBER integer media-left-margin 500
66 | MEMBER integer media-right-margin 500
67 | MEMBER integer media-top-margin 500
68 | },
69 | {
70 | MEMBER keyword media-type "paper"
71 | MEMBER keyword media-type auto
72 | MEMBER keyword media-source main
73 | MEMBER keyword media-color white
74 | MEMBER collection media-size
75 | {
76 | MEMBER integer x-dimension 21590
77 | MEMBER integer y-dimension 27940
78 | }
79 | MEMBER integer media-bottom-margin 500
80 | MEMBER integer media-left-margin 500
81 | MEMBER integer media-right-margin 500
82 | MEMBER integer media-top-margin 500
83 | },
84 | {
85 | MEMBER keyword media-type "paper"
86 | MEMBER keyword media-type auto
87 | MEMBER keyword media-source main
88 | MEMBER keyword media-color white
89 | MEMBER collection media-size
90 | {
91 | MEMBER integer x-dimension 21000
92 | MEMBER integer y-dimension 29700
93 | }
94 | MEMBER integer media-bottom-margin 500
95 | MEMBER integer media-left-margin 500
96 | MEMBER integer media-right-margin 500
97 | MEMBER integer media-top-margin 500
98 | },
99 | {
100 | MEMBER keyword media-type "photographic-glossy"
101 | MEMBER keyword media-type auto
102 | MEMBER keyword media-source main
103 | MEMBER keyword media-color white
104 | MEMBER collection media-size
105 | {
106 | MEMBER integer x-dimension 21590
107 | MEMBER integer y-dimension 27940
108 | }
109 | MEMBER integer media-bottom-margin 0
110 | MEMBER integer media-left-margin 0
111 | MEMBER integer media-right-margin 0
112 | MEMBER integer media-top-margin 0
113 | }
114 |
115 |
116 | #
117 | # media-col-ready
118 | #
119 | # Missing: photographic-glossy letter size
120 | #
121 | ATTR collection media-col-ready
122 | {
123 | MEMBER keyword media-type "auto"
124 | MEMBER keyword media-type auto
125 | MEMBER keyword media-source main
126 | MEMBER keyword media-color white
127 | MEMBER collection media-size
128 | {
129 | MEMBER integer x-dimension 21590
130 | MEMBER integer y-dimension 27940
131 | }
132 | MEMBER integer media-bottom-margin 500
133 | MEMBER integer media-left-margin 500
134 | MEMBER integer media-right-margin 500
135 | MEMBER integer media-top-margin 500
136 | },
137 | {
138 | MEMBER keyword media-type "paper"
139 | MEMBER keyword media-type auto
140 | MEMBER keyword media-source main
141 | MEMBER keyword media-color white
142 | MEMBER collection media-size
143 | {
144 | MEMBER integer x-dimension 21590
145 | MEMBER integer y-dimension 27940
146 | }
147 | MEMBER integer media-bottom-margin 500
148 | MEMBER integer media-left-margin 500
149 | MEMBER integer media-right-margin 500
150 | MEMBER integer media-top-margin 500
151 | }
152 |
153 |
154 | #
155 | # media-col-default
156 | #
157 | ATTR collection media-col-default
158 | {
159 | MEMBER keyword media-type "auto"
160 | MEMBER keyword media-type auto
161 | MEMBER keyword media-source main
162 | MEMBER keyword media-color white
163 | MEMBER collection media-size
164 | {
165 | MEMBER integer x-dimension 21590
166 | MEMBER integer y-dimension 27940
167 | }
168 | MEMBER integer media-bottom-margin 500
169 | MEMBER integer media-left-margin 500
170 | MEMBER integer media-right-margin 500
171 | MEMBER integer media-top-margin 500
172 | }
173 |
174 | # Media Support (End)
175 | ############################
176 |
177 |
178 |
179 | ############################
180 | # Other Features
181 |
182 | # Two Sided Printing - supported and enabled by default
183 | ATTR keyword sides-supported one-sided,two-sided-long-edge,two-sided-short-edge
184 | ATTR keyword sides-default two-sided-long-edge
185 |
--------------------------------------------------------------------------------
/vcnet/ippdoclint.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | x64
7 |
8 |
9 | Release
10 | x64
11 |
12 |
13 |
14 | {94D3D49D-4BF7-4335-BB61-E37498ADBC92}
15 | ippdoclint
16 | Win32Proj
17 | 10.0
18 |
19 |
20 |
21 | Application
22 | v142
23 | Unicode
24 | true
25 |
26 |
27 | Application
28 | v142
29 | Unicode
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | <_ProjectFileVersion>12.0.30501.0
43 |
44 |
45 | $(Platform)\$(Configuration)\
46 | $(Platform)\$(Configuration)\$(ProjectName)\
47 | true
48 |
49 |
50 | $(Platform)\$(Configuration)\
51 | $(Platform)\$(Configuration)\$(ProjectName)\
52 | false
53 |
54 |
55 |
56 | X64
57 |
58 |
59 | Disabled
60 | .;..\libcups\vcnet;..\libcups;..\pdfio;%(AdditionalIncludeDirectories)
61 | _DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
62 |
63 |
64 | EnableFastChecks
65 | MultiThreadedDebugDLL
66 |
67 | Level1
68 | ProgramDatabase
69 | $(IntDir)vc$(PlatformToolsetVersion).pdb
70 |
71 |
72 | ws2_32.lib;%(AdditionalDependencies)
73 | true
74 | Console
75 | false
76 |
77 | MachineX64
78 |
79 |
80 |
81 |
82 | X64
83 |
84 |
85 | .;..\libcups\vcnet;..\libcups;..\pdfio;%(AdditionalIncludeDirectories)
86 | NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
87 | MultiThreadedDLL
88 |
89 | Level1
90 | ProgramDatabase
91 |
92 |
93 |
94 | ws2_32.lib;%(AdditionalDependencies)
95 | true
96 | Console
97 | true
98 | true
99 | false
100 |
101 | MachineX64
102 |
103 |
104 | signtool sign /n "IEEE INDUSTRY STANDARDS AND TECHNOLOGY ORGANIZATION" $(TargetPath)
105 |
106 |
107 | Sign code with IEEE-ISTO certificate
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 | {c0899b3a-43e7-4bc3-a785-659e1fd2ea83}
116 |
117 |
118 | {cb4aa6f2-3e84-45be-b505-95cd375e8be3}
119 |
120 |
121 |
122 |
123 |
124 |
--------------------------------------------------------------------------------
/vcnet/ippproxy.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | x64
7 |
8 |
9 | Release
10 | x64
11 |
12 |
13 |
14 | {804CB893-644A-4530-B094-580A2A3F8FE9}
15 | ippproxy
16 | Win32Proj
17 | 10.0
18 |
19 |
20 |
21 | Application
22 | v142
23 | Unicode
24 | true
25 |
26 |
27 | Application
28 | v142
29 | Unicode
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | <_ProjectFileVersion>12.0.30501.0
43 |
44 |
45 | $(Platform)\$(Configuration)\
46 | $(Platform)\$(Configuration)\$(ProjectName)\
47 | true
48 |
49 |
50 | $(Platform)\$(Configuration)\
51 | $(Platform)\$(Configuration)\$(ProjectName)\
52 | false
53 |
54 |
55 |
56 | X64
57 |
58 |
59 | Disabled
60 | .;..\libcups\vcnet;..\libcups;..\pdfio;%(AdditionalIncludeDirectories)
61 | _DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
62 |
63 |
64 | EnableFastChecks
65 | MultiThreadedDebugDLL
66 |
67 | Level1
68 | ProgramDatabase
69 | $(IntDir)$(Target)-vc$(PlatformToolsetVersion).pdb
70 |
71 |
72 | ws2_32.lib;%(AdditionalDependencies)
73 | true
74 | Console
75 | false
76 |
77 | MachineX64
78 |
79 |
80 |
81 |
82 | X64
83 |
84 |
85 | .;..\libcups\vcnet;..\libcups;..\pdfio;%(AdditionalIncludeDirectories)
86 | NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
87 | MultiThreadedDLL
88 |
89 | Level1
90 | ProgramDatabase
91 |
92 |
93 |
94 | ws2_32.lib;%(AdditionalDependencies)
95 | true
96 | Console
97 | true
98 | true
99 | false
100 |
101 | MachineX64
102 |
103 |
104 | signtool sign /n "IEEE INDUSTRY STANDARDS AND TECHNOLOGY ORGANIZATION" $(TargetPath)
105 |
106 |
107 | Sign code with IEEE-ISTO certificate
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 | {c0899b3a-43e7-4bc3-a785-659e1fd2ea83}
116 |
117 |
118 | {cb4aa6f2-3e84-45be-b505-95cd375e8be3}
119 |
120 |
121 |
122 |
123 |
124 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | IPP Sample Implementations
2 | ==========================
3 |
4 | This code provides sample, non-production-ready implementations of IPP Clients,
5 | Printers, Proxies, and Systems. It makes use of the [CUPS Library v3][LIBCUPS]
6 | and [PDFio library][PDFIO] projects to provide low-level HTTP, IPP, and PDF
7 | support. The `ippserver` and `ipp3dprinter` code was also inspired by the
8 | original CUPS `ippeveprinter` source code.
9 |
10 | 
11 | 
12 | 
13 | 
14 | 
15 |
16 | > Note: This code is provided for educational purposes only. While we will make
17 | > every effort to ensure the code is bug-free and regularly run the code
18 | > through dynamic and static analysis tools, it is written for correctness, not
19 | > performance, and so is not intended for use as a production solution. This
20 | > code is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
21 | > ANY KIND, either express or implied.
22 |
23 |
24 | Getting the Code
25 | ----------------
26 |
27 | *Do not use the ZIP file available via the Github "Code" button on the*
28 | *main project page, as that archive is missing the libcups and PDFio submodules*
29 | *and will not compile.*
30 |
31 | The source code is available in semi-monthly release tarballs or via the Github
32 | repository. For a release tarball, run the following commands:
33 |
34 | tar xvzf ippsample-VERSION.tar.gz
35 | cd ippsample-VERSION
36 |
37 | Similarly, the release ZIP file can be extracted with the following commands:
38 |
39 | unzip ippsample-VERSION.zip
40 | cd ippsample-VERSION
41 |
42 | From the Github sources, clone the repository with the `--recurse-submodules`
43 | option *or* use the `git submodule` commands:
44 |
45 | git clone --recurse-submodules git@github.com:istopwg/ippsample.git
46 | cd ippsample
47 |
48 | git clone git@github.com:istopwg/ippsample.git
49 | cd ippsample
50 | git submodule update --init --recursive
51 |
52 | To update an already-cloned repository:
53 |
54 | git pull
55 | git submodule update --init --recursive
56 |
57 |
58 | Building the Code
59 | -----------------
60 |
61 | The IPP sample code uses a configure script on POSIX platforms to take care of
62 | any platform differences:
63 |
64 | ./configure --disable-shared OPTIONS
65 | make
66 |
67 | The following options are supported:
68 |
69 | - `--enable-debug`: Enable debugging and debug logging.
70 | - `--disable-shared`: Disable shared libraries (enabled otherwise).
71 | - `--enable-maintainer`: Enable warnings as errors.
72 | - `--enable-sanitizer`: Enable address sanitizer.
73 | - `--enable-static`: Enable static libraries.
74 | - `--prefix=PATH`: Configure the installation directory, the default is
75 | `/usr/local`.
76 |
77 | On macOS, the "xcode" directory contains an Xcode workspace called
78 | "ippsample.xcworkspace" that can be used to build the code. Similarly, on
79 | Windows the "vcnet" directory contains a Visual Studio solution called
80 | "ippsample.sln" that can be used to build the code.
81 |
82 |
83 | Testing the Code
84 | ----------------
85 |
86 | The "test" target runs all of the unit tests and a full-up "system" test of the
87 | various programs:
88 |
89 | make test
90 |
91 |
92 | Resources
93 | ---------
94 |
95 | The IPP sample code includes per-specification ipptool test files under the
96 | "examples" directory.
97 |
98 | The following documentation files may be of use as well:
99 |
100 | - `BUILD.md`: Detailed build instructions
101 | - `CONTRIBUTING.md`: How to contribute to the ippsample project
102 | - `DEVELOPING.md`: How to develop code for the ippsample project
103 | - `DOCKER.md`: How to build ippsample in a Docker container
104 | - `PI.md`: How to build ippsample for various Raspberry Pi boards
105 | - `SCRIPTING.md`: How to use the ippserver REST API
106 | - `TESTING.md`: How to test ippserver with the sample configuration under the
107 | `test` subdirectory
108 | - `man/*`: Man pages for each of the ippsample programs in nroff and HTML
109 | formats
110 |
111 |
112 | ipp3dprinter
113 | -------------
114 |
115 | The `ipp3dprinter` program implements a single IPP 3D printer and can be
116 | configured to use a print command to do processing of document data.
117 |
118 |
119 | ippdoclint
120 | ----------
121 |
122 | The `ippdoclint` program verifies and reports on document data. It is primarily
123 | used for testing IPP Clients with the `ippeveprinter` and `ippserver` programs.
124 |
125 |
126 | ippproxy
127 | --------
128 |
129 | The `ippproxy` program implements a generic IPP Proxy interface that allows you
130 | to connect a local IPP or PCL printer to an IPP Infrastructure Printer such as
131 | the `ippserver` program.
132 |
133 |
134 | ippserver
135 | ---------
136 |
137 | The `ippserver` program implements the IPP System Service and provides a generic
138 | IPP Printer interface that allows you to host shared printers using the IPP
139 | Shared Infrastructure Extensions as well as support local printing or document
140 | processing.
141 |
142 |
143 | ipptransform3d
144 | --------------
145 |
146 | The `ipptransform3d` program is a generic 3D file conversion utility that is
147 | used primarily with `ippserver` to support 3MF, G-code, and STL printing to 3D
148 | printers using the [CuraEngine][CURA] software.
149 |
150 |
151 | Legal Stuff
152 | -----------
153 |
154 | Copyright © 2014-2024 by the Printer Working Group.
155 |
156 | Copyright © 2007-2019 by Apple Inc.
157 |
158 | Copyright © 1997-2007 by Easy Software Products.
159 |
160 | This software is provided under the terms of the Apache License, Version 2.0.
161 | A copy of this license can be found in the file `LICENSE`. Additional legal
162 | information is provided in the file `NOTICE`.
163 |
164 | Unless required by applicable law or agreed to in writing, software distributed
165 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
166 | CONDITIONS OF ANY KIND, either express or implied. See the License for the
167 | specific language governing permissions and limitations under the License.
168 |
169 |
170 | [CURA]: https://github.com/Ultimaker/CuraEngine
171 | [LIBCUPS]: https://github.com/OpenPrinting/libcups
172 | [PDFIO]: https://github.com/michaelrsweet/pdfio
173 |
--------------------------------------------------------------------------------
/install-sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # Install a program, script, or datafile.
4 | #
5 | # Copyright 2008-2012 by Apple Inc.
6 | #
7 | # This script is not compatible with BSD (or any other) install program, as it
8 | # allows owner and group changes to fail with a warning and makes sure that the
9 | # destination directory permissions are as specified - BSD install and the
10 | # original X11 install script did not change permissions of existing
11 | # directories. It also does not support the transform options since CUPS does
12 | # not use them...
13 | #
14 | # Original script from X11R5 (mit/util/scripts/install.sh)
15 | # Copyright 1991 by the Massachusetts Institute of Technology
16 | #
17 | # Permission to use, copy, modify, distribute, and sell this software and its
18 | # documentation for any purpose is hereby granted without fee, provided that
19 | # the above copyright notice appear in all copies and that both that
20 | # copyright notice and this permission notice appear in supporting
21 | # documentation, and that the name of M.I.T. not be used in advertising or
22 | # publicity pertaining to distribution of the software without specific,
23 | # written prior permission. M.I.T. makes no representations about the
24 | # suitability of this software for any purpose. It is provided "as is"
25 | # without express or implied warranty.
26 | #
27 | # Calling this script install-sh is preferred over install.sh, to prevent
28 | # `make' implicit rules from creating a file called install from it
29 | # when there is no Makefile.
30 |
31 | # set DOITPROG to echo to test this script
32 | # Don't use :- since 4.3BSD and earlier shells don't like it.
33 | doit="${DOITPROG-}"
34 |
35 | # Force umask to 022...
36 | umask 022
37 |
38 | # put in absolute paths if you don't have them in your path; or use env. vars.
39 | mvprog="${MVPROG-mv}"
40 | cpprog="${CPPROG-cp}"
41 | chmodprog="${CHMODPROG-chmod}"
42 | chownprog="${CHOWNPROG-chown}"
43 | chgrpprog="${CHGRPPROG-chgrp}"
44 | stripprog="${STRIPPROG-strip}"
45 | rmprog="${RMPROG-rm}"
46 | mkdirprog="${MKDIRPROG-mkdir}"
47 | gzipprog="${GZIPPROG-gzip}"
48 |
49 | transformbasename=""
50 | transform_arg=""
51 | instcmd="$mvprog"
52 | chmodcmd="$chmodprog 0755"
53 | chowncmd=""
54 | chgrpcmd=""
55 | stripcmd=""
56 | rmcmd="$rmprog -f"
57 | mvcmd="$mvprog"
58 | src=""
59 | dst=""
60 | dir_arg=""
61 |
62 | gzipcp() {
63 | # gzipcp from to
64 | $gzipprog -9 <"$1" >"$2"
65 | }
66 |
67 | while [ x"$1" != x ]; do
68 | case $1 in
69 | -c)
70 | instcmd="$cpprog"
71 | shift
72 | continue
73 | ;;
74 |
75 | -d)
76 | dir_arg=true
77 | shift
78 | continue
79 | ;;
80 |
81 | -m)
82 | chmodcmd="$chmodprog $2"
83 | shift
84 | shift
85 | continue
86 | ;;
87 |
88 | -o)
89 | chowncmd="$chownprog $2"
90 | shift
91 | shift
92 | continue
93 | ;;
94 |
95 | -g)
96 | chgrpcmd="$chgrpprog $2"
97 | shift
98 | shift
99 | continue
100 | ;;
101 |
102 | -s)
103 | stripcmd="$stripprog"
104 | shift
105 | continue
106 | ;;
107 |
108 | -z)
109 | instcmd="gzipcp"
110 | shift
111 | continue
112 | ;;
113 |
114 | *)
115 | if [ x"$src" = x ]; then
116 | src="$1"
117 | else
118 | dst="$1"
119 | fi
120 | shift
121 | continue
122 | ;;
123 | esac
124 | done
125 |
126 | if [ x"$src" = x ]; then
127 | echo "install-sh: No input file specified"
128 | exit 1
129 | fi
130 |
131 | if [ x"$dir_arg" != x ]; then
132 | dst="$src"
133 | src=""
134 |
135 | if [ -d "$dst" ]; then
136 | instcmd=:
137 | else
138 | instcmd=$mkdirprog
139 | fi
140 | else
141 | # Waiting for this to be detected by the "$instcmd $src $dsttmp" command
142 | # might cause directories to be created, which would be especially bad
143 | # if $src (and thus $dsttmp) contains '*'.
144 | if [ ! -f "$src" -a ! -d "$src" ]; then
145 | echo "install: $src does not exist"
146 | exit 1
147 | fi
148 |
149 | if [ x"$dst" = x ]; then
150 | echo "install: No destination specified"
151 | exit 1
152 | fi
153 |
154 | # If destination is a directory, append the input filename.
155 | if [ -d "$dst" ]; then
156 | dst="$dst/`basename $src`"
157 | fi
158 | fi
159 |
160 | ## this sed command emulates the dirname command
161 | dstdir="`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`"
162 |
163 | # Make sure that the destination directory exists.
164 | # This part is taken from Noah Friedman's mkinstalldirs script
165 |
166 | # Skip lots of stat calls in the usual case.
167 | if [ ! -d "$dstdir" ]; then
168 | defaultIFS='
169 | '
170 | IFS="${IFS-${defaultIFS}}"
171 |
172 | oIFS="${IFS}"
173 | # Some sh's can't handle IFS=/ for some reason.
174 | IFS='%'
175 | set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
176 | IFS="${oIFS}"
177 |
178 | pathcomp=''
179 |
180 | while [ $# -ne 0 ] ; do
181 | pathcomp="${pathcomp}${1}"
182 | shift
183 |
184 | if [ ! -d "${pathcomp}" ]; then $doit $mkdirprog "${pathcomp}"; fi
185 |
186 | pathcomp="${pathcomp}/"
187 | done
188 | fi
189 |
190 | if [ x"$dir_arg" != x ]; then
191 | # Make a directory...
192 | $doit $instcmd $dst || exit 1
193 |
194 | # Allow chown/chgrp to fail, but log a warning
195 | if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst || echo "warning: Unable to change owner of $dst!"; fi
196 | if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst || echo "warning: Unable to change group of $dst!"; fi
197 | if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst || exit 1; fi
198 | else
199 | # Install a file...
200 | dstfile="`basename $dst`"
201 |
202 | # Check the destination file - for libraries just use the "-x" option
203 | # to strip...
204 | case "$dstfile" in
205 | *.a | *.dylib | *.sl | *.sl.* | *.so | *.so.*)
206 | stripopt="-x"
207 | ;;
208 | *)
209 | stripopt=""
210 | ;;
211 | esac
212 |
213 | # Make a temp file name in the proper directory.
214 | dsttmp="$dstdir/#inst.$$#"
215 |
216 | # Move or copy the file name to the temp name
217 | $doit $instcmd $src $dsttmp || exit 1
218 |
219 | # Update permissions and strip as needed, then move to the final name.
220 | # If the chmod, strip, rm, or mv commands fail, remove the installed
221 | # file...
222 | if [ x"$stripcmd" != x ]; then $doit $stripcmd $stripopt "$dsttmp" || echo "warning: Unable to strip $dst!"; fi
223 | if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp" || echo "warning: Unable to change owner of $dst!"; fi
224 | if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp" || echo "warning: Unable to change group of $dst!"; fi
225 |
226 | trap "rm -f ${dsttmp}" 0 &&
227 | if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; fi &&
228 | $doit $rmcmd -f "$dstdir/$dstfile" &&
229 | $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
230 | fi
231 |
232 | exit 0
233 |
--------------------------------------------------------------------------------
/man/ipptransform3d.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ipptransform3d(7)
7 |
8 |
9 | ipptransform3d(7)
10 |
11 | ipptransform3d - convert 3d document data to alternate formats
12 |
13 | ipptransform3d
14 | [
15 | --help
16 | ] [
17 | -d
18 | device-uri
19 | ] [
20 | -i
21 | input/format
22 | ] [
23 | -m
24 | output/format;machine=name
25 | ] [
26 | -o
27 | "name=value [... name=value]"
28 | ] [
29 | -v
30 | ]
31 | filename
32 |
33 | ipptransform3d
34 | converts the input file into the output format and optionally sends the output to a USB (serial) printer.
35 | ipptransform3d
36 | is normally run by
37 | ippserver (8)
38 | to convert document data for printing.
39 |
40 | The following options are recognized by
41 | ipptransform3d:
42 |
43 | --help
44 | Shows program help.
45 | -d device-uri
46 | Specifies an output device as a URI.
47 | Currently only the "usbserial" URI scheme is supported, for example "usbserial:///dev/ttyACM0" to send print data to an attached USB printer on Linux.
48 | -i input/format
49 | Specifies the MIME media type of the input file.
50 | Currently the "model/3mf" (3MF) and "application/sla" (STL) MIME media types are supported.
51 | -m output/format;machine=name
52 | Specifies the MIME media type of the output file.
53 | Currently only the "application/g-code" (G-code) MIME media type is supported.
54 | The "machine=name" parameter specifies a machine-specific variant such as "ultimaker2".
55 | -o "name=value [... name=value]"
56 | Specifies one or more named options for the conversion.
57 | Currently the "materials-col", "platform-temperature", "print-accuracy", "print-base", "print-quality", and "print-supports" options are supported.
58 | See the NAMED OPTIONS section for more information.
59 | -v
60 | Increases the verbosity for any diagnostics.
61 |
62 |
63 | The following named options are supported:
64 |
65 | materials-col
66 | Specifies the material(s) to use.
67 | Each value is surrounded by curley braces and contains a list of material properties and their values, e.g., '{material-diameter=285 material-type="pla" ...}'.
68 | The "material-diameter", "material-fill-density", "material-purpose", "material-rate", "material-rate-units", "material-shell-thickness", "material-temperature", and "material-type" properties are supported.
69 | platform-temperature
70 | Specifies the temperature of the build platform in degrees Celsius.
71 | print-accuracy
72 | Specifies the dimensional accuracy requirements for the print.
73 | For example, a horizontal accuracy of 0.1mm and vertical accuracy of 0.05mm is '{x-accuracy=100 y-accuracy=100 z-accuracy=50 accuracy-units=um}'.
74 | print-base
75 | Specifies whether brims, rafts, or skirts should be printed.
76 | The values 'none', 'brim', 'raft', and 'skirt' are supported.
77 | print-quality
78 | Specifies the print quality with value 3 (draft), 4 (normal), or 5 (high/best).
79 | print-supports
80 | Specifies whether supports are printed.
81 | The values 'none', 'material', and 'standard' are supported.
82 |
83 |
84 | ipptransform3d
85 | sends all messages to the standard error.
86 | Each message is prefixed with "ERROR", "INFO", or "DEBUG" depending on the level of verbosity.
87 |
88 | The
89 | ipptransform3d
90 | program returns 0 if the input file is converted successfully and 1 otherwise.
91 |
92 | ipptransform3d
93 | recognizes the following environment variables:
94 |
95 | CONTENT_TYPE
96 | Specifies the MIME media type of the input file.
97 | DEVICE_URI
98 | Specifies the output device as a URI.
99 | DOCUMENT_NAME
100 | Specifies the title of the input file.
101 | IPP_xxx
102 | Specifies the value of the "xxx" Job Template attribute, where "xxx" is converted to uppercase.
103 | For example, the "materials-col" Job Template attribute is stored as the "IPP_MATERIALS_COL" environment variable.
104 | IPP_xxx_DEFAULT
105 | Specifies the default value of the corresponding "xxx-default" Printer Description attribute, where "xxx" is converted to uppercase.
106 | For example, the "materials-col-default" Printer Description attribute is stored as the "IPP_MATERIALS_COL_DEFAULT" environment variable.
107 | OUTPUT_TYPE
108 | Specifies the MIME media type of the output file.
109 | For 'application/g-code' the "flavor" media type parameter specifies the variant of G-code to produce: 'bfb', 'griffin', 'mach3', 'makerbot', 'reprap' (default), 'reprap-volumatric', and 'ultimaker' are currently supported.
110 | SERVER_LOGLEVEL
111 | Specifies the log level (verbosity) as "error", "info", or "debug".
112 |
113 |
114 | Print a 3MF file to a G-code printer connected via USB on Linux using the default options:
115 |
116 |
117 | ipptransform3d -d usbserial:///dev/usbACM0 -m application/g-code \
118 | filename.3mf
119 |
120 |
121 | ippdoclint (7),
122 | ippserver (8),
123 | ipptool (1),
124 | ipptransform (7)
125 |
126 | Copyright © 2016-2019 by the Printer Working Group.
127 | Copyright © 2016-2019 by Apple Inc.
128 |
129 |
130 |
131 |
--------------------------------------------------------------------------------
/server/device.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Device support for sample IPP server implementation.
3 | *
4 | * Copyright © 2014-2022 by the Printer Working Group
5 | * Copyright © 2010-2018 by Apple Inc.
6 | *
7 | * Licensed under Apache License v2.0. See the file "LICENSE" for more
8 | * information.
9 | */
10 |
11 | #include "ippserver.h"
12 |
13 |
14 | /*
15 | * Local functions...
16 | */
17 |
18 | static int compare_devices(server_device_t *a, server_device_t *b);
19 |
20 |
21 | /*
22 | * 'serverCreateDevice()' - Create an output device tracking object.
23 | */
24 |
25 | server_device_t * /* O - Device */
26 | serverCreateDevice(
27 | server_client_t *client) /* I - Client */
28 | {
29 | server_device_t *device; /* Device */
30 | ipp_attribute_t *uuid; /* output-device-uuid */
31 |
32 |
33 | serverLogClient(SERVER_LOGLEVEL_DEBUG, client, "serverCreateDevice: Finding output-device-uuid.");
34 |
35 | if ((uuid = ippFindAttribute(client->request, "output-device-uuid", IPP_TAG_URI)) == NULL)
36 | return (NULL);
37 |
38 | cupsRWLockWrite(&client->printer->rwlock);
39 | device = serverCreateDevicePinfo(&client->printer->pinfo, ippGetString(uuid, 0, NULL));
40 | cupsRWUnlock(&client->printer->rwlock);
41 |
42 | serverLogClient(SERVER_LOGLEVEL_DEBUG, client, "serverCreateDevice: Created device object for \"%s\".", device->uuid);
43 |
44 | return (device);
45 | }
46 |
47 |
48 | /*
49 | * 'serverCreateDevicePinfo()' - Create a device in a printer-info structure.
50 | */
51 |
52 | server_device_t * /* O - Device */
53 | serverCreateDevicePinfo(
54 | server_pinfo_t *pinfo, /* I - Printer-info structure */
55 | const char *uuid) /* I - UUID string */
56 | {
57 | server_device_t *device; /* Device */
58 |
59 |
60 | if ((device = calloc(1, sizeof(server_device_t))) == NULL)
61 | return (NULL);
62 |
63 | cupsRWInit(&device->rwlock);
64 |
65 | device->uuid = strdup(uuid);
66 | device->state = IPP_PSTATE_STOPPED;
67 | device->attrs = ippNew();
68 |
69 | ippAddBoolean(device->attrs, IPP_TAG_PRINTER, "printer-is-accepting-jobs", false);
70 | ippAddString(device->attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_TEXT), "printer-make-and-model", NULL, "Unknown");
71 | ippAddInteger(device->attrs, IPP_TAG_PRINTER, IPP_TAG_ENUM, "printer-state", IPP_PSTATE_STOPPED);
72 | ippAddString(device->attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "printer-state-reasons", NULL, "printer-stopped");
73 |
74 | if (!pinfo->devices)
75 | pinfo->devices = cupsArrayNew((cups_array_cb_t)compare_devices, NULL, NULL, 0, NULL, NULL);
76 |
77 | cupsArrayAdd(pinfo->devices, device);
78 |
79 | return (device);
80 | }
81 |
82 |
83 | /*
84 | * 'serverDeleteDevice()' - Remove a device from a printer.
85 | *
86 | * Note: Caller is responsible for locking the printer object.
87 | */
88 |
89 | void
90 | serverDeleteDevice(
91 | server_device_t *device) /* I - Device */
92 | {
93 | /*
94 | * Free memory used for the device...
95 | */
96 |
97 | serverLog(SERVER_LOGLEVEL_DEBUG, "Deleting device object for \"%s\".", device->uuid);
98 |
99 | cupsRWDestroy(&device->rwlock);
100 |
101 | if (device->name)
102 | free(device->name);
103 |
104 | free(device->uuid);
105 |
106 | ippDelete(device->attrs);
107 |
108 | free(device);
109 | }
110 |
111 |
112 | /*
113 | * 'serverFindDevice()' - Find a device.
114 | */
115 |
116 | server_device_t * /* I - Device */
117 | serverFindDevice(
118 | server_client_t *client) /* I - Client */
119 | {
120 | ipp_attribute_t *uuid; /* output-device-uuid */
121 | server_device_t key, /* Search key */
122 | *device; /* Matching device */
123 |
124 |
125 | serverLogClient(SERVER_LOGLEVEL_DEBUG, client, "serverFindDevice: Looking for output-device-uuid.");
126 |
127 | if ((uuid = ippFindAttribute(client->request, "output-device-uuid", IPP_TAG_URI)) == NULL)
128 | return (NULL);
129 |
130 | key.uuid = (char *)ippGetString(uuid, 0, NULL);
131 |
132 | serverLogClient(SERVER_LOGLEVEL_DEBUG, client, "serverFindDevice: Looking for \"%s\".", key.uuid);
133 |
134 | cupsRWLockRead(&client->printer->rwlock);
135 | device = (server_device_t *)cupsArrayFind(client->printer->pinfo.devices, &key);
136 | cupsRWUnlock(&client->printer->rwlock);
137 |
138 | serverLogClient(SERVER_LOGLEVEL_DEBUG, client, "serverFindDevice: Returning device=%p", (void *)device);
139 |
140 | return (device);
141 | }
142 |
143 |
144 | /*
145 | * 'serverUpdateDeviceAttributesNoLock()' - Update the composite device attributes.
146 | *
147 | * Note: Caller MUST lock the printer object for writing before using.
148 | */
149 |
150 | void
151 | serverUpdateDeviceAttributesNoLock(
152 | server_printer_t *printer) /* I - Printer */
153 | {
154 | server_device_t *device; /* Current device */
155 | ipp_t *dev_attrs; /* Device attributes */
156 |
157 |
158 | /* TODO: Support multiple output devices, icons, etc... (Issue #89) */
159 | device = (server_device_t *)cupsArrayGetFirst(printer->pinfo.devices);
160 | dev_attrs = ippNew();
161 |
162 | if (device)
163 | serverCopyAttributes(dev_attrs, device->attrs, NULL, NULL, IPP_TAG_PRINTER, 0);
164 |
165 | ippDelete(printer->dev_attrs);
166 | printer->dev_attrs = dev_attrs;
167 | printer->config_time = time(NULL);
168 | }
169 |
170 |
171 | /*
172 | * 'serverUpdateDeviceStatusNoLock()' - Update the composite device state.
173 | *
174 | * Note: Caller MUST lock the printer object for writing before using.
175 | */
176 |
177 | void
178 | serverUpdateDeviceStateNoLock(
179 | server_printer_t *printer) /* I - Printer */
180 | {
181 | server_device_t *device; /* Current device */
182 | ipp_attribute_t *attr; /* Current attribute */
183 |
184 |
185 | /* TODO: Support multiple output devices, icons, etc... (Issue #89) */
186 | device = (server_device_t *)cupsArrayGetFirst(printer->pinfo.devices);
187 |
188 | if (device && (attr = ippFindAttribute(device->attrs, "printer-state", IPP_TAG_ENUM)) != NULL)
189 | printer->dev_state = (ipp_pstate_t)ippGetInteger(attr, 0);
190 | else
191 | printer->dev_state = IPP_PSTATE_STOPPED;
192 |
193 | if (device && (attr = ippFindAttribute(device->attrs, "printer-state-reasons", IPP_TAG_KEYWORD)) != NULL)
194 | printer->dev_reasons = serverGetPrinterStateReasonsBits(attr);
195 | else
196 | printer->dev_reasons = SERVER_PREASON_PAUSED;
197 |
198 | printer->state_time = time(NULL);
199 | }
200 |
201 |
202 | /*
203 | * 'compare_devices()' - Compare two devices...
204 | */
205 |
206 | static int /* O - Result of comparison */
207 | compare_devices(server_device_t *a, /* I - First device */
208 | server_device_t *b) /* I - Second device */
209 | {
210 | return (strcmp(a->uuid, b->uuid));
211 | }
212 |
--------------------------------------------------------------------------------
/examples/pwg5100.3.test:
--------------------------------------------------------------------------------
1 | #
2 | # Top-level Makefile for IPP sample implementations.
3 | #
4 | # Copyright © 2014-2022 by the Printer Working Group.
5 | #
6 | # Licensed under Apache License v2.0. See the file "LICENSE" for more
7 | # information.
8 | #
9 | # Usage:
10 | #
11 | # ./ipptool -t PRINTER-URI pwg5100.3.test
12 | #
13 |
14 | {
15 | NAME "PWG 5100.3-20YY: Required Attributes"
16 | OPERATION Get-Printer-Attributes
17 |
18 | GROUP operation-attributes-tag
19 | ATTR charset attributes-charset utf-8
20 | ATTR language attributes-natural-language en
21 | ATTR uri printer-uri $uri
22 |
23 | STATUS successful-ok
24 |
25 | EXPECT cover-back-supported OF-TYPE keyword IN-GROUP printer-attributes-tag DEFINE-MATCH HAVE_COVER_BACK
26 | EXPECT cover-back-default OF-TYPE collection|no-value IN-GROUP printer-attributes-tag COUNT 1 IF-DEFINED HAVE_COVER_BACK
27 |
28 | EXPECT cover-front-supported OF-TYPE keyword IN-GROUP printer-attributes-tag DEFINE-MATCH HAVE_COVER_FRONT
29 | EXPECT cover-front-default OF-TYPE collection|no-value IN-GROUP printer-attributes-tag COUNT 1 IF-DEFINED HAVE_COVER_FRONT
30 |
31 | EXPECT cover-type-supported OF-TYPE keyword IN-GROUP printer-attributes-tag IF-DEFINED HAVE_COVER_BACK
32 | EXPECT cover-type-supported OF-TYPE keyword IN-GROUP printer-attributes-tag IF-DEFINED HAVE_COVER_FRONT
33 |
34 | EXPECT image-orientation-default OF-TYPE enum|no-value IN-GROUP printer-attributes-tag COUNT 1
35 | EXPECT image-orientation-supported OF-TYPE enum IN-GROUP printer-attributes-tag
36 |
37 | EXPECT imposition-template-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag DEFINE-MATCH HAVE_IMPOSITION_TEMPLATE
38 | EXPECT imposition-template-default OF-TYPE keyword|NAME IN-GROUP printer-attributes-tag COUNT 1 IF-DEFINED HAVE_IMPOSITION_TEMPLATE
39 |
40 | EXPECT insert-count-supported OF-TYPE rangeOfInteger IN-GROUP printer-attributes-tag COUNT 1
41 | EXPECT insert-sheet-default OF-TYPE collection|no-value IN-GROUP printer-attributes-tag COUNT 1
42 | EXPECT insert-sheet-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE "insert-after-page-number"
43 | EXPECT insert-sheet-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE "insert-count"
44 | EXPECT insert-sheet-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE "media"
45 | EXPECT insert-sheet-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE "media-col"
46 |
47 | EXPECT job-error-sheet-default OF-TYPE collection|no-value IN-GROUP printer-attributes-tag COUNT 1
48 | EXPECT job-error-sheet-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE job-error-sheet-type
49 | EXPECT job-error-sheet-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE job-error-sheet-when
50 | EXPECT job-error-sheet-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE media
51 | EXPECT job-error-sheet-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE media-col
52 |
53 | EXPECT job-error-sheet-type-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE none
54 | EXPECT job-error-sheet-type-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE standard
55 |
56 | EXPECT job-error-sheet-when-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE always
57 | EXPECT job-error-sheet-when-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE on-error
58 |
59 | EXPECT job-message-to-operator-supported OF-TYPE boolean IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE true
60 |
61 | EXPECT job-sheet-message-supported OF-TYPE boolean IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE true
62 |
63 | EXPECT separator-sheets-default OF-TYPE collection|no-value IN-GROUP printer-attributes-tag COUNT 1
64 | EXPECT separator-sheets-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE separator-sheets-type
65 | EXPECT separator-sheets-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE media
66 | EXPECT separator-sheets-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE media-col
67 | EXPECT separator-sheets-type-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE both-sheets
68 | EXPECT separator-sheets-type-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE end-sheet
69 | EXPECT separator-sheets-type-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE none
70 | EXPECT separator-sheets-type-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE slip-sheets
71 | EXPECT separator-sheets-type-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE start-sheet
72 |
73 | EXPECT x-image-position-default OF-TYPE keyword IN-GROUP printer-attributes-tag COUNT 1
74 | EXPECT x-image-position-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE center
75 | EXPECT x-image-position-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE left
76 | EXPECT x-image-position-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE none
77 | EXPECT x-image-position-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE right
78 |
79 | EXPECT x-image-shift-default OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1
80 | EXPECT x-image-shift-supported OF-TYPE rangeOfInteger IN-GROUP printer-attributes-tag COUNT 1
81 |
82 | EXPECT x-side1-image-shift-default OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1
83 | EXPECT x-side1-image-shift-supported OF-TYPE rangeOfInteger IN-GROUP printer-attributes-tag COUNT 1
84 |
85 | EXPECT x-side2-image-shift-default OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1
86 | EXPECT x-side2-image-shift-supported OF-TYPE rangeOfInteger IN-GROUP printer-attributes-tag COUNT 1
87 |
88 | EXPECT y-image-position-default OF-TYPE keyword IN-GROUP printer-attributes-tag COUNT 1
89 | EXPECT y-image-position-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE bottom
90 | EXPECT y-image-position-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE center
91 | EXPECT y-image-position-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE none
92 | EXPECT y-image-position-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE top
93 |
94 | EXPECT y-image-shift-default OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1
95 | EXPECT y-image-shift-supported OF-TYPE rangeOfInteger IN-GROUP printer-attributes-tag COUNT 1
96 |
97 | EXPECT y-side1-image-shift-default OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1
98 | EXPECT y-side1-image-shift-supported OF-TYPE rangeOfInteger IN-GROUP printer-attributes-tag COUNT 1
99 |
100 | EXPECT y-side2-image-shift-default OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1
101 | EXPECT y-side2-image-shift-supported OF-TYPE rangeOfInteger IN-GROUP printer-attributes-tag COUNT 1
102 | }
103 | # TODO: Add print tests for imposition, covers, error sheets, etc.
104 |
--------------------------------------------------------------------------------
/vcnet/ippserver.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | x64
7 |
8 |
9 | Release
10 | x64
11 |
12 |
13 |
14 | {EF2E1F72-A637-42DD-AB0A-EED2F6CC3D56}
15 | ippserver
16 | Win32Proj
17 | 10.0
18 |
19 |
20 |
21 | Application
22 | v142
23 | Unicode
24 | true
25 |
26 |
27 | Application
28 | v142
29 | Unicode
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | <_ProjectFileVersion>12.0.30501.0
43 |
44 |
45 | $(Platform)\$(Configuration)\
46 | $(Platform)\$(Configuration)\$(ProjectName)\
47 | true
48 |
49 |
50 | $(Platform)\$(Configuration)\
51 | $(Platform)\$(Configuration)\$(ProjectName)\
52 | false
53 |
54 |
55 |
56 | X64
57 |
58 |
59 | Disabled
60 | .;..\libcups\vcnet;..\libcups;..\pdfio;%(AdditionalIncludeDirectories)
61 | _DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
62 |
63 |
64 | EnableFastChecks
65 | MultiThreadedDebugDLL
66 |
67 | Level1
68 | ProgramDatabase
69 | $(IntDir)$(Target)-vc$(PlatformToolsetVersion).pdb
70 |
71 |
72 | ws2_32.lib;%(AdditionalDependencies)
73 | true
74 | Console
75 | false
76 |
77 | MachineX64
78 |
79 |
80 |
81 |
82 | X64
83 |
84 |
85 | .;..\libcups\vcnet;..\libcups;..\pdfio;%(AdditionalIncludeDirectories)
86 | NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
87 | MultiThreadedDLL
88 |
89 | Level1
90 | ProgramDatabase
91 |
92 |
93 |
94 | ws2_32.lib;%(AdditionalDependencies)
95 | true
96 | Console
97 | true
98 | true
99 | false
100 |
101 | MachineX64
102 |
103 |
104 | signtool sign /n "IEEE INDUSTRY STANDARDS AND TECHNOLOGY ORGANIZATION" $(TargetPath)
105 |
106 |
107 | Sign code with IEEE-ISTO certificate
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 | {c0899b3a-43e7-4bc3-a785-659e1fd2ea83}
132 |
133 |
134 | {cb4aa6f2-3e84-45be-b505-95cd375e8be3}
135 |
136 |
137 |
138 |
139 |
140 |
--------------------------------------------------------------------------------
/vcnet/ippsample.sln:
--------------------------------------------------------------------------------
1 | Microsoft Visual Studio Solution File, Format Version 12.00
2 | # Visual Studio Version 16
3 | VisualStudioVersion = 16.0.30204.135
4 | MinimumVisualStudioVersion = 10.0.40219.1
5 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ippeveprinter", "..\libcups\vcnet\ippeveprinter.vcxproj", "{82A03BC7-0746-4B85-8908-3C7A3FAA58A9}"
6 | EndProject
7 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ippfind", "..\libcups\vcnet\ippfind.vcxproj", "{B484DA0C-62C8-4C32-83B6-CCEB58968B85}"
8 | EndProject
9 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ippserver", "ippserver.vcxproj", "{EF2E1F72-A637-42DD-AB0A-EED2F6CC3D56}"
10 | ProjectSection(ProjectDependencies) = postProject
11 | {18950A1B-D37A-40C7-B2DF-C12986C0526E} = {18950A1B-D37A-40C7-B2DF-C12986C0526E}
12 | EndProjectSection
13 | EndProject
14 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ipptool", "..\libcups\vcnet\ipptool.vcxproj", "{B246D91E-61F2-4433-BFD2-6C2A96FBD4D4}"
15 | EndProject
16 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcups3", "..\libcups\vcnet\libcups3.vcxproj", "{CB4AA6F2-3E84-45BE-B505-95CD375E8BE3}"
17 | EndProject
18 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "regex", "..\libcups\vcnet\regex.vcxproj", "{18950A1B-D37A-40C7-B2DF-C12986C0526E}"
19 | EndProject
20 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ippdoclint", "ippdoclint.vcxproj", "{94D3D49D-4BF7-4335-BB61-E37498ADBC92}"
21 | EndProject
22 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ippproxy", "ippproxy.vcxproj", "{804CB893-644A-4530-B094-580A2A3F8FE9}"
23 | EndProject
24 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ipptransform", "..\libcups\vcnet\ipptransform.vcxproj", "{54A05B7D-E945-459B-B05A-3B37AB5B1154}"
25 | EndProject
26 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pdfio1", "..\libcups\pdfio\pdfio.vcxproj", "{98F2DE9E-2978-4387-AF71-82532BEDB29E}"
27 | EndProject
28 | Global
29 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
30 | Debug|x64 = Debug|x64
31 | Debug|x86 = Debug|x86
32 | Release|x64 = Release|x64
33 | Release|x86 = Release|x86
34 | EndGlobalSection
35 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
36 | {82A03BC7-0746-4B85-8908-3C7A3FAA58A9}.Debug|x64.ActiveCfg = Debug|x64
37 | {82A03BC7-0746-4B85-8908-3C7A3FAA58A9}.Debug|x64.Build.0 = Debug|x64
38 | {82A03BC7-0746-4B85-8908-3C7A3FAA58A9}.Debug|x86.ActiveCfg = Debug|x64
39 | {82A03BC7-0746-4B85-8908-3C7A3FAA58A9}.Release|x64.ActiveCfg = Release|x64
40 | {82A03BC7-0746-4B85-8908-3C7A3FAA58A9}.Release|x64.Build.0 = Release|x64
41 | {82A03BC7-0746-4B85-8908-3C7A3FAA58A9}.Release|x86.ActiveCfg = Release|x64
42 | {B484DA0C-62C8-4C32-83B6-CCEB58968B85}.Debug|x64.ActiveCfg = Debug|x64
43 | {B484DA0C-62C8-4C32-83B6-CCEB58968B85}.Debug|x64.Build.0 = Debug|x64
44 | {B484DA0C-62C8-4C32-83B6-CCEB58968B85}.Debug|x86.ActiveCfg = Debug|x64
45 | {B484DA0C-62C8-4C32-83B6-CCEB58968B85}.Release|x64.ActiveCfg = Release|x64
46 | {B484DA0C-62C8-4C32-83B6-CCEB58968B85}.Release|x64.Build.0 = Release|x64
47 | {B484DA0C-62C8-4C32-83B6-CCEB58968B85}.Release|x86.ActiveCfg = Release|x64
48 | {EF2E1F72-A637-42DD-AB0A-EED2F6CC3D56}.Debug|x64.ActiveCfg = Debug|x64
49 | {EF2E1F72-A637-42DD-AB0A-EED2F6CC3D56}.Debug|x64.Build.0 = Debug|x64
50 | {EF2E1F72-A637-42DD-AB0A-EED2F6CC3D56}.Debug|x86.ActiveCfg = Debug|x64
51 | {EF2E1F72-A637-42DD-AB0A-EED2F6CC3D56}.Release|x64.ActiveCfg = Release|x64
52 | {EF2E1F72-A637-42DD-AB0A-EED2F6CC3D56}.Release|x64.Build.0 = Release|x64
53 | {EF2E1F72-A637-42DD-AB0A-EED2F6CC3D56}.Release|x86.ActiveCfg = Release|x64
54 | {B246D91E-61F2-4433-BFD2-6C2A96FBD4D4}.Debug|x64.ActiveCfg = Debug|x64
55 | {B246D91E-61F2-4433-BFD2-6C2A96FBD4D4}.Debug|x64.Build.0 = Debug|x64
56 | {B246D91E-61F2-4433-BFD2-6C2A96FBD4D4}.Debug|x86.ActiveCfg = Debug|x64
57 | {B246D91E-61F2-4433-BFD2-6C2A96FBD4D4}.Release|x64.ActiveCfg = Release|x64
58 | {B246D91E-61F2-4433-BFD2-6C2A96FBD4D4}.Release|x64.Build.0 = Release|x64
59 | {B246D91E-61F2-4433-BFD2-6C2A96FBD4D4}.Release|x86.ActiveCfg = Release|x64
60 | {CB4AA6F2-3E84-45BE-B505-95CD375E8BE3}.Debug|x64.ActiveCfg = Debug|x64
61 | {CB4AA6F2-3E84-45BE-B505-95CD375E8BE3}.Debug|x64.Build.0 = Debug|x64
62 | {CB4AA6F2-3E84-45BE-B505-95CD375E8BE3}.Debug|x86.ActiveCfg = Debug|x64
63 | {CB4AA6F2-3E84-45BE-B505-95CD375E8BE3}.Release|x64.ActiveCfg = Release|x64
64 | {CB4AA6F2-3E84-45BE-B505-95CD375E8BE3}.Release|x64.Build.0 = Release|x64
65 | {CB4AA6F2-3E84-45BE-B505-95CD375E8BE3}.Release|x86.ActiveCfg = Release|x64
66 | {18950A1B-D37A-40C7-B2DF-C12986C0526E}.Debug|x64.ActiveCfg = Debug|x64
67 | {18950A1B-D37A-40C7-B2DF-C12986C0526E}.Debug|x64.Build.0 = Debug|x64
68 | {18950A1B-D37A-40C7-B2DF-C12986C0526E}.Debug|x86.ActiveCfg = Debug|x64
69 | {18950A1B-D37A-40C7-B2DF-C12986C0526E}.Release|x64.ActiveCfg = Release|x64
70 | {18950A1B-D37A-40C7-B2DF-C12986C0526E}.Release|x64.Build.0 = Release|x64
71 | {18950A1B-D37A-40C7-B2DF-C12986C0526E}.Release|x86.ActiveCfg = Release|x64
72 | {94D3D49D-4BF7-4335-BB61-E37498ADBC92}.Debug|x64.ActiveCfg = Debug|x64
73 | {94D3D49D-4BF7-4335-BB61-E37498ADBC92}.Debug|x64.Build.0 = Debug|x64
74 | {94D3D49D-4BF7-4335-BB61-E37498ADBC92}.Debug|x86.ActiveCfg = Debug|x64
75 | {94D3D49D-4BF7-4335-BB61-E37498ADBC92}.Release|x64.ActiveCfg = Release|x64
76 | {94D3D49D-4BF7-4335-BB61-E37498ADBC92}.Release|x64.Build.0 = Release|x64
77 | {94D3D49D-4BF7-4335-BB61-E37498ADBC92}.Release|x86.ActiveCfg = Release|x64
78 | {804CB893-644A-4530-B094-580A2A3F8FE9}.Debug|x64.ActiveCfg = Debug|x64
79 | {804CB893-644A-4530-B094-580A2A3F8FE9}.Debug|x64.Build.0 = Debug|x64
80 | {804CB893-644A-4530-B094-580A2A3F8FE9}.Debug|x86.ActiveCfg = Debug|x64
81 | {804CB893-644A-4530-B094-580A2A3F8FE9}.Release|x64.ActiveCfg = Release|x64
82 | {804CB893-644A-4530-B094-580A2A3F8FE9}.Release|x64.Build.0 = Release|x64
83 | {804CB893-644A-4530-B094-580A2A3F8FE9}.Release|x86.ActiveCfg = Release|x64
84 | {54A05B7D-E945-459B-B05A-3B37AB5B1154}.Debug|x64.ActiveCfg = Debug|x64
85 | {54A05B7D-E945-459B-B05A-3B37AB5B1154}.Debug|x64.Build.0 = Debug|x64
86 | {54A05B7D-E945-459B-B05A-3B37AB5B1154}.Debug|x86.ActiveCfg = Debug|x64
87 | {54A05B7D-E945-459B-B05A-3B37AB5B1154}.Release|x64.ActiveCfg = Release|x64
88 | {54A05B7D-E945-459B-B05A-3B37AB5B1154}.Release|x64.Build.0 = Release|x64
89 | {54A05B7D-E945-459B-B05A-3B37AB5B1154}.Release|x86.ActiveCfg = Release|x64
90 | {98F2DE9E-2978-4387-AF71-82532BEDB29E}.Debug|x64.ActiveCfg = Debug|x64
91 | {98F2DE9E-2978-4387-AF71-82532BEDB29E}.Debug|x64.Build.0 = Debug|x64
92 | {98F2DE9E-2978-4387-AF71-82532BEDB29E}.Debug|x86.ActiveCfg = Debug|Win32
93 | {98F2DE9E-2978-4387-AF71-82532BEDB29E}.Debug|x86.Build.0 = Debug|Win32
94 | {98F2DE9E-2978-4387-AF71-82532BEDB29E}.Release|x64.ActiveCfg = Release|x64
95 | {98F2DE9E-2978-4387-AF71-82532BEDB29E}.Release|x64.Build.0 = Release|x64
96 | {98F2DE9E-2978-4387-AF71-82532BEDB29E}.Release|x86.ActiveCfg = Release|Win32
97 | {98F2DE9E-2978-4387-AF71-82532BEDB29E}.Release|x86.Build.0 = Release|Win32
98 | EndGlobalSection
99 | GlobalSection(SolutionProperties) = preSolution
100 | HideSolutionNode = FALSE
101 | EndGlobalSection
102 | GlobalSection(ExtensibilityGlobals) = postSolution
103 | SolutionGuid = {7A46D144-4B42-4BEB-8A8B-3152D587967C}
104 | EndGlobalSection
105 | EndGlobal
106 |
--------------------------------------------------------------------------------
/examples/pwg5100.18.test:
--------------------------------------------------------------------------------
1 | # -*- Mode: conf -*-
2 | #
3 | # Tests to validate conformance with section 11.2 from 5100.18
4 | #
5 | # 11.2 Conformance Requirements for Infrastructure Printers
6 | # In order for an Infrastructure Printer to claim conformance to this specification, an Infrastructure Printer MUST support:
7 | # 8. The required IPP operations defined in section 4.6,
8 | # 9. The required IPP operation attributes defined in section 4.7,
9 | # 10.The required IPP Printer attributes defined in section 4.8,
10 | # 11.The required IPP Job Template attributes defined in section 4.14,
11 | # 12.The required IPP Job Description attributes defined in section 4.14,
12 | # 13.The new operations defined in section 5 and section 6,
13 | # 14.The operation attributes defined in section 7.1,
14 | # 15.The Document Description attributes defined in section 7.2,
15 | # 16.The Job Description attributes defined in section 7.3,
16 | # 17.The Printer Description attributes defined in section 7.4,
17 | # 18.The additional semantics defined in section 8,
18 | # 19.The additional values defined in section 9,
19 | # 20.The status codes defined in section 10,
20 | # 21.The internationalization considerations in section 12, and
21 | # 22.The security considerations in section 13.
22 | #
23 |
24 |
25 | {
26 | NAME "PWG 5100.18 - 8. The required IPP operations defined in section 4.6"
27 |
28 | OPERATION Get-Printer-Attributes
29 | Version 2.0
30 |
31 | GROUP operation
32 | ATTR charset attributes-charset utf-8
33 | ATTR language attributes-natural-language en
34 | ATTR uri printer-uri $uri
35 | ATTR keyword requested-attributes printer-make-and-model,printer-name,operations-supported
36 |
37 |
38 | STATUS successful-ok
39 |
40 | EXPECT printer-make-and-model
41 | EXPECT printer-name
42 |
43 | EXPECT operations-supported OF-TYPE enum IN-GROUP printer-attributes-tag
44 |
45 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x003F # Acknowledge-Document
46 | EXPECT ?operations-supported OF-TYPE enum WITH-VALUE 0x0040 # Acknowledge-Identify-Printer
47 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x0041 # Acknowledge-Job
48 | EXPECT ?operations-supported OF-TYPE enum WITH-VALUE 0x0028 # Activate-Printer
49 | EXPECT ?operations-supported OF-TYPE enum WITH-VALUE 0x002D # Cancel-Current-Job
50 | EXPECT ?operations-supported OF-TYPE enum WITH-VALUE 0x0033 # Cancel-Document
51 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x0008 # Cancel-Job
52 | EXPECT ?operations-supported OF-TYPE enum WITH-VALUE 0x0038 # Cancel-Jobs
53 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x0039 # Cancel-My-Jobs
54 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x001B # Cancel-Subscription
55 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x003B # Close-Job
56 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x0005 # Create-Job
57 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x0017 # Create-Job-Subscriptions
58 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x0016 # Create-Printer-Subscriptions
59 | EXPECT ?operations-supported OF-TYPE enum WITH-VALUE 0x0027 # Deactivate-Printer
60 | EXPECT !operations-supported OF-TYPE enum WITH-VALUE 0x0036 # Delete-Document
61 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x0046 # Deregister-Output-Device
62 | EXPECT ?operations-supported OF-TYPE enum WITH-VALUE 0x0023 # Disable-Printer
63 | EXPECT ?operations-supported OF-TYPE enum WITH-VALUE 0x0022 # Enable-Printer
64 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x0042 # Fetch-Document
65 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x0043 # Fetch-Job
66 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x0034 # Get-Document-Attributes
67 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x0035 # Get-Documents
68 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x0009 # Get-Job-Attributes
69 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x000A # Get-Jobs
70 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x001C # Get-Notifications
71 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x0044 # Get-Output-Device-Attributes
72 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x000B # Get-Printer-Attributes
73 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x0015 # Get-Printer-Supported-Values
74 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x0018 # Get-Subscription-Attributes
75 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x0019 # Get-Subscriptions
76 | EXPECT ?operations-supported OF-TYPE enum WITH-VALUE 0x000C # Hold-Job
77 | EXPECT ?operations-supported OF-TYPE enum WITH-VALUE 0x0025 # Hold-New-Jobs
78 | EXPECT ?operations-supported OF-TYPE enum WITH-VALUE 0x003C # Identify-Printer
79 | EXPECT ?operations-supported OF-TYPE enum WITH-VALUE 0x0010 # Pause-Printer
80 | EXPECT ?operations-supported OF-TYPE enum WITH-VALUE 0x0024 # Pause-Printer-After-Current-Job
81 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x0002 # Print-Job
82 | EXPECT ?operations-supported OF-TYPE enum WITH-VALUE 0x0003 # Print-URI
83 | EXPECT ?operations-supported OF-TYPE enum WITH-VALUE 0x0030 # Promote-Job
84 | EXPECT !operations-supported OF-TYPE enum WITH-VALUE 0x0012 # Purge-Jobs
85 | EXPECT ?operations-supported OF-TYPE enum WITH-VALUE 0x0026 # Release-Held-New-Jobs
86 | EXPECT ?operations-supported OF-TYPE enum WITH-VALUE 0x000D # Release-Job
87 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x001A # Renew-Subscription
88 | EXPECT !operations-supported OF-TYPE enum WITH-VALUE 0x002C # Reprocess-Job
89 | EXPECT !operations-supported OF-TYPE enum WITH-VALUE 0x000E # Restart-Job
90 | EXPECT ?operations-supported OF-TYPE enum WITH-VALUE 0x0029 # Restart-Printer
91 | EXPECT ?operations-supported OF-TYPE enum WITH-VALUE 0x003A # Resubmit-Job
92 | EXPECT ?operations-supported OF-TYPE enum WITH-VALUE 0x002F # Resume-Job
93 | EXPECT ?operations-supported OF-TYPE enum WITH-VALUE 0x0011 # Resume-Printer
94 | EXPECT ?operations-supported OF-TYPE enum WITH-VALUE 0x0031 # Schedule-Job-After
95 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x0006 # Send-Document
96 | EXPECT ?operations-supported OF-TYPE enum WITH-VALUE 0x0007 # Send-URI
97 | EXPECT ?operations-supported OF-TYPE enum WITH-VALUE 0x0037 # Set-Document-Attributes
98 | EXPECT ?operations-supported OF-TYPE enum WITH-VALUE 0x0014 # Set-Job-Attributes
99 | EXPECT ?operations-supported OF-TYPE enum WITH-VALUE 0x0013 # Set-Printer-Attributes
100 | EXPECT ?operations-supported OF-TYPE enum WITH-VALUE 0x002A # Shutdown-Printer
101 | EXPECT ?operations-supported OF-TYPE enum WITH-VALUE 0x002B # Startup-Printer
102 | EXPECT ?operations-supported OF-TYPE enum WITH-VALUE 0x002E # Suspend-Current-Job
103 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x0045 # Update-Active-Jobs
104 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x0047 # Update-Document-Status
105 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x0048 # Update-Job-Status
106 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x0049 # Update-Output-Device-Attributes
107 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x003D # Validate-Document
108 | EXPECT operations-supported OF-TYPE enum WITH-VALUE 0x0004 # Validate-Job
109 |
110 | }
111 |
112 |
--------------------------------------------------------------------------------
/man/ipp3dprinter.1:
--------------------------------------------------------------------------------
1 | .\"
2 | .\" ipp3dprinter man page.
3 | .\"
4 | .\" Copyright © 2014-2019 by Apple Inc.
5 | .\"
6 | .\" Licensed under Apache License v2.0. See the file "LICENSE" for more
7 | .\" information.
8 | .\"
9 | .TH ipp3dprinter 1 "CUPS" "26 September 2019" "Apple Inc."
10 | .SH NAME
11 | ipp3dprinter \- an ipp 3d printer application
12 | .SH SYNOPSIS
13 | .B ipp3dprinter
14 | [
15 | .B \-\-help
16 | ] [
17 | .B \-\-no\-web\-forms
18 | ] [
19 | .B \-\-version
20 | ] [
21 | .B \-D
22 | .I device-uri
23 | ] [
24 | .B \-K
25 | .I keypath
26 | ] [
27 | .B \-M
28 | .I manufacturer
29 | ] [
30 | .B \-a
31 | .I filename.conf
32 | ] [
33 | .B \-c
34 | .I command
35 | ] [
36 | .B \-d
37 | .I spool-directory
38 | ] [
39 | .B \-f
40 | .I type/subtype[,...]
41 | ] [
42 | .B \-i
43 | .I iconfile.png
44 | ] [
45 | .B \-k
46 | ] [
47 | .B \-l
48 | .I location
49 | ] [
50 | .B \-m
51 | .I model
52 | ] [
53 | .B \-n
54 | .I hostname
55 | ] [
56 | .B \-p
57 | .I port
58 | ] [
59 | .B \-r
60 | .I subtype[,subtype]
61 | ] [
62 | .B \-v[vvv]
63 | ]
64 | .I service-name
65 | .SH DESCRIPTION
66 | .B ipp3dprinter
67 | is a simple Internet Printing Protocol (IPP) server conforming to the IPP 3D Printing Extensions (PWG 5100.21) specification.
68 | It can be used to test client software or act as a very basic print server that runs a command for every job that is printed.
69 | .SH OPTIONS
70 | The following options are recognized by
71 | .B ipp3dprinter:
72 | .TP 5
73 | .B \-\-help
74 | Show program usage.
75 | .TP 5
76 | .B \-\-no\-web\-forms
77 | Disable the web interface forms used to update the media and supply levels.
78 | .TP 5
79 | .B \-\-version
80 | Show the CUPS version.
81 | .TP 5
82 | \fB\-D \fIdevice-uri\fR
83 | Set the device URI for print output.
84 | The URI can be a filename, directory, or a network socket URI of the form "socket://ADDRESS[:PORT]" (where the default port number is 9100).
85 | When specifying a directory,
86 | .B ipp3dprinter
87 | will create an output file using the job ID and name.
88 | .TP 5
89 | \fB\-M \fImanufacturer\fR
90 | Set the manufacturer of the printer.
91 | The default is "Example".
92 | .TP 5
93 | \fB\-c \fIcommand\fR
94 | Run the specified command for each document that is printed.
95 | If "command" is not an absolute path ("/path/to/command"),
96 | .B ipp3dprinter
97 | looks for the command in the "command" subdirectory of the CUPS binary directory, typically /usr/lib/cups/command or /usr/libexec/cups/command.
98 | The
99 | .BR cups-config (1)
100 | command can be used to discover the correct binary directory ("cups-config --serverbin").
101 | In addition, the CUPS_SERVERBIN environment variable can be used to override the default location of this directory - see the
102 | .BR cups (1)
103 | man page for more details.
104 | .TP 5
105 | \fB\-d \fIspool-directory\fR
106 | Specifies the directory that will hold the print files.
107 | The default is a directory under the user's current temporary directory.
108 | .TP 5
109 | \fB\-f \fItype/subtype[,...]\fR
110 | Specifies a list of MIME media types that the server will accept.
111 | The default depends on the type of printer created.
112 | .TP 5
113 | \fB\-i \fIiconfile.png\fR
114 | Specifies the printer icon file for the server.
115 | The file must be a PNG format image.
116 | The default is an internally-provided PNG image.
117 | .TP 5
118 | .B \-k
119 | Keeps the print documents in the spool directory rather than deleting them.
120 | .TP 5
121 | \fB\-l \fIlocation\fR
122 | Specifies the human-readable location string that is reported by the server.
123 | The default is the empty string.
124 | .TP 5
125 | \fB\-m \fImodel\fR
126 | Specifies the model name of the printer.
127 | The default is "Printer".
128 | .TP 5
129 | \fB\-n \fIhostname\fR
130 | Specifies the hostname that is reported by the server.
131 | The default is the name returned by the
132 | .BR hostname (1)
133 | command.
134 | .TP 5
135 | \fB\-p \fIport\fR
136 | Specifies the port number to listen on.
137 | The default is a user-specific number from 8000 to 8999.
138 | .TP 5
139 | \fB\-r \fIsubtype[,subtype]\fR
140 | Specifies the DNS-SD subtype(s) to advertise.
141 | Separate multiple subtypes with a comma.
142 | The default is "_print".
143 | .TP 5
144 | .B \-v[vvv]
145 | Be (very) verbose when logging activity to standard error.
146 | .SH EXIT STATUS
147 | The
148 | .B ipp3dprinter
149 | program returns 1 if it is unable to process the command-line arguments or register the IPP service.
150 | Otherwise
151 | .B ipp3dprinter
152 | will run continuously until terminated.
153 | .SH CONFORMING TO
154 | The
155 | .B ipp3dprinter
156 | program is unique to CUPS and conforms to the IPP 3D Printing Extensions (PWG 5100.21) specification.
157 | .SH ENVIRONMENT
158 | .B ipp3dprinter
159 | adds environment variables starting with "IPP_" for all IPP Job attributes in the print request.
160 | For example, when executing a command for an IPP Job containing the "materials-col" Job Template attribute, the "IPP_MATERIALS_COL" environment variable will be set to the value of that attribute.
161 | .LP
162 | In addition, all IPP "xxx-default" and "pwg-xxx" Printer Description attributes are added to the environment.
163 | For example, the "IPP_MATERIALS_COL_DEFAULT" environment variable will be set to the default value for the "materials-col" Job Template attribute.
164 | .LP
165 | Enumerated values are converted to their keyword equivalents.
166 | For example, a "print-quality" Job Template attribute with a enum value of 3 will become the "IPP_PRINT_QUALITY" environment variable with a value of "draft".
167 | This string conversion only happens for standard Job Template attributes, currently "finishings" and "print-quality".
168 | .LP
169 | Finally, the "CONTENT_TYPE" environment variable contains the MIME media type of the document being printed and the "DEVICE_URI" environment variable contains the device URI as specified with the "\-D" option.
170 | .SH COMMAND OUTPUT
171 | Unless they communicate directly with a printer, print commands send printer-ready data to the standard output.
172 | .LP
173 | Print commands can send messages back to
174 | .B ipp3dprinter
175 | on the standard error with one of the following prefixes:
176 | .TP 5
177 | \fBATTR: \fIattribute=value[ attribute=value]\fR
178 | Sets the named attribute(s) to the given values.
179 | Currently only the "printer-alert" and "printer-alert-description" Printer Status attributes can be set.
180 | .TP 5
181 | \fBDEBUG: \fIDebugging message\fR
182 | Logs a debugging message if at least two \-v's have been specified.
183 | .TP 5
184 | \fBERROR: \fIError message\fR
185 | Logs an error message and copies the message to the "job-state-message" attribute.
186 | .TP 5
187 | \fBINFO: \fIInformational message\fR
188 | Logs an informational/progress message if \-v has been specified and copies the message to the "job-state-message" attribute unless an error has been reported.
189 | .TP 5
190 | \fBSTATE: \fIkeyword[,keyword,...]\fR
191 | Sets the printer's "printer-state-reasons" attribute to the listed keywords.
192 | .TP 5
193 | \fBSTATE: -\fIkeyword[,keyword,...]\fR
194 | Removes the listed keywords from the printer's "printer-state-reasons" attribute.
195 | .TP 5
196 | \fBSTATE: +\fIkeyword[,keyword,...]\fR
197 | Adds the listed keywords to the printer's "printer-state-reasons" attribute.
198 | .SH EXAMPLES
199 | Run
200 | .B ipp3dprinter
201 | with a service name of My Cool Printer:
202 | .nf
203 |
204 | ipp3dprinter "My Cool Printer"
205 | .fi
206 | .LP
207 | Run the
208 | .BR file (1)
209 | command whenever a job is sent to the server:
210 | .nf
211 |
212 | ipp3dprinter \-c /usr/bin/file "My Cool Printer"
213 | .fi
214 | .SH SEE ALSO
215 | PWG Internet Printing Protocol Workgroup (http://www.pwg.org/ipp)
216 | .SH COPYRIGHT
217 | Copyright \[co] 2007-2019 by Apple Inc.
218 |
--------------------------------------------------------------------------------