├── test ├── sgray.icc ├── srgb.icc ├── srgb-glossy.icc ├── print │ ├── pwg-5100-1-2022.png │ ├── ipp-everywhere-pdf.png │ ├── ipp-everywhere-raster.png │ ├── infra.conf │ ├── foo.conf │ ├── ippserver-data-type-test.conf │ └── ipp-everywhere-pdf.conf ├── en.strings ├── fr.strings ├── system.conf ├── start-server.sh ├── run-tests.sh └── print3d │ └── foo3d.conf ├── examples ├── srgb.icc ├── box.3mf ├── icon.png ├── ipp-3d.3mf ├── sphere.3mf ├── torus.3mf ├── vector.pdf ├── cylinder.3mf ├── cube_gears.3mf ├── heartgears.3mf ├── dodeca_chain_loop.3mf ├── delete-printer.test ├── get-jobs-all.test ├── pwg5100.22.test ├── pwg5100.9.test ├── set-system-attributes.test ├── create-job-3d.test ├── get-jobs-fetchable.test ├── Makefile ├── create-resource-strings.test ├── get-system-attributes.test ├── ipp-3d.scad ├── ipp-3d-with-grommet.scad ├── pwg5100.11.test ├── pwg5100.3.test └── pwg5100.18.test ├── server ├── printer.png ├── printer3d.png ├── printer.opacity ├── printer3d.opacity ├── Makefile ├── EXTENSIONS.md ├── Dependencies ├── DESIGN.md └── device.c ├── .dockerignore ├── vcnet ├── signmsi.bat ├── ippdoclint.vcxproj.user ├── ippproxy.vcxproj.user ├── ippserver.vcxproj.user ├── packages.config ├── ippserver.vcxproj.filters ├── config.h ├── ippdoclint.vcxproj ├── ippproxy.vcxproj ├── ippserver.vcxproj └── ippsample.sln ├── xcode ├── ippsample.xcodeproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ ├── All.xcscheme │ │ ├── ippproxy.xcscheme │ │ ├── ippdoclint.xcscheme │ │ └── ippserver.xcscheme ├── ippsample.xcworkspace │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── contents.xcworkspacedata └── config.h ├── CONTRIBUTING.md ├── TESTING.md ├── config.h.in ├── docker-compose.yml ├── tools ├── Dependencies └── Makefile ├── man ├── Makefile ├── ippproxy.8 ├── ippdoclint.1 ├── ippproxy.html ├── ippdoclint.html ├── ipptransform3d.7 ├── ipptransform3d.html └── ipp3dprinter.1 ├── NOTICE ├── PI.md ├── Dockerfile ├── snap └── snapcraft.yaml ├── Makefile ├── Makedefs.in ├── DOCKER.md ├── SCRIPTING.md ├── BUILD.md ├── README.md └── install-sh /test/sgray.icc: -------------------------------------------------------------------------------- 1 | FAKE-ICC 2 | -------------------------------------------------------------------------------- /test/srgb.icc: -------------------------------------------------------------------------------- 1 | FAKE-ICC 2 | -------------------------------------------------------------------------------- /examples/srgb.icc: -------------------------------------------------------------------------------- 1 | FAKE-ICC 2 | -------------------------------------------------------------------------------- /test/srgb-glossy.icc: -------------------------------------------------------------------------------- 1 | FAKE-ICC 2 | -------------------------------------------------------------------------------- /examples/box.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/istopwg/ippsample/HEAD/examples/box.3mf -------------------------------------------------------------------------------- /examples/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/istopwg/ippsample/HEAD/examples/icon.png -------------------------------------------------------------------------------- /examples/ipp-3d.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/istopwg/ippsample/HEAD/examples/ipp-3d.3mf -------------------------------------------------------------------------------- /examples/sphere.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/istopwg/ippsample/HEAD/examples/sphere.3mf -------------------------------------------------------------------------------- /examples/torus.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/istopwg/ippsample/HEAD/examples/torus.3mf -------------------------------------------------------------------------------- /examples/vector.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/istopwg/ippsample/HEAD/examples/vector.pdf -------------------------------------------------------------------------------- /server/printer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/istopwg/ippsample/HEAD/server/printer.png -------------------------------------------------------------------------------- /server/printer3d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/istopwg/ippsample/HEAD/server/printer3d.png -------------------------------------------------------------------------------- /examples/cylinder.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/istopwg/ippsample/HEAD/examples/cylinder.3mf -------------------------------------------------------------------------------- /server/printer.opacity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/istopwg/ippsample/HEAD/server/printer.opacity -------------------------------------------------------------------------------- /examples/cube_gears.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/istopwg/ippsample/HEAD/examples/cube_gears.3mf -------------------------------------------------------------------------------- /examples/heartgears.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/istopwg/ippsample/HEAD/examples/heartgears.3mf -------------------------------------------------------------------------------- /server/printer3d.opacity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/istopwg/ippsample/HEAD/server/printer3d.opacity -------------------------------------------------------------------------------- /examples/dodeca_chain_loop.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/istopwg/ippsample/HEAD/examples/dodeca_chain_loop.3mf -------------------------------------------------------------------------------- /test/print/pwg-5100-1-2022.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/istopwg/ippsample/HEAD/test/print/pwg-5100-1-2022.png -------------------------------------------------------------------------------- /test/en.strings: -------------------------------------------------------------------------------- 1 | "media-type.stationery-letterhead" = "Letterhead"; 2 | "media-type.stationery-plain" = "Plain Paper"; 3 | -------------------------------------------------------------------------------- /test/print/ipp-everywhere-pdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/istopwg/ippsample/HEAD/test/print/ipp-everywhere-pdf.png -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | *.o 2 | .git 3 | config.h 4 | config.log 5 | config.status 6 | docker-compose.yml 7 | Dockerfile 8 | Makedefs 9 | -------------------------------------------------------------------------------- /test/print/ipp-everywhere-raster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/istopwg/ippsample/HEAD/test/print/ipp-everywhere-raster.png -------------------------------------------------------------------------------- /test/fr.strings: -------------------------------------------------------------------------------- 1 | "media-type.stationery-letterhead" = "En-tête de lettre"; 2 | "media-type.stationery-plain" = "Papier ordinaire"; 3 | -------------------------------------------------------------------------------- /test/system.conf: -------------------------------------------------------------------------------- 1 | BinDir tools 2 | DefaultPrinter ipp-everywhere-pdf 3 | KeepFiles Yes 4 | LogFile stderr 5 | LogLevel info 6 | MaxJobs 0 7 | AuthTestPassword test123 8 | -------------------------------------------------------------------------------- /vcnet/signmsi.bat: -------------------------------------------------------------------------------- 1 | "C:\Program Files\Windows Kits\8.1\bin\x86\signtool" sign /n "IEEE Industry Standards and Technology Organization" sw-ippeveselfcert10-windows.msi 2 | 3 | -------------------------------------------------------------------------------- /vcnet/ippdoclint.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /vcnet/ippproxy.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /vcnet/ippserver.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /test/print/infra.conf: -------------------------------------------------------------------------------- 1 | # IPP Shared Infrastructure Extensions v1.0 (INFRA) queue 2 | AuthProxyGroup @system 3 | MaxOutputDevices 2 4 | WebForms No 5 | 6 | MAKE "PWG" 7 | MODEL "IPP Infra Test Printer" 8 | -------------------------------------------------------------------------------- /xcode/ippsample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /vcnet/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /xcode/ippsample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /xcode/ippsample.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /xcode/ippsample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/delete-printer.test: -------------------------------------------------------------------------------- 1 | { 2 | NAME "Delete-Printer $printer-id" 3 | 4 | OPERATION Delete-Printer 5 | VERSION 2.0 6 | 7 | GROUP operation-attributes-tag 8 | ATTR charset attributes-charset utf-8 9 | ATTR naturalLanguage attributes-natural-language en 10 | ATTR uri system-uri $uri 11 | ATTR integer printer-id $printer-id 12 | 13 | STATUS successful-ok 14 | } 15 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to the IPP Sample Implementations 2 | 3 | The IPP sample implementations are developed and distributed as open source 4 | software under the Apache License, Version 2.0. 5 | 6 | Contributions should be submitted as pull requests on the Github site: 7 | 8 | http://github.com/istopwg/ippsample/pulls 9 | 10 | Developer guidelines can be found in the file `DEVELOPING.md`. 11 | -------------------------------------------------------------------------------- /TESTING.md: -------------------------------------------------------------------------------- 1 | Testing the IPP Sample Code 2 | =========================== 3 | 4 | The `test` directory contains a test configuration for the `ippserver` program. 5 | To use this test configuration, run the `start-server.sh` script from the top- 6 | level directory: 7 | 8 | test/start-server.sh 9 | 10 | To modify its configuration: 11 | 12 | - Change the parameters to ippserver: change the arguments in "start-server.sh". 13 | 14 | - Change the printer configurations: edit the .conf files in the "print" and 15 | "print3d" subdirectories. 16 | -------------------------------------------------------------------------------- /examples/get-jobs-all.test: -------------------------------------------------------------------------------- 1 | { 2 | NAME "Get all jobs" 3 | 4 | OPERATION Get-Jobs 5 | 6 | GROUP operation-attributes-tag 7 | ATTR charset attributes-charset utf-8 8 | ATTR language attributes-natural-language en 9 | ATTR uri printer-uri $uri 10 | ATTR keyword requested-attributes job-name,job-id,job-state,job-state-reasons,job-originating-user-name,output-device-uuid-assigned 11 | ATTR keyword which-jobs all 12 | 13 | STATUS successful-ok 14 | 15 | DISPLAY job-id 16 | DISPLAY job-name 17 | DISPLAY job-state 18 | DISPLAY job-state-reasons 19 | } 20 | 21 | -------------------------------------------------------------------------------- /examples/pwg5100.22.test: -------------------------------------------------------------------------------- 1 | # 2 | # Test for conformance with PWG 5100.22-2019 3 | # 4 | # Usage: 5 | # 6 | # ./ipptool -tIf FILENAME system-uri pwg5100.22.test 7 | # 8 | # Sub-tests are provided for the base conformance tests, printer operations, 9 | # resource operations, and notification operations. 10 | # 11 | # Copyright © 2022 by the Printer Working Group. 12 | # 13 | # Licensed under Apache License v2.0. See the file "LICENSE" for more 14 | # information. 15 | # 16 | 17 | INCLUDE "pwg5100.22-base.test" 18 | INCLUDE "pwg5100.22-printers.test" 19 | INCLUDE "pwg5100.22-resources.test" 20 | INCLUDE "pwg5100.22-notifications.test" 21 | -------------------------------------------------------------------------------- /config.h.in: -------------------------------------------------------------------------------- 1 | // 2 | // Configuration file for the IPP sample code. 3 | // 4 | // Copyright © 2014-2025 by the Printer Working Group. 5 | // 6 | // Licensed under Apache License v2.0. See the file "LICENSE" for more 7 | // information. 8 | // 9 | 10 | #ifndef IPPSAMPLE_CONFIG_H 11 | #define IPPSAMPLE_CONFIG_H 12 | 13 | 14 | // Version number 15 | #define IPPSAMPLE_VERSION "" 16 | 17 | 18 | // PAM support 19 | #undef HAVE_LIBPAM 20 | #undef HAVE_SECURITY_PAM_APPL_H 21 | #undef HAVE_PAM_PAM_APPL_H 22 | 23 | 24 | // PDF support 25 | #undef HAVE_COREGRAPHICS_H 26 | 27 | 28 | // CuraEngine path 29 | #undef CURAENGINE 30 | 31 | 32 | #endif // !IPPSAMPLE_CONFIG_H 33 | -------------------------------------------------------------------------------- /xcode/config.h: -------------------------------------------------------------------------------- 1 | // 2 | // Xcode configuration file for the IPP sample code. 3 | // 4 | // Copyright © 2014-2025 by the Printer Working Group. 5 | // 6 | // Licensed under Apache License v2.0. See the file "LICENSE" for more 7 | // information. 8 | // 9 | 10 | #ifndef IPPSAMPLE_CONFIG_H 11 | #define IPPSAMPLE_CONFIG_H 12 | 13 | 14 | // Version number 15 | #define IPPSAMPLE_VERSION "2023.10" 16 | 17 | 18 | // PAM support 19 | #define HAVE_LIBPAM 1 20 | #define HAVE_SECURITY_PAM_APPL_H 1 21 | /* #undef HAVE_PAM_PAM_APPL_H */ 22 | 23 | 24 | // PDF support 25 | #define HAVE_COREGRAPHICS_H 1 26 | 27 | 28 | // CuraEngine path 29 | #define CURAENGINE "/Applications/Ultimaker Cura.app/Contents/MacOS/CuraEngine" 30 | 31 | 32 | #endif // !IPPSAMPLE_CONFIG_H 33 | -------------------------------------------------------------------------------- /test/print/foo.conf: -------------------------------------------------------------------------------- 1 | # Example configuration 2 | 3 | MAKE "PWG" 4 | MODEL "IPP Foo Test Printer" 5 | 6 | DeviceURI ipp://foo.example.com/ipp/print 7 | 8 | Attr keyword job-hold-until-default indefinite 9 | 10 | Attr collection media-col-ready { 11 | Member collection media-size { 12 | Member integer x-dimension 21590 13 | Member integer y-dimension 27940 14 | } 15 | Member keyword media-type stationery-letterhead 16 | },{ 17 | Member collection media-size { 18 | Member integer x-dimension 21000 19 | Member integer y-dimension 29700 20 | } 21 | Member keyword media-type stationery-plain 22 | } 23 | Attr keyword media-ready na_letter_8.5x11in,iso_a4_210x297mm 24 | Attr keyword media-type-supported stationery-plain,stationery-letterhead 25 | Attr integer pages-per-minute 10 26 | Attr integer pages-per-minute-color 5 27 | 28 | Strings en test/en.strings 29 | Strings fr test/fr.strings 30 | -------------------------------------------------------------------------------- /examples/pwg5100.9.test: -------------------------------------------------------------------------------- 1 | # 2 | #Check a printer for conformance with PWG 5100.9 3 | # 4 | # 5 | #Usage: 6 | # 7 | # ./ipptool printer-uri pwg5100.9.2.test 8 | # 9 | 10 | { 11 | NAME "Get printer attributes to check printer-alert and printer-alert-description" 12 | OPERATION Get-Printer-Attributes 13 | 14 | GROUP operation-attributes-tag 15 | ATTR charset attributes-charset utf-8 16 | ATTR language attributes-natural-language en 17 | ATTR uri printer-uri $uri 18 | 19 | STATUS successful-ok 20 | 21 | EXPECT printer-alert OF-TYPE octetString IN-GROUP printer-attributes-tag WITH-ALL-VALUES "/^[Cc][Oo][Dd][Ee]\=[A-Za-z]+(;([Ii][Nn][Dd][Ee][Xx]\=[0-9]+|[Ss][Ee][Vv][Ee][Rr][Ii][Tt][Yy]\=[A-Za-z]+|[Tt][Rr][Aa][Ii][Nn][Ii][Nn][Gg]\=[A-Za-z]+|[Gg][Rr][Oo][Uu][Pp]\=[A-Za-z]+|[Gg][Rr][Oo][Uu][Pp][Ii][Nn][Dd][Ee][Xx]\=[0-9]+|[Ll][Oo][Cc][Aa][Tt][Ii][Oo][Nn]\=[0-9]+|[Tt][Ii][Mm][Ee]\=[0-9]+)){0,1}$/" 22 | EXPECT printer-alert-description OF-TYPE text IN-GROUP printer-attributes-tag SAME-COUNT-AS printer-alert 23 | } -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2.1' 2 | services: 3 | ippserver: 4 | hostname: ippserver 5 | build: 6 | context: . 7 | dockerfile: Dockerfile 8 | volumes: 9 | - './test:/config' 10 | - './data/print:/print' 11 | - './data/spool:/spool' 12 | - './data/tools:/tools' 13 | command: ippserver -C /config -r _print 14 | 15 | ippfind: 16 | build: 17 | context: . 18 | dockerfile: Dockerfile 19 | command: ippfind 20 | depends_on: 21 | - "ippserver" 22 | 23 | ipptest: 24 | build: 25 | context: . 26 | dockerfile: Dockerfile 27 | volumes: 28 | - './examples:/examples' 29 | working_dir: /examples 30 | command: ipptool -V 2.0 -tf document-letter.pdf ipp://ippserver.local:8991/ipp/print/foo ipp-everywhere.test 31 | depends_on: 32 | - "ippserver" 33 | 34 | ippproxy: 35 | build: 36 | context: . 37 | dockerfile: Dockerfile 38 | command: ippproxy -d ipp://ippserver.local:8991/ipp/print/foo ipp://ippserver.local:8991/ipp/print/bar 39 | depends_on: 40 | - "ippserver" 41 | -------------------------------------------------------------------------------- /test/start-server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright © 2017-2018 by The Printer Working Group. 4 | # 5 | # Licensed under Apache License v2.0. See the file "LICENSE" for more 6 | # information. 7 | # 8 | # Usage: 9 | # 10 | # test/start-server.sh [options] 11 | # 12 | 13 | # Verify we have been run from the correct location... 14 | if test ! -d test; then 15 | echo "Usage: test/start-server.sh [options]" 16 | exit 1 17 | fi 18 | 19 | # Find where the ippserver binary resides 20 | IPPSERVER="" 21 | for file in server/ippserver xcode/DerivedData/ippsample/Build/Products/Debug/ippserver xcode/DerivedData/ippsample/Build/Products/Release/ippserver; do 22 | if test -x $file; then 23 | IPPSERVER="$file" 24 | break 25 | fi 26 | done 27 | 28 | if test "x$IPPSERVER" = x; then 29 | echo "You must build ippserver before running this script." 30 | exit 1 31 | fi 32 | 33 | # Run server with base options: 34 | # 35 | # - Be very verbose 36 | # - Use configuration directory "test" 37 | # - Specify IPP Everywhere sub-type 38 | echo "Running $IPPSERVER -vvv -C test -r _print $@" 39 | 40 | exec $IPPSERVER -vvv -C test -r _print "$@" 41 | -------------------------------------------------------------------------------- /examples/set-system-attributes.test: -------------------------------------------------------------------------------- 1 | { 2 | # The name of the test... 3 | NAME "Set-System-Attributes" 4 | 5 | # Always IPP/2.0 6 | VERSION 2.0 7 | 8 | # The operation to use 9 | OPERATION Set-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 | GROUP system-attributes-tag 18 | ATTR integer system-default-printer-id 3 19 | ATTR uri system-geo-location "geo:37.334722,-122.008889" 20 | ATTR text system-info "System description changed." 21 | ATTR text system-location "System location changed." 22 | ATTR text system-make-and-model "System make and model changed." 23 | ATTR name system-name "System name changed." 24 | ATTR collection system-owner-col { 25 | MEMBER name owner-name "John Adams" 26 | MEMBER uri owner-uri "mailto:john.adams@example.com" 27 | MEMBER text owner-vcard "BEGIN:VCARD\r\n","VERSION:4.0\r\n","FN:John Adams\r\n","EMAIL;TYPE=work:john.adams@example.com\r\n","NOTE:Unknown location.\r\n","END:VCARD\r\n" 28 | } 29 | 30 | # What statuses are OK? 31 | STATUS successful-ok 32 | } 33 | -------------------------------------------------------------------------------- /tools/Dependencies: -------------------------------------------------------------------------------- 1 | ipp3dprinter.o: ipp3dprinter.c ../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/transcode.h \ 5 | ../libcups/cups/pwg.h ../libcups/cups/dnssd.h ../libcups/cups/thread.h \ 6 | ../server/printer3d-png.h 7 | ippdoclint.o: ippdoclint.c ../config.h ../libcups/cups/cups.h \ 8 | ../libcups/cups/file.h ../libcups/cups/base.h ../libcups/cups/ipp.h \ 9 | ../libcups/cups/http.h ../libcups/cups/array.h \ 10 | ../libcups/cups/language.h ../libcups/cups/transcode.h \ 11 | ../libcups/cups/pwg.h ../libcups/cups/raster.h 12 | ippproxy.o: ippproxy.c ../config.h ../libcups/cups/cups.h \ 13 | ../libcups/cups/file.h ../libcups/cups/base.h ../libcups/cups/ipp.h \ 14 | ../libcups/cups/http.h ../libcups/cups/array.h \ 15 | ../libcups/cups/language.h ../libcups/cups/transcode.h \ 16 | ../libcups/cups/pwg.h ../libcups/cups/thread.h 17 | ipptransform3d.o: ipptransform3d.c ../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/transcode.h \ 21 | ../libcups/cups/pwg.h ../libcups/cups/thread.h 22 | -------------------------------------------------------------------------------- /examples/create-job-3d.test: -------------------------------------------------------------------------------- 1 | # Print a 3MF file using Create-Job + Send-Document 2 | { 3 | # The name of the test... 4 | NAME "Create-Job for 3D Print Job" 5 | 6 | # The operation to use 7 | OPERATION Create-Job 8 | 9 | # Attributes, starting in the operation group... 10 | GROUP operation-attributes-tag 11 | ATTR charset attributes-charset utf-8 12 | ATTR language attributes-natural-language en 13 | ATTR uri printer-uri $uri 14 | ATTR name requesting-user-name $user 15 | 16 | GROUP job-attributes-tag 17 | ATTR collection materials-col { 18 | MEMBER keyword material-type pla 19 | } 20 | ATTR enum print-quality 4 21 | 22 | # What statuses are OK? 23 | STATUS successful-ok 24 | 25 | # What attributes do we expect? 26 | EXPECT job-id 27 | EXPECT job-uri 28 | } 29 | { 30 | # The name of the test... 31 | NAME "... and Send-Document" 32 | 33 | # The operation to use 34 | OPERATION Send-Document 35 | 36 | # Attributes, starting in the operation group... 37 | GROUP operation 38 | ATTR charset attributes-charset utf-8 39 | ATTR language attributes-natural-language en 40 | ATTR uri printer-uri $uri 41 | ATTR integer job-id $job-id 42 | ATTR name requesting-user-name $user 43 | ATTR boolean last-document true 44 | ATTR mimeMediaType document-format $filetype 45 | 46 | FILE $filename 47 | 48 | # What statuses are OK? 49 | STATUS successful-ok 50 | } 51 | -------------------------------------------------------------------------------- /man/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # IPP documentation makefile. 3 | # 4 | # Copyright © 2014-2023 by the Printer Working Group. 5 | # 6 | # Licensed under Apache License v2.0. See the file "LICENSE" for more 7 | # information. 8 | # 9 | 10 | include ../Makedefs 11 | 12 | 13 | MAN1 = \ 14 | ipp3dprinter.1 \ 15 | ippdoclint.1 \ 16 | $(IPPTRANSFORM3D_MAN) 17 | MAN8 = \ 18 | ippproxy.8 \ 19 | ippserver.8 20 | HTML = \ 21 | ipp3dprinter.html \ 22 | ippdoclint.html \ 23 | ippproxy.html \ 24 | ippserver.html \ 25 | $(IPPTRANSFORM3D_HTML) 26 | 27 | 28 | # 29 | # Rules for converting man pages to HTML... 30 | # 31 | 32 | .SUFFIXES: .1 .8 .html 33 | .1.html .8.html: 34 | echo Generating $@... 35 | mantohtml $< >$@ 36 | 37 | 38 | # 39 | # Make all targets... 40 | # 41 | 42 | all: $(HTML) 43 | 44 | 45 | # 46 | # Clean all object files... 47 | # 48 | 49 | clean: 50 | 51 | 52 | # 53 | # Update dependencies (without system header dependencies...) 54 | # 55 | 56 | depend: 57 | 58 | 59 | # 60 | # Install man pages... 61 | # 62 | 63 | install: 64 | echo "Installing man pages to $(BUILDROOT)/$(mandir)..." 65 | $(INSTALL_DIR) $(BUILDROOT)$(mandir)/man1 66 | for file in $(MAN1); do \ 67 | $(INSTALL_MAN) $$file $(BUILDROOT)$(mandir)/man1/$$man; \ 68 | done 69 | $(INSTALL_DIR) $(BUILDROOT)$(mandir)/man8 70 | for file in $(MAN8); do \ 71 | $(INSTALL_MAN) $$file $(BUILDROOT)$(mandir)/man8/$$man; \ 72 | done 73 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | IPP Sample Code 2 | 3 | Copyright © 2014-2024 by the Printer Working Group. 4 | Copyright © 2007-2018 by Apple Inc. 5 | Copyright © 1997-2007 by Easy Software Products. 6 | 7 | CUPS and the CUPS logo are trademarks of Apple Inc. 8 | 9 | The MD5 Digest code is Copyright 1999 Aladdin Enterprises. 10 | 11 | The Kerberos support code ("KSC") is copyright 2006 by Jelmer Vernooij and is 12 | provided 'as-is', without any express or implied warranty. In no event will the 13 | author or Apple Inc. be held liable for any damages arising from the use of the 14 | KSC. 15 | 16 | Sources files containing KSC have the following text at the top of each source 17 | file: 18 | 19 | This file contains Kerberos support code, copyright 2006 by Jelmer Vernooij. 20 | 21 | The KSC copyright and license apply only to Kerberos-related feature code in 22 | CUPS. Such code is typically conditionally compiled based on the present of the 23 | HAVE_GSSAPI preprocessor definition. 24 | 25 | Permission is granted to anyone to use the KSC for any purpose, including 26 | commercial applications, and to alter it and redistribute it freely, subject to 27 | the following restrictions: 28 | 29 | 1. The origin of the KSC must not be misrepresented; you must not claim that 30 | you wrote the original software. If you use the KSC in a product, an 31 | acknowledgment in the product documentation would be appreciated but is not 32 | required. 33 | 2. Altered source versions must be plainly marked as such, and must not be 34 | misrepresented as being the original software. 35 | 3. This notice may not be removed or altered from any source distribution. 36 | -------------------------------------------------------------------------------- /examples/get-jobs-fetchable.test: -------------------------------------------------------------------------------- 1 | DEFINE MY-JOBS false 2 | 3 | { 4 | NAME "Get Printer's which-jobs-supported attribute" 5 | 6 | OPERATION Get-Printer-Attributes 7 | Version 2.0 8 | 9 | GROUP operation 10 | ATTR charset attributes-charset utf-8 11 | ATTR language attributes-natural-language en 12 | ATTR uri printer-uri $uri 13 | ATTR keyword requested-attributes printer-make-and-model,printer-name,printer-state,which-jobs-supported 14 | 15 | STATUS successful-ok 16 | 17 | EXPECT printer-make-and-model 18 | EXPECT printer-name 19 | EXPECT printer-state 20 | EXPECT which-jobs-supported OF-TYPE keyword WITH-VALUE 'fetchable' 21 | EXPECT which-jobs-supported OF-TYPE keyword WITH-VALUE 'fetchable' DEFINE-MATCH FETCHABLE-SUPPORTED 22 | 23 | } 24 | 25 | 26 | { 27 | 28 | SKIP-IF-NOT-DEFINED FETCHABLE-SUPPORTED 29 | 30 | NAME "Get fetchable jobs; -d MY-JOBS=true for just yours" 31 | 32 | OPERATION Get-Jobs 33 | 34 | GROUP operation-attributes-tag 35 | ATTR charset attributes-charset utf-8 36 | ATTR language attributes-natural-language en 37 | ATTR uri printer-uri $uri 38 | ATTR keyword requested-attributes job-name,job-id,job-state,job-state-reasons,job-originating-user-name,output-device-uuid-assigned 39 | ATTR keyword which-jobs fetchable 40 | ATTR boolean my-jobs $MY-JOBS 41 | 42 | 43 | STATUS successful-ok 44 | 45 | EXPECT ?job-name 46 | EXPECT ?job-id 47 | EXPECT ?job-state 48 | EXPECT ?job-state-reasons 49 | EXPECT ?job-originating-user-name 50 | EXPECT ?output-device-uuid-assigned 51 | 52 | } 53 | 54 | -------------------------------------------------------------------------------- /PI.md: -------------------------------------------------------------------------------- 1 | # Raspberry Pi Build/Usage Instructions 2 | 3 | All of this sample code will build on a Raspberry Pi, which can then be used 4 | as an inexpensive print server or as part of an automated test framework. All 5 | of the commands in this file assume you are using the Raspbian OS. 6 | 7 | 8 | ## Prerequisites 9 | 10 | Run the following command to install the core software you'll need to build and 11 | use all of the ippsample code: 12 | 13 | sudo apt-get install build-essential autoconf avahi-daemon avahi-utils \ 14 | cura-engine libavahi-client-dev libnss-mdns libpam-dev libssl-dev \ 15 | zlib1g-dev 16 | 17 | Prerequisites for just 2D printing: 18 | 19 | sudo apt-get install build-essential autoconf avahi-daemon avahi-utils \ 20 | libavahi-client-dev libnss-mdns libpam-dev libssl-dev zlib1g-dev 21 | 22 | Prerequisites for just 3D printing: 23 | 24 | sudo apt-get install build-essential autoconf avahi-daemon avahi-utils \ 25 | cura-engine libavahi-client-dev libnss-mdns libpam-dev libssl-dev \ 26 | zlib1g-dev 27 | 28 | 29 | ## Building the IPP Sample Code 30 | 31 | If you haven't already done so, you can download the latested IPP sample sources 32 | with Git using: 33 | 34 | git clone --recurse-submodules https://github.com/istopwg/ippsample.git 35 | 36 | Then, from the ippsample source directory, run the following commands to 37 | build and install everything: 38 | 39 | ./configure 40 | make 41 | sudo make install 42 | 43 | 44 | ## Using the IPP Server 45 | 46 | The `sample-configs` directory contains sample configuration directories for 47 | `ippserver` to do different things. 48 | 49 | > Work in progress here... 50 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # Docker container for IPP sample implementations. 3 | # 4 | # Copyright © 2014-2025 by the Printer Working Group. 5 | # 6 | # Licensed under Apache License v2.0. See the file "LICENSE" for more 7 | # information. 8 | # 9 | 10 | # Build using current Ubuntu... 11 | FROM ubuntu:latest AS builder 12 | 13 | ARG DEBIAN_FRONTEND=noninteractive 14 | #RUN apt-get -qq update 15 | RUN apt-get update 16 | RUN apt-get upgrade -y 17 | RUN apt-get install -y avahi-daemon avahi-utils curl man iputils-ping net-tools tcpdump vim 18 | RUN apt-get install -y build-essential autoconf libavahi-client-dev libjpeg-dev libnss-mdns libpam-dev libpng-dev libssl-dev libusb-1.0-0-dev zlib1g-dev 19 | 20 | # Copy source files to image 21 | COPY . /root/ippsample/ 22 | WORKDIR /root/ippsample 23 | RUN ./configure; test -f server/ippserver && make clean; make && make install 24 | 25 | 26 | # Use latest Ubuntu for run-time image... 27 | FROM ubuntu:latest 28 | ARG DEBIAN_FRONTEND=noninteractive 29 | #RUN apt-get -qq update 30 | RUN apt-get update 31 | RUN apt-get upgrade -y 32 | RUN apt-get install -y avahi-daemon avahi-utils curl man iputils-ping net-tools tcpdump vim 33 | COPY --from=builder /usr/local /usr/local 34 | RUN ldconfig 35 | 36 | # Make changes necessary to run Avahi for DNS-SD support 37 | RUN sed -ie 's/rlimit-nproc=3/rlimit-nproc=8/' /etc/avahi/avahi-daemon.conf 38 | RUN update-rc.d dbus defaults 39 | # RUN update-rc.d avahi-daemon defaults 40 | 41 | # Create entrypoint.sh script to start dbus and avahi-daemon 42 | RUN echo '#!/bin/bash\n\ 43 | service dbus start\n\ 44 | service avahi-daemon start\n\ 45 | $*\n\ 46 | ' > /usr/bin/entrypoint.sh && chmod +x /usr/bin/entrypoint.sh 47 | ENTRYPOINT ["/usr/bin/entrypoint.sh"] 48 | 49 | # Export port 8000 for ippserver 50 | EXPOSE 8000 -------------------------------------------------------------------------------- /snap/snapcraft.yaml: -------------------------------------------------------------------------------- 1 | name: ipp 2 | base: core22 3 | version: '2023.10' 4 | summary: IPP Sample Implementation 5 | description: | 6 | This snap provides sample, non-production-ready implementations of IPP 7 | Clients, Printers, Proxies, and Systems. 8 | 9 | grade: stable 10 | confinement: strict 11 | icon: server/printer.png 12 | 13 | architectures: 14 | - build-on: amd64 15 | - build-on: arm64 16 | - build-on: armhf 17 | 18 | apps: 19 | ipp3dprinter: 20 | command: usr/local/bin/ipp3dprinter 21 | plugs: [avahi-observe, home, network, network-bind] 22 | ippdoclint: 23 | command: usr/local/bin/ippdoclint 24 | plugs: [home] 25 | ippeveprinter: 26 | command: usr/local/bin/ippeveprinter 27 | plugs: [avahi-observe, home, network, network-bind] 28 | ippfind: 29 | command: usr/local/bin/ippfind 30 | plugs: [avahi-observe, home, network] 31 | ippproxy: 32 | command: usr/local/sbin/ippproxy 33 | plugs: [avahi-observe, home, network] 34 | ippserver: 35 | command: usr/local/sbin/ippserver 36 | plugs: [avahi-observe, home, network, network-bind] 37 | ipptool: 38 | command: usr/local/bin/ipptool 39 | plugs: [home, network] 40 | ipptransform: 41 | command: usr/local/bin/ipptransform 42 | plugs: [home, network] 43 | ipptransform3d: 44 | command: usr/local/bin/ipptransform3d 45 | plugs: [home, network] 46 | 47 | parts: 48 | main: 49 | plugin: autotools 50 | source: . 51 | source-submodules: [libcups, pdfio] 52 | build-packages: [cura-engine, libavahi-client-dev, libjpeg-dev, libpam-dev, libpng-dev, libssl-dev, libusb-1.0-0-dev, zlib1g-dev] 53 | stage-packages: [libavahi-client3, libjpeg-turbo8, poppler-utils] 54 | -------------------------------------------------------------------------------- /examples/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # IPP examples makefile. 3 | # 4 | # Copyright © 2021-2022 by the Printer Working Group. 5 | # 6 | # Licensed under Apache License v2.0. See the file "LICENSE" for more 7 | # information. 8 | # 9 | 10 | include ../Makedefs 11 | 12 | 13 | DOCFILES = \ 14 | box.3mf \ 15 | cube_gears.3mf \ 16 | cylinder.3mf \ 17 | dodeca_chain_loop.3mf \ 18 | heartgears.3mf \ 19 | ipp-3d-with-grommet.stl \ 20 | ipp-3d.3mf \ 21 | ipp-3d.stl \ 22 | sphere.3mf \ 23 | torus.3mf \ 24 | vector.pdf 25 | 26 | TESTFILES = \ 27 | create-job-3d.test \ 28 | create-resource-strings.test \ 29 | delete-printer.test \ 30 | get-jobs-all.test \ 31 | get-jobs-fetchable.test \ 32 | get-system-attributes.test \ 33 | ipp-3d.test \ 34 | pwg5100.1.test \ 35 | pwg5100.2.test \ 36 | pwg5100.3.test \ 37 | pwg5100.5.test \ 38 | pwg5100.6.test \ 39 | pwg5100.7.test \ 40 | pwg5100.8.test \ 41 | pwg5100.9.test \ 42 | pwg5100.11.test \ 43 | pwg5100.15.test \ 44 | pwg5100.16.test \ 45 | pwg5100.17.test \ 46 | pwg5100.18.test \ 47 | pwg5100.22.test \ 48 | pwg5100.22-base.test \ 49 | pwg5100.22-notifications.test \ 50 | pwg5100.22-printers.test \ 51 | pwg5100.22-resources.test \ 52 | rfc3380.test \ 53 | rfc3995-3996.test \ 54 | rfc3998.test \ 55 | set-system-attributes.test 56 | 57 | 58 | # 59 | # Make all targets... 60 | # 61 | 62 | all: 63 | 64 | 65 | # 66 | # Clean all object files... 67 | # 68 | 69 | clean: 70 | 71 | 72 | # 73 | # Update dependencies (without system header dependencies...) 74 | # 75 | 76 | depend: 77 | 78 | 79 | # 80 | # Install... 81 | # 82 | 83 | install: 84 | echo "Installing ipptool files to $(BUILDROOT)$(datadir)/ipptool..." 85 | $(INSTALL_DIR) $(BUILDROOT)$(datadir)/ipptool 86 | for file in $(TESTFILES) $(DOCFILES); do \ 87 | $(INSTALL_DATA) $$file $(BUILDROOT)$(datadir)/ipptool; \ 88 | done 89 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Top-level Makefile for IPP sample implementations. 3 | # 4 | # Copyright © 2014-2024 by the Printer Working Group. 5 | # 6 | # Licensed under Apache License v2.0. See the file "LICENSE" for more 7 | # information. 8 | # 9 | 10 | include Makedefs 11 | 12 | 13 | # Source directories... 14 | DIRS = \ 15 | libcups/cups \ 16 | libcups/pdfio \ 17 | libcups/tools \ 18 | server \ 19 | tools 20 | 21 | 22 | # 23 | # Make all targets... 24 | # 25 | 26 | all: 27 | for dir in $(DIRS); do \ 28 | if test -f $$dir/Makefile; then \ 29 | echo "======== all in $$dir ========"; \ 30 | (cd $$dir; $(MAKE) $(MFLAGS) all) || exit 1; \ 31 | fi; \ 32 | done 33 | 34 | 35 | # 36 | # Remove object and target files... 37 | # 38 | 39 | clean: 40 | for dir in $(DIRS); do \ 41 | if test -f $$dir/Makefile; then \ 42 | echo "======== clean in $$dir ========"; \ 43 | (cd $$dir; $(MAKE) $(MFLAGS) clean) || exit 1; \ 44 | fi; \ 45 | done 46 | 47 | 48 | # 49 | # Remove all non-distribution files... 50 | # 51 | 52 | distclean: clean 53 | $(RM) Makedefs config.h config.log config.status 54 | -$(RM) -r autom4te*.cache 55 | (cd libcups; make distclean) 56 | 57 | 58 | # 59 | # Make dependencies 60 | # 61 | 62 | depend: 63 | for dir in server tools; do \ 64 | echo "======== depend in $$dir ========"; \ 65 | (cd $$dir; $(MAKE) $(MFLAGS) depend) || exit 1; \ 66 | done 67 | 68 | 69 | # 70 | # Install everything... 71 | # 72 | 73 | install: 74 | for dir in $(DIRS) examples man; do \ 75 | if test -f $$dir/Makefile; then \ 76 | echo "======== install in $$dir ========"; \ 77 | (cd $$dir; $(MAKE) $(MFLAGS) prefix=$(prefix) install) || exit 1; \ 78 | fi; \ 79 | done 80 | 81 | 82 | # 83 | # Test everything... 84 | # 85 | 86 | .PHONY: test 87 | 88 | test: 89 | for dir in $(DIRS); do \ 90 | if test -f $$dir/Makefile; then \ 91 | echo "======== test in $$dir ========"; \ 92 | (cd $$dir; $(MAKE) $(MFLAGS) CFLAGS="$(CFLAGS)" COMMONFLAGS="$(OPTIM)" test) || exit 1; \ 93 | fi; \ 94 | done 95 | echo "Running integration tests..." 96 | test/run-tests.sh 97 | 98 | 99 | # 100 | # Don't run top-level build targets in parallel... 101 | # 102 | 103 | .NOTPARALLEL: 104 | -------------------------------------------------------------------------------- /Makedefs.in: -------------------------------------------------------------------------------- 1 | # 2 | # Common makefile definitions for the IPP sample code. 3 | # 4 | # Copyright © 2014-2022 by the Printer Working Group. 5 | # Copyright © 2007-2018 by Apple Inc. 6 | # Copyright © 1997-2007 by Easy Software Products, all rights reserved. 7 | # 8 | # Licensed under Apache License v2.0. See the file "LICENSE" for more 9 | # information. 10 | # 11 | 12 | # Version of the IPP sample code. 13 | IPPSAMPLE_VERSION = @IPPSAMPLE_VERSION@ 14 | 15 | 16 | # Components that get built... 17 | IPPTRANSFORM3D_BIN = @IPPTRANSFORM3D_BIN@ 18 | IPPTRANSFORM3D_HTML = @IPPTRANSFORM3D_HTML@ 19 | IPPTRANSFORM3D_MAN = @IPPTRANSFORM3D_MAN@ 20 | 21 | 22 | # Programs... 23 | CC = @CC@ 24 | INSTALL = @INSTALL@ 25 | LN = @LN@ -sf 26 | MKDIR = @MKDIR@ -p 27 | RM = @RM@ -f 28 | RMDIR = @RMDIR@ 29 | SHELL = /bin/sh 30 | 31 | 32 | # Installation programs... 33 | INSTALL_BIN = $(LIBTOOL) $(INSTALL) -c -m 755 34 | INSTALL_DATA = $(INSTALL) -c -m 444 35 | INSTALL_DIR = $(INSTALL) -d -m 755 36 | INSTALL_LIB = $(LIBTOOL) $(INSTALL) -c -m 755 37 | INSTALL_MAN = $(INSTALL) -c -m 444 38 | 39 | 40 | # Programs and options... 41 | CC = @CC@ 42 | CFLAGS = @CFLAGS@ $(CPPFLAGS) $(OPTIM) $(WARNINGS) 43 | CODE_SIGN = @CODE_SIGN@ 44 | CODESIGN_IDENTITY = - 45 | CPPFLAGS = -I.. -I../libcups -I../pdfio @CPPFLAGS@ 46 | CSFLAGS = -s "$(CODESIGN_IDENTITY)" @CSFLAGS@ --timestamp 47 | INSTALL = @INSTALL@ 48 | LDFLAGS = @LDFLAGS@ $(OPTIM) 49 | LIBS = -L../libcups/cups `PKG_CONFIG_PATH=../libcups pkg-config --libs cups3` @LIBS@ 50 | OPTIM = @OPTIM@ 51 | WARNINGS = @WARNINGS@ 52 | 53 | 54 | # Directories... 55 | bindir = @bindir@ 56 | datadir = @datadir@ 57 | datarootdir = @datarootdir@ 58 | exec_prefix = @exec_prefix@ 59 | includedir = @includedir@ 60 | infodir = @infodir@ 61 | libdir = @libdir@ 62 | libexecdir = @libexecdir@ 63 | localstatedir = @localstatedir@ 64 | mandir = @mandir@ 65 | oldincludedir = @oldincludedir@ 66 | prefix = @prefix@ 67 | privateinclude = @privateinclude@ 68 | sbindir = @sbindir@ 69 | sharedstatedir = @sharedstatedir@ 70 | srcdir = @srcdir@ 71 | sysconfdir = @sysconfdir@ 72 | top_srcdir = @top_srcdir@ 73 | 74 | BUILDROOT = $(DSTROOT)$(RPM_BUILD_ROOT)$(DESTDIR) 75 | 76 | 77 | # Build commands... 78 | .SILENT: 79 | .SUFFIXES: .c .h .o 80 | 81 | .c.o: 82 | echo Compiling $<... 83 | $(CC) $(CFLAGS) -c -o $@ $< 84 | -------------------------------------------------------------------------------- /server/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for sample IPP server. 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 | 10 | include ../Makedefs 11 | 12 | 13 | # 14 | # Object files... 15 | # 16 | 17 | OBJS = \ 18 | auth.o \ 19 | client.o \ 20 | conf.o \ 21 | device.o \ 22 | ipp.o \ 23 | job.o \ 24 | log.o \ 25 | main.o \ 26 | printer.o \ 27 | resource.o \ 28 | subscription.o \ 29 | transform.o 30 | 31 | 32 | # 33 | # Targets in this directory... 34 | # 35 | 36 | TARGETS = ippserver 37 | 38 | 39 | # 40 | # Make all targets... 41 | # 42 | 43 | all: $(TARGETS) 44 | 45 | 46 | # 47 | # Remove object and target files... 48 | # 49 | 50 | clean: 51 | $(RM) $(OBJS) $(TARGETS) 52 | 53 | 54 | # 55 | # Update dependencies (without system header dependencies...) 56 | # 57 | 58 | depend: 59 | $(CC) -MM $(CPPFLAGS) $(OBJS:.o=.c) >Dependencies 60 | 61 | 62 | # 63 | # Install the server. 64 | # 65 | 66 | install: all 67 | echo "Installing server to $(BUILDROOT)$(sbindir)..." 68 | $(INSTALL_DIR) $(BUILDROOT)$(sbindir) 69 | $(INSTALL_BIN) ippserver $(BUILDROOT)$(sbindir)/ippserver 70 | 71 | 72 | # 73 | # Test the server. 74 | # 75 | 76 | test: 77 | 78 | 79 | # 80 | # ippserver 81 | # 82 | 83 | ippserver: $(OBJS) ../libcups/cups/libcups3.a 84 | echo Linking $@... 85 | $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) 86 | 87 | 88 | # 89 | # Embedded PNG headers... 90 | # 91 | 92 | pngheaders: 93 | echo "Generating printer-png.h from printer.png..." 94 | echo "static const unsigned char printer_png[] =" >printer-png.h 95 | echo "{" >>printer-png.h 96 | od -t x1 printer.png | cut -b12- | awk '{printf(" "); for (i = 1; i <= NF; i ++) printf("0x%s,", $$i); print "";}' >>printer-png.h 97 | echo "};" >>printer-png.h 98 | echo "Generating printer3d-png.h from printer3d.png..." 99 | echo "static const unsigned char printer3d_png[] =" >printer3d-png.h 100 | echo "{" >>printer3d-png.h 101 | od -t x1 printer3d.png | cut -b12- | awk '{printf(" "); for (i = 1; i <= NF; i ++) printf("0x%s,", $$i); print "";}' >>printer3d-png.h 102 | echo "};" >>printer3d-png.h 103 | 104 | 105 | # 106 | # Dependencies... 107 | # 108 | 109 | include Dependencies 110 | -------------------------------------------------------------------------------- /tools/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Tools makefile for the IPP sample code. 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 | 10 | include ../Makedefs 11 | 12 | 13 | OBJS = \ 14 | ipp3dprinter.o \ 15 | ippdoclint.o \ 16 | ippproxy.o \ 17 | ipptransform3d.o 18 | TARGETS = \ 19 | $(BIN_TARGETS) \ 20 | $(SBIN_TARGETS) 21 | BIN_TARGETS = \ 22 | ipp3dprinter \ 23 | ippdoclint \ 24 | $(IPPTRANSFORM3D_BIN) 25 | SBIN_TARGETS = \ 26 | ippproxy 27 | 28 | 29 | # 30 | # Make all targets... 31 | # 32 | 33 | all: $(TARGETS) 34 | 35 | 36 | # 37 | # Clean all object files... 38 | # 39 | 40 | clean: 41 | $(RM) $(TARGETS) $(OBJS) 42 | 43 | 44 | # 45 | # Update dependencies (without system header dependencies...) 46 | # 47 | 48 | depend: 49 | $(CC) -MM $(CPPFLAGS) $(OBJS:.o=.c) >Dependencies 50 | 51 | 52 | # 53 | # Install all tools. 54 | # 55 | 56 | install: all 57 | echo "Installing user programs to $(BUILDROOT)$(bindir)..." 58 | $(INSTALL_DIR) $(BUILDROOT)$(bindir) 59 | for file in $(BIN_TARGETS); do \ 60 | $(INSTALL_BIN) $$file $(BUILDROOT)$(bindir)/$$file; \ 61 | done 62 | echo "Installing admin programs to $(BUILDROOT)$(sbindir)..." 63 | $(INSTALL_DIR) $(BUILDROOT)$(sbindir) 64 | for file in $(SBIN_TARGETS); do \ 65 | $(INSTALL_BIN) $$file $(BUILDROOT)$(sbindir)/$$file; \ 66 | done 67 | 68 | 69 | # 70 | # Test all tools. 71 | # 72 | 73 | test: 74 | 75 | 76 | # 77 | # ipp3dprinter 78 | # 79 | 80 | ipp3dprinter: ipp3dprinter.o ../libcups/cups/libcups3.a 81 | echo Linking $@... 82 | $(CC) $(LDFLAGS) -o $@ ipp3dprinter.o $(LIBS) 83 | 84 | 85 | # 86 | # ippdoclint 87 | # 88 | 89 | ippdoclint: ippdoclint.o ../libcups/cups/libcups3.a 90 | echo Linking $@... 91 | $(CC) $(LDFLAGS) -o $@ ippdoclint.o $(LIBS) 92 | 93 | 94 | # 95 | # ippproxy 96 | # 97 | 98 | ippproxy: ippproxy.o ../libcups/cups/libcups3.a 99 | echo Linking $@... 100 | $(CC) $(LDFLAGS) -o $@ ippproxy.o $(LIBS) 101 | 102 | 103 | # 104 | # ipptransform3d 105 | # 106 | 107 | ipptransform3d: ipptransform3d.o ../libcups/cups/libcups3.a 108 | echo Linking $@... 109 | $(CC) $(LDFLAGS) -o $@ ipptransform3d.o $(LIBS) 110 | 111 | 112 | # 113 | # Dependencies... 114 | # 115 | 116 | include Dependencies 117 | -------------------------------------------------------------------------------- /test/run-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Integration test script for ippsample. 4 | # 5 | # Copyright © 2018-2023 by The Printer Working Group. 6 | # 7 | # Licensed under Apache License v2.0. See the file "LICENSE" for more 8 | # information. 9 | # 10 | # Usage: 11 | # 12 | # test/run-tests.sh 13 | # 14 | # Set IPPEVEPRINTERPORT and IPPSERVERPORT environment variable to override the 15 | # default 8xxx and 9xxx port numbers. 16 | status=0 17 | 18 | # Support running with shared libraries as necessary on macOS and Linux... 19 | DYLD_LIBRARY_PATH="$(pwd)/libcups/cups"; export DYLD_LIBRARY_PATH 20 | LD_LIBRARY_PATH="$(pwd)/libcups/cups"; export LD_LIBRARY_PATH 21 | 22 | # Determine port numbers to use for tests... 23 | ippeveprinterport=${IPPEVEPRINTERPORT:=$((8000 + ( $(id -u) % 1000 ) ))} 24 | ippserverport=${IPPSERVERPORT:=$((9000 + ( $(id -u) % 1000 ) ))} 25 | 26 | # Run ippserver, ippeveprinter, and ippproxy... 27 | echo "Running ippeveprinter on port $ippeveprinterport..." 28 | libcups/tools/ippeveprinter-static -vvv -p "$ippeveprinterport" -a libcups/tools/test.conf "Test Printer $(date +%H%M%S)" 2>test/test-ippeveprinter.log & 29 | ippeveprinter=$! 30 | echo "ippeveprinter has PID $ippeveprinter..." 31 | 32 | echo "" 33 | echo "Running ippserver on port $ippserverport..." 34 | server/ippserver -vvv -p "$ippserverport" -C test 2>test/test-ippserver.log & 35 | ippserver=$! 36 | echo "ippserver has PID $ippserver, waiting for server to come up..." 37 | sleep 10 38 | 39 | echo "" 40 | echo "Running ippproxy..." 41 | tools/ippproxy -vvv -d "ipp://localhost:$ippeveprinterport/ipp/print" "ipp://localhost:$ippserverport/ipp/print/infra" 2>test/test-ippproxy.log & 42 | ippproxy=$! 43 | echo "ippproxy has PID $ippproxy..." 44 | 45 | # Test the instance... 46 | echo "" 47 | echo "Running IPP 2.0 tests against IPP Everywhere PDF printer..." 48 | libcups/tools/ipptool-static -V 2.0 -tIf libcups/examples/document-letter.pdf "ipp://localhost:$ippserverport/ipp/print/ipp-everywhere-pdf" libcups/examples/ipp-2.0.test || status=1 49 | 50 | echo "" 51 | echo "Running IPP 2.0 tests against infra printer..." 52 | libcups/tools/ipptool-static -V 2.0 -tIf libcups/examples/document-letter.pdf "ipp://localhost:$ippserverport/ipp/print/infra" libcups/examples/ipp-2.0.test || status=1 53 | 54 | echo "" 55 | echo "Running IPP System Service tests..." 56 | libcups/tools/ipptool-static -V 2.0 -tI "ipp://localhost:$ippserverport/ipp/system" examples/pwg5100.22.test || status=1 57 | 58 | # Clean up 59 | kill $ippeveprinter $ippproxy $ippserver 60 | 61 | exit $status 62 | -------------------------------------------------------------------------------- /vcnet/ippserver.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {5129820B-88C2-40AE-BE81-C7957F76540D} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {CAF4FFBF-7D66-4368-A03A-3FD0971B59A0} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {17D3B9CD-53D2-47AF-9D2A-4516D777D695} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | Source Files 41 | 42 | 43 | Source Files 44 | 45 | 46 | Source Files 47 | 48 | 49 | Source Files 50 | 51 | 52 | Source Files 53 | 54 | 55 | 56 | 57 | Header Files 58 | 59 | 60 | Header Files 61 | 62 | 63 | Header Files 64 | 65 | 66 | -------------------------------------------------------------------------------- /xcode/ippsample.xcodeproj/xcshareddata/xcschemes/All.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 57 | 58 | 59 | 60 | 62 | 63 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /man/ippproxy.8: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" ippproxy man page. 3 | .\" 4 | .\" Copyright © 2014-2018 by the Printer Working Group. 5 | .\" Copyright © 2014-2018 by Apple Inc. 6 | .\" 7 | .\" Licensed under Apache License v2.0. See the file "LICENSE" for more 8 | .\" information. 9 | .\" 10 | .TH ippproxy 8 "ippsample" "15 March 2018" "Apple Inc." 11 | .SH NAME 12 | ippproxy \- a simple ipp proxy client 13 | .SH SYNOPSIS 14 | .B ippproxy 15 | [ 16 | .B \-\-help 17 | ] [ 18 | .B \-\-version 19 | ] [ 20 | .B \-d 21 | .I device-uri 22 | ] [ 23 | .B \-m 24 | .I mime/type 25 | ] [ 26 | .B \-p 27 | .I password 28 | ] [ 29 | .B \-u 30 | .I user 31 | ] [ 32 | .B \-v[vv] 33 | ] 34 | .I infrastructure-printer-uri 35 | .SH DESCRIPTION 36 | .B 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 | .BR ippserver (8). 39 | .SH OPTIONS 40 | The following options are recognized by 41 | .B ippproxy: 42 | .TP 5 43 | .B \-\-help 44 | Show program help. 45 | .TP 5 46 | .B \-\-version 47 | Show program version. 48 | .TP 5 49 | \fB\-d \fIdevice-uri\fR 50 | Specifies the local device using its URI. 51 | .B ippproxy 52 | supports "ipp", "ipps", and "socket" URIs. 53 | .TP 5 54 | \fB\-m \fImime/types\fR 55 | Specifies the output format as a MIME media type. 56 | .B ippproxy 57 | supports "application/vnd.hp-pcl" (HP PCL), "image/pwg-raster" (PWG Raster), and "image/urf" (Apple Raster). 58 | The default is to choose an output format automatically. 59 | .TP 5 60 | \fB\-p \fIpassword\fR 61 | Specifies the password to use when authenticating with the Infrastructure Printer. 62 | .TP 5 63 | \fB\-u \fIuser\fR 64 | Specifies the user name to use when authenticating with the Infrastructure Printer. 65 | .TP 5 66 | .B \-v[vvv] 67 | Be (very) verbose when logging activity to the standard output. 68 | .SH EXIT STATUS 69 | The 70 | .B ippproxy 71 | program returns 1 if it is unable to process the command-line arguments or connect to either the infrastructure or local printers. 72 | Otherwise 73 | .B ippproxy 74 | will run continuously until terminated. 75 | .SH CONFORMING TO 76 | The 77 | .B ippproxy 78 | program conforms to PWG Candidate Standard 5100.18: IPP Shared Infrastructure Extensions (INFRA). 79 | .SH EXAMPLE 80 | Run 81 | .B ippproxy 82 | with an infrastructure URI of "ipps://host.example.com/ipp/print" and a local URI of "ipp://10.0.1.42/ipp/print": 83 | .nf 84 | 85 | ippproxy -d ipp://10.0.1.42/ipp/print ipps://host.example.com/ipp/print 86 | .fi 87 | .SH SEE ALSO 88 | .BR ippserver (8), 89 | PWG Internet Printing Protocol Workgroup (http://www.pwg.org/ipp) 90 | .SH COPYRIGHT 91 | Copyright \[co] 2014-2018 by the Printer Working Group. 92 | Copyright \[co] 2007-2018 by Apple Inc. 93 | -------------------------------------------------------------------------------- /vcnet/config.h: -------------------------------------------------------------------------------- 1 | // 2 | // Visual Studio configuration file for the IPP sample code. 3 | // 4 | // Copyright © 2014-2023 by the Printer Working Group. 5 | // 6 | // Licensed under Apache License v2.0. See the file "LICENSE" for more 7 | // information. 8 | // 9 | 10 | #ifndef IPPSAMPLE_CONFIG_H 11 | #define IPPSAMPLE_CONFIG_H 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 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 |

Conforming To

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 | ![Version](https://img.shields.io/github/v/release/istopwg/ippsample?include_prereleases) 11 | ![Apache 2.0](https://img.shields.io/github/license/istopwg/ippsample) 12 | ![Build and Test](https://github.com/istopwg/ippsample/workflows/Build%20and%20Test/badge.svg) 13 | ![ipp](https://snapcraft.io/ipp/badge.svg) 14 | ![Coverity Scan Status](https://img.shields.io/coverity/scan/22384.svg) 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 |

Name

11 | ipptransform3d - convert 3d document data to alternate formats 12 |

Synopsis

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 |

Description

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 |

Options

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 |

Named Options

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 |

Diagnostics

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 |

Exit Status

88 | The 89 | ipptransform3d 90 | program returns 0 if the input file is converted successfully and 1 otherwise. 91 |

Environment

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 |

Examples

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 |

See Also

121 | ippdoclint(7), 122 | ippserver(8), 123 | ipptool(1), 124 | ipptransform(7) 125 |

Copyright

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 | --------------------------------------------------------------------------------