1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195
|
README - OpenPrinting CUPS Filters v1.0.18 - 2012-05-16
-------------------------------------------------------
Looking for compile instructions? Read the file "INSTALL.txt"
instead...
INTRODUCTION
CUPS is a standards-based, open source printing system developed by Apple
Inc. for Mac OS® X and other UNIX®-like operating systems. CUPS uses the
Internet Printing Protocol ("IPP") and provides System V and Berkeley
command-line interfaces, a web interface, and a C API to manage printers and
print jobs.
This distribution contains backends, filters, and other software that was
once part of the core CUPS distribution but is no longer maintained by
Apple Inc. In addition it contains additional filters developed
independently of Apple, especially filters for the PDF-centric printing
workflow introduced by OpenPrinting.
From CUPS 1.6.0 on, this package will be required for using printer drivers
with CUPS under Linux. With CUPS 1.5.x and earlier this package can be used
optionally to switch over to PDF-based printing. In that case some filters
are provided by both CUPS and this package. Then the filters of this package
should be used.
For compiling and using this package CUPS, Poppler, libjpeg, libpng,
libtiff, libijs, freetype, fontconfig, and liblcms (liblcms2 recommended)
are needed. It is highly recommended, especially if non-PostScript printers
are used, to have Ghostscript, foomatic-filters, and foomatic-db installed.
CUPS, this package, and Ghostscript contain some rudimentary printer
drivers, see http://www.openprinting.org/drivers/ for a more
comprehensive set of printer drivers for Linux.
See
http://www.linuxfoundation.org/collaborate/workgroups/openprinting/pdf_as_standard_print_job_format
for information about the PDF-based printing workflow.
Report bugs to
https://bugs.linuxfoundation.org/
Choose "OpenPrinting" as the product and "cups-filters" as the component.
See the "LICENSE.txt" files for legal information.
IMAGE PRINTING DEFAULT CHANGED TO "SCALE TO FIT"
Compared to the PostScript-based original CUPS filters there is a
change of deafults: The imagetopdf and imagetoraster filters print
in "scale-to-fit" mode (image is scaled to fill one page but
nothing of the image being cut off) by default.
This is done to support photo printing via AirPrint. The photo
apps on Apple's iOS devices send print jobs as JPEG images and do
not allow to set any options like "scaling" or the page size. With
"scale-to-fit" mode set by default, the iOS photos come out on one
page, as expected.
To get back to the old behavior, supply one of the options
"nofitplot" "filplot=Off", "nofit-to-page", or "fit-to-page=Off".
POSTSCRIPT PRINTING RENDERER AND RESOLUTION SELECTION
If you use CUPS with this package and a PostScript printer then
the included pdftops filter converts the print job data which is
in PDF format into PostScript. By default, the PostScript is
generated with Ghostscript's "ps2write" output device, which
generates a DSC-conforming PostScript with compressed embedded
fonts and compressed page content. This is resource-saving and
leads to fast wire transfer of print jobs to the printer.
Unfortunately, Ghostscript's PostScript output is not compatible
with some printers due to interpreter bugs in the printer and in
addition, processing (by Ghostscript or by the printer's
interpreter) can get very slow with high printing resolutions when
parts of the incoming PDF file are converted to bitmaps if they
contain graphical structures which are not supported by
PostScript. The bitmap problem especially occurs on input files
with transparency, especially also the ones produced by Cairo
(evince and many other GNOME/GTK applications) which unnecessarily
introduces transparency even if the input PDF has no transparency.
Therefore there are two possibilities to configure pdftops at
runtime:
1. Selection of the renderer: Ghostscript or Poppler
Ghostscript has better color management and is generally optimized
more for printing. Poppler produces a PostScript which is
compatible with more buggy built-in PostScript interpreters of
printers and it leads to a somewhat quicker workflow when
graphical structures of the input PDF has to be turned into
bitmaps.
The selection is done by the "pdftops-renderer" option, setting it
to "gs" or "pdftops":
Per-job: lpr -o pdftops-renderer=pdftops ...
Per-queue default: lpadmin -p printer -o pdftops-renderer-default=gs
Remove default: lpadmin -p printer -R pdftops-renderer-default
By default, pdftops uses Ghostscript if this does not get changed
at compile time, for example by the Linux distribution vendor.
2. Limitation of the image rendering resolution
If graphical structures of the incoming PDF file have to be
converted to bitmaps due to limitations of PostScript, the
conversion of the file by pdftops or the rendering by the printer
can get too slow if the bitmap resolution is too high or the
printout quality can degrade if the bitmap resolution is too low.
By default, pdftops tries to find out the actual printing
resolution and sets the resolution for bitmap generation to the
same value. If it cannot find the printing resolution, it uses 300
dpi. It never goes higher than a limit of 1440 dpi. Note that this
default limit can get changed at compile time, for example by the
Linux distribution vendor.
The resolution limit for bitmaps can be changed to a lower or
higher value, or be set to unlimited. This is done by the option
"pdftops-max-image-resolution-default", setting it to the desired
value (in dpi) or to zero for unlimited. It can be used per-job or
as per-queue default as the "pdftops-renderer" option described
above.
POSTSCRIPT PRINTING DEBUG MODE
Sometimes a PostScript printer's interpreter errors, crashes, or
somehow else misbehaves on Ghostscript's output. To find
workarounds (currently we have already workarounds for Brother and
Kyocera) it is much easier to work with uncompressed PostScript.
To get uncompressed PostScript as output, send a job with the
"psdebug" option, with commands like the following:
lpr -P <printer> -o psdebug <file>
lp -d <printer> -o psdebug <file>
If you want to send your job out of a desktop application, run
lpoptions -p <printer> -o psdebug
to make "psdebug" a personal default setting for you.
To extract the PostScript output for a developer to analyse it,
clone your print queue to a one which prints into a file:
cupsctl FileDevice=yes
lpadmin -p test -E -v file:/tmp/printout \
-P /etc/cups/ppd/<name of original queue>.ppd
and print into this queue as described above. The PostScript
output is in /tmp/printout after the job has completed.
This option does not change anything if Poppler's pdftops is used
as renderer.
CUPS FILTERS FOR PDF AS STANDARD PRINT JOB FORMAT
Here is documentation from the former CUPS add-on tarball with the filters
for the PDF-based printing workflow: imagetopdf, texttopdf,
pdftopdf, pdftoraster, pdftoopvp, and pdftoijs
The original filters are from http://sourceforge.jp/projects/opfc/
NOTE: the texttops and imagetops filters shipping with this package
are simple wrapper scripts for backward compatibility with third-party
PPD files and custom configurations. There are not referred to in the
cupsfilters.convs file and therefore not used by the default
configuration. Direct conversion of text or images to PostScript is
deprecated in the PDF-based printing workflow. So do not use these
filters when creating new PPDs or custom configurations. The parameters
for these filters are the same as for texttopdf and imagetopdf (see
below) as the ...tops filter calls the ....topdf filter plus
Ghostscript's pdf2ps.
IMAGETOPDF
1. INTRODUCTION
This program is "imagetopdf". "imagetopdf" is a CUPS filter which reads
a single image file, converts it into a PDF file and outputs it to stdout.
This program accepts the following image file format;
gif, png, jpeg, tiff, photocd, portable-anymap, portable-bitmap,
portable-graymap, portable-pixmap, sgi-rgb, sun-raster, xbitmap,
xpixmap, xwindowdump
xbitmap, xpixmap and xwindowdump images are converted into png images by
the "convert" command. Other kinds of image file format can be supported
if the "convert" command support them.
Output PDF file format conforms to PDF version 1.3 specification, and
input image is converted and contained in the output PDF file as a binary
format non-compression image.
"imagetopdf" may outputs multiple pages if the input image exceeds page
printable area.
2. LICENSE
"imagetopdf.c" is under the CUPS license. See the "LICENSE.txt" file.
For other files, see the copyright notice and license of each file.
3. COMMAND LINE
"imagetopdf" is a CUPS filter, and the command line arguments, environment
variables and configuration files are in accordance with the CUPS filter
interface.
imagetopdf <job> <user> <title> <num-copies> <options> [<filename>]
"imagetopdf" ignores <job> and <user>.
<title> is appended into the PDF dictionary as /Title.
<num-copies> specifies the number of document copies.
<options> is a CUPS option list.
<filename> is an input image file name.
When omit the <filename>, "imagetopdf" reads an image file from stdin.
4. ENVIRONMENT VARIABLES
This program refers the following environment variable;
PPD: PPD file name of the printer.
5. COMMAND OPTIONS
"imagetopdf" accepts the following CUPS standard options;
fitplot
mirror
PageSize
page-left, page-right, page-bottom, page-top
OutputOrder
Collate
sides
cupsEvenDuplex
position
scaling
ppi
natural-scaling
landscape
orientation-requested
See the CUPS documents for details of these options.
6. KNOWN PROBLEMS
Problem:
PBM and SUN raster images can not be printed.
Solution:
Due to the CUPS libcupsimage library's bug. Update the CUPS on your system.
7. INFORMATION FOR DEVELOPERS
Following information is for developers, not for driver users.
7.1 Options handled by a printer or "imagetopdf"
Following options are handled by a printer or "imagetopdf".
Collate, Copies, Duplex, OutputOrder
Which handles these options depends on following options and attributes.
Collate, Copies, Duplex, OutputOrder, cupsEvenDuplex, cupsManualCopies
"imagetopdf" judges whether a printer can handle these options according to
the followings option settings in a PPD file.
Collate:
If Collate is defined, "imagetopdf" judges the printer supports Collate.
Copies:
If cupsManualCopies is defined as False, "imagetopdf" judges the printer
does not support Copies feature.
Duplex:
If Duplex is defined, "imagetopdf" judges the printer supports Duplex.
If cupsEvenDuplex is True, Number of pages must be even.
OutputOrder:
If OutputOrder is defined, "imagetopdf" judges the printer supports
OutputOrder.
If the printer cannot handle these options, "imagetopdf" handles it.
Following pseudo program describes how "imagetopdf" judges to handle
these options.
Variables
Copies : specified Copies
Duplex : specified Duplex
Collate : specified Collate
OutputOrder : specified OutputOrder
EvenDuplex : specified cupsEvenDuplex
pages : number of pages
number_up : specified number-up
device_copies : Copies passed to the printer
device_duplex : Duplex passed to the printer
device_collate : Collate passed to the printer
device_outputorder : OutputOrder passed to the printer
soft_copies : copies by imagetopdf
device_copies = 1;
device_duplex = False;
device_collate = False;
device_outputorder = False;
if (Copies == 1) {
/* Collate is not needed. */
Collate = False;
}
if (!Duplex) {
/* EvenDuplex is not needed */
EvenDuplex = False;
}
if (Copies > 1 && the printer can handle Copies) device_copies = Copies;
if (Duplex && the printer can handle Duplex) {
device_duplex = True;
} else {
/* imagetopdf cannot handle Duplex */
}
if (Collate && the printer can handle Collate) device_collate = True;
if (OutputOrder == Reverse && the printer can handle OutputOrder)
device_outputorder = True;
if (Collate && !device_collate) {
/* The printer cannot handle Collate.
So imagetopdf handle Copies */
device_copies = 1;
}
if (device_copies != Copies /* imagetopdf handle Copies */ && Duplex)
/* Make imagetopdf handle Collate, otherwise both paper side may have
same page */
Collate = True;
device_collate = False;
}
if (Duplex && Collate && !device_collate) {
/* Handle EvenDuplex, otherwise the last page has
the next copy's first page in the other side of the paper. */
EvenDuplex = True;
}
if (Duplex && OutputOrder == Reverse && !device_outputorder) {
/* Handle EvenDuplex, otherwise the first page's other side of paper
is empty. */
EvenDuplex = True;
}
soft_copies = device_copies > 1 ? 1 : Copies;
7.2 JCL
When you print PDF files to a PostScript(PS) printer, you can specify
device options in PS. In this case, you can write PS commands in a PPD file
like as follows.
*OpenUI *Resolution/Resolution : PickOne
*DefaultResolution: 600
*Resolution 300/300 dpi: "<</HWResolution[300 300]>>setpagedevice"
*Resolution 600/600 dpi: "<</HWResolution[600 600]>>setpagedevice"
*CloseUI: *Resolution
However, if options cannot be described in PS file, you can write JCLs
as follows;
*JCLOpenUI *JCLFrameBufferSize/Frame Buffer Size: PickOne
*DefaultJCLFrameBufferSize: Letter
*OrderDependency: 20 JCLSetup *JCLFrameBufferSize
*JCLFrameBufferSize Off: '@PJL SET PAGEPROTECT = OFF<0A>'
*JCLFrameBufferSize Letter: '@PJL SET PAGEPROTECT = LTR<0A>'
*JCLFrameBufferSize Legal: '@PJL SET PAGEPROTECT = LGL<0A>'
*JCLCloseUI: *JCLFrameBufferSize
Because PDF cannot specify device options in a PDF file, you have to define
all the device options as JCLs.
When a printer does not support PS nor PDF, you can use Ghostscript (GS).
In this case, you can specify device options like a PS printer.
If you want to use the same printer and same PPD file for both PDF and PS
printing, when you print a PS file, you can specify that GS handles it,
and when you print a PDF file, you can also specify that PDF filters handle
it in the same PPD file. However in this case, previous methods is not
appropriate to specify device options.
So, "imagetopdf" handles this case as follows;
(In following pseudo program, JCL option is an option specified with JCLOpenUI)
if (Both JCLBegin and JCLToPSInterpreter are specified in the PPD file) {
output JCLs that marked JCL options.
}
if (pdftopdfJCLBegin attribute is specified in the PPD file) {
output it's value
}
if (Copies option is specified in the PPD file) {
mark Number of copies specified
} else if (pdftopdfJCLCopies is specified in the PPD file) {
output JCL specified with JCLCopies
}
for (each marked options) {
if (pdftopdfJCL<marked option's name> is specified in the PPD file) {
output it's value as a JCL
} else if (pdftopdfJCLBegin attributes is specified in the PPD file) {
output "<option's name>=<marked choice>;" as a JCL
}
}
output NEWLINE
Thus, if you want to use both PDF filters and GS by single PPD file,
what you should do is to add the following line in the PPD file;
*pdftopdfJCLBegin: "pdftoopvp jobInfo:"
Note:
If you specify JCLBegin, you have to specify JCLToPSInterpreter as well.
Note:
When you need to specify the value which is different from the choosen
value based on the PPD into the jobInfo, you have to specify the values
with the key started by "pdftopdfJCL" string.
For example, if the page size is defined in a PPD file as following;
*OpenUI *PageSize/Page Size: PickOne
*DefaultPageSize: A4
*PageSize A4/A4:
*PageSize Letter/US Letter:
*CloseUI: *PageSize
if you choose the page size "Letter", the string "PageSize=Letter;" is
added to jobInfo. On the other hand, if the driver requires the different
value for the "Letter" size, for instance driver requires "PS=LT;"
instead of "PageSize=Letter;" as the jobInfo value, the PPD file has to
be defined as following;
*OpenUI *PageSize/Page Size: PickOne
*DefaultPageSize: A4
*PageSize A4/A4:
*pdftopdfJCLPageSize A4/A4: "PS=A4;"
*PageSize Letter/US Letter:
*pdftopdfJCLPageSize Letter/US Letter: "PS=LT;"
*CloseUI: *PageSize
7.3 Temporally files location
"imagetopdf" creates temporally files if needed. Temporary files are created
in the location specified by TMPDIR environment variable. Default location
is "/tmp".
PDFTOPDF
1. INTRODUCTION
There are two executable programs, "pdftopdf" and "pdf2pdf", in this package.
"pdftopdf" is a filter for CUPS. It reads PDF files, changes page layout
and output a new PDF file. "pdf2pdf" is a user command version of "pdftopdf".
This document describes about only "pdftopdf". See man/pdf2pdf.1 for "pdf2pdf".
When a input PDF file which is given to "pdftopdf" does not include some
required fonts, and if you set the font embedding option, "pdftopdf" embed
fonts in the new PDF file
"pdftopdf" finds fonts to embed by fontconfig library.
"pdftopdf" now embed only TrueType format fonts.
PDF Standard fonts are not embedded.
Note: Do not embed fonts that the font licenses inhibit embedding.
"pdftopdf" does not support functions that are not related to printing
features, including interactive features and document interchange features.
Many of these operators and sections are just ignored.
Some of these may be output, but those functions are not assured.
Encryption feature is not supported.
2. NATIVE PDF PRINTER SUPPORT
pdftopdf introduces native PDF printer support to CUPS for the first
time. PPD files must have a line
*cupsFilter: "application/vnd.cups-pdf 0 -"
and use the "*JCLToPDFInterpreter:" keyword, for example:
*JCLBegin: "<1B>%-12345X@PJL JOB<0A>"
*JCLToPDFInterpreter: "@PJL ENTER LANGUAGE = PDF <0A>"
*JCLEnd: "<1B>%-12345X@PJL EOJ <0A><1B>%-12345X"
They MUST NOT accept PostScript as input data format and will not work
with stock CUPS. They will need cups-filters (which implements the PDF-
based printing workflow) to work.
Options must not be implemented by specifying PostScript code to
inject. They must be injecting JCL code ("*JCLOpenUI:
... ... *JCLCloseUI: ...").
A sample PPD file, HP-Color_LaserJet_CM3530_MFP-PDF.ppd is included.
3. LICENSE
Almost all source files are under MIT like license. However,
"pdftopdf" links some "poppler" libraries, and these files are under
GNU public license. See copyright notice of each file for details.
4. COMMAND LINE
"pdftopdf" is a CUPS filter, and the command line arguments, environment
variables and configuration files are in accordance with the CUPS filter
interface.
pdftopdf <job> <user> <title> <num-copies> <options> [<filename>]
"pdftopdf" ignores <job> and <user>.
<title> is appended into the PDF dictionary as /Title.
<num-copies> specifies the number of document copies.
<options> is a CUPS option list.
<filename> is an input PDF file name.
When omit the <filename>, "pdftopdf" reads a PDF file from stdin,
and save it as a temporary file.
CUPS options defined in <options> are delimited by space. Boolean
type CUPS option is defined only by the option key, and other type
CUPS option are defined by pairs of key and value, <key>=<value>.
5. COMMAND OPTIONS
"pdftopdf" accepts the following CUPS standard options;
fiplot
mirror
PageSize
page-left, page-right, page-bottom, page-top
number-up
number-up-layout
page-border
OutputOrder
page-set
page-ranges
Collate
sides
cupsEvenDuplex
See the CUPS documents for details of these options.
Margin given by the page-left, page-right, page-bottom and page-top is
valid when fiplot or number-up option is set.
"pdftopdf" accepts the following original options;
pdftopdfFontEmbedding
Boolean option.
Force "pdftopdf" to embed fonts. "pdftopdf" does not embed fonts by default.
pdftopdfFontEmbeddingWhole
Boolean option.
Force "pdftopdf" to embed whole fonts.
"pdftopdf" does not embed whole fonts by default.
If this option is false, "pdftopdf" embed subset of the fonts.
This option is valid only when the pdftopdfFontEmbedding option is true.
pdftopdfFontEmbeddingPreLoad
Boolean option.
Force "pdftopdf" to embed fonts specified as pre-loaded fonts in a PPD file.
"pdftopdf" does not embed pre-loaded fonts by default.
If this option is false, pdftopdf does not embed pre-loaded fonts.
This option is valid only when the pdftopdfFontEmbedding option is true.
pdftopdfFontCompress
Boolean option.
Force "pdftopdf" to compress embed fonts.
"pdftopdf" does not compress embed fonts by default.
This option is valid only when the pdftopdfFontEmbedding option is true.
pdftopdfContentsCompress
Boolean option.
Force "pdftopdf" to compress page contents.
"pdftopdf" does not compress page contents by default.
pdftopdfJCLBegin
Boolean option.
Force "pdftopdf" to create JCL info for the following PDF filter
"pdftoopvp".
6. INFORMATION FOR DEVELOPERS
Following information is for developers, not for driver users.
6.1 Options handled by a printer or "pdftopdf"
Following options are handled by a printer or "pdftopdf".
Collate, Copies, Duplex, OutputOrder
Which handles these options depends on following options and attributes.
Collate, Copies, Duplex, OutputOrder, cupsEvenDuplex, cupsManualCopies
"pdftopdf" judges whether a printer can handle these options according to
the followings option settings in a PPD file.
Collate:
If Collate is defined, "pdftopdf" judges the printer supports Collate.
Copies:
If cupsManualCopies is defined as False, "pdftopdf" judges the printer
does not support Copies feature.
Duplex:
If Duplex is defined, "pdftopdf" judges the printer supports Duplex.
If cupsEvenDuplex is True, Number of pages must be even.
OutputOrder:
If OutputOrder is defined, "pdftopdf" judges the printer supports
OutputOrder.
If the printer cannot handle these options, "pdftopdf" handles it.
Following pseudo program describes how "pdftopdf" judges to handle
these options.
Variables
Copies : specified Copies
Duplex : specified Duplex
Collate : specified Collate
OutputOrder : specified OutputOrder
EvenDuplex : specified cupsEvenDuplex
pages : number of pages
number_up : specified number-up
device_copies : Copies passed to the printer
device_duplex : Duplex passed to the printer
device_collate : Collate passed to the printer
device_outputorder : OutputOrder passed to the printer
soft_copies : copies by pdftopdf
device_copies = 1;
device_duplex = False;
device_collate = False;
device_outputorder = False;
if (Copies == 1) {
/* Collate is not needed. */
Collate = False;
}
if (!Duplex) {
/* EvenDuplex is not needed */
EvenDuplex = False;
}
if (Copies > 1 && the printer can handle Copies) device_copies = Copies;
if (Duplex && the printer can handle Duplex) {
device_duplex = True;
} else {
/* pdftopdf cannot handle Duplex */
}
if (Collate && the printer can handle Collate) device_collate = True;
if (OutputOrder == Reverse && the printer can handle OutputOrder)
device_outputorder = True;
if (Collate && !device_collate) {
/* The printer cannot handle Collate.
So pdftopdf handle Copies */
device_copies = 1;
}
if (device_copies != Copies /* pdftopdf handle Copies */ && Duplex)
/* Make pdftopdf handle Collate, otherwise both paper side may have
same page */
Collate = True;
device_collate = False;
}
if (Duplex && Collate && !device_collate) {
/* Handle EvenDuplex, otherwise the last page has
the next copy's first page in the other side of the paper. */
EvenDuplex = True;
}
if (Duplex && OutputOrder == Reverse && !device_outputorder) {
/* Handle EvenDuplex, otherwise the first page's other side of paper
is empty. */
EvenDuplex = True;
}
soft_copies = device_copies > 1 ? 1 : Copies;
6.2 JCL
When you print PDF files to a PostScript(PS) printer, you can specify
device options in PS. In this case, you can write PS commands in a PPD file
like as follows.
*OpenUI *Resolution/Resolution : PickOne
*DefaultResolution: 600
*Resolution 300/300 dpi: "<</HWResolution[300 300]>>setpagedevice"
*Resolution 600/600 dpi: "<</HWResolution[600 600]>>setpagedevice"
*CloseUI: *Resolution
However, if options cannot be described in PS file, you can write JCLs
as follows;
*JCLOpenUI *JCLFrameBufferSize/Frame Buffer Size: PickOne
*DefaultJCLFrameBufferSize: Letter
*OrderDependency: 20 JCLSetup *JCLFrameBufferSize
*JCLFrameBufferSize Off: '@PJL SET PAGEPROTECT = OFF<0A>'
*JCLFrameBufferSize Letter: '@PJL SET PAGEPROTECT = LTR<0A>'
*JCLFrameBufferSize Legal: '@PJL SET PAGEPROTECT = LGL<0A>'
*JCLCloseUI: *JCLFrameBufferSize
For PostScript printers all these options are handled by the pdftops
filter which is the PostScript printer driver in the PDF-based
printing workflow.
If you have a native PDF printer you cannot use options which inject
PostScript code into the data stream, you have to define all options
with JCL. Only in this case pdftopdf adds the JCL header and trailer
to the PDF job. Native PDF PPDs with JCL options are recognized by the
"*JCLToPDFInterpreter:" keyword, for example with the following lines:
*JCLBegin: "<1B>%-12345X@PJL JOB<0A>"
*JCLToPDFInterpreter: "@PJL ENTER LANGUAGE = PDF <0A>"
*JCLEnd: "<1B>%-12345X@PJL EOJ <0A><1B>%-12345X"
To get the correct CUPS filter chain for them, they need the following
line:
*cupsFilter: "application/vnd.cups-pdf 0 -"
and NO "*cupsFilter:" line which accepts PostScript input.
A sample PPD file for a native PDF printer,
HP-Color_LaserJet_CM3530_MFP-PDF.ppd is included.
When a printer does not support PS nor PDF, you can use Ghostscript (GS).
In this case, you can specify device options like a PS printer.
If you want to use the same printer and same PPD file for both PDF and PS
printing, when you print a PS file, you can specify that GS handles it,
and when you print a PDF file, you can also specify that PDF filters handle
it in the same PPD file. However in this case, previous methods is not
appropriate to specify device options.
So, "pdftopdf" handles this case as follows;
(In following pseudo program, JCL option is a option specified with JCLOpenUI)
if (Both JCLBegin and JCLToPDFInterpreter are specified in the PPD file) {
output JCLs that marked JCL options.
}
if (pdftopdfJCLBegin attribute is specified in the PPD file) {
output it's value
}
if (Copies option is specified in the PPD file) {
mark Number of copies specified
} else if (pdftopdfJCLCopies is specified in the PPD file) {
output JCL specified with JCLCopies
}
for (each marked options) {
if (pdftopdfJCL<marked option's name> is specified in the PPD file) {
output it's value as a JCL
} else if (pdftopdfJCLBegin attributes is specified in the PPD file) {
output "<option's name>=<marked choice>;" as a JCL
}
}
output NEWLINE
Thus, if you want to use both PDF filters and GS by single PPD file,
what you should do is to add the following line in the PPD file;
*pdftopdfJCLBegin: "pdftoopvp jobInfo:"
Note:
If you specify JCLBegin, you have to specify JCLToPDFInterpreter as well.
Note:
When you need to specify the value which is different from the choosen
value based on the PPD into the jobInfo, you have to specify the values
with the key started by "pdftopdfJCL" string.
For example, if the page size is defined in a PPD file as following;
*OpenUI *PageSize/Page Size: PickOne
*DefaultPageSize: A4
*PageSize A4/A4:
*PageSize Letter/US Letter:
*CloseUI: *PageSize
if you choose the page size "Letter", the string "PageSize=Letter;" is
added to jobInfo. On the other hand, if the driver requires the different
value for the "Letter" size, for instance driver requires "PS=LT;"
instead of "PageSize=Letter;" as the jobInfo value, the PPD file has to
be defined as following;
*OpenUI *PageSize/Page Size: PickOne
*DefaultPageSize: A4
*PageSize A4/A4:
*pdftopdfJCLPageSize A4/A4: "PS=A4;"
*PageSize Letter/US Letter:
*pdftopdfJCLPageSize Letter/US Letter: "PS=LT;"
*CloseUI: *PageSize
6.3 Special PDF comment
"pdftopdf" outputs the following special comments from the 4th line in the
created PDF data.
%%PDFTOPDFNumCopies : <copies> --- <copies> specified Number of Copies
%%PDFTOPDFCollate : <collate> --- <collate> is true or false
6.4 Temporally files location
"pdftopdf" creates temporally files if needed. Temporary files are created
in the location specified by TMPDIR environment variable. Default location
is "/tmp".
TEXTTOPDF
This implements a texttopdf filter, and is derived from cups' texttops.
To configure:
-------------
- texttopdf uses CUPS_DATADIR/charset/pdf.utf-8 for font configuration
(when utf-8 was requested as charset). The font names given there are
used as fontconfig selectors; the best matching font, that is both
monospaced and in a supported format (TTC, TTF or OTF) will then be used.
- As a special exception, all fontnames that start with a '.' or '/' are
considered filenames, and fontconfig is skipped; the name is used directly
for loading the font file.
- Implementation note: TrueType Collections (.TTC) are internally handled
by appending '/' and the index of the font inside the collection to
the filename (e.g. to use the second font of uming.ttc, the filename
uming.ttc/1 must be given to the fontembed-library).
By appending the index-field returned from fontconfig, this is completely
transparent to the user (but currently not widely tested).
- You may look at the two examples: pdf.utf-8.simple and pdf.utf-8.heavy.
To use:
-------
The filter is called just like any other cups filter. Have a
look at test.sh for example.
Known Issues
------------
- Text extraction does not work (at least for pdftotext from xpdf)
for the resulting pdfs.
- OTF(CFF) embedding currently does not subset the fonts.
- Text wrapping in pretty-printing mode does not respect double-wide
characters (CJK), and thus produce wrong results (wrap too late)
for lines where they occur. The fix is not trivial, since all the
pretty-printing processing is done without knowledge of / prior to
the font configuration (which is where single or double width
code-ranges are specified).
- The hebrew example in test5.pdf shows one of our limitations:
Compose glyphs are not composed with the primary glyph but printed
as separate glyphs.
Further Infos
-------------
Font embedding is handled by libfontembed in the filter/fontembed
subdirectory.
Please report all bugs to https://bugs.linuxfoundation.org/, product
"OpenPrinting", component "cups-filters".
PDFTORASTER
1. INTRODUCTION
"pdftoraster" is a filter for CUPS. It reads PDF files, convert it and
output CUPS raster.
"pdftoraster" does not support functions that are not related to printing
features, including interactive features and document interchange features.
Many of these operators and sections are just ignored.
Some of these may be output, but those functions are not assured.
Encryption feature is not supported.
2. LICENSE
Almost source files are under MIT like license. However, "pdftoraster" links
some "poppler" libraries, and these files are under GNU public license.
See copyright notice of each file for details.
3. COMMAND LINE
"pdftoraster" is a CUPS filter, and the command line arguments, environment
variables and configuration files are in accordance with the CUPS filter
interface.
pdftoraster <job> <user> <title> <num-copies> <options> [<filename>]
"pdftoraster" ignores <job> and <user>.
<title> is appended into the PDF dictionary as /Title.
<num-copies> specifies the number of document copies.
<options> is a CUPS option list.
<filename> is an input PDF file name.
When omit the <filename>, "pdftoraster" reads a PDF file from the stdin,
and save it as a temporary file.
4. ENVIRONMENT VARIABLES
This program refers the following environment variable;
PPD: PPD file name of the printer.
5. COMMAND OPTIONS
See CUPS documents for details.
6. INFORMATION FOR DEVELOPERS
Following information is for developers, not for driver users.
6.1 Options handled by a printer or "pdftoraster"
"pdftopdf" outputs the following special comments from the 4th line in the
created PDF data.
%%PDFTOPDFNumCopies : <copies> --- <copies> specified Number of Copies
%%PDFTOPDFCollate : <collate> --- <collate> is true or false
"pdftoraster" overrides the command line options by above two option's values.
6.2 Temporally files location
"pdftoraster" creates temporally files if needed. Temporary files are created
in the location specified by TMPDIR environment variable. Default location
is "/tmp".
PDFTOIJS
1. INTRODUCTION
"pdftoijs" is a filter for CUPS. It reads PDF files, converts it
and sends it to an IJS server.
2. LICENSE
Almost source files are under MIT like license. However, "pdftoijs" links
some "poppler" libraries, and these files are under GNU public license.
See copyright notice of each file for details.
3. COMMAND LINE
"pdftoijs" is a CUPS filter, and the command line arguments, environment
variables and configuration files are in accordance with the CUPS filter
interface.
pdftoijs <job> <user> <title> <num-copies> <options> [<filename>]
"pdftoijs" ignores <job> and <user>.
<title> is appended into the PDF dictionary as /Title.
<num-copies> specifies the number of document copies.
<options> is a CUPS option list.
<filename> is an input PDF file name.
When omit the <filename>, "pdftoijs" reads a PDF file from the stdin,
and save it as a temporary file.
4. ENVIRONMENT VARIABLES
This program refers the following environment variable;
PPD: PPD file name of the printer.
5. NEW PPD KEYWORDS
*ijsServer : the ijsserver executable
*ijsManufacturer, *ijsModel : as used by the ijs server
*ijsColorspace : the desired output colorspace, one of
'rgb'
'cmyk' (availability depending on poppler compile-options)
'white1', 'black1': 1-bit normal/inverted
'white8', 'black8': 8-bit greyscale normal/inverted
*ijsResolution [option]=[choice]: the desired output resolution e.g. "600 600"
*ijsParams [option]=[choice]: custom ijs parameters, separated by ','
(to escape: use \,)
6. COMMAND OPTIONS
(See CUPS documents for details.)
ijsOutputFile : the destination file, stdout otherwise
7. INFORMATION FOR DEVELOPERS
Following information is for developers, not for driver users.
7.1 Temporally files location
"pdftoijs" creates temporally files if needed. Temporary files are created
in the location specified by TMPDIR environment variable. Default location
is "/tmp".
PDFTOOPVP
1. INTRODUCTION
"pdftoopvp" is a CUPS filter which reads PDF file, renders pages and
outputs PDL to a printer driver which is compliant with the OpenPrinting
Vector Printer Driver Interface "opvp".
2. CONFIGURATION
"pdftoopvp" refers the poppler configuration file. Be aware that poppler
uses "fontconfig" for its font configuration.
3. JCL
When "pdftoopvp" reads a PDF file from stdin, "pdftoopvp" handles the data
prior to PDF header (%PDF ...) as JCL options. JCL options for "pdftoopvp"
must begin with "pdftoopvp jobInfo:". "pdftoopvp" passes the option string
just after ":" to the driver as the jobInfo option.
4. COMMAND LINE
"pdftoopvp" is a CUPS filter, and the command line arguments,
environment variables and configuration files are in accordance with
the CUPS filter interface.
pdftoopvp <job> <user> <title> <num-copies> <options> [<filename>]
"pdftoopvp" ignores <job>, <user>, <title> and <num-copies>.
<options> is a CUPS option list.
When omit the <filename>, "pdftoopvp" reads a PDF file from stdin,
and save it as a temporary file.
CUPS options defined in <options> are delimited by space. Boolean
type CUPS option is defined only by the option key, and other type
CUPS option are defined by pairs of key and value, <key>=<value>.
5. COMMAND OPTIONS
"pdftoopvp" accepts the following CUPS standard options;
Resolution=<int>
Specifies a printer resolution in dpi.
When this option is omitted, the resolution is treated as 300dpi.
Horizontal and vertical resolution are treated as the same resolution.
PageSize=<string>
Specifies a paper size by name defined in the PPD file.
This option is ignored when no PPD file is assigned for the printer
queue.
"pdftoopvp" accepts the following original options;
opvpDriver=<string>
Specifies a driver library name.
opvpModel=<string>
Specifies a printer model name.
opvpJobInfo=<string>
Specifies "jobInfo" printing options that are passed to the driver.
Printing options are overridden by JCL options.
opvpDocInfo=<string>
Specifies "docInfo" document options that are passed to the driver.
opvpPageInfo=<string>
Specifies "pageInfo" page options that are passed to the driver.
pdftoopvpClipPathNotSaved (Boolean option)
Specifies that the driver cannot save clipping path operators in PDF.
nopdftoopvpShearImage (Boolean option)
Specifies that the driver cannot rotate/shear images by CTM.
nopdftoopvpMiterLimit (Boolean option)
Specifies that the driver does not support miter limit.
If the driver does not prepare the opvpSetMiterLimit function entry,
this option setting is ignored, and also miter limit is ignored.
pdftoopvpIgnoreMiterLimit (Boolean option)
When nopdftoopvpMiterLimit option is set, pdftoopvp automatically
replace paths to multiple lines or drawing images. This option
specifies to avoid the path replacement even when nopdftoopvpMiterLimit
option is set.
pdftoopvpMaxClipPathLength=<int>
Specifies the maximum number of clipping path points that the driver
supports. Default value is 2000 points.
pdftoopvpMaxFillPathLength=<int>
Specifies the maximum number of fill path points that the driver supports.
Default value is 4000 points.
nopdftoopvpLineStyle (Boolean option)
Specifies that the driver ignores the line style settings in PDF.
If the driver does not prepare the SetLineStyle , SetLineDash or
SetLineDashOffset function entry, this option setting is ignored, and
also line style, line dash and line dash offset are ignored.
nopdftoopvpClipPath (Boolean option)
Specifies that the driver does not support clipping path.
If the driver does not prepare the opvpSetClipPath function entry, this
option is ignored, and also clip path setting is ignored.
nopdftoopvpBitmapChar (Boolean option)
Specifies that the driver does not output characters as images.
Default setting is that "pdftoopvp" outputs small characters as images.
pdftoopvpBitmapCharThreshold=<int>
Specifies the threshold value that "pdftoopvp" outputs characters as
images. Threshold value is defined as W x H where character's width
is given by W pixels and height is given by H pixels.
Default threshold value is 2000 points.
nopdftoopvpImageMask (Boolean option)
Specifies that the driver does not support image mask.
If this option is set, "pdftoopvp" treats as the nopdftoopvpBitmapChar
option is given.
6. PPD OPTIONS
Following options can be defined in a PPD.
Resolution=<int>
PageSize=<string>
opvpDriver=<string>
opvpModel=<string>
opvpJobInfo=<string>
opvpDocInfo=<string>
opvpPageInfo=<string>
pdftoopvpClipPathNotSaved=True
pdftoopvpShearImage=False
pdftoopvpMiterLimit=False
pdftoopvpIgnoreMiterLimit=True
pdftoopvpMaxClipPathLength=<int>
pdftoopvpMaxFillPathLength=<int>
pdftoopvpLineStyle=False
pdftoopvpClipPath=False
pdftoopvpBitmapChar=False
pdftoopvpBitmapCharThreshold=<int>
pdftoopvpImageMask=False
7. OPTIONS OVERRIDING RULE
"jobInfo" printing options in a PPD is used as a initial "jobInfo" printing
options. If opvpJobInfo option is given in the command line, precedent
"jobInfo" printing options are overridden by the opvpJobInfo options.
After the "jobInfo" printing options are overridden by the opvpJobInfo
options, if JCL options are given, precedent "jobInfo" printing options are
overridden by the options given by JCL options.
8. INFORMATION FOR CUPS 1.1
To use this program under CUPS 1.1, following lines must be defined
in the CUPS's "mime.types" file.
application/vnd.cups-pdf
9. KNOWN PROBLEMS
Problem:
When a page is rotated and a character is small, character might not be
rotated correctly. This problem is caused by free type library.
Solution:
Define the nopdftoopvpBitmapChar to inhibit characters output as images.
|