17b66cf61Sopenharmony_ciREADME - OpenPrinting CUPS Filters v1.28.17 - 2023-01-24 27b66cf61Sopenharmony_ci-------------------------------------------------------- 37b66cf61Sopenharmony_ci 47b66cf61Sopenharmony_ciLooking for compile instructions? Read the file "INSTALL.txt" 57b66cf61Sopenharmony_ciinstead... 67b66cf61Sopenharmony_ci 77b66cf61Sopenharmony_ci 87b66cf61Sopenharmony_ciINTRODUCTION 97b66cf61Sopenharmony_ci 107b66cf61Sopenharmony_ci CUPS is a standards-based, open source printing system developed 117b66cf61Sopenharmony_ci by Apple Inc. for Mac OS® X and other UNIX®-like operating 127b66cf61Sopenharmony_ci systems. CUPS uses the Internet Printing Protocol ("IPP") and 137b66cf61Sopenharmony_ci provides System V and Berkeley command-line interfaces, a web 147b66cf61Sopenharmony_ci interface, and a C API to manage printers and print jobs. 157b66cf61Sopenharmony_ci 167b66cf61Sopenharmony_ci This package contains backends, filters, and other software that 177b66cf61Sopenharmony_ci was once part of the core CUPS distribution but is no longer 187b66cf61Sopenharmony_ci maintained by Apple Inc. In addition it contains additional 197b66cf61Sopenharmony_ci filters and software developed independently of Apple, especially 207b66cf61Sopenharmony_ci filters for the PDF-centric printing workflow introduced by 217b66cf61Sopenharmony_ci OpenPrinting and a daemon to browse broadcasts of remote CUPS 227b66cf61Sopenharmony_ci printers and IPP printers to make them available locally. 237b66cf61Sopenharmony_ci 247b66cf61Sopenharmony_ci From CUPS 1.6.0 on, this package is required for using printer 257b66cf61Sopenharmony_ci drivers (and also driverless printing) with CUPS under Linux. With 267b66cf61Sopenharmony_ci CUPS 1.5.x and 1.4.x this package can be used optionally to switch 277b66cf61Sopenharmony_ci over to PDF-based printing. In that case some filters are provided 287b66cf61Sopenharmony_ci by both CUPS and this package. Then the filters of this package 297b66cf61Sopenharmony_ci should be used. 307b66cf61Sopenharmony_ci 317b66cf61Sopenharmony_ci For compiling and using this package CUPS, libqpdf (8.3.0 or 327b66cf61Sopenharmony_ci newer), libjpeg, libpng, libtiff, freetype, fontconfig, liblcms 337b66cf61Sopenharmony_ci (liblcms2 recommended), libavahi-common, libavahi-client, libdbus, 347b66cf61Sopenharmony_ci and glib are needed. It is highly recommended, especially if 357b66cf61Sopenharmony_ci non-PDF printers are used, to have at least one of Ghostscript, 367b66cf61Sopenharmony_ci Poppler, or MuPDF. 377b66cf61Sopenharmony_ci 387b66cf61Sopenharmony_ci The Poppler-based pdftoraster filter needs a C++ compiler which 397b66cf61Sopenharmony_ci supports C++11 and Poppler being built with the "./configure" 407b66cf61Sopenharmony_ci option "-DENABLE_CPP=ON" for building the C++ support library 417b66cf61Sopenharmony_ci libpoppler-cpp. This is the case for most modern Linux 427b66cf61Sopenharmony_ci distributions. 437b66cf61Sopenharmony_ci 447b66cf61Sopenharmony_ci If you use MuPDF as PDF renderer make sure to use at least version 457b66cf61Sopenharmony_ci 1.15, as the older versions have bugs and so some files get not 467b66cf61Sopenharmony_ci printed correctly. 477b66cf61Sopenharmony_ci 487b66cf61Sopenharmony_ci For Apple Raster output (used by AirPrint printers) at least CUPS 497b66cf61Sopenharmony_ci 2.2.2 is required. 507b66cf61Sopenharmony_ci 517b66cf61Sopenharmony_ci For Braille embosser support (see below) you will also need at 527b66cf61Sopenharmony_ci least liblouis, ImageMagick, and poppler-utils. Recommended is to 537b66cf61Sopenharmony_ci also have liblouisutdml, antiword, docx2txt for more sophisticated 547b66cf61Sopenharmony_ci Braille generation representing also the formatting of the input 557b66cf61Sopenharmony_ci text. None of these is needed for compiling cups-filters. 567b66cf61Sopenharmony_ci 577b66cf61Sopenharmony_ci CUPS, this package, and Ghostscript contain some rudimentary 587b66cf61Sopenharmony_ci printer drivers and especially the filters needed for driverless 597b66cf61Sopenharmony_ci printing (currently PWG Raster, Apple Raster, PCLm, and PDF output 607b66cf61Sopenharmony_ci formats, for printers supporting IPP Everywhere, AirPrint, Wi-Fi 617b66cf61Sopenharmony_ci Direct, and other standards), see 627b66cf61Sopenharmony_ci http://www.openprinting.org/drivers/ for a more comprehensive set 637b66cf61Sopenharmony_ci of printer drivers for Linux. 647b66cf61Sopenharmony_ci 657b66cf61Sopenharmony_ci See 667b66cf61Sopenharmony_ci 677b66cf61Sopenharmony_ci https://wiki.linuxfoundation.org/openprinting/pdf_as_standard_print_job_format 687b66cf61Sopenharmony_ci 697b66cf61Sopenharmony_ci for information about the PDF-based printing workflow. 707b66cf61Sopenharmony_ci 717b66cf61Sopenharmony_ci Report bugs to 727b66cf61Sopenharmony_ci 737b66cf61Sopenharmony_ci https://github.com/OpenPrinting/cups-filters/issues 747b66cf61Sopenharmony_ci 757b66cf61Sopenharmony_ci or alternatively to 767b66cf61Sopenharmony_ci 777b66cf61Sopenharmony_ci https://bugs.linuxfoundation.org/ 787b66cf61Sopenharmony_ci 797b66cf61Sopenharmony_ci Choose "OpenPrinting" as the product and "cups-filters" as the component. 807b66cf61Sopenharmony_ci 817b66cf61Sopenharmony_ci See the "COPYING" files for legal information. 827b66cf61Sopenharmony_ci 837b66cf61Sopenharmony_ciIMAGE PRINTING DEFAULT CHANGED TO "SCALE TO FIT" 847b66cf61Sopenharmony_ci 857b66cf61Sopenharmony_ci Compared to the PostScript-based original CUPS filters there is a 867b66cf61Sopenharmony_ci change of defaults: The imagetopdf and imagetoraster filters print 877b66cf61Sopenharmony_ci in "scale-to-fit" mode (image is scaled to fill one page but 887b66cf61Sopenharmony_ci nothing of the image being cut off) by default. 897b66cf61Sopenharmony_ci 907b66cf61Sopenharmony_ci This is done to support photo printing via AirPrint. The photo 917b66cf61Sopenharmony_ci apps on Apple's iOS devices send print jobs as JPEG images and do 927b66cf61Sopenharmony_ci not allow to set any options like "scaling" or the page size. With 937b66cf61Sopenharmony_ci "scale-to-fit" mode set by default, the iOS photos come out on one 947b66cf61Sopenharmony_ci page, as expected. 957b66cf61Sopenharmony_ci 967b66cf61Sopenharmony_ci To get back to the old behavior, supply one of the options 977b66cf61Sopenharmony_ci "nofitplot" "filplot=Off", "nofit-to-page", or "fit-to-page=Off". 987b66cf61Sopenharmony_ci 997b66cf61Sopenharmony_ciGHOSTSCRIPT RENDERING OF FILLED PATHS 1007b66cf61Sopenharmony_ci 1017b66cf61Sopenharmony_ci When Ghostscript is rendering PostScript or PDF files into a 1027b66cf61Sopenharmony_ci raster format the filled paths are ususally rendered with the 1037b66cf61Sopenharmony_ci any-part-of-pixel method as it is PostScript standard. On 1047b66cf61Sopenharmony_ci low-resolution printers, like label printers with 203 dpi, 1057b66cf61Sopenharmony_ci graphics output can get inaccurate and so for example bar codes do 1067b66cf61Sopenharmony_ci not work any more. This problem can be solved by letting 1077b66cf61Sopenharmony_ci Ghostscript use the center-of-pixel method. 1087b66cf61Sopenharmony_ci 1097b66cf61Sopenharmony_ci This can be done by either supplying the option "-o 1107b66cf61Sopenharmony_ci center-of-pixel" or "-o CenterOfPixel" on the command line when 1117b66cf61Sopenharmony_ci printing or by adding a "CenterOfPixel" option to the PPD file and 1127b66cf61Sopenharmony_ci set it to "true", for example by adding the following lines to the 1137b66cf61Sopenharmony_ci PPD file of the print queue (usually in /etc/cups/ppd/): 1147b66cf61Sopenharmony_ci 1157b66cf61Sopenharmony_ci *OpenUI *CenterOfPixel/Center Of Pixel: PickOne 1167b66cf61Sopenharmony_ci *OrderDependency: 20 AnySetup *CenterOfPixel 1177b66cf61Sopenharmony_ci *DefaultCenterOfPixel: true 1187b66cf61Sopenharmony_ci *CenterOfPixel true/true: "" 1197b66cf61Sopenharmony_ci *CenterOfPixel false/false: "" 1207b66cf61Sopenharmony_ci *CloseUI: *CenterOfPixel 1217b66cf61Sopenharmony_ci 1227b66cf61Sopenharmony_ci This option can be used when the print queue uses the gstoraster 1237b66cf61Sopenharmony_ci filter. 1247b66cf61Sopenharmony_ci 1257b66cf61Sopenharmony_ciPOSTSCRIPT PRINTING RENDERER AND RESOLUTION SELECTION 1267b66cf61Sopenharmony_ci 1277b66cf61Sopenharmony_ci If you use CUPS with this package and a PostScript printer then 1287b66cf61Sopenharmony_ci the included pdftops filter converts the print job data which is 1297b66cf61Sopenharmony_ci in PDF format into PostScript. By default, the PostScript is 1307b66cf61Sopenharmony_ci generated with Ghostscript's "ps2write" output device, which 1317b66cf61Sopenharmony_ci generates a DSC-conforming PostScript with compressed embedded 1327b66cf61Sopenharmony_ci fonts and compressed page content. This is resource-saving and 1337b66cf61Sopenharmony_ci leads to fast wire transfer of print jobs to the printer. 1347b66cf61Sopenharmony_ci 1357b66cf61Sopenharmony_ci Unfortunately, Ghostscript's PostScript output is not compatible 1367b66cf61Sopenharmony_ci with some printers due to interpreter bugs in the printer and in 1377b66cf61Sopenharmony_ci addition, processing (by Ghostscript or by the printer's 1387b66cf61Sopenharmony_ci interpreter) can get very slow with high printing resolutions when 1397b66cf61Sopenharmony_ci parts of the incoming PDF file are converted to bitmaps if they 1407b66cf61Sopenharmony_ci contain graphical structures which are not supported by 1417b66cf61Sopenharmony_ci PostScript. The bitmap problem especially occurs on input files 1427b66cf61Sopenharmony_ci with transparency, especially also the ones produced by Cairo 1437b66cf61Sopenharmony_ci (evince and many other GNOME/GTK applications) which unnecessarily 1447b66cf61Sopenharmony_ci introduces transparency even if the input PDF has no transparency. 1457b66cf61Sopenharmony_ci 1467b66cf61Sopenharmony_ci Therefore there are two possibilities to configure pdftops at 1477b66cf61Sopenharmony_ci runtime: 1487b66cf61Sopenharmony_ci 1497b66cf61Sopenharmony_ci 1. Selection of the renderer: Ghostscript, Poppler, pdftocairo, 1507b66cf61Sopenharmony_ci Adobe Reader, or MuPDF 1517b66cf61Sopenharmony_ci 1527b66cf61Sopenharmony_ci Ghostscript has better color management and is generally optimized 1537b66cf61Sopenharmony_ci more for printing. Poppler produces a PostScript which is 1547b66cf61Sopenharmony_ci compatible with more buggy built-in PostScript interpreters of 1557b66cf61Sopenharmony_ci printers and it leads to a somewhat quicker workflow when 1567b66cf61Sopenharmony_ci graphical structures of the input PDF has to be turned into 1577b66cf61Sopenharmony_ci bitmaps. Adobe Reader is the PDF renderer from Adobe, the ones who 1587b66cf61Sopenharmony_ci created PDF and PostScript. pdftocairo is a good choice for the 1597b66cf61Sopenharmony_ci PDF output of Cairo (for example when printing from evince). It 1607b66cf61Sopenharmony_ci is less resource-consuming when rasterizing graphical elements 1617b66cf61Sopenharmony_ci which cannot be represented in PostScript (like 1627b66cf61Sopenharmony_ci transparency). Note that pdftocairo only supports PDF input using 1637b66cf61Sopenharmony_ci DeviceRGB, DeviceGray, RGB or sGray and is not capable of 1647b66cf61Sopenharmony_ci generating PostScript level 1. So its support is only experimental 1657b66cf61Sopenharmony_ci and distributions should not choose it as default. 1667b66cf61Sopenharmony_ci 1677b66cf61Sopenharmony_ci The selection is done by the "pdftops-renderer" option, setting it 1687b66cf61Sopenharmony_ci to "gs", "pdftops", "pdftocairo", "acroread", "mupdf", or "hybrid": 1697b66cf61Sopenharmony_ci 1707b66cf61Sopenharmony_ci Per-job: lpr -o pdftops-renderer=pdftops ... 1717b66cf61Sopenharmony_ci Per-queue default: lpadmin -p printer -o pdftops-renderer-default=gs 1727b66cf61Sopenharmony_ci Remove default: lpadmin -p printer -R pdftops-renderer-default 1737b66cf61Sopenharmony_ci 1747b66cf61Sopenharmony_ci By default, pdftops uses Ghostscript if this does not get changed 1757b66cf61Sopenharmony_ci at compile time, for example by the Linux distribution vendor. 1767b66cf61Sopenharmony_ci 1777b66cf61Sopenharmony_ci Hybrid means Ghostscript for most printers, but Poppler's pdftops 1787b66cf61Sopenharmony_ci for Brother, Minolta, and Konica Minolta. Printer make and model 1797b66cf61Sopenharmony_ci information comes from the PPD or via the "make-and-model" option. 1807b66cf61Sopenharmony_ci 1817b66cf61Sopenharmony_ci 2. Limitation of the image rendering resolution 1827b66cf61Sopenharmony_ci 1837b66cf61Sopenharmony_ci If graphical structures of the incoming PDF file have to be 1847b66cf61Sopenharmony_ci converted to bitmaps due to limitations of PostScript, the 1857b66cf61Sopenharmony_ci conversion of the file by pdftops or the rendering by the printer 1867b66cf61Sopenharmony_ci can get too slow if the bitmap resolution is too high or the 1877b66cf61Sopenharmony_ci printout quality can degrade if the bitmap resolution is too low. 1887b66cf61Sopenharmony_ci 1897b66cf61Sopenharmony_ci By default, pdftops tries to find out the actual printing 1907b66cf61Sopenharmony_ci resolution and sets the resolution for bitmap generation to the 1917b66cf61Sopenharmony_ci same value. If it cannot find the printing resolution, it uses 300 1927b66cf61Sopenharmony_ci dpi. It never goes higher than a limit of 1440 dpi. Note that this 1937b66cf61Sopenharmony_ci default limit can get changed at compile time, for example by the 1947b66cf61Sopenharmony_ci Linux distribution vendor. 1957b66cf61Sopenharmony_ci 1967b66cf61Sopenharmony_ci The resolution limit for bitmaps can be changed to a lower or 1977b66cf61Sopenharmony_ci higher value, or be set to unlimited. This is done by the option 1987b66cf61Sopenharmony_ci "pdftops-max-image-resolution", setting it to the desired value 1997b66cf61Sopenharmony_ci (in dpi) or to zero for unlimited. It can be used per-job or as 2007b66cf61Sopenharmony_ci per-queue default as the "pdftops-renderer" option described 2017b66cf61Sopenharmony_ci above. 2027b66cf61Sopenharmony_ci 2037b66cf61Sopenharmony_ci The "pdftops-max-image-resolution" option is ignored when Adobe 2047b66cf61Sopenharmony_ci Reader is selected as PDF renderer. 2057b66cf61Sopenharmony_ci 2067b66cf61Sopenharmony_ciPOSTSCRIPT PRINTING DEBUG MODE 2077b66cf61Sopenharmony_ci 2087b66cf61Sopenharmony_ci Sometimes a PostScript printer's interpreter errors, crashes, or 2097b66cf61Sopenharmony_ci somehow else misbehaves on Ghostscript's output. To find 2107b66cf61Sopenharmony_ci workarounds (currently we have already workarounds for Brother and 2117b66cf61Sopenharmony_ci Kyocera) it is much easier to work with uncompressed PostScript. 2127b66cf61Sopenharmony_ci To get uncompressed PostScript as output, send a job with the 2137b66cf61Sopenharmony_ci "psdebug" option, with commands like the following: 2147b66cf61Sopenharmony_ci 2157b66cf61Sopenharmony_ci lpr -P <printer> -o psdebug <file> 2167b66cf61Sopenharmony_ci lp -d <printer> -o psdebug <file> 2177b66cf61Sopenharmony_ci 2187b66cf61Sopenharmony_ci If you want to send your job out of a desktop application, run 2197b66cf61Sopenharmony_ci 2207b66cf61Sopenharmony_ci lpoptions -p <printer> -o psdebug 2217b66cf61Sopenharmony_ci 2227b66cf61Sopenharmony_ci to make "psdebug" a personal default setting for you. 2237b66cf61Sopenharmony_ci 2247b66cf61Sopenharmony_ci To extract the PostScript output for a developer to analyse it, 2257b66cf61Sopenharmony_ci clone your print queue to a one which prints into a file: 2267b66cf61Sopenharmony_ci 2277b66cf61Sopenharmony_ci cupsctl FileDevice=yes 2287b66cf61Sopenharmony_ci lpadmin -p test -E -v file:/tmp/printout \ 2297b66cf61Sopenharmony_ci -P /etc/cups/ppd/<name of original queue>.ppd 2307b66cf61Sopenharmony_ci 2317b66cf61Sopenharmony_ci and print into this queue as described above. The PostScript 2327b66cf61Sopenharmony_ci output is in /tmp/printout after the job has completed. 2337b66cf61Sopenharmony_ci 2347b66cf61Sopenharmony_ci This option does not change anything if Poppler's pdftops is used 2357b66cf61Sopenharmony_ci as renderer. 2367b66cf61Sopenharmony_ci 2377b66cf61Sopenharmony_ciHELPER DAEMON FOR BROWSING REMOTE CUPS PRINTERS AND IPP NETWORK PRINTERS 2387b66cf61Sopenharmony_ci 2397b66cf61Sopenharmony_ci From version 1.6.0 on in CUPS the CUPS broadcasting/browsing 2407b66cf61Sopenharmony_ci facility was dropped, in favour of Bonjour-based broadcasting of 2417b66cf61Sopenharmony_ci shared printers. This is done as Bonjour broadcasting of shared 2427b66cf61Sopenharmony_ci printers is a standard, established by the PWG (Printing Working 2437b66cf61Sopenharmony_ci Group, http://www.pwg.org/), and most other network services 2447b66cf61Sopenharmony_ci (shared file systems, shared media files/streams, remote desktop 2457b66cf61Sopenharmony_ci services, ...) are also broadcasted via Bonjour. 2467b66cf61Sopenharmony_ci 2477b66cf61Sopenharmony_ci Problem is that CUPS only broadcasts its shared printers but does 2487b66cf61Sopenharmony_ci not browse broadcasts of other CUPS servers to make the shared 2497b66cf61Sopenharmony_ci remote printers available locally without any configuration 2507b66cf61Sopenharmony_ci efforts. This is a regression compared to the old CUPS 2517b66cf61Sopenharmony_ci broadcasting/browsing. The intention of CUPS upstream is that the 2527b66cf61Sopenharmony_ci application's print dialogs browse the Bonjour broadcasts as an 2537b66cf61Sopenharmony_ci AirPrint-capable iPhone does, but it will take its time until all 2547b66cf61Sopenharmony_ci toolkit developers add the needed functionality, and programs 2557b66cf61Sopenharmony_ci using old toolkits or no toolkits at all, or the command line stay 2567b66cf61Sopenharmony_ci uncovered. 2577b66cf61Sopenharmony_ci 2587b66cf61Sopenharmony_ci The solution is cups-browsed, a helper daemon running in parallel 2597b66cf61Sopenharmony_ci to the CUPS daemon which listens to Bonjour broadcasts of shared 2607b66cf61Sopenharmony_ci CUPS printers on remote machines in the local network via Avahi, 2617b66cf61Sopenharmony_ci and can also listen for (and send) CUPS Browsing broadcasts. For 2627b66cf61Sopenharmony_ci each reported remote printer it creates a local raw queue pointing 2637b66cf61Sopenharmony_ci to the remote printer so that the printer appears in local print 2647b66cf61Sopenharmony_ci dialogs and is also available for printing via the command 2657b66cf61Sopenharmony_ci line. As with the former CUPS broadcasting/browsing with this 2667b66cf61Sopenharmony_ci queue the driver on the server is used and the local print dialogs 2677b66cf61Sopenharmony_ci give access to all options of the server-side printer driver. 2687b66cf61Sopenharmony_ci 2697b66cf61Sopenharmony_ci Note that CUPS broadcasting/browsing is available for legacy 2707b66cf61Sopenharmony_ci support, to let the local CUPS daemon work seamlessly together 2717b66cf61Sopenharmony_ci with remote CUPS daemons of version 1.5.x and older which only 2727b66cf61Sopenharmony_ci support CUPS broadcasting/browsing. In networks with only CUPS 2737b66cf61Sopenharmony_ci 1.6.x servers (or Ubuntu or Fedora/Red Hat servers with CUPS 2747b66cf61Sopenharmony_ci 1.5.x) please use the native Bonjour broadcasting of your servers 2757b66cf61Sopenharmony_ci and cups-browsed, configured for Bonjour browsing only on the 2767b66cf61Sopenharmony_ci clients. 2777b66cf61Sopenharmony_ci 2787b66cf61Sopenharmony_ci Also high availability with redundant print servers and load 2797b66cf61Sopenharmony_ci balancing is supported. If there is more than one server providing 2807b66cf61Sopenharmony_ci a shared print queue with the same name, cups-browsed forms a 2817b66cf61Sopenharmony_ci cluster locally with this name as queue name and printing through 2827b66cf61Sopenharmony_ci the "implicitclass" backend. Each job triggers cups-browsed to 2837b66cf61Sopenharmony_ci check which remote queue is suitable for the job, meaning that it 2847b66cf61Sopenharmony_ci is enabled, accepts jobs, and is not currently printing. If none 2857b66cf61Sopenharmony_ci of the remote queues fulfills these criteria, we check again in 5 2867b66cf61Sopenharmony_ci seconds, until a printer gets free to accommodate the job. When we 2877b66cf61Sopenharmony_ci search for a free printer, we do not start at the first in the 2887b66cf61Sopenharmony_ci list, but always on the one after the last one used (as CUPS also 2897b66cf61Sopenharmony_ci does with classes), so that all printer get used, even if the 2907b66cf61Sopenharmony_ci frequency of jobs is low. This is also what CUPS formerly did with 2917b66cf61Sopenharmony_ci implicit classes. Optionally, jobs can be sent immediately into 2927b66cf61Sopenharmony_ci the remote queue with the lowest number of waiting jobs, so that 2937b66cf61Sopenharmony_ci no local queue of waiting jobs is built up. 2947b66cf61Sopenharmony_ci 2957b66cf61Sopenharmony_ci For maximum security cups-browsed uses IPPS (encrypted IPP) 2967b66cf61Sopenharmony_ci whenever possible. 2977b66cf61Sopenharmony_ci 2987b66cf61Sopenharmony_ci In addition, cups-browsed is also capable of discovering IPP 2997b66cf61Sopenharmony_ci network printers (native printers, not CUPS queues) with known 3007b66cf61Sopenharmony_ci page description languages (PWG Raster, Apple Raster, PDF, 3017b66cf61Sopenharmony_ci PostScript, PCL XL, PCL 5c/e) in the local network and auto-create 3027b66cf61Sopenharmony_ci print queues with auto-created PPD file or PPD-less for them (for 3037b66cf61Sopenharmony_ci the latter using a System V interface script to control the filter 3047b66cf61Sopenharmony_ci chain, only available for CUPS 2.1.0 and older, clients have to 3057b66cf61Sopenharmony_ci IPP-poll the capabilities of the printer and send option settings 3067b66cf61Sopenharmony_ci as standard IPP attributes then). This functionality is primarily 3077b66cf61Sopenharmony_ci for mobile devices running CUPS to not need a printer setup tool 3087b66cf61Sopenharmony_ci nor a collection of printer drivers and PPDs. 3097b66cf61Sopenharmony_ci 3107b66cf61Sopenharmony_ci cups-browsed can also be started on-demand, for example to save 3117b66cf61Sopenharmony_ci resources on mobile devices. For this, cups-browsed can be set 3127b66cf61Sopenharmony_ci into an auto shutdown mode so that it stops automatically when it 3137b66cf61Sopenharmony_ci has no remote printers to take care of any more, especially if an 3147b66cf61Sopenharmony_ci on-demand running avahi-daemon stops. Note that CUPS must stay 3157b66cf61Sopenharmony_ci running for cups-browsed removing its queues and so being able to 3167b66cf61Sopenharmony_ci shut down. Ideal is if CUPS stays running another 30 seconds after 3177b66cf61Sopenharmony_ci finishing its last job so that cups-browsed can take down the 3187b66cf61Sopenharmony_ci queue. For how to set up and control this mode via command line, 3197b66cf61Sopenharmony_ci configuration directives, or sending signals see the man pages 3207b66cf61Sopenharmony_ci cups-browsed(8) and cups-browsed.conf(5). 3217b66cf61Sopenharmony_ci 3227b66cf61Sopenharmony_ci The configuration file for cups-browsed is 3237b66cf61Sopenharmony_ci /etc/cups/cups-browsed.conf. This file can include limited forms 3247b66cf61Sopenharmony_ci of the original CUPS BrowseRemoteProtocols, BrowseLocalProtocols, 3257b66cf61Sopenharmony_ci BrowsePoll, and BrowseAllow directives. It also can contain the 3267b66cf61Sopenharmony_ci new CreateIPPPrinterQueues to activate discovering of IPP network 3277b66cf61Sopenharmony_ci printers and creating PPD-less queues for them. 3287b66cf61Sopenharmony_ci 3297b66cf61Sopenharmony_ci Note that cups-browsed does not work with remote CUPS servers 3307b66cf61Sopenharmony_ci specified by a client.conf file. It always connects to the local 3317b66cf61Sopenharmony_ci CUPS daemon by setting the CUPS_SERVER environment variable and so 3327b66cf61Sopenharmony_ci overriding client.conf. If your local CUPS daemon uses a 3337b66cf61Sopenharmony_ci non-standard domain socket as only way of access, you need to 3347b66cf61Sopenharmony_ci specify it via the DomainSocket directive in 3357b66cf61Sopenharmony_ci /etc/cups/cups-browsed.conf. 3367b66cf61Sopenharmony_ci 3377b66cf61Sopenharmony_ci The "make install" process installs init scripts which make the 3387b66cf61Sopenharmony_ci daemon automatically started during boot. You can also manually 3397b66cf61Sopenharmony_ci start it with (as root): 3407b66cf61Sopenharmony_ci 3417b66cf61Sopenharmony_ci /usr/sbin/cups-browsed & 3427b66cf61Sopenharmony_ci 3437b66cf61Sopenharmony_ci or in debug mode with 3447b66cf61Sopenharmony_ci 3457b66cf61Sopenharmony_ci /usr/sbin/cups-browsed --debug 3467b66cf61Sopenharmony_ci 3477b66cf61Sopenharmony_ci Shut it down by sending signal 2 (SIGINT) or 15 (SIGTERM) to 3487b66cf61Sopenharmony_ci it. The queues which it has created get removed then (except a 3497b66cf61Sopenharmony_ci queue set as system default, to not loose its system default 3507b66cf61Sopenharmony_ci state). 3517b66cf61Sopenharmony_ci 3527b66cf61Sopenharmony_ci On systems using systemd use a 3537b66cf61Sopenharmony_ci /usr/lib/systemd/system/cups-browsed.service file like this: 3547b66cf61Sopenharmony_ci 3557b66cf61Sopenharmony_ci [Unit] 3567b66cf61Sopenharmony_ci Description=Make remote CUPS printers available locally 3577b66cf61Sopenharmony_ci After=cups.service avahi-daemon.service 3587b66cf61Sopenharmony_ci Wants=cups.service avahi-daemon.service 3597b66cf61Sopenharmony_ci 3607b66cf61Sopenharmony_ci [Service] 3617b66cf61Sopenharmony_ci ExecStart=/usr/sbin/cups-browsed 3627b66cf61Sopenharmony_ci 3637b66cf61Sopenharmony_ci [Install] 3647b66cf61Sopenharmony_ci WantedBy=multi-user.target 3657b66cf61Sopenharmony_ci 3667b66cf61Sopenharmony_ci On systems using Upstart use an /etc/init/cups-browsed.conf file like this: 3677b66cf61Sopenharmony_ci 3687b66cf61Sopenharmony_ci start on (filesystem 3697b66cf61Sopenharmony_ci and (started cups or runlevel [2345])) 3707b66cf61Sopenharmony_ci stop on runlevel [016] 3717b66cf61Sopenharmony_ci 3727b66cf61Sopenharmony_ci respawn 3737b66cf61Sopenharmony_ci respawn limit 3 240 3747b66cf61Sopenharmony_ci 3757b66cf61Sopenharmony_ci pre-start script 3767b66cf61Sopenharmony_ci [ -x /usr/sbin/cups-browsed ] 3777b66cf61Sopenharmony_ci end script 3787b66cf61Sopenharmony_ci 3797b66cf61Sopenharmony_ci exec /usr/sbin/cups-browsed 3807b66cf61Sopenharmony_ci 3817b66cf61Sopenharmony_ci These files are included in the source distribution as 3827b66cf61Sopenharmony_ci utils/cups-browsed.service and utils/cups-browsed-upstart.conf. 3837b66cf61Sopenharmony_ci 3847b66cf61Sopenharmony_ci In the examples we start cups-browsed after starting 3857b66cf61Sopenharmony_ci avahi-daemon. This is not required. If cups-browsed starts first, 3867b66cf61Sopenharmony_ci then Bonjour/DNS-SD browsing kicks in as soon as avahi-daemon comes 3877b66cf61Sopenharmony_ci up. cups-browsed is also robust against any shutdown and restart 3887b66cf61Sopenharmony_ci of avahi-daemon. 3897b66cf61Sopenharmony_ci 3907b66cf61Sopenharmony_ci Here is some info on how cups-browsed works internally (first concept of a 3917b66cf61Sopenharmony_ci daemon which does only Bonjour browsing): 3927b66cf61Sopenharmony_ci 3937b66cf61Sopenharmony_ci - Daemon start 3947b66cf61Sopenharmony_ci o Wait for CUPS daemon if it is not running 3957b66cf61Sopenharmony_ci o Read out all CUPS queues created by this daemon (in former sessions) 3967b66cf61Sopenharmony_ci o Mark them unconfirmed and set timeout 10 sec from now 3977b66cf61Sopenharmony_ci - Main loop (use avahi_simple_poll_iterate() to do queue list maintenance 3987b66cf61Sopenharmony_ci regularly) 3997b66cf61Sopenharmony_ci o Event: New printer shows up 4007b66cf61Sopenharmony_ci + Queue for printer is already created by this daemon -> Mark list 4017b66cf61Sopenharmony_ci entry confirmed, if discovered printer is ipps but existing queue ipp, 4027b66cf61Sopenharmony_ci upgrade existing queue by setting URI to ipps. Set status to 4037b66cf61Sopenharmony_ci to-be-created and timeout to now-1 sec to make the CUPS queue be 4047b66cf61Sopenharmony_ci updated. 4057b66cf61Sopenharmony_ci + Queue does not yet exist -> Mark as to-be-created and set 4067b66cf61Sopenharmony_ci timeout to now-1 sec. 4077b66cf61Sopenharmony_ci o Event: A printer disappears 4087b66cf61Sopenharmony_ci + If we have listed a queue for it, mark the entry as disappeared, set 4097b66cf61Sopenharmony_ci timeout to now-1 sec 4107b66cf61Sopenharmony_ci o On any of the above events and every 2 sec 4117b66cf61Sopenharmony_ci + Check through list of our listed queues 4127b66cf61Sopenharmony_ci - If queue is unconfirmed and timeout has passed, mark it as 4137b66cf61Sopenharmony_ci disappeared, set timeout to now-1 sec 4147b66cf61Sopenharmony_ci - If queue is marked disappered and timeout has passed, check whether 4157b66cf61Sopenharmony_ci there are still jobs in it, if yes, set timeout to 10 sec from now, 4167b66cf61Sopenharmony_ci if no, remove the CUPS queue and the queue entry in our list. If 4177b66cf61Sopenharmony_ci removal fails, set timeout to 10 sec. 4187b66cf61Sopenharmony_ci - If queue is to-be-created, create it, if succeeded set to 4197b66cf61Sopenharmony_ci confirmed, if not, set timeout to 10 sec fron now. printer-is-shared 4207b66cf61Sopenharmony_ci must be set to false. 4217b66cf61Sopenharmony_ci - Daemon shutdown 4227b66cf61Sopenharmony_ci o Remove all CUPS queues in our list, as long as they do not have jobs. 4237b66cf61Sopenharmony_ci 4247b66cf61Sopenharmony_ci Do not overwrite existing queues which are not created by us If 4257b66cf61Sopenharmony_ci the simple <remote_printer> name is already taken, try to create a 4267b66cf61Sopenharmony_ci <remote_printer>@<server> name, if this is also taken, ignore the 4277b66cf61Sopenharmony_ci remote printer. Do not retry, to avoid polling CUPS all the time. 4287b66cf61Sopenharmony_ci 4297b66cf61Sopenharmony_ci Do not remove queues which are not created by us. We do this by 4307b66cf61Sopenharmony_ci listing only our queues and remove only listed queues. 4317b66cf61Sopenharmony_ci 4327b66cf61Sopenharmony_ci Queue names: Use the name of the remote queue. If a queue with the 4337b66cf61Sopenharmony_ci same name from another server already exists, mark the new queue 4347b66cf61Sopenharmony_ci as duplicate and when a queue disappears, check whether it has 4357b66cf61Sopenharmony_ci duplicates and change the URI of the disappeared queue to the URI 4367b66cf61Sopenharmony_ci of the first duplicate, mark the queue as to-be-created with 4377b66cf61Sopenharmony_ci timeout now-1 sec (to update the URI of the CUPS queue) and mark 4387b66cf61Sopenharmony_ci the duplicate disappeared with timeout now-1 sec. In terms of 4397b66cf61Sopenharmony_ci high availability we replace the old load balancing of the 4407b66cf61Sopenharmony_ci implicit class by a failover solution. Alternatively (not 4417b66cf61Sopenharmony_ci implemented), if queue with same name but from other server 4427b66cf61Sopenharmony_ci appears, create new queue as <original name>@<server name without 4437b66cf61Sopenharmony_ci .local>. When queue with simple name is removed, replace the first 4447b66cf61Sopenharmony_ci of the others by one with simple name (mark old queue disappeared 4457b66cf61Sopenharmony_ci with timeout now-1 sec and create new queue with simple name). 4467b66cf61Sopenharmony_ci 4477b66cf61Sopenharmony_ci Fill description of the created CUPS queue with the Bonjour 4487b66cf61Sopenharmony_ci service name (= original description) and location with the server 4497b66cf61Sopenharmony_ci name without .local. 4507b66cf61Sopenharmony_ci 4517b66cf61Sopenharmony_ci stderr messages only in debug mode (command line options: 4527b66cf61Sopenharmony_ci "--debug" or "-d" or "-v"). 4537b66cf61Sopenharmony_ci 4547b66cf61Sopenharmony_ci Queue identified as from this daemon by doing the equivalent of 4557b66cf61Sopenharmony_ci "lpadmin -p printer -o cups-browsed-default", this generates a 4567b66cf61Sopenharmony_ci "cups-browsed" attribute in printers.conf with value "true". 4577b66cf61Sopenharmony_ci 4587b66cf61Sopenharmony_ciCUPS FILTERS FOR PDF AS STANDARD PRINT JOB FORMAT 4597b66cf61Sopenharmony_ci 4607b66cf61Sopenharmony_ci Here is documentation from the former CUPS add-on tarball with the filters 4617b66cf61Sopenharmony_ci for the PDF-based printing workflow: imagetopdf, texttopdf, 4627b66cf61Sopenharmony_ci pdftopdf, and pdftoraster 4637b66cf61Sopenharmony_ci 4647b66cf61Sopenharmony_ci The original filters are from http://sourceforge.jp/projects/opfc/ 4657b66cf61Sopenharmony_ci 4667b66cf61Sopenharmony_ci NOTE: the texttops and imagetops filters shipping with this package 4677b66cf61Sopenharmony_ci are simple wrapper scripts for backward compatibility with third-party 4687b66cf61Sopenharmony_ci PPD files and custom configurations. There are not referred to in the 4697b66cf61Sopenharmony_ci cupsfilters.convs file and therefore not used by the default 4707b66cf61Sopenharmony_ci configuration. Direct conversion of text or images to PostScript is 4717b66cf61Sopenharmony_ci deprecated in the PDF-based printing workflow. So do not use these 4727b66cf61Sopenharmony_ci filters when creating new PPDs or custom configurations. The parameters 4737b66cf61Sopenharmony_ci for these filters are the same as for texttopdf and imagetopdf (see 4747b66cf61Sopenharmony_ci below) as the ...tops filter calls the ....topdf filter plus 4757b66cf61Sopenharmony_ci Ghostscript's pdf2ps. 4767b66cf61Sopenharmony_ci 4777b66cf61Sopenharmony_ci 4787b66cf61Sopenharmony_ciIMAGETOPDF 4797b66cf61Sopenharmony_ci========== 4807b66cf61Sopenharmony_ci 4817b66cf61Sopenharmony_ci1. INTRODUCTION 4827b66cf61Sopenharmony_ci 4837b66cf61Sopenharmony_ciThis program is "imagetopdf". "imagetopdf" is a CUPS filter which reads 4847b66cf61Sopenharmony_cia single image file, converts it into a PDF file and outputs it to stdout. 4857b66cf61Sopenharmony_ci 4867b66cf61Sopenharmony_ciThis program accepts the following image file format; 4877b66cf61Sopenharmony_ci 4887b66cf61Sopenharmony_ci gif, png, jpeg, tiff, photocd, portable-anymap, portable-bitmap, 4897b66cf61Sopenharmony_ci portable-graymap, portable-pixmap, sgi-rgb, sun-raster, xbitmap, 4907b66cf61Sopenharmony_ci xpixmap, xwindowdump 4917b66cf61Sopenharmony_ci 4927b66cf61Sopenharmony_cixbitmap, xpixmap and xwindowdump images are converted into png images by 4937b66cf61Sopenharmony_cithe "convert" command. Other kinds of image file format can be supported 4947b66cf61Sopenharmony_ciif the "convert" command support them. 4957b66cf61Sopenharmony_ci 4967b66cf61Sopenharmony_ciOutput PDF file format conforms to PDF version 1.3 specification, and 4977b66cf61Sopenharmony_ciinput image is converted and contained in the output PDF file as a binary 4987b66cf61Sopenharmony_ciformat non-compression image. 4997b66cf61Sopenharmony_ci 5007b66cf61Sopenharmony_ci"imagetopdf" may outputs multiple pages if the input image exceeds page 5017b66cf61Sopenharmony_ciprintable area. 5027b66cf61Sopenharmony_ci 5037b66cf61Sopenharmony_ci2. LICENSE 5047b66cf61Sopenharmony_ci 5057b66cf61Sopenharmony_ci"imagetopdf.c" is under the CUPS license. See the "COPYING" file. 5067b66cf61Sopenharmony_ciFor other files, see the copyright notice and license of each file. 5077b66cf61Sopenharmony_ci 5087b66cf61Sopenharmony_ci3. COMMAND LINE 5097b66cf61Sopenharmony_ci 5107b66cf61Sopenharmony_ci"imagetopdf" is a CUPS filter, and the command line arguments, environment 5117b66cf61Sopenharmony_civariables and configuration files are in accordance with the CUPS filter 5127b66cf61Sopenharmony_ciinterface. 5137b66cf61Sopenharmony_ci 5147b66cf61Sopenharmony_ciimagetopdf <job> <user> <title> <num-copies> <options> [<filename>] 5157b66cf61Sopenharmony_ci 5167b66cf61Sopenharmony_ci"imagetopdf" ignores <job> and <user>. 5177b66cf61Sopenharmony_ci<title> is appended into the PDF dictionary as /Title. 5187b66cf61Sopenharmony_ci<num-copies> specifies the number of document copies. 5197b66cf61Sopenharmony_ci<options> is a CUPS option list. 5207b66cf61Sopenharmony_ci<filename> is an input image file name. 5217b66cf61Sopenharmony_ci 5227b66cf61Sopenharmony_ciWhen omit the <filename>, "imagetopdf" reads an image file from stdin. 5237b66cf61Sopenharmony_ci 5247b66cf61Sopenharmony_ci4. ENVIRONMENT VARIABLES 5257b66cf61Sopenharmony_ci 5267b66cf61Sopenharmony_ciThis program refers the following environment variable; 5277b66cf61Sopenharmony_ci 5287b66cf61Sopenharmony_ci PPD: PPD file name of the printer. 5297b66cf61Sopenharmony_ci 5307b66cf61Sopenharmony_ci5. COMMAND OPTIONS 5317b66cf61Sopenharmony_ci 5327b66cf61Sopenharmony_ci"imagetopdf" accepts the following CUPS standard options; 5337b66cf61Sopenharmony_ci 5347b66cf61Sopenharmony_cifitplot 5357b66cf61Sopenharmony_cimirror 5367b66cf61Sopenharmony_ciPageSize 5377b66cf61Sopenharmony_cipage-left, page-right, page-bottom, page-top 5387b66cf61Sopenharmony_ciOutputOrder 5397b66cf61Sopenharmony_ciCollate 5407b66cf61Sopenharmony_cisides 5417b66cf61Sopenharmony_cicupsEvenDuplex 5427b66cf61Sopenharmony_ciposition 5437b66cf61Sopenharmony_ciscaling 5447b66cf61Sopenharmony_cippi 5457b66cf61Sopenharmony_cinatural-scaling 5467b66cf61Sopenharmony_cilandscape 5477b66cf61Sopenharmony_ciorientation-requested 5487b66cf61Sopenharmony_ci 5497b66cf61Sopenharmony_ciSee the CUPS documents for details of these options. 5507b66cf61Sopenharmony_ci 5517b66cf61Sopenharmony_ci6. KNOWN PROBLEMS 5527b66cf61Sopenharmony_ci 5537b66cf61Sopenharmony_ciProblem: 5547b66cf61Sopenharmony_ci PBM and SUN raster images can not be printed. 5557b66cf61Sopenharmony_ciSolution: 5567b66cf61Sopenharmony_ci Due to the CUPS libcupsimage library's bug. Update the CUPS on your system. 5577b66cf61Sopenharmony_ci 5587b66cf61Sopenharmony_ci7. INFORMATION FOR DEVELOPERS 5597b66cf61Sopenharmony_ci 5607b66cf61Sopenharmony_ciFollowing information is for developers, not for driver users. 5617b66cf61Sopenharmony_ci 5627b66cf61Sopenharmony_ci7.1 Options handled by a printer or "imagetopdf" 5637b66cf61Sopenharmony_ci 5647b66cf61Sopenharmony_ciFollowing options are handled by a printer or "imagetopdf". 5657b66cf61Sopenharmony_ci Collate, Copies, Duplex, OutputOrder 5667b66cf61Sopenharmony_ci 5677b66cf61Sopenharmony_ciWhich handles these options depends on following options and attributes. 5687b66cf61Sopenharmony_ci Collate, Copies, Duplex, OutputOrder, cupsEvenDuplex, cupsManualCopies 5697b66cf61Sopenharmony_ci 5707b66cf61Sopenharmony_ci"imagetopdf" judges whether a printer can handle these options according to 5717b66cf61Sopenharmony_cithe followings option settings in a PPD file. 5727b66cf61Sopenharmony_ci 5737b66cf61Sopenharmony_ciCollate: 5747b66cf61Sopenharmony_ci If Collate is defined, "imagetopdf" judges the printer supports Collate. 5757b66cf61Sopenharmony_ciCopies: 5767b66cf61Sopenharmony_ci If cupsManualCopies is defined as True, "imagetopdf" judges the printer 5777b66cf61Sopenharmony_ci does not support Copies feature. 5787b66cf61Sopenharmony_ci 5797b66cf61Sopenharmony_ciDuplex: 5807b66cf61Sopenharmony_ci If Duplex is defined, "imagetopdf" judges the printer supports Duplex. 5817b66cf61Sopenharmony_ci If cupsEvenDuplex is True, Number of pages must be even. 5827b66cf61Sopenharmony_ciOutputOrder: 5837b66cf61Sopenharmony_ci If OutputOrder is defined, "imagetopdf" judges the printer supports 5847b66cf61Sopenharmony_ci OutputOrder. 5857b66cf61Sopenharmony_ci 5867b66cf61Sopenharmony_ciIf the printer cannot handle these options, "imagetopdf" handles it. 5877b66cf61Sopenharmony_ci 5887b66cf61Sopenharmony_ciFollowing pseudo program describes how "imagetopdf" judges to handle 5897b66cf61Sopenharmony_cithese options. 5907b66cf61Sopenharmony_ci 5917b66cf61Sopenharmony_ciVariables 5927b66cf61Sopenharmony_ci 5937b66cf61Sopenharmony_ciCopies : specified Copies 5947b66cf61Sopenharmony_ciDuplex : specified Duplex 5957b66cf61Sopenharmony_ciCollate : specified Collate 5967b66cf61Sopenharmony_ciOutputOrder : specified OutputOrder 5977b66cf61Sopenharmony_ciEvenDuplex : specified cupsEvenDuplex 5987b66cf61Sopenharmony_cipages : number of pages 5997b66cf61Sopenharmony_cinumber_up : specified number-up 6007b66cf61Sopenharmony_ci 6017b66cf61Sopenharmony_cidevice_copies : Copies passed to the printer 6027b66cf61Sopenharmony_cidevice_duplex : Duplex passed to the printer 6037b66cf61Sopenharmony_cidevice_collate : Collate passed to the printer 6047b66cf61Sopenharmony_cidevice_outputorder : OutputOrder passed to the printer 6057b66cf61Sopenharmony_ci 6067b66cf61Sopenharmony_cisoft_copies : copies by imagetopdf 6077b66cf61Sopenharmony_ci 6087b66cf61Sopenharmony_ci 6097b66cf61Sopenharmony_cidevice_copies = 1; 6107b66cf61Sopenharmony_cidevice_duplex = False; 6117b66cf61Sopenharmony_cidevice_collate = False; 6127b66cf61Sopenharmony_cidevice_outputorder = False; 6137b66cf61Sopenharmony_ci 6147b66cf61Sopenharmony_ciif (Copies == 1) { 6157b66cf61Sopenharmony_ci /* Collate is not needed. */ 6167b66cf61Sopenharmony_ci Collate = False; 6177b66cf61Sopenharmony_ci} 6187b66cf61Sopenharmony_ci 6197b66cf61Sopenharmony_ciif (!Duplex) { 6207b66cf61Sopenharmony_ci /* EvenDuplex is not needed */ 6217b66cf61Sopenharmony_ci EvenDuplex = False; 6227b66cf61Sopenharmony_ci} 6237b66cf61Sopenharmony_ci 6247b66cf61Sopenharmony_ci 6257b66cf61Sopenharmony_ciif (Copies > 1 && the printer can handle Copies) device_copies = Copies; 6267b66cf61Sopenharmony_ciif (Duplex && the printer can handle Duplex) { 6277b66cf61Sopenharmony_ci device_duplex = True; 6287b66cf61Sopenharmony_ci} else { 6297b66cf61Sopenharmony_ci /* imagetopdf cannot handle Duplex */ 6307b66cf61Sopenharmony_ci} 6317b66cf61Sopenharmony_ciif (Collate && the printer can handle Collate) device_collate = True; 6327b66cf61Sopenharmony_ciif (OutputOrder == Reverse && the printer can handle OutputOrder) 6337b66cf61Sopenharmony_ci device_outputorder = True; 6347b66cf61Sopenharmony_ci 6357b66cf61Sopenharmony_ciif (Collate && !device_collate) { 6367b66cf61Sopenharmony_ci /* The printer cannot handle Collate. 6377b66cf61Sopenharmony_ci So imagetopdf handle Copies */ 6387b66cf61Sopenharmony_ci device_copies = 1; 6397b66cf61Sopenharmony_ci} 6407b66cf61Sopenharmony_ci 6417b66cf61Sopenharmony_ciif (device_copies != Copies /* imagetopdf handle Copies */ && Duplex) 6427b66cf61Sopenharmony_ci /* Make imagetopdf handle Collate, otherwise both paper side may have 6437b66cf61Sopenharmony_ci same page */ 6447b66cf61Sopenharmony_ci Collate = True; 6457b66cf61Sopenharmony_ci device_collate = False; 6467b66cf61Sopenharmony_ci} 6477b66cf61Sopenharmony_ci 6487b66cf61Sopenharmony_ciif (Duplex && Collate && !device_collate) { 6497b66cf61Sopenharmony_ci /* Handle EvenDuplex, otherwise the last page has 6507b66cf61Sopenharmony_ci the next copy's first page in the other side of the paper. */ 6517b66cf61Sopenharmony_ci EvenDuplex = True; 6527b66cf61Sopenharmony_ci} 6537b66cf61Sopenharmony_ci 6547b66cf61Sopenharmony_ciif (Duplex && OutputOrder == Reverse && !device_outputorder) { 6557b66cf61Sopenharmony_ci /* Handle EvenDuplex, otherwise the first page's other side of paper 6567b66cf61Sopenharmony_ci is empty. */ 6577b66cf61Sopenharmony_ci EvenDuplex = True; 6587b66cf61Sopenharmony_ci} 6597b66cf61Sopenharmony_ci 6607b66cf61Sopenharmony_cisoft_copies = device_copies > 1 ? 1 : Copies; 6617b66cf61Sopenharmony_ci 6627b66cf61Sopenharmony_ci7.2 JCL 6637b66cf61Sopenharmony_ci 6647b66cf61Sopenharmony_ciWhen you print PDF files to a PostScript(PS) printer, you can specify 6657b66cf61Sopenharmony_cidevice options in PS. In this case, you can write PS commands in a PPD file 6667b66cf61Sopenharmony_cilike as follows. 6677b66cf61Sopenharmony_ci 6687b66cf61Sopenharmony_ci*OpenUI *Resolution/Resolution : PickOne 6697b66cf61Sopenharmony_ci*DefaultResolution: 600 6707b66cf61Sopenharmony_ci*Resolution 300/300 dpi: "<</HWResolution[300 300]>>setpagedevice" 6717b66cf61Sopenharmony_ci*Resolution 600/600 dpi: "<</HWResolution[600 600]>>setpagedevice" 6727b66cf61Sopenharmony_ci*CloseUI: *Resolution 6737b66cf61Sopenharmony_ci 6747b66cf61Sopenharmony_ciHowever, if options cannot be described in PS file, you can write JCLs 6757b66cf61Sopenharmony_cias follows; 6767b66cf61Sopenharmony_ci 6777b66cf61Sopenharmony_ci*JCLOpenUI *JCLFrameBufferSize/Frame Buffer Size: PickOne 6787b66cf61Sopenharmony_ci*DefaultJCLFrameBufferSize: Letter 6797b66cf61Sopenharmony_ci*OrderDependency: 20 JCLSetup *JCLFrameBufferSize 6807b66cf61Sopenharmony_ci*JCLFrameBufferSize Off: '@PJL SET PAGEPROTECT = OFF<0A>' 6817b66cf61Sopenharmony_ci*JCLFrameBufferSize Letter: '@PJL SET PAGEPROTECT = LTR<0A>' 6827b66cf61Sopenharmony_ci*JCLFrameBufferSize Legal: '@PJL SET PAGEPROTECT = LGL<0A>' 6837b66cf61Sopenharmony_ci*JCLCloseUI: *JCLFrameBufferSize 6847b66cf61Sopenharmony_ci 6857b66cf61Sopenharmony_ciBecause PDF cannot specify device options in a PDF file, you have to define 6867b66cf61Sopenharmony_ciall the device options as JCLs. 6877b66cf61Sopenharmony_ci 6887b66cf61Sopenharmony_ciWhen a printer does not support PS or PDF, you can use Ghostscript (GS). 6897b66cf61Sopenharmony_ciIn this case, you can specify device options like a PS printer. 6907b66cf61Sopenharmony_ciIf you want to use the same printer and same PPD file for both PDF and PS 6917b66cf61Sopenharmony_ciprinting, when you print a PS file, you can specify that GS handles it, 6927b66cf61Sopenharmony_ciand when you print a PDF file, you can also specify that PDF filters handle 6937b66cf61Sopenharmony_ciit in the same PPD file. However in this case, previous methods is not 6947b66cf61Sopenharmony_ciappropriate to specify device options. 6957b66cf61Sopenharmony_ci 6967b66cf61Sopenharmony_ciSo, "imagetopdf" handles this case as follows; 6977b66cf61Sopenharmony_ci(In following pseudo program, JCL option is an option specified with JCLOpenUI) 6987b66cf61Sopenharmony_ci 6997b66cf61Sopenharmony_ciif (Both JCLBegin and JCLToPSInterpreter are specified in the PPD file) { 7007b66cf61Sopenharmony_ci output JCLs that marked JCL options. 7017b66cf61Sopenharmony_ci} 7027b66cf61Sopenharmony_ci 7037b66cf61Sopenharmony_ciif (pdftopdfJCLBegin attribute is specified in the PPD file) { 7047b66cf61Sopenharmony_ci output it's value 7057b66cf61Sopenharmony_ci} 7067b66cf61Sopenharmony_ci 7077b66cf61Sopenharmony_ciif (Copies option is specified in the PPD file) { 7087b66cf61Sopenharmony_ci mark Number of copies specified 7097b66cf61Sopenharmony_ci} else if (pdftopdfJCLCopies is specified in the PPD file) { 7107b66cf61Sopenharmony_ci output JCL specified with JCLCopies 7117b66cf61Sopenharmony_ci} 7127b66cf61Sopenharmony_ci 7137b66cf61Sopenharmony_cifor (each marked options) { 7147b66cf61Sopenharmony_ci if (pdftopdfJCL<marked option's name> is specified in the PPD file) { 7157b66cf61Sopenharmony_ci output it's value as a JCL 7167b66cf61Sopenharmony_ci } else if (pdftopdfJCLBegin attributes is specified in the PPD file) { 7177b66cf61Sopenharmony_ci output "<option's name>=<marked choice>;" as a JCL 7187b66cf61Sopenharmony_ci } 7197b66cf61Sopenharmony_ci} 7207b66cf61Sopenharmony_cioutput NEWLINE 7217b66cf61Sopenharmony_ci 7227b66cf61Sopenharmony_ciThus, if you want to use both PDF filters and GS by single PPD file, 7237b66cf61Sopenharmony_ciwhat you should do is to add the following line in the PPD file; 7247b66cf61Sopenharmony_ci 7257b66cf61Sopenharmony_ci*pdftopdfJCLBegin: "pdfto... jobInfo:" 7267b66cf61Sopenharmony_ci 7277b66cf61Sopenharmony_ciReplace "pdfto..." by the name of the actual filter to be called after 7287b66cf61Sopenharmony_cipdftopdf. 7297b66cf61Sopenharmony_ci 7307b66cf61Sopenharmony_ciNote: 7317b66cf61Sopenharmony_ci If you specify JCLBegin, you have to specify JCLToPSInterpreter as well. 7327b66cf61Sopenharmony_ci 7337b66cf61Sopenharmony_ciNote: 7347b66cf61Sopenharmony_ci When you need to specify the value which is different from the choosen 7357b66cf61Sopenharmony_ci value based on the PPD into the jobInfo, you have to specify the values 7367b66cf61Sopenharmony_ci with the key started by "pdftopdfJCL" string. 7377b66cf61Sopenharmony_ci 7387b66cf61Sopenharmony_ci For example, if the page size is defined in a PPD file as following; 7397b66cf61Sopenharmony_ci 7407b66cf61Sopenharmony_ci *OpenUI *PageSize/Page Size: PickOne 7417b66cf61Sopenharmony_ci *DefaultPageSize: A4 7427b66cf61Sopenharmony_ci *PageSize A4/A4: 7437b66cf61Sopenharmony_ci *PageSize Letter/US Letter: 7447b66cf61Sopenharmony_ci *CloseUI: *PageSize 7457b66cf61Sopenharmony_ci 7467b66cf61Sopenharmony_ci if you choose the page size "Letter", the string "PageSize=Letter;" is 7477b66cf61Sopenharmony_ci added to jobInfo. On the other hand, if the driver requires the different 7487b66cf61Sopenharmony_ci value for the "Letter" size, for instance driver requires "PS=LT;" 7497b66cf61Sopenharmony_ci instead of "PageSize=Letter;" as the jobInfo value, the PPD file has to 7507b66cf61Sopenharmony_ci be defined as following; 7517b66cf61Sopenharmony_ci 7527b66cf61Sopenharmony_ci *OpenUI *PageSize/Page Size: PickOne 7537b66cf61Sopenharmony_ci *DefaultPageSize: A4 7547b66cf61Sopenharmony_ci *PageSize A4/A4: 7557b66cf61Sopenharmony_ci *pdftopdfJCLPageSize A4/A4: "PS=A4;" 7567b66cf61Sopenharmony_ci *PageSize Letter/US Letter: 7577b66cf61Sopenharmony_ci *pdftopdfJCLPageSize Letter/US Letter: "PS=LT;" 7587b66cf61Sopenharmony_ci *CloseUI: *PageSize 7597b66cf61Sopenharmony_ci 7607b66cf61Sopenharmony_ci7.3 Temporally files location 7617b66cf61Sopenharmony_ci 7627b66cf61Sopenharmony_ci"imagetopdf" creates temporally files if needed. Temporary files are created 7637b66cf61Sopenharmony_ciin the location specified by TMPDIR environment variable. Default location 7647b66cf61Sopenharmony_ciis "/tmp". 7657b66cf61Sopenharmony_ci 7667b66cf61Sopenharmony_ci 7677b66cf61Sopenharmony_ciPDFTOPDF 7687b66cf61Sopenharmony_ci======== 7697b66cf61Sopenharmony_ci 7707b66cf61Sopenharmony_ciThe pdftopdf filter depends on libqpdf to read and write PDF files. 7717b66cf61Sopenharmony_ci 7727b66cf61Sopenharmony_ciIt replaces and imitates the pstops filter in the PDF-based workflow. 7737b66cf61Sopenharmony_ciA similar filter (which can serve as behavior reference) 7747b66cf61Sopenharmony_ciis called "cgpdftopdf" in OS X (not open source). 7757b66cf61Sopenharmony_ci 7767b66cf61Sopenharmony_ciCommand line 7777b66cf61Sopenharmony_ci------------ 7787b66cf61Sopenharmony_ci 7797b66cf61Sopenharmony_cipdftopdf follows the usual CUPS filter calling conventions, i.e. 7807b66cf61Sopenharmony_ci 7817b66cf61Sopenharmony_ci pdftopdf <job> <user> <title> <num-copies> <options> [<filename>] 7827b66cf61Sopenharmony_ci 7837b66cf61Sopenharmony_citogether with the environment variables "PPD" and "CLASSIFICATION". 7847b66cf61Sopenharmony_ci 7857b66cf61Sopenharmony_ciWhen omitting <filename>, "pdftopdf" reads a PDF file from stdin. 7867b66cf61Sopenharmony_ciInternally this will write the data to a temporary file, because 7877b66cf61Sopenharmony_cithe PDF format cannot be processed in a streaming fashion. 7887b66cf61Sopenharmony_ci 7897b66cf61Sopenharmony_ci<options> are delimited by space; boolean type CUPS options can be set 7907b66cf61Sopenharmony_ciby only adding the option key, other types are provided as 7917b66cf61Sopenharmony_cipairs of key and value, <key>=<value>. 7927b66cf61Sopenharmony_ci 7937b66cf61Sopenharmony_cipdftopdf processes the following standard command-line and/or PPD options: 7947b66cf61Sopenharmony_ci 7957b66cf61Sopenharmony_ciCopies # ppd will only override, when commandline parameter was 1 7967b66cf61Sopenharmony_cifitplot / fit-to-page / ipp-attribute-fidelity 7977b66cf61Sopenharmony_cilandscape / orientation-requested 7987b66cf61Sopenharmony_ciPageSize / page-size / MediaSize / media-size 7997b66cf61Sopenharmony_cipage-left / page-right / page-bottom / page-top 8007b66cf61Sopenharmony_cimedia-top-margin / media-left-margin / media-right-margin / media-bottom-margin 8017b66cf61Sopenharmony_ciDuplex / JCLDuplex / EFDuplex / JD03Duplex / sides 8027b66cf61Sopenharmony_cinumber-up / number-up-layout 8037b66cf61Sopenharmony_cipage-border 8047b66cf61Sopenharmony_ciOutputOrder / OutputBin / DefaultOutputOrder / page-delivery 8057b66cf61Sopenharmony_cipage-label 8067b66cf61Sopenharmony_cipage-set 8077b66cf61Sopenharmony_cipage-ranges 8087b66cf61Sopenharmony_ciMirrorPrint / mirror 8097b66cf61Sopenharmony_ciemit-jcl 8107b66cf61Sopenharmony_ciposition 8117b66cf61Sopenharmony_ciCollate / multiple-document-handling / sheet-collate 8127b66cf61Sopenharmony_cicupsEvenDuplex 8137b66cf61Sopenharmony_cicupsManualCopies # via ppd 8147b66cf61Sopenharmony_ci 8157b66cf61Sopenharmony_ciAdditional (non-standard) options 8167b66cf61Sopenharmony_ci--------------------------------- 8177b66cf61Sopenharmony_ci 8187b66cf61Sopenharmony_ci1) Booklet printing 8197b66cf61Sopenharmony_ci 8207b66cf61Sopenharmony_ci booklet=Off/On/Shuffle-Only 8217b66cf61Sopenharmony_ci 8227b66cf61Sopenharmony_ci"On" also tries to set DuplexTumble (two-sided-short-edge) and forces number-up=2 8237b66cf61Sopenharmony_ci 8247b66cf61Sopenharmony_ci booklet-signature=(multiple of 4, or default: -1 to use "all pages") 8257b66cf61Sopenharmony_ci 8267b66cf61Sopenharmony_ci2) Page autorotate 8277b66cf61Sopenharmony_ci 8287b66cf61Sopenharmony_cipdftopdf automatically rotates pages to the same orientation, 8297b66cf61Sopenharmony_ciinstead of (e.g. fitplot) scaling them down unrotated. 8307b66cf61Sopenharmony_ciThis behavier can be controlled by 8317b66cf61Sopenharmony_ci 8327b66cf61Sopenharmony_ci pdfAutorotate / nopdfAutorotate 8337b66cf61Sopenharmony_ci 8347b66cf61Sopenharmony_ciSpecifically, if a PDF file contains pages with page width greater than 8357b66cf61Sopenharmony_cipage height (a landscape page), such pages are automatically rotated 8367b66cf61Sopenharmony_cianticlockwise by 90 degrees, unless the PPD file specifies 8377b66cf61Sopenharmony_ci"*LandscapeOrientation: Minus90". In this case, clockwise rotation is used. 8387b66cf61Sopenharmony_ciTo turn off the feature on a job-by-job basis use 8397b66cf61Sopenharmony_ci 8407b66cf61Sopenharmony_ci lp -d <print_queue_name> -o nopdfAutorotate <document> 8417b66cf61Sopenharmony_ci 8427b66cf61Sopenharmony_ciOn a per-queue basis use 8437b66cf61Sopenharmony_ci 8447b66cf61Sopenharmony_ci -o nopdfAutorotate-default 8457b66cf61Sopenharmony_ci 8467b66cf61Sopenharmony_cias an option to lpadmin. 8477b66cf61Sopenharmony_ci 8487b66cf61Sopenharmony_ciWhen the 'landscape' or 'orientation-requested=4' (or =5) option of CUPS is 8497b66cf61Sopenharmony_cigiven, the pdfAutorotate processing will adjust and accordingly rotate the 8507b66cf61Sopenharmony_cinon-landscape pages are rotated instead. 8517b66cf61Sopenharmony_ci 8527b66cf61Sopenharmony_ciNote: Some pages might end up 180 degree rotated (instead of 0 degree). 8537b66cf61Sopenharmony_ciThose should probably be rotated manually before binding the pages together. 8547b66cf61Sopenharmony_ci 8557b66cf61Sopenharmony_ci3) Method of flattening interactive PDF forms and annotations. 8567b66cf61Sopenharmony_ci 8577b66cf61Sopenharmony_ciSome PDF files (like application forms) contain interactive forms 8587b66cf61Sopenharmony_ciwhich the user can fill in inside a PDF viewer like evince. The filled 8597b66cf61Sopenharmony_ciin data is not integrated in each page of the PDF file but stored in 8607b66cf61Sopenharmony_cian extra layer. Due to this the data gets lost when applying 8617b66cf61Sopenharmony_cimanipulations like scaling or N-up to the pages. To prevent the loss 8627b66cf61Sopenharmony_ciof the data pdftopdf flattens the form before doing the 8637b66cf61Sopenharmony_cimanipulations. This means the PDF will be converted into a static PDF 8647b66cf61Sopenharmony_cifile with the data being integral part of the pages. 8657b66cf61Sopenharmony_ci 8667b66cf61Sopenharmony_ciThe same flattening is needed for annotations in PDF files. 8677b66cf61Sopenharmony_ci 8687b66cf61Sopenharmony_ciBy default the actual flattening work is done by QPDF, as QPDF is also 8697b66cf61Sopenharmony_cidoing everything else in pdftopdf. This way no external utilities need 8707b66cf61Sopenharmony_cito be called and so extra piping between processes and extra PDF 8717b66cf61Sopenharmony_ciinterpreter runs are avoided which makes the filtering process faster. 8727b66cf61Sopenharmony_ci 8737b66cf61Sopenharmony_ciAs we did not test the new QPDF-based form-flattening with thousands 8747b66cf61Sopenharmony_ciof PDF files yet and it has not been available to actual users yet it 8757b66cf61Sopenharmony_ciis possible that there are still some bugs. To give users a 8767b66cf61Sopenharmony_cipossibility to work around possible bugs in QPDF's form flattening, we 8777b66cf61Sopenharmony_cihave introduced an option to get back to the old flattening by the 8787b66cf61Sopenharmony_ciexternal tools pdftocairo or Ghostscript. 8797b66cf61Sopenharmony_ci 8807b66cf61Sopenharmony_ciThe selection of the method is done by the "pdftopdf-form-flattening" 8817b66cf61Sopenharmony_cioption, setting it to "auto", "qpdf", "pdftocairo", "ghostscript", 8827b66cf61Sopenharmony_ci"gs", "internal" or "external": 8837b66cf61Sopenharmony_ci 8847b66cf61Sopenharmony_ciPer-job: lpr -o pdftopdf-form-flattening=pdftocairo ... 8857b66cf61Sopenharmony_ciPer-queue default: lpadmin -p printer -o pdftopdf-form-flattening-default=gs 8867b66cf61Sopenharmony_ciRemove default: lpadmin -p printer -R pdftopdf-form-flattening-default 8877b66cf61Sopenharmony_ci 8887b66cf61Sopenharmony_ciBy default, pdftopdf uses QPDF if the option is not supplied, also the 8897b66cf61Sopenharmony_cisettings "auto" and "internal" make QPDF being used. "external" 8907b66cf61Sopenharmony_ciauto-selects from the two external utilities, trying pdftocairo at 8917b66cf61Sopenharmony_cifirst and on failure Ghostscript. If the selected utility fails, the 8927b66cf61Sopenharmony_ciform stays unflattened and so the filled in data will possibly not get 8937b66cf61Sopenharmony_ciprinted. 8947b66cf61Sopenharmony_ci 8957b66cf61Sopenharmony_ciNative PDF Printer / JCL Support 8967b66cf61Sopenharmony_ci-------------------------------- 8977b66cf61Sopenharmony_ci 8987b66cf61Sopenharmony_ciNote that for most modern native PDF printers JCL is not needed any 8997b66cf61Sopenharmony_cimore as they are controlled via IPP. For these the PPD files get 9007b66cf61Sopenharmony_ciauto-generated by the support of CUPS and cups-filters for driverless 9017b66cf61Sopenharmony_ciIPP printing. 9027b66cf61Sopenharmony_ci 9037b66cf61Sopenharmony_cipdftopdf will emit JCL when provided with a PPD file that includes the 9047b66cf61Sopenharmony_ci"*JCLToPDFInterpreter:" keyword. 9057b66cf61Sopenharmony_ci 9067b66cf61Sopenharmony_ciThis enables for hardware copy generation and device collate; e.g. with PJL: 9077b66cf61Sopenharmony_ci 9087b66cf61Sopenharmony_ci*JCLBegin: "<1B>%-12345X@PJL JOB<0A>" 9097b66cf61Sopenharmony_ci*JCLToPDFInterpreter: "@PJL ENTER LANGUAGE = PDF <0A>" 9107b66cf61Sopenharmony_ci*JCLEnd: "<1B>%-12345X@PJL EOJ <0A><1B>%-12345X" 9117b66cf61Sopenharmony_ci 9127b66cf61Sopenharmony_ciFor each marked option, the prefixed "pdftopdfJCL<option name>" keywords 9137b66cf61Sopenharmony_cican also be used to send raw JCL strings for that option. 9147b66cf61Sopenharmony_ciThese keywords also include *pdftopdfJCLBegin and *pdftopdfJCLCopies, 9157b66cf61Sopenharmony_ciThis allows the use of the same PPD for PDF- and PS-based workflows, 9167b66cf61Sopenharmony_cias pdftopdfJCL... will not be read in the PS case. 9177b66cf61Sopenharmony_ci 9187b66cf61Sopenharmony_ciWhen the PPD contains the "Copies" keyword, pdftopdf will detect the use 9197b66cf61Sopenharmony_ciof PJL and has special code which adds "@PJL SET COPIES=...", 9207b66cf61Sopenharmony_cior "@PJL SET QTY=...", respectively. 9217b66cf61Sopenharmony_ci 9227b66cf61Sopenharmony_ciOther JCL code can be injected via "*JCLOpenUI: ..." ... "*JCLCloseUI: ...". 9237b66cf61Sopenharmony_ci 9247b66cf61Sopenharmony_ciSpecial PDF comments 9257b66cf61Sopenharmony_ci-------------------- 9267b66cf61Sopenharmony_ci 9277b66cf61Sopenharmony_cipdftopdf adds comments to the pdf preamble that might esp. be of use 9287b66cf61Sopenharmony_cito subsequent filters, e.g. 9297b66cf61Sopenharmony_ci 9307b66cf61Sopenharmony_ci % This file was generated by pdftopdf 9317b66cf61Sopenharmony_ci %%PDFTOPDFNumCopies : 1 9327b66cf61Sopenharmony_ci %%PDFTOPDFCollate : false 9337b66cf61Sopenharmony_ci 9347b66cf61Sopenharmony_ciThe "NumCopies" and "Collate" values refer to the expected device/hardware 9357b66cf61Sopenharmony_cicopies, i.e. when pdftopdf's soft-copy generation did not handle this options. 9367b66cf61Sopenharmony_ci 9377b66cf61Sopenharmony_ciLimitations 9387b66cf61Sopenharmony_ci----------- 9397b66cf61Sopenharmony_ci 9407b66cf61Sopenharmony_cipdftopdf does not support functions that are not related to printing 9417b66cf61Sopenharmony_cifeatures, including interactive features and document interchange features. 9427b66cf61Sopenharmony_ciMany of these operators and sections are just ignored. 9437b66cf61Sopenharmony_ciSome of these may be output, but those functions are not assured. 9447b66cf61Sopenharmony_ci 9457b66cf61Sopenharmony_ciMost notable is the use of AcroForms; their content will not be printed 9467b66cf61Sopenharmony_ciif any non-trivial processing by pdftopdf is involved (e.g. "fitplot"). 9477b66cf61Sopenharmony_ciThis only occurs when a file is printed directly, e.g. by "lpr". 9487b66cf61Sopenharmony_ci 9497b66cf61Sopenharmony_ciUsual PDF viewer applications (xpdf, evince, acroread, ghostscript, ...) 9507b66cf61Sopenharmony_ciwill hardcopy the form content into printable pdf operations, 9517b66cf61Sopenharmony_ciwhen choosing to print such a document. 9527b66cf61Sopenharmony_ci 9537b66cf61Sopenharmony_ciKnown issues 9547b66cf61Sopenharmony_ci------------ 9557b66cf61Sopenharmony_ci 9567b66cf61Sopenharmony_ci- Borders, esp. in the "number-up=1 fitplot=false"-case might be drawn 9577b66cf61Sopenharmony_ci at incorrect locations. 9587b66cf61Sopenharmony_ci 9597b66cf61Sopenharmony_ci- JCL documentation is sparse. 9607b66cf61Sopenharmony_ci The imagetopdf or old pdftopdf documentation contains a tad more information. 9617b66cf61Sopenharmony_ci 9627b66cf61Sopenharmony_ci- Missing AcroForm-content might surprise users printing PDF files directly / 9637b66cf61Sopenharmony_ci from the command-line (see the Limitations section, above). 9647b66cf61Sopenharmony_ci 9657b66cf61Sopenharmony_ciLicense 9667b66cf61Sopenharmony_ci------- 9677b66cf61Sopenharmony_ci 9687b66cf61Sopenharmony_cipdftopdf is released under the MIT license. 9697b66cf61Sopenharmony_ci 9707b66cf61Sopenharmony_ciThe required libqpdf is available under version 2.0 of the Apache License, 9717b66cf61Sopenharmony_cie.g. here: https://github.com/qpdf/qpdf 9727b66cf61Sopenharmony_ci 9737b66cf61Sopenharmony_ci 9747b66cf61Sopenharmony_ciTEXTTOPDF 9757b66cf61Sopenharmony_ci========= 9767b66cf61Sopenharmony_ci 9777b66cf61Sopenharmony_ciThis implements a texttopdf filter, and is derived from cups' texttops. 9787b66cf61Sopenharmony_ci 9797b66cf61Sopenharmony_ciTo configure: 9807b66cf61Sopenharmony_ci------------- 9817b66cf61Sopenharmony_ci 9827b66cf61Sopenharmony_ci- texttopdf uses CUPS_DATADIR/charset/pdf.utf-8 for font configuration 9837b66cf61Sopenharmony_ci (when utf-8 was requested as charset). The font names given there are 9847b66cf61Sopenharmony_ci used as fontconfig selectors; the best matching font, that is both 9857b66cf61Sopenharmony_ci monospaced and in a supported format (TTC, TTF or OTF) will then be used. 9867b66cf61Sopenharmony_ci 9877b66cf61Sopenharmony_ci- As a special exception, all fontnames that start with a '.' or '/' are 9887b66cf61Sopenharmony_ci considered filenames, and fontconfig is skipped; the name is used directly 9897b66cf61Sopenharmony_ci for loading the font file. 9907b66cf61Sopenharmony_ci 9917b66cf61Sopenharmony_ci- Implementation note: TrueType Collections (.TTC) are internally handled 9927b66cf61Sopenharmony_ci by appending '/' and the index of the font inside the collection to 9937b66cf61Sopenharmony_ci the filename (e.g. to use the second font of uming.ttc, the filename 9947b66cf61Sopenharmony_ci uming.ttc/1 must be given to the fontembed-library). 9957b66cf61Sopenharmony_ci By appending the index-field returned from fontconfig, this is completely 9967b66cf61Sopenharmony_ci transparent to the user (but currently not widely tested). 9977b66cf61Sopenharmony_ci 9987b66cf61Sopenharmony_ci- You may look at the two examples: pdf.utf-8.simple and pdf.utf-8.heavy. 9997b66cf61Sopenharmony_ci 10007b66cf61Sopenharmony_ciTo use: 10017b66cf61Sopenharmony_ci------- 10027b66cf61Sopenharmony_ci 10037b66cf61Sopenharmony_ciThe filter is called just like any other cups filter. Have a 10047b66cf61Sopenharmony_cilook at test.sh for example. 10057b66cf61Sopenharmony_ci 10067b66cf61Sopenharmony_ciKnown Issues 10077b66cf61Sopenharmony_ci------------ 10087b66cf61Sopenharmony_ci 10097b66cf61Sopenharmony_ci - Text extraction does not work (at least for pdftotext from xpdf) 10107b66cf61Sopenharmony_ci for the resulting pdfs. 10117b66cf61Sopenharmony_ci 10127b66cf61Sopenharmony_ci - OTF(CFF) embedding currently does not subset the fonts. 10137b66cf61Sopenharmony_ci 10147b66cf61Sopenharmony_ci - Text wrapping in pretty-printing mode does not respect double-wide 10157b66cf61Sopenharmony_ci characters (CJK), and thus produce wrong results (wrap too late) 10167b66cf61Sopenharmony_ci for lines where they occur. The fix is not trivial, since all the 10177b66cf61Sopenharmony_ci pretty-printing processing is done without knowledge of / prior to 10187b66cf61Sopenharmony_ci the font configuration (which is where single or double width 10197b66cf61Sopenharmony_ci code-ranges are specified). 10207b66cf61Sopenharmony_ci 10217b66cf61Sopenharmony_ci - The hebrew example in test5.pdf shows one of our limitations: 10227b66cf61Sopenharmony_ci Compose glyphs are not composed with the primary glyph but printed 10237b66cf61Sopenharmony_ci as separate glyphs. 10247b66cf61Sopenharmony_ci 10257b66cf61Sopenharmony_ciFurther Infos 10267b66cf61Sopenharmony_ci------------- 10277b66cf61Sopenharmony_ci 10287b66cf61Sopenharmony_ciFont embedding is handled by libfontembed in the filter/fontembed 10297b66cf61Sopenharmony_cisubdirectory. 10307b66cf61Sopenharmony_ci 10317b66cf61Sopenharmony_ciPlease report all bugs to 10327b66cf61Sopenharmony_ci 10337b66cf61Sopenharmony_cihttps://github.com/OpenPrinting/cups-filters/issues 10347b66cf61Sopenharmony_ci 10357b66cf61Sopenharmony_cior to 10367b66cf61Sopenharmony_ci 10377b66cf61Sopenharmony_cihttps://bugs.linuxfoundation.org/ 10387b66cf61Sopenharmony_ci 10397b66cf61Sopenharmony_ci(product "OpenPrinting", component "cups-filters"). 10407b66cf61Sopenharmony_ci 10417b66cf61Sopenharmony_ci 10427b66cf61Sopenharmony_ciPDFTORASTER 10437b66cf61Sopenharmony_ci=========== 10447b66cf61Sopenharmony_ci 10457b66cf61Sopenharmony_ci1. INTRODUCTION 10467b66cf61Sopenharmony_ci 10477b66cf61Sopenharmony_ci"pdftoraster" is a filter for CUPS. It reads PDF files, convert it and 10487b66cf61Sopenharmony_cioutput CUPS raster. 10497b66cf61Sopenharmony_ci 10507b66cf61Sopenharmony_ci"pdftoraster" does not support functions that are not related to printing 10517b66cf61Sopenharmony_cifeatures, including interactive features and document interchange features. 10527b66cf61Sopenharmony_ciMany of these operators and sections are just ignored. 10537b66cf61Sopenharmony_ciSome of these may be output, but those functions are not assured. 10547b66cf61Sopenharmony_ciEncryption feature is not supported. 10557b66cf61Sopenharmony_ci 10567b66cf61Sopenharmony_ci2. LICENSE 10577b66cf61Sopenharmony_ci 10587b66cf61Sopenharmony_ciAlmost all source files are under MIT like license. However, 10597b66cf61Sopenharmony_ci"pdftoraster" links some "poppler" libraries, and these files are 10607b66cf61Sopenharmony_ciunder GNU public license. See copyright notice of each file for 10617b66cf61Sopenharmony_cidetails. 10627b66cf61Sopenharmony_ci 10637b66cf61Sopenharmony_ci3. COMMAND LINE 10647b66cf61Sopenharmony_ci 10657b66cf61Sopenharmony_ci"pdftoraster" is a CUPS filter, and the command line arguments, environment 10667b66cf61Sopenharmony_civariables and configuration files are in accordance with the CUPS filter 10677b66cf61Sopenharmony_ciinterface. 10687b66cf61Sopenharmony_ci 10697b66cf61Sopenharmony_cipdftoraster <job> <user> <title> <num-copies> <options> [<filename>] 10707b66cf61Sopenharmony_ci 10717b66cf61Sopenharmony_ci"pdftoraster" ignores <job> and <user>. 10727b66cf61Sopenharmony_ci<title> is appended into the PDF dictionary as /Title. 10737b66cf61Sopenharmony_ci<num-copies> specifies the number of document copies. 10747b66cf61Sopenharmony_ci<options> is a CUPS option list. 10757b66cf61Sopenharmony_ci<filename> is an input PDF file name. 10767b66cf61Sopenharmony_ci 10777b66cf61Sopenharmony_ciWhen omit the <filename>, "pdftoraster" reads a PDF file from the stdin, 10787b66cf61Sopenharmony_ciand save it as a temporary file. 10797b66cf61Sopenharmony_ci 10807b66cf61Sopenharmony_ci4. ENVIRONMENT VARIABLES 10817b66cf61Sopenharmony_ci 10827b66cf61Sopenharmony_ciThis program refers the following environment variable; 10837b66cf61Sopenharmony_ci PPD: PPD file name of the printer. 10847b66cf61Sopenharmony_ci 10857b66cf61Sopenharmony_ci5. COMMAND OPTIONS 10867b66cf61Sopenharmony_ci 10877b66cf61Sopenharmony_ciSee CUPS documents for details. 10887b66cf61Sopenharmony_ci 10897b66cf61Sopenharmony_ci6. INFORMATION FOR DEVELOPERS 10907b66cf61Sopenharmony_ci 10917b66cf61Sopenharmony_ciFollowing information is for developers, not for driver users. 10927b66cf61Sopenharmony_ci 10937b66cf61Sopenharmony_ci6.1 Options handled by a printer or "pdftoraster" 10947b66cf61Sopenharmony_ci 10957b66cf61Sopenharmony_ci"pdftopdf" outputs the following special comments from the 4th line in the 10967b66cf61Sopenharmony_cicreated PDF data. 10977b66cf61Sopenharmony_ci 10987b66cf61Sopenharmony_ci%%PDFTOPDFNumCopies : <copies> --- <copies> specified Number of Copies 10997b66cf61Sopenharmony_ci%%PDFTOPDFCollate : <collate> --- <collate> is true or false 11007b66cf61Sopenharmony_ci 11017b66cf61Sopenharmony_ci"pdftoraster" overrides the command line options by above two option's values. 11027b66cf61Sopenharmony_ci 11037b66cf61Sopenharmony_ci6.2 Temporally files location 11047b66cf61Sopenharmony_ci 11057b66cf61Sopenharmony_ci"pdftoraster" creates temporally files if needed. Temporary files are created 11067b66cf61Sopenharmony_ciin the location specified by TMPDIR environment variable. Default location 11077b66cf61Sopenharmony_ciis "/tmp". 11087b66cf61Sopenharmony_ci 11097b66cf61Sopenharmony_ci 11107b66cf61Sopenharmony_ciURFTOPDF 11117b66cf61Sopenharmony_ci======== 11127b66cf61Sopenharmony_ci 11137b66cf61Sopenharmony_ci"urftopdf" is a filter to convert Apple's proprietary URF raster 11147b66cf61Sopenharmony_ciformat into PDF. URF raster is generated by some iOS applications when 11157b66cf61Sopenharmony_ciprinting via Airprint, so this filter provides a more complete support 11167b66cf61Sopenharmony_cifor AirPrint clients. Note that it is not clear whether nowadays all 11177b66cf61Sopenharmony_ciiOS applications send PDF and not URF any more. Also the filter does 11187b66cf61Sopenharmony_cinot support all variants of URF format so the URF support is most 11197b66cf61Sopenharmony_ciprobably incomplete. 11207b66cf61Sopenharmony_ci 11217b66cf61Sopenharmony_ciApple does not provide any official documentation of the format but there is 11227b66cf61Sopenharmony_cialready some reverse engineering done. A description of the format as far as it 11237b66cf61Sopenharmony_cigot found out and two sample files can be found here: 11247b66cf61Sopenharmony_ci 11257b66cf61Sopenharmony_cihttps://github.com/AlanQuatermain/unirast 11267b66cf61Sopenharmony_ci 11277b66cf61Sopenharmony_ciAn actual implementation of an urftopdf filter is here: 11287b66cf61Sopenharmony_ci 11297b66cf61Sopenharmony_cihttps://github.com/superna9999/urftopdf 11307b66cf61Sopenharmony_ci 11317b66cf61Sopenharmony_ciThis original version uses libharu and to avoid an extra dependency 11327b66cf61Sopenharmony_cithe filter coming with this package is converted to use libqpdf 11337b66cf61Sopenharmony_ciinstead (the same library as pdftopdf uses). 11347b66cf61Sopenharmony_ci 11357b66cf61Sopenharmony_ciLicense: GNU General Public License version 3 or any newer version 11367b66cf61Sopenharmony_ci 11377b66cf61Sopenharmony_ci 11387b66cf61Sopenharmony_ciTEXTTOTEXT 11397b66cf61Sopenharmony_ci========== 11407b66cf61Sopenharmony_ci 11417b66cf61Sopenharmony_ciThis is a special filter for text-only printers (e. g. line printers, 11427b66cf61Sopenharmony_cidaisy-wheel printers, POS printers, ...) or for using printers in 11437b66cf61Sopenharmony_citheir text mode (e. g. dot-matrix printers or otherwise unsupported 11447b66cf61Sopenharmony_ciprinters). It takes plain text (UTF-8-encoded as this is standard with 11457b66cf61Sopenharmony_ciCUPS) and not PDF as input. 11467b66cf61Sopenharmony_ci 11477b66cf61Sopenharmony_ciThe texttotext filter replaces the former textonly filter. 11487b66cf61Sopenharmony_ci 11497b66cf61Sopenharmony_ciIt is for the following use cases: 11507b66cf61Sopenharmony_ci 11517b66cf61Sopenharmony_ci- Using text-only printers, like line printers or daisy-wheel 11527b66cf61Sopenharmony_ci printers. Note that only text can get printed in the way the printer 11537b66cf61Sopenharmony_ci is designed. No support for graphics printing tricks like ASCII art 11547b66cf61Sopenharmony_ci or printing pixels with the period character. 11557b66cf61Sopenharmony_ci 11567b66cf61Sopenharmony_ci- Fast and less resource-consuming text printing with dot-matrix 11577b66cf61Sopenharmony_ci printers using the printer's text mode instead of converting the 11587b66cf61Sopenharmony_ci text to PDF and printing the PDF in the printer's graphics mode, 11597b66cf61Sopenharmony_ci which is slow, loud, and consumes much more ink. 11607b66cf61Sopenharmony_ci 11617b66cf61Sopenharmony_ci- POS printing. POS printers often print only text on roll paper. This 11627b66cf61Sopenharmony_ci filter has a non-paginated mode which prints continuously, ignoring 11637b66cf61Sopenharmony_ci page height definitions. 11647b66cf61Sopenharmony_ci 11657b66cf61Sopenharmony_ciThe filter has the following features: 11667b66cf61Sopenharmony_ci 11677b66cf61Sopenharmony_ci- Conversion of UTF-8 to most printer's encodings. 11687b66cf61Sopenharmony_ci 11697b66cf61Sopenharmony_ci- To each page size a number of lines and columns is assigned, after that 11707b66cf61Sopenharmony_ci you only need to select the size of the paper in use. 11717b66cf61Sopenharmony_ci 11727b66cf61Sopenharmony_ci- At end of page you can optionally send a Form Feed or let the filter fill 11737b66cf61Sopenharmony_ci up the rest of the page with blank lines. 11747b66cf61Sopenharmony_ci 11757b66cf61Sopenharmony_ci- New lines can be initiated by Line Feed, Carriage Return, or both. 11767b66cf61Sopenharmony_ci 11777b66cf61Sopenharmony_ci- Adjustable margins. 11787b66cf61Sopenharmony_ci 11797b66cf61Sopenharmony_ci- Adjustable width for tab stops. 11807b66cf61Sopenharmony_ci 11817b66cf61Sopenharmony_ci- Pagination can be turned off for roll paper or continuous printing in 11827b66cf61Sopenharmony_ci general. 11837b66cf61Sopenharmony_ci 11847b66cf61Sopenharmony_ci- Wrapping or truncation of long lines 11857b66cf61Sopenharmony_ci 11867b66cf61Sopenharmony_ci- Support for most of CUPS' page management options (only with 11877b66cf61Sopenharmony_ci pagination turned on): page-ranges, page-set, output-order, collate, 11887b66cf61Sopenharmony_ci multiple copies. 11897b66cf61Sopenharmony_ci 11907b66cf61Sopenharmony_ciSetting up the printer 11917b66cf61Sopenharmony_ci 11927b66cf61Sopenharmony_ciIn the printer setup tool select the "Generic Text-Only Printer" (with 11937b66cf61Sopenharmony_cilpadmin use "-m drv:///cupsfilters.drv/textonly.ppd"), then under the 11947b66cf61Sopenharmony_ci"Installable Options" adjust the following: 11957b66cf61Sopenharmony_ci 11967b66cf61Sopenharmony_ci- Which page sizes to use and how many lines and columns the printer 11977b66cf61Sopenharmony_ci is capable to print on them. The default setting for lines and 11987b66cf61Sopenharmony_ci columns assume 6 lines per inch and 10 columns per inch. 11997b66cf61Sopenharmony_ci 12007b66cf61Sopenharmony_ci- Whether to send a Form Feed character after each page. Sending a 12017b66cf61Sopenharmony_ci Form Feed is highly recommended to get the content of each page 12027b66cf61Sopenharmony_ci exactly onto the desired sheet. If the printer does not support Form 12037b66cf61Sopenharmony_ci Feed characters, turn them off and make sure that you have adjusted 12047b66cf61Sopenharmony_ci the correct number of lines for each page size, as the printer is 12057b66cf61Sopenharmony_ci advancing pages by filling up the rest of the paper with blank 12067b66cf61Sopenharmony_ci lines. 12077b66cf61Sopenharmony_ci 12087b66cf61Sopenharmony_ci- How the printer advancs to a new line. Most printers require both 12097b66cf61Sopenharmony_ci Crriage Return and Line Feed (the DOS/Windows standard), but some 12107b66cf61Sopenharmony_ci would also work with either Carriage Return or Line Feed. 12117b66cf61Sopenharmony_ci 12127b66cf61Sopenharmony_ci- The printer's encoding: Most text and dot-matrix printers (usually 12137b66cf61Sopenharmony_ci older devices) do not understand CUPS' standard encoding UTF-8 but 12147b66cf61Sopenharmony_ci instead, the use a simpler encoding (where each character is 12157b66cf61Sopenharmony_ci represented by one byte). ASCII should always work, but does not 12167b66cf61Sopenharmony_ci support letters with accents. So check the printer's manual what is 12177b66cf61Sopenharmony_ci supported. You cannot only use the encodings suggested by the PPD 12187b66cf61Sopenharmony_ci file, but any one-byte-per-character encoding which the "iconv" 12197b66cf61Sopenharmony_ci utility supports (see "iconv --list" for a list of encodings). 12207b66cf61Sopenharmony_ci 12217b66cf61Sopenharmony_ciAlso note that text-only and dot-matrix printers often have a DIP 12227b66cf61Sopenharmony_ciswitch block which allows for some hardware configuration, like 12237b66cf61Sopenharmony_cinewline characters, length of page, input encoding, ... 12247b66cf61Sopenharmony_ci 12257b66cf61Sopenharmony_ciOptions of the texttotext filter: 12267b66cf61Sopenharmony_ci 12277b66cf61Sopenharmony_ciTo be usually used when sending a job: 12287b66cf61Sopenharmony_ci 12297b66cf61Sopenharmony_ciPageSize: Paper format to be used. Make sure that the number of lines 12307b66cf61Sopenharmony_ciand columns printable on each paper size are correctly adjusted with 12317b66cf61Sopenharmony_cithe appropriate setup option. The page height is ignore when 12327b66cf61Sopenharmony_cipagination is turned off. Possible values: Letter, Legal, Tabloid, 12337b66cf61Sopenharmony_ciLedger, A4, A3, FanFoldGerman, FanFoldGermanLegal, 11x14Rotated, 12347b66cf61Sopenharmony_ciLegalRotated, Custom1, Custom2, Custom3 12357b66cf61Sopenharmony_ci 12367b66cf61Sopenharmony_ciOverLongLines: What to do with lines longer that the width of the 12377b66cf61Sopenharmony_cipage: Truncate: Simply drop the extra characters; WrapAtWidth 12387b66cf61Sopenharmony_ci(default): Continue the line in the next line on the paper; WordWrap: 12397b66cf61Sopenharmony_ciAs WrapAtWidth, but do not cut in the middle of a word. 12407b66cf61Sopenharmony_ci 12417b66cf61Sopenharmony_ciTabWidth: Width of a tab stop. Can be any positive number. 12427b66cf61Sopenharmony_ci 12437b66cf61Sopenharmony_ciPagination: On: Text is divided in pages depending on the page size 12447b66cf61Sopenharmony_ciselection, with each page having the user-selected margins, 12457b66cf61Sopenharmony_cirecommended for sheet paper; Off: Text is printed continuously, 12467b66cf61Sopenharmony_ciignoring page breaks and the height and upper and lower margins of the 12477b66cf61Sopenharmony_cidestination page size, recommended for roll paper, POS, long lists on 12487b66cf61Sopenharmony_cicontinuous paper, ... Note that with pagination turned off, multiple 12497b66cf61Sopenharmony_cicopies, collate, page-ranges, page-set, and output-order are not 12507b66cf61Sopenharmony_cisupported and therefore ignored. 12517b66cf61Sopenharmony_ci 12527b66cf61Sopenharmony_cipage-left, page-right, page-top, page-bottom: Width of the margins 12537b66cf61Sopenharmony_cileft blank, counted in lines or columns. Top and bottom margins are 12547b66cf61Sopenharmony_ciignored when pagination is turned off. Can be any positive number or 12557b66cf61Sopenharmony_cizero for no margin. 12567b66cf61Sopenharmony_ci 12577b66cf61Sopenharmony_ciTo be usually used when setting up the printer: 12587b66cf61Sopenharmony_ci 12597b66cf61Sopenharmony_ciPrinterEncoding: The printer's character encoding (code page). Any 12607b66cf61Sopenharmony_ciencoding which the iconv utility can generate (see "iconv --list") and 12617b66cf61Sopenharmony_ciwhich uses only one byte per character can be used. This should 12627b66cf61Sopenharmony_cisupport practically any printer which is capable of printing 12637b66cf61Sopenharmony_citext. ASCII is the default setting. See the printer's manual for the 12647b66cf61Sopenharmony_cicorrect encoding to use. 12657b66cf61Sopenharmony_ci 12667b66cf61Sopenharmony_ciNewlineCharacters: The characters sent on the end of a line, LineFeed 12677b66cf61Sopenharmony_ci(LF), Crriage Return (CR), or both Carriage Return and Line Feed 12687b66cf61Sopenharmony_ci(CRLF). Default is CRLF as most printers require this. 12697b66cf61Sopenharmony_ci 12707b66cf61Sopenharmony_ciSendFF: On: Send a Form Feed after each page, so that printer changes 12717b66cf61Sopenharmony_cito the next sheet. Off: Do not send Form Feeds. To advance to the next 12727b66cf61Sopenharmony_cipage blank lines are printed to fill up the page (requires the number 12737b66cf61Sopenharmony_ciof limes for the selected page size correctly being set). When 12747b66cf61Sopenharmony_cipagination is off, Form Feeds are never sent. 12757b66cf61Sopenharmony_ci 12767b66cf61Sopenharmony_ciLetterAvailable, LegalAvailable, TabloidAvailable, LedgerAvailable, 12777b66cf61Sopenharmony_ciA4Available, A3Available, FanFoldGermanAvailable, 12787b66cf61Sopenharmony_ciFanFoldGermanLegalAvailable, 11x14RotatedAvailable, 12797b66cf61Sopenharmony_ciLegalRotatedAvailable, Custom1Available, Custom2Available, 12807b66cf61Sopenharmony_ciCustom3Available: On: Paper of this size is available; Off: This paper 12817b66cf61Sopenharmony_cisize is not available. 12827b66cf61Sopenharmony_ci 12837b66cf61Sopenharmony_ciLetterNumLines, LegalNumLines, TabloidNumLines, LedgerNumLines, 12847b66cf61Sopenharmony_ciA4NumLines, A3NumLines, FanFoldGermanNumLines, 12857b66cf61Sopenharmony_ciFanFoldGermanLegalNumLines, 11x14RotatedNumLines, 12867b66cf61Sopenharmony_ciLegalRotatedNumLines, Custom1NumLines, Custom2NumLines, 12877b66cf61Sopenharmony_ciCustom3NumLines: Maximum number of text lines fitting on the paper 12887b66cf61Sopenharmony_cisize. Default value is selected assuming 6 lines per inch. Can be any 12897b66cf61Sopenharmony_cipositive number. 12907b66cf61Sopenharmony_ci 12917b66cf61Sopenharmony_ciLetterNumColumns, LegalNumColumns, TabloidNumColumns, 12927b66cf61Sopenharmony_ciLedgerNumColumns, A4NumColumns, A3NumColumns, FanFoldGermanNumColumns, 12937b66cf61Sopenharmony_ciFanFoldGermanLegalNumColumns, 11x14RotatedNumColumns, 12947b66cf61Sopenharmony_ciLegalRotatedNumColumns, Custom1NumColumns, Custom2NumColumns, 12957b66cf61Sopenharmony_ciCustom3NumColumns: Maximum number of columns (characters) fitting on 12967b66cf61Sopenharmony_cithe paper size. Default value is selected assuming 10 characters per 12977b66cf61Sopenharmony_ciinch. Can be any positive number. 12987b66cf61Sopenharmony_ci 12997b66cf61Sopenharmony_ciStandard CUPS options supported: 13007b66cf61Sopenharmony_ci 13017b66cf61Sopenharmony_cipage-ranges, page set, output-order, collate 13027b66cf61Sopenharmony_ci 13037b66cf61Sopenharmony_ciNote that these options and multiple copies are ignored when 13047b66cf61Sopenharmony_cipagination is turned off. 13057b66cf61Sopenharmony_ci 13067b66cf61Sopenharmony_ci 13077b66cf61Sopenharmony_ciBEH - Backend Error Handler wrapper backend 13087b66cf61Sopenharmony_ci=========================================== 13097b66cf61Sopenharmony_ci 13107b66cf61Sopenharmony_ciA wrapper for CUPS backends to make error handling more configurable 13117b66cf61Sopenharmony_ci 13127b66cf61Sopenharmony_ciUsually, if a CUPS backend exits with an error status other than zero 13137b66cf61Sopenharmony_ci(for example if a printer is not turned on or not reachable on the 13147b66cf61Sopenharmony_cinetwork), CUPS disables the print queue and one can only print again 13157b66cf61Sopenharmony_ciif a system administrator re-enables the queue manually. Even 13167b66cf61Sopenharmony_cirestarting CUPS (or rebooting) does not re-enable disabled queues. 13177b66cf61Sopenharmony_ci 13187b66cf61Sopenharmony_ciFor system administrators this can get annoying, for newbie users who 13197b66cf61Sopenharmony_ciare not aware of this problem it looks like that CUPS is severely 13207b66cf61Sopenharmony_cibroken. They remove and re-install print queues, getting on the nerves 13217b66cf61Sopenharmony_ciof distro install support, people, or even switch back to a 13227b66cf61Sopenharmony_ciproprietary operating system. 13237b66cf61Sopenharmony_ci 13247b66cf61Sopenharmony_ciNowadays CUPS allows some configurability to avoid this, setting the 13257b66cf61Sopenharmony_ciError Policy to "retry-job", but this does not allow to retry for 13267b66cf61Sopenharmony_ciinfinitely many times and generally does not allow to change the 13277b66cf61Sopenharmony_cinumber of repetitions. It is also not possible to simply drop the job 13287b66cf61Sopenharmony_ciwithout disabling the queue when CUPS gives up repeating the job. 13297b66cf61Sopenharmony_ci 13307b66cf61Sopenharmony_ciThis script makes the handling of such backend errors more 13317b66cf61Sopenharmony_ciconfigurable, so that the problem can easily be worked around. The new 13327b66cf61Sopenharmony_cipossibilities are: 13337b66cf61Sopenharmony_ci 13347b66cf61Sopenharmony_ci - Let queues simply not being disabled. Simple approach, but job gets 13357b66cf61Sopenharmony_ci lost. 13367b66cf61Sopenharmony_ci 13377b66cf61Sopenharmony_ci - Repeat a given number of times. 13387b66cf61Sopenharmony_ci 13397b66cf61Sopenharmony_ci - Repeat infinitely often, until the job gets finally through. This 13407b66cf61Sopenharmony_ci is the standard of LPRng, and it eliminates loss of the job. 13417b66cf61Sopenharmony_ci 13427b66cf61Sopenharmony_ci - The interval between two attempts to run the backend can also be 13437b66cf61Sopenharmony_ci configured. 13447b66cf61Sopenharmony_ci 13457b66cf61Sopenharmony_ci - Configuration is done independently for each print queue. So local 13467b66cf61Sopenharmony_ci printers and network printers can be treated differently. 13477b66cf61Sopenharmony_ci 13487b66cf61Sopenharmony_ci 13497b66cf61Sopenharmony_ciUsage: 13507b66cf61Sopenharmony_ci 13517b66cf61Sopenharmony_ciActivate "beh" for your print queue(s) with command(s) like this: 13527b66cf61Sopenharmony_ci 13537b66cf61Sopenharmony_cilpadmin -p <queue name> -E -v beh:/<dd>/<att>/<delay>/<originaluri> 13547b66cf61Sopenharmony_ci 13557b66cf61Sopenharmony_ciwith 13567b66cf61Sopenharmony_ci <queue name>: The name of your print queue 13577b66cf61Sopenharmony_ci <dd>: Don't Disable, if "1", beh always exits with zero 13587b66cf61Sopenharmony_ci status, so the queue gets never disabled when the 13597b66cf61Sopenharmony_ci original backend exits with an error. "0" carries 13607b66cf61Sopenharmony_ci the error status of the last call of the backend 13617b66cf61Sopenharmony_ci (after <att> retries) on to CUPS, so the queue 13627b66cf61Sopenharmony_ci usually gets disabled. 13637b66cf61Sopenharmony_ci <att>: Attempts, number of attempts to recall the backend 13647b66cf61Sopenharmony_ci in case of an error. "0" means infinite retries. In 13657b66cf61Sopenharmony_ci this case <dd> gets meaningless. 13667b66cf61Sopenharmony_ci <delay>: Delay between two attempts to call the beckend, to 13677b66cf61Sopenharmony_ci be given in seconds and as an integer number. 13687b66cf61Sopenharmony_ci Meaningless if <att> is one. 13697b66cf61Sopenharmony_ci <originaluri>: The original URI, which your queue had before. Can 13707b66cf61Sopenharmony_ci be determined with "lpstat -v". 13717b66cf61Sopenharmony_ci 13727b66cf61Sopenharmony_ciAll parameters, especially, <dd>, <att>, and <delay> have always to be 13737b66cf61Sopenharmony_cispecified, even if one of them is meaningless due to the setting of 13747b66cf61Sopenharmony_cithe others. 13757b66cf61Sopenharmony_ci 13767b66cf61Sopenharmony_cibeh works with every backend except the "hp" backend of HPLIP, as the 13777b66cf61Sopenharmony_ci"hp" backend repeats failed jobs by itself. 13787b66cf61Sopenharmony_ci 13797b66cf61Sopenharmony_ciExample URIs: 13807b66cf61Sopenharmony_ci 13817b66cf61Sopenharmony_cibeh:/1/3/5/socket://printer:9100 13827b66cf61Sopenharmony_ci 13837b66cf61Sopenharmony_ci On the network printer with host name "printer" it is tried to 13847b66cf61Sopenharmony_ci access 3 times with 5 second delays between the attempts. If the job 13857b66cf61Sopenharmony_ci still fails, the queue is not disabled (and the job discarded). 13867b66cf61Sopenharmony_ci 13877b66cf61Sopenharmony_cibeh:/0/10/60/socket://printer:9100 13887b66cf61Sopenharmony_ci 13897b66cf61Sopenharmony_ci Retry 10 times in one minute intervals, disable the queue when still 13907b66cf61Sopenharmony_ci not succeeding. 13917b66cf61Sopenharmony_ci 13927b66cf61Sopenharmony_cibeh:/1/0/60/usb://Brother/HL-5040%20series 13937b66cf61Sopenharmony_ci 13947b66cf61Sopenharmony_ci On a Brother HL-5040 on the USB try infinitely often until the 13957b66cf61Sopenharmony_ci printer comes back, in intervals of one minute. This way the job 13967b66cf61Sopenharmony_ci does not get lost when the printer is turned off and one can 13977b66cf61Sopenharmony_ci intendedly delay printing by simply switching off the printer. The 13987b66cf61Sopenharmony_ci ideal configuration for desktop printers and/or home users. 13997b66cf61Sopenharmony_ci 14007b66cf61Sopenharmony_ciOriginally this backend was written in Perl and part of the 14017b66cf61Sopenharmony_cifoomatic-filters package. It was not overtaken into cups-filters 14027b66cf61Sopenharmony_citogether with foomatic-rip to avoid the introduction of a dependency 14037b66cf61Sopenharmony_cion Perl. Now it has been re-written in C and so it can be part of 14047b66cf61Sopenharmony_cicups-filters without introducing new dependencies. 14057b66cf61Sopenharmony_ci 14067b66cf61Sopenharmony_ci 14077b66cf61Sopenharmony_ciBRAILLE EMBOSSING 14087b66cf61Sopenharmony_ci================= 14097b66cf61Sopenharmony_ci 14107b66cf61Sopenharmony_cicups-filters also provides filters and drivers for braille 14117b66cf61Sopenharmony_ciembossers. It supports: 14127b66cf61Sopenharmony_ci 14137b66cf61Sopenharmony_ci- Text on all kinds of embossers with generic support 14147b66cf61Sopenharmony_ci- Text and graphics on the Index V3 embossers and above. 14157b66cf61Sopenharmony_ci 14167b66cf61Sopenharmony_ciThis is configured in CUPS just like any printer. Options can then be configured 14177b66cf61Sopenharmony_ciin the standard printer panel, or passed as -o options to the lp command. 14187b66cf61Sopenharmony_ci 14197b66cf61Sopenharmony_ci 14207b66cf61Sopenharmony_ci------------ 14217b66cf61Sopenharmony_ciText support 14227b66cf61Sopenharmony_ci------------ 14237b66cf61Sopenharmony_ci 14247b66cf61Sopenharmony_ciText can be embossed either with no translation on the computer side (the 14257b66cf61Sopenharmony_ciembosser will translate), or with translation on the computer side (thanks to 14267b66cf61Sopenharmony_ciliblouis). It is a matter of running 14277b66cf61Sopenharmony_ci 14287b66cf61Sopenharmony_cilp file.txt 14297b66cf61Sopenharmony_ci 14307b66cf61Sopenharmony_cior even 14317b66cf61Sopenharmony_ci 14327b66cf61Sopenharmony_cilp file.html 14337b66cf61Sopenharmony_cilp file.odt 14347b66cf61Sopenharmony_cilp file.doc 14357b66cf61Sopenharmony_cilp file.rtf 14367b66cf61Sopenharmony_cilp file.docx 14377b66cf61Sopenharmony_cilp file.pdf 14387b66cf61Sopenharmony_ci 14397b66cf61Sopenharmony_ciImportant: it is really preferrable to directly print the document files 14407b66cf61Sopenharmony_cithemselves, and not a pdf output, or printing from the application (which 14417b66cf61Sopenharmony_ciwould first convert to pdf). That way, the braille conversion will have the 14427b66cf61Sopenharmony_ciproper document structure (paragraphs, titles, footnotes, etc.) to produce good 14437b66cf61Sopenharmony_ciquality. 14447b66cf61Sopenharmony_ci 14457b66cf61Sopenharmony_ci 14467b66cf61Sopenharmony_ci-------------------- 14477b66cf61Sopenharmony_ciVector Image support 14487b66cf61Sopenharmony_ci-------------------- 14497b66cf61Sopenharmony_ci 14507b66cf61Sopenharmony_ciVector images can be embossed by converting them to braille dots. 14517b66cf61Sopenharmony_ci 14527b66cf61Sopenharmony_ciThis needs the inkscape package installed. Various input formats are then 14537b66cf61Sopenharmony_cisupported: .svg, .fig, .wmf, .emf, .cgm, .cmx 14547b66cf61Sopenharmony_ci 14557b66cf61Sopenharmony_ciThe conversion assumes that the input is black-on-white. If it is 14567b66cf61Sopenharmony_ciwhite-on-black, the -o Negate option can be used. 14577b66cf61Sopenharmony_ci 14587b66cf61Sopenharmony_ciThis image support is preferred over the generic image support described below, 14597b66cf61Sopenharmony_ciwhich has to reconstruct lines to be embossed. 14607b66cf61Sopenharmony_ci 14617b66cf61Sopenharmony_ci 14627b66cf61Sopenharmony_ci------------- 14637b66cf61Sopenharmony_ciImage support 14647b66cf61Sopenharmony_ci------------- 14657b66cf61Sopenharmony_ci 14667b66cf61Sopenharmony_ciImages can be embossed by converting them to braille dots. 14677b66cf61Sopenharmony_ci 14687b66cf61Sopenharmony_ciThe orientation of the image can be controlled. By default it will be rotate to 14697b66cf61Sopenharmony_cifit the image orientation, i.e. it will be rotate by 90 degree if it is wider 14707b66cf61Sopenharmony_cithan high and the paper is higher than wide, or if vice-versa. Other rotation 14717b66cf61Sopenharmony_cimodes are provided. 14727b66cf61Sopenharmony_ci 14737b66cf61Sopenharmony_ciBy default, the image will be resized to fit the size of the paper. Disabling 14747b66cf61Sopenharmony_cithe resize (fitplot set to No) will crop the image to the paper size. This is 14757b66cf61Sopenharmony_ciuseful for instance when a carefully-drawn image was designed especially for 14767b66cf61Sopenharmony_ciembossing, and thus its pixels should exactly match with braille dots. In such 14777b66cf61Sopenharmony_cicase, edge detection should very probably be disabled too. 14787b66cf61Sopenharmony_ci 14797b66cf61Sopenharmony_ciThe image can be processed for edge detection. When no processing is done (edge 14807b66cf61Sopenharmony_cidetection is configured to "None"), the dark pixels are embossed if the Negate 14817b66cf61Sopenharmony_cioption is off, or the light pixels are embossed if the Negate option is on. When 14827b66cf61Sopenharmony_ciedge processing is done, only the edges of the images will be embossed. The 14837b66cf61Sopenharmony_ciBasic and the Canny algorithms bring differing results. The Basic algorithm 14847b66cf61Sopenharmony_cican be tuned thanks to the edge factor only. The Canny algorithm can also be 14857b66cf61Sopenharmony_cituned: increasing the Upper value will reduce the amount of detected edges (and 14867b66cf61Sopenharmony_civice-versa), increasing the Lower value will reduce the lengths of the detected 14877b66cf61Sopenharmony_ciedges (and vice-versa). The Radius and Sigma parameter control the blurring 14887b66cf61Sopenharmony_ciperformed before edge detection, to improve the result; the Radius parameter 14897b66cf61Sopenharmony_cicontrols how large blurring should be performed, setting it to zero requests 14907b66cf61Sopenharmony_ciautodetection; the Sigma parameter determines how strongly blurring should be 14917b66cf61Sopenharmony_ciperformed. 14927b66cf61Sopenharmony_ci 14937b66cf61Sopenharmony_ciA lot of images formats are support, so one can just run 14947b66cf61Sopenharmony_ci 14957b66cf61Sopenharmony_cilp file.png 14967b66cf61Sopenharmony_cilp file.gif 14977b66cf61Sopenharmony_cilp file.jpg 14987b66cf61Sopenharmony_ci... 14997b66cf61Sopenharmony_ci 15007b66cf61Sopenharmony_ciHere are complete examples for controlling the processing (all options can be 15017b66cf61Sopenharmony_ciomitted, the default values are shown here): 15027b66cf61Sopenharmony_ci 15037b66cf61Sopenharmony_ciEmboss the image without edge detection, as black on white or white on black: 15047b66cf61Sopenharmony_ci 15057b66cf61Sopenharmony_cilp -o "Edge=None" file.png 15067b66cf61Sopenharmony_cilp -o "Edge=None Negate" file.png 15077b66cf61Sopenharmony_ci 15087b66cf61Sopenharmony_ciEmboss the image with edge detection, the default tuning parameters are set 15097b66cf61Sopenharmony_cihere: 15107b66cf61Sopenharmony_ci 15117b66cf61Sopenharmony_cilp -o "Edge=Edge EdgeFactor=1" file.png 15127b66cf61Sopenharmony_cilp -o "Edge=Canny CannyRadius=0 CannySigma=1 CannyLower=10 CannyUpper=30" file.png 15137b66cf61Sopenharmony_ci 15147b66cf61Sopenharmony_ciEmboss the image as it is, without any resize or edge detection, as black on 15157b66cf61Sopenharmony_ciwhite or white on black: 15167b66cf61Sopenharmony_ci 15177b66cf61Sopenharmony_cilp -o "nofitplot Edge=None" file.png 15187b66cf61Sopenharmony_cilp -o "nofitplot Edge=None Negate" file.png 15197b66cf61Sopenharmony_ci 15207b66cf61Sopenharmony_ci------------------------ 15217b66cf61Sopenharmony_ciGeneric embosser support 15227b66cf61Sopenharmony_ci------------------------ 15237b66cf61Sopenharmony_ci 15247b66cf61Sopenharmony_ciIt should be possible to make all embossers use the generic driver. For this to 15257b66cf61Sopenharmony_ciwork, one has to: 15267b66cf61Sopenharmony_ci 15277b66cf61Sopenharmony_ci- configure the embosser itself so that it uses an MIT/NABCC/BRF braille table 15287b66cf61Sopenharmony_ci- add in CUPS a printer with the "Generic" manufacturer and "Braille embosser" 15297b66cf61Sopenharmony_ci model 15307b66cf61Sopenharmony_ci- configure CUPS options according to the embosser settings, so that CUPS knows 15317b66cf61Sopenharmony_ci the page size, braille spacing, etc. 15327b66cf61Sopenharmony_ci 15337b66cf61Sopenharmony_ciThe generic driver can emboss text, as well as images, but images will probably 15347b66cf61Sopenharmony_cibe distorted by the Braille interline spacing. 15357b66cf61Sopenharmony_ci 15367b66cf61Sopenharmony_ci 15377b66cf61Sopenharmony_ci----------------------- 15387b66cf61Sopenharmony_ciIndex embossers support 15397b66cf61Sopenharmony_ci----------------------- 15407b66cf61Sopenharmony_ci 15417b66cf61Sopenharmony_ciSupported models: 15427b66cf61Sopenharmony_ci 15437b66cf61Sopenharmony_ciBasic-S V3/4 15447b66cf61Sopenharmony_ciBasic-D V3/4 15457b66cf61Sopenharmony_ciEverest-D V3/4 15467b66cf61Sopenharmony_ci4-Waves PRO V3 15477b66cf61Sopenharmony_ci4X4 PRO V3 15487b66cf61Sopenharmony_ciBraille Box V4 15497b66cf61Sopenharmony_ci 15507b66cf61Sopenharmony_ciIndex V3 embosser support has been well tested. It supports both text and 15517b66cf61Sopenharmony_cigraphics mode. Embossers with firmware 10.30 and above can be easily configured 15527b66cf61Sopenharmony_cifrom CUPS (paper dimension, braille spacing, etc.). 15537b66cf61Sopenharmony_ci 15547b66cf61Sopenharmony_ciIndex V4 embosser support has not been tested, but is very close to V3 support, 15557b66cf61Sopenharmony_ciso it is probably working fine already. Feedback would be very welcome. 15567b66cf61Sopenharmony_ci 15577b66cf61Sopenharmony_ciTo connect an Index embosser through Ethernet, gather its IP adress, select the 15587b66cf61Sopenharmony_ci"AppSocket/HP JetDirect" network printer protocol, and set 15597b66cf61Sopenharmony_cisocket://the.embosser.IP.address:9100 as Connection URL. 15607b66cf61Sopenharmony_ci 15617b66cf61Sopenharmony_ciThe density of dots for images can easily be chosen from the command line, for 15627b66cf61Sopenharmony_ciinstance: 15637b66cf61Sopenharmony_ci 15647b66cf61Sopenharmony_cilp -o "GraphicDotDistance=160" file.png 15657b66cf61Sopenharmony_ci 15667b66cf61Sopenharmony_cito select 1.6mm dots spacing 15677b66cf61Sopenharmony_ci 15687b66cf61Sopenharmony_ciTroubleshooting: if your embosser starts every document with spurious 15697b66cf61Sopenharmony_ci"TM0,BM0,IM0,OM0" or "TM0,BI0", your embosser is most probably still using an 15707b66cf61Sopenharmony_ciold 10.20 firmware. Please either reflash the embosser with a firmware version 15717b66cf61Sopenharmony_ci10.30 or above, or select the 10.20 firmware version in the "index" panel of the 15727b66cf61Sopenharmony_cicups printer options. 15737b66cf61Sopenharmony_ci 15747b66cf61Sopenharmony_ci---------------------- 15757b66cf61Sopenharmony_ciBraille output options 15767b66cf61Sopenharmony_ci---------------------- 15777b66cf61Sopenharmony_ci 15787b66cf61Sopenharmony_ciThe output can be finely tuned from the standard printing panel, or from the 15797b66cf61Sopenharmony_cicommand-line, the following example selects translation tables for French and 15807b66cf61Sopenharmony_ciGreek, with 2.5mm dot spacing and 5mm line spacing. All options can be omitted, 15817b66cf61Sopenharmony_cithe default values are shown here. 15827b66cf61Sopenharmony_ci 15837b66cf61Sopenharmony_cilp -o "LibLouis=fr-fr-g1 LibLouis2=gr-gr-g1 TextDotDistance=250 LineSpacing=500" file.txt 15847b66cf61Sopenharmony_ci 15857b66cf61Sopenharmony_ci 15867b66cf61Sopenharmony_ci--------------------------------- 15877b66cf61Sopenharmony_ciReworking output before embossing 15887b66cf61Sopenharmony_ci--------------------------------- 15897b66cf61Sopenharmony_ci 15907b66cf61Sopenharmony_ciOne may want to check and modify the .brf or .ubrl output before sending it to 15917b66cf61Sopenharmony_cithe embosser. This can be achieved by first generating the .brf file: 15927b66cf61Sopenharmony_ci 15937b66cf61Sopenharmony_ci /usr/sbin/cupsfilter -m application/vnd.cups-brf -p /etc/cups/ppd/yourprinter.ppd yourdocument.txt > ~/test.brf 15947b66cf61Sopenharmony_ci 15957b66cf61Sopenharmony_ciOne can choose a ppd file and additionally pass -o options to control the 15967b66cf61Sopenharmony_cigenerated output. One can then modify the .brf file with a text editor. One can 15977b66cf61Sopenharmony_cithen emboss it: 15987b66cf61Sopenharmony_ci 15997b66cf61Sopenharmony_ci lp -o document-format=application/vnd.cups-brf ~/test.brf 16007b66cf61Sopenharmony_ci 16017b66cf61Sopenharmony_ci 16027b66cf61Sopenharmony_ciThe same can be achieved for images: 16037b66cf61Sopenharmony_ci 16047b66cf61Sopenharmony_ci /usr/sbin/cupsfilter -m image/vnd.cups-ubrl -p /etc/cups/ppd/yourprinter.ppd yourimage.png > ~/test.ubrl 16057b66cf61Sopenharmony_ci 16067b66cf61Sopenharmony_ci lp -o document-format=image/vnd.cups-ubrl ~/test.ubrl 16077b66cf61Sopenharmony_ci 16087b66cf61Sopenharmony_ci 16097b66cf61Sopenharmony_ci--------------- 16107b66cf61Sopenharmony_ciBRF file output 16117b66cf61Sopenharmony_ci--------------- 16127b66cf61Sopenharmony_ci 16137b66cf61Sopenharmony_ciOne can generate BRF files by adding a virtual BRF printer. 16147b66cf61Sopenharmony_ci 16157b66cf61Sopenharmony_ciWhen creating it in the cups interface, choose the CUPS-BRF local printer, 16167b66cf61Sopenharmony_ciselect the Generic maker, and choose the Generic Braille embosser model. 16177b66cf61Sopenharmony_ci 16187b66cf61Sopenharmony_ciPrinting to the resulting printer will generate a .brf file in a BRF 16197b66cf61Sopenharmony_cisubdirectory of the home directory. 16207b66cf61Sopenharmony_ci 16217b66cf61Sopenharmony_ci 16227b66cf61Sopenharmony_ci---------------- 16237b66cf61Sopenharmony_ciUBRL file output 16247b66cf61Sopenharmony_ci---------------- 16257b66cf61Sopenharmony_ci 16267b66cf61Sopenharmony_ciOne can generate Unicode braille files, not useful for embossing, but which can 16277b66cf61Sopenharmony_cibe easily looked at by sighted people to check for the output. 16287b66cf61Sopenharmony_ci 16297b66cf61Sopenharmony_ciIn the cups interface, create a printer with the CUPS-BRF local printer, 16307b66cf61Sopenharmony_cithe Generic maker, and choose the Generic UBRL generator model. 16317b66cf61Sopenharmony_ci 16327b66cf61Sopenharmony_ciPrinting to the resulting printer will generate a .brf file in a BRF 16337b66cf61Sopenharmony_cisubdirectory of the home directory. 16347b66cf61Sopenharmony_ci 16357b66cf61Sopenharmony_ci 16367b66cf61Sopenharmony_ci---------------------------- 16377b66cf61Sopenharmony_ciRemark about the source code 16387b66cf61Sopenharmony_ci---------------------------- 16397b66cf61Sopenharmony_ci 16407b66cf61Sopenharmony_ciThe file filter/braille/drivers/index/ubrlto4dot.c is used to generate 16417b66cf61Sopenharmony_cithe translation table in 16427b66cf61Sopenharmony_cifilter/braille/drivers/index/imageubrltoindexv[34]. It is included as 16437b66cf61Sopenharmony_ci"source code" for these two files, even if actually running the 16447b66cf61Sopenharmony_cigeneration in the Makefile is more tedious than really useful. 16457b66cf61Sopenharmony_ci 16467b66cf61Sopenharmony_ci 16477b66cf61Sopenharmony_ci---- 16487b66cf61Sopenharmony_ciTODO 16497b66cf61Sopenharmony_ci---- 16507b66cf61Sopenharmony_ci 16517b66cf61Sopenharmony_ci- Test whether one wants to negate, e.g. to emboss as few dots as possible 16527b66cf61Sopenharmony_ci- textubrltoindex when liblouis tools will be able to emit 8dot braille 16537b66cf61Sopenharmony_ci 1654