--- cups-1.3.8.orig/debian/cups.prerm +++ cups-1.3.8/debian/cups.prerm @@ -0,0 +1,47 @@ +#! /bin/sh +# prerm script for cups +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove) + (cd /usr/lib/cups/backend && rm -f http ipp lpd parallel scsi serial socket usb snmp dnssd) + if [ -L /usr/share/ppd/1-local-admin ]; then + rm -f /usr/share/ppd/1-local-admin + fi + if [ -L /usr/share/ppd/2-third-party ]; then + rm -f /usr/share/ppd/2-third-party + fi + ;; + upgrade|deconfigure) + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- cups-1.3.8.orig/debian/cups.default +++ cups-1.3.8/debian/cups.default @@ -0,0 +1,4 @@ +# Cups configure options + +# LOAD_LP_MODULE: enable/disable to load "lp" parallel printer driver module +LOAD_LP_MODULE=yes --- cups-1.3.8.orig/debian/libcups2.shlibs +++ cups-1.3.8/debian/libcups2.shlibs @@ -0,0 +1 @@ +libcups 2 libcups2 (>= 1.3.8) --- cups-1.3.8.orig/debian/cups.postinst +++ cups-1.3.8/debian/cups.postinst @@ -0,0 +1,162 @@ +#! /bin/sh +# postinst script for cups +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see /usr/doc/packaging-manual/ +# +# quoting from the policy: +# Any necessary prompting should almost always be confined to the +# post-installation script, and should be protected with a conditional +# so that unnecessary prompting doesn't happen if a package's +# installation fails and the `postinst' is called with `abort-upgrade', +# `abort-remove' or `abort-deconfigure'. + +# Debconf +. /usr/share/debconf/confmodule + +# Default Configuration file +if [ -e /etc/default/cups ]; then + . /etc/default/cups +fi + +case "$1" in + configure) + # Set up lpadmin group. + if [ -z "`getent group lpadmin`" ]; then + addgroup --system lpadmin + fi + + if [ -L /usr/share/ppd/cups-transitional-dir ]; then + rm -f /usr/share/ppd/cups-transitional-dir + fi + if [ -L /usr/share/cups/model/cups-included ]; then + rm -f /usr/share/cups/model/cups-included + fi + + # Generate raw MIME handling files if they don't already exist. + if [ ! -e /etc/cups/raw.types ]; then + cat >/etc/cups/raw.types </etc/cups/raw.convs < /etc/cups/raw.convs + else + sed 's/^application/#application/' \ + < /etc/cups/raw.convs-convert > /etc/cups/raw.convs + fi + rm -f /etc/cups/raw.convs-convert + db_fset cupsys/raw-print changed false + fi + # Set up backends + db_get cupsys/backend && SELECTED=$RET + list=`echo $SELECTED | sed -e 's/, /,/g'` + save_IFS=$IFS + IFS=, + (cd /usr/lib/cups/backend && rm -f http ipp lpd parallel scsi serial socket usb snmp dnssd) + for module in $list; do + ln /usr/lib/cups/backend-available/$module /usr/lib/cups/backend/$module + if [ "$module" = "ipp" ]; then + ln /usr/lib/cups/backend/ipp /usr/lib/cups/backend/http + fi + done + IFS=$save_IFS + + # activate new backends on upgrades + db_fset cupsys/backend changed false + + if dpkg --compare-versions "$2" lt-nl "1.3.4-2"; then + for module in snmp scsi serial dnssd; do + [ -e /usr/lib/cups/backend/$module ] || \ + ln /usr/lib/cups/backend-available/$module /usr/lib/cups/backend/$module + done + fi + + # Resync Debconf database with real state + list=`( cd /usr/lib/cups/backend && for f in ipp lpd parallel scsi serial socket usb snmp dnssd; do [ -e $f ] && echo -n "$f, "; done ) | sed -e 's/, $//'` + db_set cupsys/backend $list; + + if [ -f /etc/cups/classes.conf ]; then + chown root:lp /etc/cups/classes.conf ; chmod 600 /etc/cups/classes.conf + fi + if [ -f /etc/cups/printers.conf ]; then + chown root:lp /etc/cups/printers.conf ; chmod 600 /etc/cups/printers.conf + fi + # Add symlink to local files required by LSB + if [ ! -e /usr/share/ppd/1-local-admin -a ! -L /usr/share/ppd/1-local-admin ]; then + ln -s /usr/local/share/ppd /usr/share/ppd/1-local-admin + fi + if [ ! -e /usr/share/ppd/2-third-party -a ! -L /usr/share/ppd/2-third-party ]; then + ln -s /opt/share/ppd /usr/share/ppd/2-third-party + fi + + # symlink snakeoil SSL certificate if present + if [ -e /etc/ssl/certs/ssl-cert-snakeoil.pem -a \ + -e /etc/ssl/private/ssl-cert-snakeoil.key -a \ + -n "`getent group ssl-cert`" -a ! -e /etc/cups/ssl/server.crt -a \ + ! -e /etc/cups/ssl/server.key ]; then + ln -s /etc/ssl/certs/ssl-cert-snakeoil.pem /etc/cups/ssl/server.crt + ln -s /etc/ssl/private/ssl-cert-snakeoil.key /etc/cups/ssl/server.key + fi + + # Remove shutdown and reboot links; this init script does not need them. + if dpkg --compare-versions "$2" lt-nl "1.3.6-2"; then + rm -f /etc/rc0.d/K??cups /etc/rc6.d/K??cups + fi + + # Reload AppArmor profile if present + if [ -e /etc/apparmor.d/usr.sbin.cupsd ] && [ -x /etc/init.d/apparmor ]; then + invoke-rc.d apparmor force-reload || true + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +db_stop +exit 0 + + --- cups-1.3.8.orig/debian/cups.lintian-overrides +++ cups-1.3.8/debian/cups.lintian-overrides @@ -0,0 +1,4 @@ +cups: executable-is-not-world-readable usr/lib/cups/backend-available/ipp 0700 != 0755 +cups: executable-is-not-world-readable usr/lib/cups/backend-available/lpd 0700 != 0755 +cups: package-contains-empty-directory usr/share/ppd/custom/ +cups: package-contains-empty-directory usr/lib/cups/backend/ --- cups-1.3.8.orig/debian/changelog +++ cups-1.3.8/debian/changelog @@ -0,0 +1,2918 @@ +cups (1.3.8-10) experimental; urgency=low + + [ Martin Pitt ] + * rootbackends-worldreadable.dpatch: Do not run backends as root if they are + group or world writable (this is by and large a paranoia fix, though). + * dont-chown-symlinked-ssl.dpatch: Replace patch with the upstream committed + version, which is more general. + * debian/control: Package development moved to bzr, update Vcs- tags. + * cupsaccept.dpatch: Replaced with the more comprehensive solution upstream + committed to 1.4 trunk. Removed debian/cups-client.links, since the links + are now installed by upstream. Adapt manpage-translations.dpatch + accordingly. + * Move installation of D-BUS configuration files from debian/rules to + debian/cups.install. + * debian/libcups2-dev.install: Add missing sidechannel.h. + + [ Johan Kiviniemi ] + * debian/filters/pstopdf: Apply PPD settings (resolution, page size, page + margins) to the conversion (LP: #263049). + * debian/control: cups Depends: bc (for margin calculation). + + -- Martin Pitt Thu, 11 Sep 2008 13:43:34 +0200 + +cups (1.3.8-9) experimental; urgency=low + + * Previous upload had some cruft in the diff.gz which caused some changed + defaults in cupsd.conf. Reupload with a clean diff.gz. *Brown paperbag* + + -- Martin Pitt Sun, 07 Sep 2008 00:22:23 +0200 + +cups (1.3.8-8) experimental; urgency=low + + * Remove debian/patches/dont_force_ssl.dpatch; gnome-cups-manager is ancient + and removed from Debian, and newer GUIs like system-config-printer get + along fine with the default setting. + * Add quiesce-bonjour-warning.dpatch: Silence the "Apple Bonjour + compatibility layer of Avahi" warning, since it can cause SIGPIPE crashes + when being issued in a child process without stderr. (Closes: #497492) + * confdirperms.dpatch, manpage-translations.dpatch: Revert note that Debian + doesn't install lppasswd suid root, since we do. (Closes: #478280) + * debian/control: Drop the "It can be safely removed from your system" from + the old package names, since that is untrue until the transition is + actually complete. (Closes: #489246) + * debian/control: Bump Standards-Version (no actual changes necessary). + * Remove classes_crash.dpatch, it has been fixed upstream a while ago. + * cupsaccept.dpatch: Rewrite to be consistent with current upstream code, + and send it upstream. + * Drop quiesce_ipp_logging.dpatch: It was only necessary for the polling + from gnome-cups-icon, but fortunately gnome-cups-manager has been removed + now. + * confdirperms.dpatch: Remove a few hunks which were only relevant for + running cups as system user. Remove the SSL certificate bits as well, + rewrite it to be upstream compatible, split it out to + dont-chown-symlinked-ssl.dpatch, reported it upstream. + * Remove device_uri.dpatch, does not seem to be necessary any more. + * Add rootbackends-worldreadable.dpatch: Install root backends + world-readable, to comply to Debian Policy and because it is both + nonsensical to to not do so, and also breaks system checkers, bug + reporting, etc. (Closes: #410171) + + -- Martin Pitt Sat, 06 Sep 2008 18:21:01 +0200 + +cups (1.3.8-7) experimental; urgency=low + + * Previous upload had some cruft in the diff.gz which caused some changed + defaults in cupsd.conf. Reupload with a clean diff.gz. + + -- Martin Pitt Tue, 02 Sep 2008 12:27:18 +0200 + +cups (1.3.8-6) experimental; urgency=low + + [ Till Kamppeter ] + * debian/local/filters/pdf-filters/filter/texttopdf.c, + debian/local/filters/pdf-filters/filter/pdfutils.c, + debian/local/filters/pdf-filters/filter/test_pdf2.c, + debian/local/filters/pdf-filters/filter/fontembed/test_ps.c, + debian/local/filters/pdf-filters/filter/fontembed/test_pdf.c, + debian/local/filters/pdf-filters/filter/fontembed/sfnt.h, + debian/local/filters/pdf-filters/filter/fontembed/main.c, + debian/local/filters/pdf-filters/filter/fontembed/iofn.h, + debian/local/filters/pdf-filters/filter/fontembed/fontfile.h, + debian/local/filters/pdf-filters/filter/fontembed/fontfile.c, + debian/local/filters/pdf-filters/filter/fontembed/embed.h, + debian/local/filters/pdf-filters/filter/fontembed/embed.c, + debian/local/filters/pdf-filters/filter/fontembed/Makefile, + debian/local/filters/pdf-filters/addtocups: + Fixed crashes of texttopdf on bad or missing fonts, make texttopdf + also working without configuration of the fonts (at least for ASCII). + * debian/local/filters/pdf-filters/filter/pdftoijs.cxx, + debian/local/filters/pdf-filters/conf/HP-PhotoSmart_Pro_B8300-hpijs-pdftoijs.ppd + debian/local/filters/pdf-filters/addtocups, + debian/local/filters/pdf-filters/config-scripts/cups-pdf-filters.m4, + debian/local/filters/pdf-filters/removefromcups, + debian/local/filters/pdf-filters/README, + debian/control, debian/rules: Added pdftoijs filter. + + [ Johan Kiviniemi ] + * debian/filters/pstopdf: + - Adobe Reader generates DRM-infested PostScript from encrypted PDF files. + This PostScript contains code which stops Ghostscript with an error when + one tries to convert it to (now unencrypted) PDF. Change the filter to + normalize such PostScript using ps2ps before conversion. + + [ Martin Pitt ] + * Add alternative dependency "gsfonts-x11" for ttf-freefonts. + (Closes: #495598) + * debian/patches/: Update the status of patches, add some upstream + references, update status in 00list. + * Drop obsolete include_krb5_h_in_job_h.dpatch, package builds fine in + current unstable. + * debian/rules: Enable PIE and other compiler flags security enhancements + with DEB_BUILD_HARDENING=1. Add hardening-wrapper build dependency. Thanks + to Kees Cook! + * Add debian/local/cups.ufw.profile: "ufw" firewall profile. Install it + for Ubuntu builds only for now, until ufw enters Debian as well. Thanks to + Didier Roche and Jamie Strandboge! (https://launchpad.net/bugs/261903) + + -- Martin Pitt Tue, 02 Sep 2008 11:34:54 +0200 + +cups (1.3.8-5) experimental; urgency=low + + [ Till Kamppeter ] + * debian/local/filters/pdf-filters/filter/texttopdf.c: Added bug fix + from upstream so that texttopdf does not segfault on missing or bad + fonts any more. Backed out Johan Kiviniemi's patch of replacing + Courier by FreeMono. + * Remove hardcoded -march=pentium from texttopdf Makefile. + (Closes: #495220) + + * debian/local/filters/pdf-filters/conf/imagetopdf.convs: Reduced cost + factor to prefer this filter instead of imagetops. + + [ Johan Kiviniemi ] + * debian/local/filters/cpdftocps, debian/local/cpdftocps.convs, + debian/cups.install, debian/rules: + - Add an application/vnd.cups-pdf → application/vnd.cups-postscript + filter, thus making the PDF filter chain possible for PostScript + printers. + - The filter’s cost is 22, making the total cost of pstopdf → pdftopdf → + cpdftocps 66 after the following change. + * debian/local/filters/pdf-filters/conf/pdftopdf.convs, + debian/local/pstopdf.convs, debian/rules: + - Change filter costs to prefer the PDF chain over pstops. + • pdftopdf: 22 instead of 66. + • pstopdf: 22 instead of 100. + • pstops: 100 instead of 66. + * Add pjl-display-ready-message.dpatch: + - According to the PJL spec, one should use "" (not "READY") to return the + display to the normal ready message. + + -- Martin Pitt Fri, 15 Aug 2008 15:54:36 +0200 + +cups (1.3.8-4) experimental; urgency=low + + [ Till Kamppeter ] + * debian/control, debian/rules, + debian/local/filters/pdf-filters/filter/pdfutils.h, + debian/local/filters/pdf-filters/filter/texttopdf.c, + debian/local/filters/pdf-filters/filter/fontembed, + debian/local/filters/pdf-filters/filter/test.sh, + debian/local/filters/pdf-filters/filter/test_pdf1.c, + debian/local/filters/pdf-filters/filter/test_pdf2.c, + debian/local/filters/pdf-filters/filter/pdfutils.c, + debian/local/filters/pdf-filters/conf/texttopdf.convs, + debian/local/filters/pdf-filters/AUTHORS, + debian/local/filters/pdf-filters/addtocups, + debian/local/filters/pdf-filters/data, + debian/local/filters/pdf-filters/data/pdf.utf-8.simple, + debian/local/filters/pdf-filters/data/pdf.utf-8.heavy, + debian/local/filters/pdf-filters/removefromcups, + debian/local/filters/pdf-filters/README: Added texttopdf filter. + Added "Depends: ttf-freefont" for the cups package, as the + texttopdf filter needs these fonts. + + [ Johan Kiviniemi ] + * Add cupsfilter-path-typo.dpatch: Fix a typo in scheduler/cupsfilter.c, + which caused filters not to have /bin in their PATH. + * debian/filters/pstopdf: + - Do not log to /tmp/pstopdf.log. A user running the filter (e.g. via + cupsfilter) made all other users (including cups itself) unable to run + the filter because of no permission to open the logfile. + - Put unquoted variables into quotes where appropriate. + - Never create an outfile in the same directory as the given infile; the + process might not have write access there. + - set -e. + * debian/local/filters/pdf-filters/filter/texttopdf.c: + - Use FreeMono instead of Courier, since texttopdf requires a TrueType + font. + + [ Martin Pitt ] + * Bump shlibs version for libcups2 and libcupsimage2. (Closes: #494168) + + -- Martin Pitt Fri, 15 Aug 2008 08:02:32 +0200 + +cups (1.3.8-3) experimental; urgency=low + + [ Till Kamppeter ] + * debian/local/filters/pdf-filters/addtocups, + debian/local/filters/pdf-filters/removefromcups, + debian/local/filters/pdf-filters/config-scripts/cups-pdf-filters.m4, + pdftopdf/Makefile: Avoid that all executables and libraries of CUPS + get linked against libpoppler. This especially leads to all packages + dependent on CUPS needing libpoppler, even for building. + + -- Martin Pitt Mon, 11 Aug 2008 16:48:59 +0200 + +cups (1.3.8-2) experimental; urgency=low + + [ Till Kamppeter ] + * debian/local/filters/pdf-filters/, debian/local/pstopdf.convs, + debian/rules, debian/control, debian/copyright, debian/cups.install: + Introduced the first bunch of infrastructure for using PDF as standard + print job format. Added CUPS filters imagetopdf, pstopdf, pdftopdf, + pdftoraster, added build dependency on libpoppler-dev, as the new filters + are Poppler-based. texttopdf and pdftoijs will be added soon. + All this is temporary, as the filters are planned to be added to the + upstream package of CUPS (CUPS STR #2897, #1595). + * debian/patches/search_mime_files_in_usr_share.dpatch: Replaced by the + changes which were done for this purpose in CUPS 1.4. In addition to + the introduction of /usr/share/cups/mime for installing file detection and + conversion rules as non-conffiles it also changes the reading order to + all *.types files and the all *.convs files (instead of all in + /usr/share/cups/mime and then all in /etc/cups). This way + /usr/share/cups/mime can contain conversion rules based on file types + defined by files in /etc/cups (CUPS STR #2719, CUPS SVN revs #7670 and + #7694). + + [ Martin Pitt ] + * Add missing CVE and more verbose descriptions to security fixes to 1.3.6-1 + changelog. + + -- Martin Pitt Sat, 9 Aug 2008 23:48:59 +0200 + +cups (1.3.8-1) unstable; urgency=low + + * New upstream release: some 20 bug fixes, no new features (see + http://www.cups.org/articles.php?L562 for details). + * Dropped patches, accepted upstream: + - empty_option_value_crash.dpatch + - CVE-2008-1722.dpatch + - glibc2.8_build.dpatch + - HostNameLookups_values.dpatch + * manpage-typos.dpatch: Most of this got applied to 1.3.8. The ".Sh" -> + ".SS" fix only got applied to trunk, so backport these remaining ones. + * manpage-translations.dpatch: Update to new upstream version. + + -- Martin Pitt Wed, 23 Jul 2008 08:58:57 +0200 + +cups (1.3.7-9) unstable; urgency=low + + [ Martin Pitt ] + * Update Turkish debconf translations, thanks Mert Dirik! + (Closes: #489408) + + [ Till Kamppeter ] + * Updated "Suggests:" for the "cups" package, replacing obsolete + foomatic-filters-ppds by foomatic-db and foomatic-db-engine. + (Closes: #286127) + + -- Martin Pitt Fri, 11 Jul 2008 09:49:08 +0200 + +cups (1.3.7-8) unstable; urgency=medium + + * Urgency medium due to RC bug fix (#487606). + * debian/cups.init.d: Restart xprint on start/stop/reload. (Closes: #285332) + * Add empty_option_value_crash.dpatch: Fix crash on cupsd.conf options + without a value. (Closes: #250848) + * Add glibc2.8_build.dpatch: Fix building with glibc 2.8. + * debian/patches/00list: Sort patches by upstream status. + * Add HostNameLookups_values.dpatch: Make possible values of HostNameLookups + consistent to manpage and to other options in cupsd.conf. (Closes: #379014) + * debian/patches/confdirperms.dpatch: Fix typo, thanks Nicolas François! + * Add manpage-typos.dpatch: Fix various typos in manpages, thanks Nicolas + François! (part of #478597) + * Add manpage-translations.dpatch: Provide po4a infrastructure for + translating mangpages, and add French manpage translations. Add po4a build + dependency, and add translated manpages to debian/*.install. Thanks to + Nicolas François! (Closes: #478597) + * Add Slovak debconf translations, thanks to Ivan Masár. (Closes: #488906) + * Add Romanian debconf translations, thanks to Eddy Petrișor. + (Closes: #488597) + * debian/cups.init.d: Test for executability of daemon, not merely its + existence. (Closes: #488843) + * debian/cups.prerm: Do not delete the /usr/lib/cups/backend/smb symlink on + removal, it is owned by smbclient, not cups. (Closes: #487606) + + -- Martin Pitt Wed, 02 Jul 2008 11:58:47 +0200 + +cups (1.3.7-7) unstable; urgency=low + + * Provide transitional cupsys-common package, to ease apt-get dist-upgrade. + * debian/cups.preinst: Run conffile transition for "install" as well, not + just for "upgrade" (brown paperback for this thinko!), and also remove the + old rc.d symlinks for cupsys. (Closes: #485514) + * debian/control: Drop obsolete "gs-esp" alternative dependency. + + -- Martin Pitt Tue, 10 Jun 2008 16:32:33 +0200 + +cups (1.3.7-6) unstable; urgency=low + + * Rename the package to cups. This is the proper upstream name. Upstream has + made it clear that the usual distro patches are not a trademark violation. + This unbreaks all the documentation out there, which refers to "cups", not + "cupsys" (including names of the init script), as well as unbreaks + dependencies of openprinting.org's LSB printer driver packages. + (Closes: #482296, LP: #233790) + * debian/cups.{config,postinst}: Remove some old cruft. + * debian/cups.preinst: Move conffiles to new names on upgrades, in a dpkg + conffile question avoiding manner. + * debian/cupsys.install: Install oopstops.{convs,types} in /etc/cups, they + do not work in /usr/share/cups/mime (loaded too early). (Closes: #474109) + + -- Martin Pitt Fri, 23 May 2008 00:32:17 +0200 + +cupsys (1.3.7-5) unstable; urgency=low + + * debian/cupsys-bsd.install: Remove daemon/cups-lpd. It really does not + belong into -bsd. + * debian/control: Add appropriate Conflicts/Replaces to older cupsys-bsd + which shipped daemon/cups-lpd. (Closes: #477392) + + -- Martin Pitt Wed, 23 Apr 2008 11:00:41 +0200 + +cupsys (1.3.7-4) unstable; urgency=high + + * debian/rules: Do not fail the build when the test suite fails on m68k and + arm. It is currently unclear why these tests fail on these architectures, + but that shouldn't block testing migration (given that the actual bugs + existed before as well, they just didn't get caught during build). + + -- Martin Pitt Tue, 22 Apr 2008 18:34:35 +0200 + +cupsys (1.3.7-3) unstable; urgency=low + + * debian/copyright: Update to current reality. (Closes: #474176) + * Drop usage of dh_movefiles, rename the remaining debian/*.files to + debian/*.install. This also brings back the lost + /usr/lib/cups/daemon/cups-lpd. + * debian/libcupsimage2-dev.install: Add cups/i18n.h from upstream (not + installed by upstream Makefiles any more). (Closes: #474922) + * debian/rules: Drop lintian magic, current debhelper (dh_lintian) and cdbs + support that now. Rename .lintian -> .lintian-overrides for this. + * debian/cupsys.doc-base: Fix section. + + -- Martin Pitt Tue, 22 Apr 2008 12:28:25 +0200 + +cupsys (1.3.7-2) unstable; urgency=high + + [ Martin Pitt ] + * debian/control: Add missing build dependency lsb-release. (LP: #211375) + Also wrap long fields, so that they are easier to edit. + * Drop pdftops-wait-eintr.dpatch, an improved version has been committed + upstream. Integrate the upstream solution into pdftops-cups-1.4.dpatch. + * Add pdftops-dont_fail_on_cancel.dpatch: Fix behavioural change in patch + from STR #2780 which broke the test suite: When a job is cancelled, do not + report a failure in the exit code of pdftops. + * Rebuild against fixed debhelper to properly compress manpages again (see + #470913). (Closes: #475887, #476495) + + [ Nico Golde ] + * Add debian/patches/CVE-2008-1722.dpatch: Two integer overflows in png + image filter allow a denial of service attack and possibly arbitrary code + execution. [STR #2790, CVE-2008-1722] (Closes: #476305). + + -- Martin Pitt Mon, 21 Apr 2008 19:06:55 +0200 + +cupsys (1.3.7-1) unstable; urgency=medium + + * Urgency medium due to security fix. + * New upstream bugfix/security update release. For a detailled list of + changes see http://www.cups.org/articles.php?L537. + - CUPS GIF image filter overflow [CVE-2008-1373, STR #2765]. + * Drop patches which are now upstream: + - cgiCompileSearch_buffer_overflow.dpatch + - testsuite-exit-code.dpatch + - pbmprint.dpatch + * search_mime_files_in_usr_share.dpatch: Drop log message about missing + /usr/share/cups/mime/ from error to info, since it is not really an + error, and causing the test suite to fail due to error log count mismatch. + * pdftops-cups-1.4.dpatch: Apply r7391 from SVN head to fix missing error + message newlines (STR #2743). + * debian/rules: Remove cleaning of test suite HTML reports in test/, they + are written to /tmp now. + * Add pdftops-wait-eintr.dpatch: Handle EINTR in pdftops' wait() call. + (Caught by test suite.) + * debian/libcupsys2-dev.files: Drop i18n.h, it's an internal interface and + not installed by upstream any more. + * debian/control: Add poppler-utils | xpdf-utils build dependency, so that + the test suite works during build. + + -- Martin Pitt Wed, 02 Apr 2008 11:03:37 +0200 + +cupsys (1.3.6-3) unstable; urgency=high + + [ Till Kamppeter ] + * pdftops-cups-1.4.dpatch: Updated to Mike Sweet's patch version from CUPS + STR #2716. + * debian/patches/ppd-poll-with-client-conf.dpatch: If there is a client.conf + pointing to a remote server, clients were not able to poll the PPD options + from printers on that server (CUPS STRs #2731, #2763) + + [ Martin Pitt ] + * Urgency high due to security fix. + * debian/local/apparmor-profile: Allow cups-pdf to read files in ~/PDF/, so + that it can overwrite files. (LP: #161222) + * Add cgiCompileSearch_buffer_overflow.dpatch: Fix buffer overflow in + cgiCompileSearch() using crafted search expressions. Exploitable if + printer sharing is enabled. (CVE-2008-0047, STR #2729, Closes: #472105) + + -- Martin Pitt Sat, 22 Mar 2008 12:37:57 +0100 + +cupsys (1.3.6-2) unstable; urgency=low + + * debian/rules: Configure with default log file permissions 0640. + (Closes: #469853) + * debian/control: Mention "lpr" in the description of -bsd, for easier + apt-cache search catching. (Closes: #426519) + * Remove debian/NEWS, there's nothing new since Etch's release. + (Closes: #376580) + * Add debian/patches/pbmprint.dpatch: Fix printing of PBM files, thanks to + Eugeniy Meshcheryakov! (Closes: #313536) + * debian/cupsys.preinst: Only chown /var/run/cups if it exists. (LP #156634) + * Move scripting examples from cupsys to libcupsys2-dev. No need to install + those 1.3 MB by default on every system, this is much more developer + oriented. Mention this in the package description. + * debian/rules: Explicitly build with -fno-stack-protector on arm and armel, + since the compiler produces segfaulting binaries. Works around #469517. + * search_mime_files_in_usr_share.dpatch: Do not fatally fail if + DataDir/mime does not exist. This both makes much more sense (since + /etc/cups is the canonical dir which must exist, and /usr/share/cups/mime + is optional), and also unbreaks the test suite (which does not create this + directory by default). + * pidfile.dpatch: Specify PidFile in temporary directory in the self test's + cupsd.conf. + * debian/rules clean: Remove test suite HTML reports. + * Add testsuite-exit-code.dpatch: Exit with nonzero if the test suite fails, + so that it is easier to integrate into package building. + * pdftops-cups-1.4.dpatch: Update pdftops location in test suite, too, so + that it does not fail the PDF printing test. (Forwarded to STR #2759) + * debian/rules: Run test suite on build. This will fail the build if any + tests fail, so that problems on particular platforms will be caught + easily. + * debian/control: Add alternative (build-)depends to heimdal-dev. + * debian/rules, debian/cupsys.postinst: Call update-rc.d to not install stop + symlinks for runlevels 0 and 6, since they just needlessly slow down + shutdown. Remove the obsolete kill symlinks on upgrade. Patch adopted from + the Ubuntu branch, but without using the Ubuntu-only 'multiuser' mode of + update-rc.d. + * Add debian/local/apparmor-profile: AppArmor profile (taken from Ubuntu + branch). Install it in debian/rules if package is built on Ubuntu (tested + with lsb_release -is). Reload AppArmor in debian/cupsys.postinst if both + the cupsys profile and AppArmor itself are present. + * Add debian/patches/ubuntu-disable-browsing.dpatch: Disable Browsing by + default when building on Ubuntu. + * Add debian/patches/ubuntu-default-error-policy-retry-job.dpatch: Set + default job error policy to "Retry", since it is less confusing and a + better default on desktop machines. This is only applied when building on + Ubuntu. + * debian/control: Add Vcs-{Svn,Browser} fields. + + -- Martin Pitt Sun, 16 Mar 2008 22:34:50 +0100 + +cupsys (1.3.6-1) unstable; urgency=low + + * New upstream bugfix release. + - Fixes buffer overflows in filter/hpgl-input.c, possibly exploitable to + run arbitrary code with crafted HP-GL files. (CVE-2008-0053) + - Fixes double free vulnerability in process_browse_data(), + exploitable to remote DoS. (CVE-2008-0882, bug #467653) + * Remove the following patches which are upstream now: + - fix_regression_reactivate_net_ifaces_changes_detection.dpatch + - web-interface-breaks-default-auth-setting.dpatch + * search_mime_files_in_usr_share.dpatch: Greatly simplified the patch by + using mimeMerge(), so that it is more robust against upstream changes. + Forwarded to STR#2719. + * Dropped cupsd.conf-AllowLocal.dpatch; it does not do anything good any + more for the current web and GUI administration tools (they handle this + fine by themselves), so it's obsolete now. + * Drop enable{sharing,browsing} and {sharing,browsing}_status scripts. They + have never been used in Debian, not used any more in Ubuntu, and the + current frontends (web, system-config-printer, etc.) do this in a much + better way. + * debian/docs: Remove redundant LICENSE.txt. + * debian/rules: Add a generic rule to install lintian overrides in + debian/packagename.lintian. + * Add lintian overrides for unjustified/wontfix complaints about libcupsys2 + and cupsys. + * debian/cupsys.doc-base: Remove erroneous whitespace in the section + separator. + * debian/rules: Remove *.o and *.so files from PHP scripting examples + directory (it's /usr/share after all). + * debian/cupsys.init.d: Add Short-Description. + * debian/rules: Do not ship an empty /usr/share/cups/model/ directory. + + -- Martin Pitt Tue, 26 Feb 2008 14:23:50 +0100 + +cupsys (1.3.5-2) unstable; urgency=low + + [ Martin Pitt ] + * debian/cupsys.init.d: Add Should-Start: avahi. (Closes: #459662) + + [ Till Kamppeter ] + * debian/patches/pdftops-cups-1.4.dpatch, debian/local/filters/pdftops: + Replaced Helge Blischke's alternative pdftops wrapper by the pdftops + of CUPS 1.4. The old pdftops wrapper did not work with the pdftops + filter of Poppler, the new one works with the pdftops filters of both + Poppler and XPDF (Closes: #457810; Ubuntu LP: #182379). + * debian/patches/web-interface-breaks-default-auth-setting.dpatch: When + modifying server settings with the CUPS web interface, the setting + for the default authentication got overwritten with gibberish + (Closes: #461331; CUPS STR #2703, Ubuntu LP: #188426). + * debian/local/backends/dnssd: Updated dnssd to filter out IPv6 entries, + as they clutter the lists of detected printers and make the network + printer discovery process taking more time than needed. Applied also + a bug fix and the possibility of querying one IP address by calling + the dnssd backend with the IP as command line argument (like the + snmp CUPS backend). + + -- Martin Pitt Mon, 25 Feb 2008 11:13:15 +0100 + +cupsys (1.3.5-1) unstable; urgency=high + + [ Kenshi Muto] + * New upstream release + - cups-stops-broadcasting-on-HUP-with-explicit-BrowseAddress patch is + merged. + - Fix that SNMP backend did not check for negative string lengths. + (CVE-2007-5849, closes: #457453). + * Update pdftops.pl to 1.20. It fixes overwriting arbitary files + via symlink attack. (CVE-2007-6358, closes: #456960) + + [ Till Kamppeter ] + * debian/patches/fix_regression_reactivate_net_ifaces_changes_detection.dpatch : + Fix a regression in upstream code that has removed the network interface + update poll (CUPS STR #2631, LP: #177075). Thanks to Hugues Fournier + (hugues dot fournier at gmail dot com) for the patch. + + -- Kenshi Muto Wed, 19 Dec 2007 17:07:05 +0900 + +cupsys (1.3.4-4) unstable; urgency=high + + [ Kenshi Muto] + * cupsys depends on "ghostscript | gs-esp", not "ghostscript | gsp-esp"! + I should punish myself. + (closes: #456455) + + -- Kenshi Muto Tue, 18 Dec 2007 07:49:17 +0900 + +cupsys (1.3.4-3) unstable; urgency=high + + [ Martin Pitt ] + * debian/control: Bump Standards-Version to 3.7.3 (no changes necessary). + + [ Till Kamppeter ] + * debian/patches/cups-stops-broadcasting-on-HUP-with-explicit-BrowseAddress.dpatch: + CUPS stopped broadcasting on a HUP signal when using a fixed + BrowseAddress (CUPS STR #2618, Ubuntu LP: #173470). + * debian/local/backends/dnssd: Updated dnssd to support Mac OS X servers + which broadcast their print queues only via DNS-SD and require clients + to create raw IPP queues pointing to the server's queues manually. + + [ Kenshi Muto] + * Debconf translation + - French (closes: #456272) + - do update-debconfpo. Update all translations to use the msgstr 'dnssd' + for msgid 'dnssd'. + * cupsys depends on "ghostscript | gs-esp", to ease testing transition and + upgrades from etch (closes: #456455). + + -- Kenshi Muto Mon, 17 Dec 2007 10:25:02 +0900 + +cupsys (1.3.4-2) unstable; urgency=low + + [ Kenshi Muto ] + * Bumps up shlibs to 1.3.4. + + [ Martin Pitt ] + * debian/control: Remove gs-esp alternative dependency, it's just + "ghostscript" nowadays. + * debian/control: Slightly bump the C/R: for -common; it's a pointless delta + to Ubuntu and it doesn't hurt us. + * debian/cupsys-bsd.postinst: Symlink cupsys-bsd's doc directory to + cupsys-common's, not cupsys', since the latter is not a dependency. + * debian/control: Demote cups-pdf from Recommends: to Suggests: to match the + semantics (apt installs recommends by default now). + * debian/cupsys.init.d: Add LSB header, thanks to Petter Reinholdtsen! + (closes: #337640) + * debian/rules: Configure with default printcap in /var/run/cups/. + (closes: #452446) + + [ Till Kamppeter ] + * Add debian/local/backends/dnssd: Printer discovery backend for + several cheaper printers, like the HP Color LaserJet 2600n, are not + discovered by the "snmp" backend. In addition, this backend extracts more + info from the printers than the "snmp" backend, like for example available + page description languages. This leads to better driver choices for + unknown printer models. + * debian/cupsys.install, debian/cupsys.{prerm,postinst,templates,rules}: + Install new backend. + * debian/control: Add Recommends: to avahi-utils; if it is installed, the + dnssd backend can actually work. + * debian/postinst: Activate new backends (since Etch) by default on + upgrades. This affects snmp, scsi, serial, and dnssd. + + -- Martin Pitt Fri, 30 Nov 2007 18:42:15 +0100 + +cupsys (1.3.4-1) unstable; urgency=high + + * New upstream release. + - Fixes CVE-2007-4351 + IPP Tags Memory Corruption Vulnerability (closes: #448866) + + [ Martin Pitt ] + * debian/cupsys.postinst: Drop ancient code to remove root from group + lpadmin. + + [ Kenshi Muto ] + * Debconf translation + - Finnish (closes: #446740) + + -- Kenshi Muto Fri, 02 Nov 2007 21:32:29 +0900 + +cupsys (1.3.2-1) unstable; urgency=low + + * New upstream bug fix release. + - Fixes web interface for many browsers. (STR#2472, Closes: #440589) + * Remove str2488-fix-localedir.dpatch, str2505_localize.dpatch, + str2508-dont_kill_edit-config.tmpl.dpatch: Fixed upstream. + + -- Martin Pitt Tue, 18 Sep 2007 08:15:17 +0200 + +cupsys (1.3.0-4) unstable; urgency=low + + * Install PO files again, but this time under /usr/share/cups/locale. cups + has its own crazy PO file parser. + * Add debian/patches/str2488-fix-localedir.dpatch: Make the --localedir + configure option actually work (taken from upstream SVN, STR#2488) + * debian/rules: Add --enable-gssapi to ensure that the package is built with + Kerberos support. + * debian/rules: Use -Wl,--as-needed linker flag. This drops a few + unnecessary dependencies and should make checklib much happier. + * Add debian/patches/str2508-dont_kill_edit-config.tmpl.dpatch: Do not kill + edit-config.tmpl on distclean. Forwarded upstream as STR#2508. + (Closes: #441697) + * Add debian/patches/str2505_localize.dpatch: Fix localization of web + interface (STR#2505, Closes: #440256) + + -- Martin Pitt Tue, 11 Sep 2007 22:43:06 +0200 + +cupsys (1.3.0-3) unstable; urgency=low + + [ Martin Pitt ] + * debian/control: Allow 'ghostscript' as alternative dependency to gs-esp. + * debian/cupsys.dirs: Create /usr/lib/cups/backend/ (regression from the big + debian/rules cleanup). (closes: #438432) + * debian/cupsys.preinst: Bump the version comparison for the file owner + cleanup, since some log files were still left as owned by 'cupsys' until + #437536 was fixed. + * debian/cupsys-common.files: Do not install the .po files, cups does not + use them at runtime. (closes: #438625) + + [ Till Kamppeter ] + * debian/local/postscript.ppd: New generic PostScript PPD file for + unknown PostScript printers added. + + -- Martin Pitt Mon, 20 Aug 2007 16:23:58 +0200 + +cupsys (1.3.0-2) unstable; urgency=low + + * debian/control: Re-add erroneously dropped adduser dependencies to cupsys + and cupsys-client. Still needed for addgroup lpadmin. (closes: #437951) + * debian/control: Add missing libkrb5-dev dependency to libcupsys2-dev. + + -- Martin Pitt Wed, 15 Aug 2007 09:22:29 +0200 + +cupsys (1.3.0-1) unstable; urgency=low + + [ Till Kamppeter ] + * New upstream release (first release of 1.3.x generation) + * 90_include_krb5_h_in_job_h.dpatch: Added a missing "#include " to + the scheduler/job.h file (upstream bug). + * Regenerated patches: 44_fixconfdirperms.dpatch, 47_pid.dpatch, + 70_reactivate_recommended_driver.dpatch. + * Removed patches (fixed upstream): 53_usr_share_ppd_support.dpatch, + 55_ppd_okidata_name.dpatch, 68_edit-config.dpatch + * debian/control: Added "libkrb5-dev", and "libavahi-compat-libdnssd-dev" + to the build dependencies, so that the new Kerberos and DNS Service + Discovery support of CUPS gets compiled. + * debian/libcupsys2-dev.files: Removed /usr/include/cups/md5.h This file is + not provided any more by CUPS + * debian/cupsys.install, debian/cupsys-client.files: Added new files. + * debian/rules: Added more files to "clean::" rule which upstream has + forgotten in "make clean". + + [ Martin Pitt ] + * Bump library shlibs to >= 1.3.0. + * Drop 02_configure.dpatch, upstream configure does not set rpath any more + for prefix=/usr. + * Drop 54_cups-config_modeldir.dpatch, --modeldir was never actually used + anywhere and not documented, and LSB prescribes /usr/share/ppd/ anyway. + * Drop 56_dirsvc.dpatch, which was fixed upstream long ago and disabled in + 00list anyway since then. + * Drop 67_printcap.dpatch: /var/run/cups/printcap is now the implicit + default upstream. + * debian/patches: Drop number prefixes from patches. The enumeration is not + useful at all any more since it both got inflated and is not sorted by any + category. With dpatch we also do not need number prefixes. + + -- Martin Pitt Tue, 14 Aug 2007 21:10:50 +0200 + +cupsys (1.2.12-4) unstable; urgency=low + + [ Martin Pitt ] + * cupsys.logrotate: Fix last occurence of 'cupsys' user. + (closes: #437536) + * Moved all Debian specific filters to debian/local/filters. + * Cleaned up debian/rules, moved some file installs to + debian/cupsys.install. + * Merge debian/cupsys.files into debian/cupsys.install and remove the + former. Two different files are just too confusing. + * debian/local/filters/pdftops: Do not pass /etc/cups/pdftops.conf to + pdftops if it does not exist (poppler-utils does not have this file). + (https://launchpad.net/bugs/125300) + + [ Martin-Éric Racine ] + * Corrected download URL in debian/copyright. + * Added debian/watch file using that URL. + * Revised the Uploaders in debian/control: + - Fixed the name for Masayuki Hatta. + - Added Roger Leigh. + * Removed cupsys-driver-gimpprint alternative in debian/control; + superseded by cupsys-driver-gutenprint since Etch. + + -- Martin-Éric Racine Sun, 12 Aug 2007 13:36:30 +0300 + +cupsys (1.2.12-3) unstable; urgency=low + + [ Martin-Éric Racine ] + * Added presubj script to warn bug reporters to avoid filing Poppler + or XPDF security issues, since we don't use that codebase; we call + external programs who do and that's where the bug should be filed. + + [ Martin Pitt ] + * cupsys.init.d: Remove stray chown'ing to 'cupsys' which does not exist any + more. (closes: #436662) + * cupsys.init.d: Fix detection of parallel printers when 'lp' is already + loaded. (https://launchpad.net/bugs/29050) + * debian/cupsys.init.d: Put back 'reload'. + + -- Martin Pitt Thu, 09 Aug 2007 20:47:42 +0200 + +cupsys (1.2.12-2) unstable; urgency=low + + [ Kenshi Muto ] + * Added scripting directory to /usr/share/doc/cupsys/examples. + This directory contains the binding code from Java, Perl, and PHP + to CUPS. (closes: #193076) + Although we Debian CUPS team cannot afford to maintain them, + some of you may want them. + * Added 'Recommends: cupsys' to cupsys-bsd. (closes: #426521) + * Changed cupsys-client from 'Recommends: cupsys-bsd' to 'Suggests: + cupsys-bsd.' because cupsys-bsd isn't so necessary for cupsys-client. + * Fixed to use 'cupsys' instead of 'cups' for PAM on cups-check-pam-auth. + (though Debian CUPS doesn't use this daemon) (closes: #425701) + * Added debconf-2.0 to the dependency of cupsys-bsd. (closes: #415684) + + [ Martin Pitt ] + * Drop the derooting changes. It still has some regressions, and with + upstream not even acknowledging the need for improving cupsys' security we + will sit on this forever. This will be replaced by an AppArmor/SELinux + profiles in the future. + - Drop derooting related patches: + 06_disable_backend_setuid.dpatch + 10_external_pam_helper.dpatch + 09_runasuser.dpatch + 09_runasuser_autoconf.dpatch + - debian/cupsys{,-client}.postinst: Drop the 'cupsys' user setup and file + permission juggling. + - debian/rules: + + Drop --with-cups-user configure option. + + Do not modify the upstream default backend permissions. + - debian/cupsys.init.d: Do not touch log file permissions any more. + - debian/cupsys.files: Drop cups-check-pam-auth. + - debian/NEWS: Drop description of derooting changes. + - debian/control: Drop adduser dependency. + * debian/patches/44_fixconfdirperms.dpatch: Do not create + /var/run/cups/certs as lp:lpadmin, but as root:lpadmin, so that cupsd + does not need CAP_DAC_OVERRIDE. This will make it possible to create a + sensible AppArmor/SELinux profile. + * debian/cupsys.preinst: Fix file permissions on upgrades (owner cupsys -> + root). + * debian/control, debian/rules: Remove references to libcupsys2-gnutls10, + since it's a transitional package in Etch and not relevant any more in + Lenny. + * debian/cupsys.{pre,post}inst: Remove obsolete transition bits. + * Remove obsolete debian/patches/05_avoidunknowngroup.dpatch. + * Use ssl-cert's "snakeoil" SSL certificate by default: (Closes: #402370) + - debian/control: Add ssl-cert dependency. + - debian/cupsys.postinst: Symlink snakeoil SSL certificate if present, and + there is none present yet. + * debian/control: Replace obsolete ${Source-Version} with ${binary:Version}. + + [ Till Kamppeter ] + * Add debian/local/textonly.{ppd,filter}: Text-only printer driver from Red + Hat. Install it in debian/rules. + * debian/rules: Install the D-Bus config file so that CUPS reports + job progress to dbus clients (like sytem-config-printer). + * Add debian/local/oopstops.{.pl,types,convs}: Helge Bliscke's oopstops + filter to work around the bugs in the PostScript output of OpenOffice.org + (from http://www.srz.de/Members/bla/cups/filter/oopstops). Install them in + debian/rules. + + -- Martin Pitt Mon, 06 Aug 2007 15:47:33 +0200 + +cupsys (1.2.12-1) unstable; urgency=low + + * New upstream release + * removed unnecessary dependency against patch package (Closes: #431069) + * Debconf translation + - Danish (Closes: #426772) + - Vietnamese (Closes: #426822) + - Spanish (Closes: #430004) + * Disabled external_pam_helper due to #425944 and Ubuntu#112803. + (closes: #425944) + + -- Kenshi Muto Sat, 14 Jul 2007 14:56:24 +0900 + +cupsys (1.2.11-3) unstable; urgency=medium + + * debian/rules: Disable privilege dropping for now until we fixed the + backend invocation to become compatible to upstream's behaviour again. + This unbreaks third-party backends again for now. (Closes: #427559) + + -- Martin Pitt Fri, 08 Jun 2007 11:15:12 +0200 + +cupsys (1.2.11-2) unstable; urgency=low + + * debian/rules: Latest cups installs the ipp backend with 0700 permissions, + which makes it inaccessible to both the cups daemon (Closes: #423972) and + unreadable for users (Closes: #415872) + + -- Martin Pitt Wed, 16 May 2007 09:06:44 +0200 + +cupsys (1.2.11-1) unstable; urgency=low + + [ Kenshi Muto ] + * Applied templates improvement patch contributed by + debian-l10n-english team. (closes: #416350) + * Debconf translation + - Japanese + - Galician (closes: #416357) + - Swedish (closes: #416356) + - Catalan (closes: #416367) + - Basque (closes: #416385) + - Norwegian (closes: #416401) + - Italian (closes: #416407) + * New upstream version 1.2.11: + - 56_dirsvc patch is merged. + + [ Christian Perrier ] + * Debconf translation + - Czech (closes: #416939) + - German (closes: #416994) + - Brazilian Portuguese (closes: #417249) + - French + - Malayalam. (closes: #418030) + - Russian. (closes: #417874) + - Dutch. (closes: #418135) + - Portuguese (closes: #418299) + + [ Martin Pitt ] + * New upstream bugfix release (closes: #421899). + + Synchronize patches with Ubuntu and new upstream version 1.2.10: + + * Drop patches which are fixed upstream: + 00_00str2111.dpatch, 00_01str2137.dpatch, 00_02str2144.dpatch, + 00_03str2106.dpatch, 00_04str2117.dpatch, 00_05str2133.dpatch, + 00_06str2121.dpatch, 00_07str2123.dpatch, 00_08str2135.dpatch, + 00_09str2198.dpatch, 03_clean.dpatch, 65_detect_http_shutdown.dpatch + * Remove a few obsolete patches: + 08_cupsd.conf.conf.d.dpatch, 26_modprobe.dpatch, 48_stdlib.dpatch, + 61_job_c_strangeloop.dpatch, 08_cupsd.conf.conf.d.dpatch, + 64_driverfolder.dpatch. + * Add debian/patches/14_dont_force_ssl.dpatch: Do not require SSL for /admin + pages, since gnome-cups-manager (and most probably other GUI frontends) + does not support this. + * Add debian/patches/58_cupsd.conf-AllowLocal.dpatch: Allow access to local + ethernet by default. This just affects the ACL, for actually enabling + access cupsd needs to be switched to not only listen on localhost. With + that, this setting does not need to be configured in two different places. + * Add debian/patches/70_reactivate_recommended_driver.dpatch: Upstream CUPS + filters the "(recommended)" marking from the NickNames of the PPD files + when listing PPDs. These are an important orientation for the user and + they are also made use of by some printer setup tools. We need them at + least until a better solution for recommending drivers gets available. + * Add debian/patches/98_search_mime_files_in_usr_share.dpatch: Let CUPS also + search for *.types and *.convs files in /usr/share/cups/mime. This way + packages can provide *.types and *.convs files which do not get considered + as conffiles. (See https://launchpad.net/36532 for details). + * debian/patches/*.dpatch: Forwarded a lot of patches to upstream bug + tracker, add STR URLs to dpatch DP: headers. + + Synchronize packaging with Ubuntu: + + * debian/control: Drop transitional libcupsys2-gnutls10 package, it was only + required for Sarge->Etch upgrades. + * debian/control: Change netbase dependency to update-inetd, since that + lives in its own package now. + * debian/local/enable_sharing: Also match on 127.0.0.1 IP adresses in + addition to 'localhost'. + * debian/rules: Most of the clean:: rule is obsolete, only two files are + left behind now. These two have been reported upstream in + http://www.cups.org/str.php?L2366. + * debian/cupsys.templates: Activate SCSI, serial, and SNMP backends by + default. With these backends activated, many printers can be easily set up + with the printer setup tools. Especially network printers get + auto-detected and the correct URI gets assigned to them (doing this + manually is a non-trivial task for most users). + * debian/cupsys.dirs: Add /usr/share/ppd/custom/, a place where lpadmins can + store additional PPDs (this functionality is e. g. provided in + gnome-cups-manager's "Custom driver..." file dialog). + * debian/cupsys.init.d: Give proper permissions to /usr/share/ppd/custom/: + root:lpadmin 3775. Drop the obsolete chmod/chowning of + /usr/share/cups/model. + * Run the backend as non-root system user to confine the impact of security + vulnerabilities: + - Add debian/patches/10_external_pam_helper.dpatch: + + Add a helper program 'cups-check-pam-auth' which performs PAM + authentication and returns the status as exit code. + + scheduler/auth.c, cupsdAuthorize(): Attempt to use + cups-check-pam-auth before trying native PAM. + + With this we do not need to put the cupsys user into the shadow group. + - debian/cupsys.files: Install PAM helper. + - debian/cupsys.postinst: Set permissions of PAM helper to cupsys:shadow + 2754, alter permissions of some configuration files and directories to + work with non-root cupsd. + - debian/cupsys.postinst: Fix /var/cache/cups/ permissions for upgrades + which might have written cache files as root. + - debian/cupsys.logrotate: Save log files as cupsys:lpadmin. + - debian/cupsys.init.d: Disable 'reload'; change force-reload to restart, + since cupsd cannot reload as non-root. + - debian/cupsys.init.d: Set up proper permissions of log files. + - debian/rules: Enable --enable-privilege-dropping configure option. + - debian/rules: Install lpd backend suid root, so that it can bind to + ports < 1024 (really silly, but required for RFC compliance). + - debian/cupsys-client.postinst, debian/cupsys.postinst: Set up cupsys + system user. + * debian/NEWS: Describe derooting. + + -- Martin Pitt Mon, 14 May 2007 09:23:16 +0200 + +cupsys (1.2.7-4) unstable; urgency=high + + [ Kenshi Muto ] + * Use dh_usrlocal to install files in /usr/local in the + maintainer scripts, instead of shipping them in the deb. + This was policy violation (closes: #409335) + + -- Kenshi Muto Fri, 2 Feb 2007 18:16:24 +0900 + +cupsys (1.2.7-3) unstable; urgency=high + + [ Kenshi Muto ] + * removed STR2137 patch. This patch corruted some + Postscript files. (closes: #403703) This was a release + critical bug. + * Provides /usr/local/share/ppd and /opt/share/ppd + to satisfy LSB 3.2. (closes: #408154) + * Applied upstream patch: + - STR2198: The scheduler still loaded the remote printer cache, + even when browsing was disabled + * Debconf translation + - Portuguese (closes: #408332) + - Norwegian (closes: #406253) + + -- Kenshi Muto Thu, 1 Feb 2007 10:17:30 +0000 + +cupsys (1.2.7-2) unstable; urgency=high + + [ Kenshi Muto ] + * Applied upstream patches to fix some (include RC) bugs as dpatch style: + - STR2106: Raw PBM files did not print correctly + - STR2111: The PostScript filter did not properly output + document setup commands for reversed output (closes: Bug#403703) + - STR2117: The scheduler did not parse IPv6 netmask properly + - STR2121: cupsDoAuthentication() did not translate the password + prompt + - STR2123: The backends incorrectly used STATUS: + media-tray-empty-error messages for out-of-paper conditions + - STR2133: httpGetLength2() did not handle error messages without + content correctly + - STR2135: cupsMarkOptions() did not handle the + multiple-document-handling option + - STR2137: Collated output produced by the PostScript filter could + lose some options + - STR2144: job-hold-until with time values for the next day would + be held for 60 days + * 67_printcap: Add Printcap/PrintcapFormat/PrintcapGUI variables to + cupsd.conf file. (closes: #401981) + * cupsys makes /var/run/cups/certs. Although CUPS daemon can make + it automatically, the daemon logs an warning. + * 68_edit-config: Provide same cupsd.conf as initial package + installation. + + -- Kenshi Muto Wed, 6 Dec 2006 22:42:34 +0000 + +cupsys (1.2.7-1) unstable; urgency=low + + * New upstream release + - Added Italian translation + + [ Kenshi Muto ] + * Add printer.schema to /usr/share/doc/cupsys/examples for LDAP. + (closes: #399122) + + -- Kenshi Muto Sat, 18 Nov 2006 10:03:30 +0900 + +cupsys (1.2.6-2) unstable; urgency=low + + [ Kenshi Muto ] + * Debconf translation + - Brazillian Portuguese (closes: #397842) + - Basque (closes: #398574) + * 00_r6100: Apply SVN r6100. + - Fixed an inefficiency in the SNMP IPP detection code + (closes: #397833) + + -- Kenshi Muto Tue, 14 Nov 2006 22:29:08 +0900 + +cupsys (1.2.6-1) unstable; urgency=low + + * New upstream release + Fixes bugs include + - "lpc status" did not show the number of queued jobs for + disabled queues + - The lpstat program could hang + + -- Kenshi Muto Tue, 7 Nov 2006 21:09:33 +0900 + +cupsys (1.2.5-1) unstable; urgency=medium + + * New upstream release. + + [ Kenshi Muto ] + * 00_r6052: Apply SVN r6052 to pass the compile with libpaper. + * provides /etc/pam.d/cupsys correctly. (closes: #392142) + (renamed debian/pam to debian/cupsys.pam) + * fixed "ppd API fails to discover printer nickname and options" + problem" by upstream (closes: #394255) + + -- Kenshi Muto Sat, 21 Oct 2006 01:18:34 +0000 + +cupsys (1.2.4-2) unstable; urgency=low + + [ Kenshi Muto ] + * PPD transition to /usr/share/ppd is mostly finished. + Now I remove old symlink /usr/share/ppd/cups-transitional-dir and + /usr/share/cups/cups-included. (closes: #381266, #383291) + * Update debconf translations: + - Brazilian Portuguese (closes: #389222) + * Tried to solve the backend permission problem. CUPS scheduler + uses a permission and owner information of backend program. + - Install ipp and lpd as mode 0700. + - Create backend links as hardlink instead of symlink. + + -- Kenshi Muto Sat, 30 Sep 2006 14:56:29 +0900 + +cupsys (1.2.4-1) unstable; urgency=medium + + * New upstream release + - The web interface change settings and edit configuration + file buttons would truncate the cupsd.conf file (STR #1976, + closes: #389093) + Because this bug seems critical, we upload this fixed version + as urgency=medium. + [ Martin Pitt ] + * debian/patches/56_dirsvc.dpatch: Update patch so that a patch/unpatch + cycle restores the source properly instead of breaking dirsvc.c in two + different places. + + [ Kenshi Muto ] + * debian/patches/65_detect_http_shutdown.dpatch: avoid that + gnome-cups-manager eats CPU 100%. (closes: #377640) + + -- Kenshi Muto Sun, 24 Sep 2006 09:54:44 +0000 + +cupsys (1.2.3-1) unstable; urgency=medium + + * New upstream release + - The parallel and USB backends no longer wait for the + printer to go on-line - this caused problems with + certain printers that don't follow with the IEEE-1284 + standard (STR #1738, closes: #383091) + - fixed Printer options were not always honored when printing + from Windows clients (STR#1839, closes: #385605) + + [ Martin Pitt ] + * Add appropriate Replaces: to cupsys-common to unbreak upgrades. + * debian/patches/44_fixconfdirperms.dpatch: Fix file mode specification: + 3755 -> 03755 (regression of svn commit 353). + + [ Kenshi Muto ] + * Apply upstream svn r5958. + * check modprobe command and /proc/modules dir exist before running + modprobe (closes: #387176). + * 62_classes_crash: fix incorrect code. old code returned an error + even if user use the correct class configuration. (closes: #380663, #384654) + * bump up libcupsys2.shlibs version to 1.2.3. (closes: #385724) + * Merge old separated style configuration to the single format + only if user upgraded from an affected version. (closes: #386551) + * Provide /usr/share/cups/drivers to contain Windows drivers. + * 57_cupsaddsmb: original cupsaddsmb easily goes infinite and DoS-like + loop. Debian cupsaddsmb ends soon when it catches an error. + + -- Kenshi Muto Fri, 8 Sep 2006 11:28:12 +0200 + +cupsys (1.2.2-2) unstable; urgency=high + + [ Kenshi Muto ] + * Apply upstream svn change r5845. + - BrowseRelay didn't work on Debian (closes: #372855) + 61_job_c_strangeloop.dpatch: I don't make sure but job.c of + r5818 causes strange CPU busy when it gets printing jobs. + This patch avoids it. + * 12_quiesce_ipp_logging: some part are merged into the upstream + source. updated. + * libcupsys2 conflicts cupsys version 1.1. + libcupsys2 version 1.2 changed its private API. This breaks + old cupsys 1.1, but we believe cupsys is only one application + is affected by this change. (closes: #380619) + * Provide an new package, "cupsys-dbg" to help chasing the + problems at user's environment. + * Increment compat to 5. + * 44_fixconfdirperms: set owner lp for /etc/cups directory. + And modify lppasswd.man to mention about Debian + specific changes. lppasswd command now work. (closes: #378062) + * 62_classes_crash: when class hasn't any printers, cupsd will + crash immedieately after receiving a job. This patch avoids + a crash. + * Update debconf translations: + - Spanish (closes: #383087) + + -- Kenshi Muto Thu, 27 Jul 2006 23:40:54 +0900 + +cupsys (1.2.2-1) unstable; urgency=medium + + * New upstream release + + [ Martin Pitt ] + * Adapt patches to new upstream version. + * debian/cupsys.init.d: If lp module loading is requested, also load the + 'ppdev' module to fix the name and model detection of parallel printers on + newer kernels. + * Revive debian/patches/56_dirsvc.dpatch; it's still not fixed upstream. + * debian/patches/09_runasuser.dpatch: Do not drop additional group + privileges in scheduler/process.c. This should fix a range of bugs + concerning detection of parallel port printers and other 'permission + denied' bugs if privilege dropping is enabled (it is disabled by default in + Debian). + * debian/patches/44_fixconfdirperms.dpatch: Do not change owner and mode of + SSL certificate, in order to not break permissions of customized global + ones (like the one from the ssl-cert package). Grrr, cups, no, you cannot + own the world! + * debian/patches/54_cups-config_modeldir.dpatch: Add --modeldir to + cups-config so that other packages can use it to figure out the correct + PPD base path. + * debian/cupsys.examples: Do not ship .svn files (upstream Makefiles install + them). + * debian/local/{enable_browsing,browsing_status}: Adapt to single-file + configuration file style. + * Add debian/local/{enable_sharing,sharing_status}: Similar to + enable_browsing and browsing_status, this switches between "Listen + localhost:631" and "Port 631" (just as the web interface does). Install + files in debian/rules. + + -- Kenshi Muto Mon, 24 Jul 2006 10:59:27 +0200 + +cupsys (1.2.1-4) unstable; urgency=medium + + [Kenshi Muto] + * Include changelogs during 1.1.23-13 - 1.1.23-15. (closes: #374494) + * Apply upstream svn change r5754. + - Fix negotiation problem between unstable clients and sarge servers. + (closes: #375359) + * 58_fixdestc: avoid build failure of r5754 (add ipp-private.h include). + * 59_de_docroot: install German translation/images. Although upstream + SVN has, Debian diff structure can't handle a binary diff. This patch + will be removed when 1.2.2 is released. + * Add snmp to backend choices. Because I don't make sure this backend + is stable, the default is disabled. Use dpkg-reconfigure cupsys to + enable. (closes: #376496) + * Don't remove backend symlinks during reconfigure/upgrade process. + (closes: #376499) + * Check Include directive with case insensitive. (closes: #376883) + * libcupsys2 has /etc/cups directory to allow admin put own + client.conf. (closes: #370788) + * Include sample client.conf in libcupsys2. You can copy /usr/share/ + doc/libcupsys2/examples/client.conf to /etc/cups or ~/.cups and modify + for your environment. (closes: #376840) + * Split locale files to new package "cupsys-common". (closes: #378659) + This package is used by cupsys and cupsys-client/cupsys-bsd. + * removed 26_modprobe: because parallel backend executes with user 'lp' + permission, modprobe can't work. We CUPS team believe it's better + that lp module is loaded by discover or any other hardware detection + programs instead of CUPS. We provide a module loader by init script + for user's convenience at this time. + * 60_device_uri: preserve old URI during the printer configuration on + Web interface. + + -- Kenshi Muto Wed, 21 Jun 2006 15:06:02 +0000 + +cupsys (1.2.1-3) unstable; urgency=low + + [Kenshi Muto] + * Apply upstream svn change r5673. + - Remove unnecessary %s from dirsvc.c and will solve a mysterious + cupsd crash. Thanks Neil. (closes: #372696, #370611) + - Support again * character as IP address. (closes: #372291) + - Fixes wrong command line arguments to backend. (closes: #372586, #373839) + * Improve the wording of NEWS file, thanks Tomas (closes: #372256) + * 53_usr_share_ppd_support: Use /usr/share/ppd as PPD path. + (closes: #365300, #373722) + Make symlink /usr/share/ppd/cups-transitional-dir -> /usr/share/cups/ppd + for keeping a compatibility. We'll migrate all of PPD files to + /usr/share/ppd in the future. + * Revert to use single /etc/cups/cupsd.conf file for the configuration + instead of using separate files in /etc/cups/cups.d. The migration will + be done automatically. (closes: #345973, #372727) + * Apply correct permission modes to the files under /etc/cups at postinst + stage. + * Update debconf translations: + - Danish (closes: #371170) + - French (closes: #372714) + - Italian (closes: #372198) + + -- Kenshi Muto Sun, 11 Jun 2006 11:51:01 +0000 + +cupsys (1.2.1-2) unstable; urgency=low + + [Kenshi Muto] + * Provides /etc/cups/ssl directory for SSL. (closes: #370407, #370450) + * Add an newline after 'Starting ...' message by appending log_end_msg + to /etc/init.d/cupsys. (closes: #370460) + + -- Kenshi Muto Mon, 5 Jun 2006 22:44:55 +0900 + +cupsys (1.2.1-1) unstable; urgency=low + + [Kenshi Muto] + * New upstream release 1.2.1 for Debian unstable/testing. + * 00_r5610: Apply patches from upstream r5610. + * Re-update Dutch debconf translation (closes: #369004) + * Pump up shlibs to >=1.2.1 for compatibility safe. + + -- Kenshi Muto Wed, 31 May 2006 13:17:16 +0000 + +cupsys (1.2.1-0exp1) experimental; urgency=low + + [Kenshi Muto] + * New upstream release 1.2.1. + * Update Dutch debconf translation (closes: #369004) + * Update Italian debconf translation (closes: #367943) + * Includes the installation guide of dvi filter to /usr/share/doc/ + cupsys/examples/filters/dvipipetops.INSTALL is contributed by + Francesco Potort. This is partial fix for Bug#368450. + + [Martin Pitt] + * New upstream release 1.2.0. + * Update patches for new upstream release. + * Remove debian/patches/01_cupsimage.dpatch, fixed upstream. + * Remove debian/patches/20_httpGetHostname_crash.dpatch, fixed upstream. + * debian/patches/55_ppd_okidata_name.dpatch: Change "Oki" manufacturer name + to "Okidata" to be consistent with other PPD files. + * Implement http://wiki.debian.org/PpdFileStructureSpecification: + - debian/dirs: Create /usr/share/ppd/cups-included/. + - debian/rules: Install shipped PPDs into + /usr/share/ppd/cups-included// and provide a symlink to + the old /usr/share/cups/model directory for backwards compatibility. + * debian/cupsys.dirs: Ship /usr/lib/cups/driver/ to avoid error messages if + it's missing. + * debian/patches/09_runasuser.dpatch, scheduler/cert.c: Change root + certificate permissions from 0440 to 0240, so that the CGI programs cannot + read it any more. Without this patch, cupsd presented its own certificate + to itself, and *every* user could do admin tasks without authentication. + * debian/cupsys-client.links: Fix cupsenable/cupsdisable manpage link. + Closes: #364447 + * debian/patches/08_cupsd.conf.conf.d.dpatch: + - Set "BrowseAddress @LOCAL"; without this, sending browsing information + does not work (Browsing still has to be enabled). + - Add some comments to point out that the Port and Browsing settings are + moved to /etc/cups/cups.d/. + * debian/cupsys.postrm: Clean up passwd.md5 on purge. + + -- Kenshi Muto Sun, 28 May 2006 13:07:36 +0000 + +cupsys (1.1.99.rc2-0exp1) experimental; urgency=low + + [ Kenshi Muto ] + * New upstream release 1.2RC2. + - Because -fpie config becomes optional, compiler works on amd64 and + other architectures. (closes: #335199) + * Enable LDAP support. + * Remove duplicated update-rc.d (closes: #356911) + * Stopped asking admin password because it works only if user chooses + digest authentication. The default configuration of Debian uses + PAM and basic authentication. + * Enable dbus support. + * 03_clean.dpatch: Remove produced and remained files during build. + * Now CUPS uses 'lp' user/group privilege to call backend or any other + programs. + CUPS SystemGroup is 'lpadmin'. You need to add users who are allowed + to add/modify/remove printers/jobs/classes. + * Remove image.h.patch from source. It is no longer needed. + * 02_configure.dpath: Remove -rpath from configure. + * Fix typo in cupsys-bsd description. (closes: #362070) + * Add Galician debconf translation. (closes: #361258) + * Update Danish debconf translation. (closes: #357969) + * Use 'reload' during logrotate instead of 'restart'. It looks safe + on CUPS 1.2. (though job-restart problem still remains) + * set TZ in init script only if TZ isn't defined yet. + * Use if-fi structure style for postrotate of logrotate script. + It solves error when cupsys is not running. (closes: #347641) + * Unset TMPDIR environment variable before running daemon. (closes: #347829) + * Removed /etc/cups/pdftops.conf because it was for pdftops of upstream + version. Debian CUPS uses xpdf-utils wrapper and doesn't need + pdftops.conf. + * Notice: /etc/cups/client.conf has been removed upstream. + * Notice: {dis,en}able have been renamed to cups{dis,en}able. + + [ Martin Pitt ] + * debian/patches/48_stdlib.dpatch: Adapted to new upstream version. + * debian/cupsys.init.d: + - Fix arguments of start-stop-daemon and remove the hideous kill + algorithm. + - Ensure that /var/run/cupsd exists; this makes the init script work with + /var/run mounted on a tmpfs. + * debian/libcupsys2-dev.files, debian/libcupsimage2-dev.files: Remove static + library; upstream does not build them any more, and they are useless + anyway. + * Add debian/patches/06_disable_backend_setuid.dpatch: Remove the uid + changing in scheduler/cups-deviced.c which was introduced recently in + upstream. It totally breaks device node access (e. g. /dev/lp0 is root:lp + 0660, which is inaccessible for a process which runs as lp:root). + * debian/rules: Remove --with-cups-user, upstream does not support + it any more. + * debian/patches/09_runasuser_fixes.dpatch: RunAsUser was removed upstream; + rename the patch to 09_runasuser.dpatch and rewrite it: + - Enclose all changes in an #if CUPS_DROP_PRIVILEGES, so that it is easy to + enable this feature. + - scheduler/main.c: Drop privileges after initialization. + - scheduler/conf.c: If we build with CUPS_DROP_PRIVILEGES, set RunUser to + User instead of getuid(), since at that point we will always run as root + (privileges cannot yet be dropped at that point). + - config-scripts/cups-defaults.m4: Add --enable-privilege-dropping option. + - config.h.in: Add CUPS_DROP_PRIVILEGES option template. + * Add debian/patches/09_runasuser_autoconf.dpatch: autoconf changes for + 09_runasuser_fixes.dpatch changes. + * debian/pdftops: Fix reading from stdin (https://launchpad.net/bugs/17124) + * debian/cupsys.preinst: Remove dangling /etc/cups/pdftops.conf symlink on + upgrades to unbreak printing with poppler-utils. + * debian/control: Add poppler-utils alternative for xpdf-utils dependency. + * Add debian/patches/12_quiesce_ipp_logging.dpatch: + - Drop successful IPP messages to log level 'debug' and unsuccessful ones + to 'info'. + - Do not flood access_log with successful CUPS-Get-Printers and + Get-Printer-Attributes queries (which are generated by e. g. + gnome-cups-icon every 3 seconds). + - Closes: #280718 + * Add debian/patches/13_default_log_warn.dpatch: Raise default log severity + to 'warning' to not log gazillions of IPP requests by default. (other part + of #280718) + * debian/rules, debian/cupsys.postinst: Remove obsolete /etc/cups/certs and + /var/lib/cups/certs (certificates are managed in /var/run/certs now). + * debian/cupsys.preinst: Remove obsolete /etc/cups/certs symlink on upgrades. + * debian/cupsys-client.files: Install cupstestdsc and manpage. + * debian/cupsd.init: Have force-reload to reload, not restart. + * debian/cupsys.logrotate: Use force-reload instead of reload, since the + latter is not required to exist by Debian Policy. + * debian/rules: Ship browsing_status and enable_browsing. + * debian/patches/20_httpGetHostname_crash.dpatch: Add some robustifications + to httpGetHostname() to hopefully fix a reported crash. + + -- Kenshi Muto Sun, 16 Apr 2006 17:49:57 +0900 + +cupsys (1.1.99.b1.r4885-1) experimental; urgency=low + + [ Kenshi Muto ] + * New SVN release taken from rr4885. + * Updated Russian debconf translation, taken from cupsys trunk. + * Downgrade port and browse question to low. + * Add timeout routine to avoid lockup. + * debian/patches/08_cupsd.conf.conf.d.dpatch: + - Commented out Port/Listen/Browsing from cupsd.conf.in. + CUPS crashes when there is a duplicate definition. + * Updated Swedish debconf translation. + * Set seen false flag when ports configuration is failed. + * Allow '*' for hostname in ports.conf. + * Use /bin/echo instead of shell built-in echo. + * Improve cupsys.templates. + * Updated Russian, German, Czech,French, Vietnamese debconf translation. + * Removed example descriptions from init.d script. + * Fix IPv4 validation. + + [ Martin Pitt ] + * Adapt debian/patches/02_configure.dpatch to r4885. + * Move forcefully killing of cupsd if start-stop-daemon fails from + postinst to init script, where it belongs to. Do not kill all running + cupsd processes, but only the one in the pid file; this will unbreak cupsd + behaviour in chroots. + * debian/cupsys.default: Remove obsolete FORCE_RESTART option. + * Resurrect debian/patches/01_cupsimage.dpatch (formerly + 03_cupsimage.dpatch), as we get unresolved symbols if libcupsimage + isn't properly linked to libcupsys, causing other packages to FTBFS. + Thanks to Adam Conrad. + * debian/cupsys.init.d: Add --oknodo to not fail if cupsd is already + running. + * debian/rules: In clean rule, clean up a lot of files that are left behind + by 'make clean'. + + -- Kenshi Muto Fri, 23 Dec 2005 06:33:05 +0000 + +cupsys (1.1.99.b1.r4876-1) unstable; urgency=low + + [ Martin Pitt ] + * debian/local/{enable_browsing,browsing_status}: Adapt configuration file + locations to new conf.d structure. + * debian/cupsys.templates: Fix default value for cupsys/browse: 'yes' is an + invalid bool option, change to true. + * debian/cupsys.init.d: Use LSB init functions. Add lsb-base package + dependency. + * debian/cupsys.postinst: Wait a second between kill -9'ing cupsys and + checking if the process still exists to avoid false positives and upgrade + failures. + * Clean up support for /etc/cups/conf.d: + - Add debian/patches/08_cupsd.conf.conf.d.dpatch: Add include commands to + default cupsd.conf file. + - debian/cupsys.postinst: Remove fiddling with cupsd.conf. + - This will ensure that cupsd.conf will remain an unchanged conffile. + * debian/rules: Remove empty debian/patched on clean. + * debian/patches/10_cupsd.conf2.dpatch: Re-enable listening to localhost to + make the web interface work. + * debian/patches/44_fixconfdirperms.dpatch: + - Put configuration files into group root instead of nobody to avoid + privilege escalation of nobody/nogroup and comply to Debian standards. + - Use CUPS_DEFAULT_GROUP instead of 'nobody' as the default group for + setgid'ing to and conffiles which must be writable for cupsd. + - Disable changing permissions of cupsd.conf conffile. + * Add debian/patches/09_runasuser_fixes.dpatch: + - scheduler/main.c: Generate a certificate even when running as user, just + as in 1.1.x; this unbreaks local certificate authorization for cupsd + when it runs as normal user. + - scheduler/main.c: When running as non-root, call initgroups() instead of + setgroups() to allow auxiliary groups. These are required to access + different device types (lp for USB/parallel printers, dialout for serial + printers, etc.) + + [ Kenshi Muto ] + * New SVN release taken from r4876. + + -- Kenshi Muto Thu, 8 Dec 2005 21:26:22 +0900 + +cupsys (1.1.99.b1.r4841-1) experimental; urgency=low + + * EXPERIMENTAL + * New SVN release taken from r4841. + * Remove -pie and -fpie from compiler option. pie option causes + a problem with Debian binutils. + I hope this change avoids FTBFS on sparc and others. (closes: #339120) + + -- Kenshi Muto Wed, 16 Nov 2005 12:27:27 +0000 + +cupsys (1.1.99.b1.r4748-4) experimental; urgency=low + + * EXPERIMENTAL + * 00_r4835.dpatch: Taken from r4835. + Well, r4835 removes some files. It means dpkg-buildpackage always + fails when we rebuild source. Maybe it's time to change orig source. + Moved obsolete patches to patches/obsolete. + * 48_stdlib.dpatch: Fix FTBFS for arm, mips, and mipsel. + * 03_manext.dpatch: Don't use upstream's manpage file handling. + Debian uses dh_installman. + * 04_freebsd.dpatch: Apply Brian's patch to support GNU/kFreeBSD + (closes: #338266) + * Install lppasswd as owner 'lp'. + + -- Kenshi Muto Fri, 4 Nov 2005 13:56:27 +0000 + +cupsys (1.1.99.b1.r4748-3) experimental; urgency=low + + * EXPERIMENTAL + * 47_pid.dpatch: Modified to allow to configure location of pid file. + (closes: #337093) + You can change this location by PidFile directive at your cupsd.conf. + * Remove example comments from init script. (closes: #334842) + + -- Kenshi Muto Thu, 3 Nov 2005 11:39:07 +0000 + +cupsys (1.1.99.b1.r4748-2) experimental; urgency=medium + + * EXPERIMENTAL + * 02_configure.dpatch: Modified to remove -pie/-fpie if arch = x86_64. + (closes: #335199) + + -- Kenshi Muto Mon, 24 Oct 2005 11:42:59 +0000 + +cupsys (1.1.99.b1.r4748-1) experimental; urgency=low + + * EXPERIMENTAL + * CUPS 1.2 snapshot (r4748) from SVN. + + -- Kenshi Muto Wed, 5 Oct 2005 12:54:27 +0000 + +cupsys (1.1.23-15) unstable; urgency=high + + [Kenshi Muto] + * Allow '*' for hostname in ports.conf. (closes: #340975) + * Fix IPv4 address validation. + * Use /bin/echo instead of shell built-in echo. (closes: #343566) + * Improve cupsys.templates. (closes: #343498) + * Updated Swedish debconf translation. + * Updated Russian debconf translation. + * Updated German debconf translation. + * Updated Czech debconf translation. (closes: #343716) + * Updated French debconf translation. (closes: #344116) + * Updated Vietnamese debconf translation. + * Removed example descriptions from init.d script. (closes: #334842) + * Apply kFreeBSD patch. (closes: 338266) + + -- Kenshi Muto Fri, 16 Dec 2005 21:05:47 +0900 + +cupsys (1.1.23-14) unstable; urgency=high + + [Kenshi Muto] + * Downgrade port and browse question to low. (closes: #343341) + * debian/patches/08_cupsd.conf.conf.d.dpatch: + - Commented out Port/Listen/Browsing in cupsd.conf.in because + CUPS crashes when there is a duplicate definition! + (closes: #343251, #343279, ##343285, #343292) + * Added NEWS to explain how to fix this for 1.1.23-13 users: + Tweaking cupsd.conf via postinst is a bad idea, so I gave up + trying to correct this automatically. Instead, comment out the + Port/Listen/Browsing lines in /etc/cups/cupsd.conf if you had + already replaced this file by the one from 1.1.23-13. + * Updated Swedish debconf translation. (closes: #343397) + * Set seen false flag when ports configuration is failed. + (closes: #343400) + + [Martin-Éric Racine] + * Added debian/watch file. + + -- Kenshi Muto Thu, 15 Dec 2005 06:00:09 +0900 + +cupsys (1.1.23-13) unstable; urgency=high + + * 38_pdftopscan.dpatch: Apply CAN-2005-0064, CAN-2004-0888, + and CAN-2005-2097 patches. (closes: #324459, #324460, #324464) + Because Debian cupsys uses xpdf wrapper instead of forked pdftops, + so users aren't affected these security problems. + This patch is just for users who want to create own pdftops from + source. + * Move Port/Listen and Browsing configurations from /etc/cups/ + cupsd.conf to /etc/cups/cups.d/. + + /etc/cups/cups.d/ports.conf: Port/Listen configuration. + /etc/cups/cups.d/browse.conf: Browsing configuration + + You can configure these values by using "dpkg-reconfigure cupsys". + (closes: #235906, #297695, #178838, #288838) + + * Added Swedish debconf translation (closes: #338545). Thanks Daniel. + * Updated Russian debconf translation (closes: #340626). Thanks Yuri. + + * Applied xpdf patch to fix buffer overflows [pdftops/Stream.cxx, + pdftops/Stream.h, CAN-2005-3191, CAN-2005-3192, + 48_security_CAN-2005-3191.dpatch] + Because Debian cupsys uses xpdf wrapper instead of forked pdftops, + so users aren't affected these security problems. + This patch is just for users who want to create own pdftops from + source. + + -- Kenshi Muto Mon, 22 Aug 2005 18:50:26 +0900 + +cupsys (1.1.23-12) unstable; urgency=medium + + * foomatic-rip may be treated as recommended tool. + Modified control file. (closes: #320196) + * Add debconf-2.0 as debconf alternative. + * Migrated to libgnutls12. (closes: #322087) + libcupsys2 backed as real library. libcupsys2-gnutls10 became + transitional package. (closes: #322018) + * Add procps to Depends: of cupsys. ps command is used by + cupsys.postinst. + * 47_pid.dpatch: Added a patch to make forked PID file. + Now init script use this file instead of one created by + start-stop-daemon. + I hope this solves Samba starting bug. (closes: #315017) + * Back gs-esp to Depends:. (closes: #312244) + PostScript printer owners may claim this, but currently + we Debian CUPS Maintainers team have massive complains about + missing gs-esp dependency. It's current best workaround to + avoid such printing problems. + + -- Kenshi Muto Thu, 28 Jul 2005 11:35:27 +0900 + +cupsys (1.1.23-11) unstable; urgency=low + + * "At Debconf 5" release. + * Now CUPS is maintained by Debian CUPS Maintainers Team. + + * Do "sleep 2" to wait daemon's wake up. (this is just workaround... + needs better solution, for #309794 and #315017) + * Added Vietnamese translation. (closes: #310152) + * Check whether daemon is running or not before restart in logrotate. + (closes: #310535) + * Add description about foomatic-rip (in foomatic-filters package) + to README.Debian. (closes: #309399) + * Remove unnecessary comment from debian/po/de.po (closes: #314135) + * Apply status option for init script (closes: #312683). Thanks Stephen. + * Suggests cupsys-driver-gutenprint, this package is new name of + cupsys-driver-gimpprint. + * 46_ppdsdat: Move /etc/cups/ppds.dat to /var/lib/cups/ppds.dat and + make symlink. (closes: #317905) + * Unapply NOAUTH handling from 33_jobauthorize. A user warns me + it's dangerous to use. + + -- Kenshi Muto Fri, 20 May 2005 11:07:42 +0900 + +cupsys (1.1.23-10) unstable; urgency=high + + * Recovered http backend. -8 and -9 missed it. (closes: #305169) + * Use absolete path for doc-root instead of relative path. + (closes: #305339) + + -- Kenshi Muto Tue, 19 Apr 2005 20:47:49 +0900 + +cupsys (1.1.23-9) unstable; urgency=medium + + * Remove unnecessary and toxic space in doc-base file. + (closes: #305084) + + -- Kenshi Muto Mon, 18 Apr 2005 08:08:03 +0900 + +cupsys (1.1.23-8) unstable; urgency=medium + + * "Brush up for Sarge" release. + * Introduced dpatch for source management. + * Included Spanish man pages. + * 43_filtercost: Applied a patch for wrong computation of cost + (closes: #304205) + * Applied many part of ubuntu patch, http://people.ubuntu.com/~scott/patches/cupsys/cupsys_1.1.23-7ubuntu1.patch. + (User 'cupsys' feature and Browsing feature aren't applied at this time. + They are post-Sarge things) + * Applied improved dvifilter patch. (Although you need to modify + /etc/cups/mime.convs and some other files to use it) (closes: #198100) + * Provides /var/run/cups/cupsd.pid. (closes: #301804) + * Added cupsys documentation to doc-base structure. (closes: #171396, #304333) + * Included filter for PostScript from Windows PostScript driver, created by + Matt Swift . + If you want to use, put /usr/share/doc/cupsys/examples/filters/samba-postscript.* to /etc/cups, + and put /usr/share/doc/cupsys/examples/filters/samba-ps-to-ps to /usr/lib/cups/filter. (closes: #246577) + + -- Kenshi Muto Wed, 16 Mar 2005 10:01:57 +0900 + +cupsys (1.1.23-7) unstable; urgency=low + + * Drop /etc/cups/printers.conf and /etc/cups/classes.conf from + configuration files. (closes: #298103) + Migration will be done automatically. + * Add /etc/default/cupsys. You can change force stop behavior by + changing FORCE_RESTART in this file. (closes: #298040) + * Add hplip to Suggests:. (closes: #297776) + + -- Kenshi Muto Sat, 5 Mar 2005 12:27:32 +0900 + +cupsys (1.1.23-6) unstable; urgency=medium + + * Fix missing adduser dependency in cupsys-client. (closes: #296849) + * Apply parallel backend improvement patch. + - don't receive signal during writing (closes: #296222) + - fix 64bit problem (closes: #296223) + + -- Kenshi Muto Sat, 26 Feb 2005 08:07:39 +0000 + +cupsys (1.1.23-5) unstable; urgency=low + + * Improve postinst message (closes: #295642). Thanks Adam. + + -- Kenshi Muto Fri, 18 Feb 2005 21:23:10 +0900 + +cupsys (1.1.23-4) unstable; urgency=low + + * 20defaultport.patch is merged in upstream source. + * ARGH, libcupsys2-dev should conflict/replace against <<1.1.22-3. + Fix control file. (closes: #292879) + * Remove obsolete README_fr.txt. (closes: #293274) + + -- Kenshi Muto Sun, 30 Jan 2005 08:35:17 +0900 + +cupsys (1.1.23-3) unstable; urgency=low + + * Remove $Id$ from config file: 07cvsremovetag.patch (closes: #291629) + * Fix 'lppasswd does not work with nonexisting passwd file' by mpitt's patch: + 41lppasswdnoexistingconf.patch (closes: 290011) + + -- Kenshi Muto Sat, 22 Jan 2005 12:23:46 +0900 + +cupsys (1.1.23-2) unstable; urgency=medium + + * Move defvalue declaration to begin block for compile on + backports environment. Thanks Massimiliano. + * Fix Cyclades serial port name: 40cycladeserial.patch (closes: #270375) + * Upgrade shlibs of libcupsys2-gnutls10. cupsys-client needs newest + libcupsys2-gnutls10 (closes: #289930, #289939). + + -- Kenshi Muto Mon, 10 Jan 2005 13:48:32 +0900 + +cupsys (1.1.23-1) unstable; urgency=low + + * New upstream release + * lprng disabled ipp feature since 3.8.26-1. Remove conflicts: lprng + of cupsys. (closes: #288531) + + -- Kenshi Muto Tue, 4 Jan 2005 19:32:16 +0900 + +cupsys (1.1.22-8) unstable; urgency=high + + * Fix another security vulnerability since 1.1.21. Sigh... + (closes: #287835) + + -- Kenshi Muto Fri, 31 Dec 2004 13:16:54 +0900 + +cupsys (1.1.22-7) unstable; urgency=medium + + * Use Depends: xpdf-utils instead of Recommends:. + This is RC fix (closes: #287921) + + -- Kenshi Muto Fri, 31 Dec 2004 08:37:54 +0900 + +cupsys (1.1.22-6) unstable; urgency=high + + * Replaced upstream pdftops (derived from Xpdf) with pdftops.pl wrapper. + pdftops.pl is made by Helge Blischke, GNU GPL licensed. + + CUPS 1.1.22 should enter to Sarge ASAP by some security reasons, + but upstream pdftops prevents to enter because it has libgcc_s.so + dependency and current gcc 3.4 faces difficult 'unwind' problem. + Now I believe cupsys 1.1.22-6 can enter soon without waiting + gcc problem. + + If you want to print PDF files directly, you need to install + xpdf-utils. pdftops.pl calls pdftops in xpdf-utils package. + * Fix typo in control file. + + -- Kenshi Muto Wed, 29 Dec 2004 14:59:28 +0000 + +cupsys (1.1.22-5) unstable; urgency=high + + * Apply upstream CVS patch (00cvs20041229.patch) + This includes fix of buffer overflow possibility in scheduler. + + -- Kenshi Muto Wed, 29 Dec 2004 21:35:51 +0900 + +cupsys (1.1.22-4) unstable; urgency=high + + * Add Replaces migration for libcupsys2-dev. + It solves 'libcupsys2-dev overwrite a file in cupsys' problem. + (closes: #287609) + + -- Kenshi Muto Wed, 29 Dec 2004 02:43:09 +0000 + +cupsys (1.1.22-3) unstable; urgency=medium + + * Remove unwanted ldflag: Back 02configure.patch (closes: #286450) + * Move fr/cups-config.1 to libcupsys2-dev (closes: #286449) + Thanks for your above two bug reports, Henrique. + * Note: [CAN-2004-1125] "xpdf buffer overflows" is already fixed in + previous Debian revision (1.1.22-2) with upstream patch. + + -- Kenshi Muto Sat, 25 Dec 2004 23:40:15 +0900 + +cupsys (1.1.22-2) unstable; urgency=medium + + * Apply security fix patches from 1.1.23rc1. + * Revert logrotate to use 'reload'. (closes: #271872) + + -- Kenshi Muto Sun, 19 Dec 2004 17:43:10 +0900 + +cupsys (1.1.22-1) unstable; urgency=low + + * New upstream release for unstable. Time is over, sarge isn't shipped. + I checked 1.1.21 to 1.1.22 migration doesn't break ABI quickly, + but I'm still scared... + * Apply gcc-4.0 patch for amd64: 37gfxfont.patch (closes: #285601) + * Do 'restart' instead of 'reload' when log is rotated. + 'reload' sometime causes just shutdown daemon. (Unknown problem) + * Fix equation in cupsys.postscript. (closes: #285205) + * Apply Russell's patch: 38httpwait.patch (closes: #284829) + (This is trial. If there is any grave problem by this, I'll off this + patch) + - Made http_wait() handle EINTR. This bug was causing cups + to print multiple copies of reports on remote printers. + - Lengthed the wait in ipp_http_read to handle connections + running over the internet. The short wait was causing + unwated multiple copies of reports to be printed. + - While both these bugs need to be fixed, neither completely + solves the original multiple copies problem. To solve + that no data should be printed if there was a read error. + * Add dependency version of smbclient. (closes: #284733) + * Fix SIGSEGV when remote destination goes timeout: 39remotetimeout.patch + (closes: #283500) + + -- Kenshi Muto Wed, 15 Dec 2004 18:58:55 +0900 + +cupsys (1.1.22-0.experimental4) experimental; urgency=low + + * "I'm tired waiting Sarge forever" release. + I'm considering to upload 1.1.22 to unstable. + * I forgot to copy files from unstable version... FTBFS is solved. + (closes: #284574) + * Downgrade gs-esp dependency to Recommends. + I'm bore with attacks from stingy people. + + -- Kenshi Muto Tue, 7 Dec 2004 21:39:55 +0900 + +cupsys (1.1.22-0.experimental3) experimental; urgency=low + + * Rebuild with -sa. + + -- Kenshi Muto Tue, 7 Dec 2004 00:52:15 +0900 + +cupsys (1.1.22-0.experimental2) experimental; urgency=low + + * New upstream release + + -- Kenshi Muto Mon, 6 Dec 2004 23:10:18 +0900 + +cupsys (1.1.21-0.experimental2) experimental; urgency=low + + * Fix typo in templates and unfuzzied po files. (closes: Bug#274851) + * Update German translation (closes: Bug#274828) + * Make pam.d/cupsys standard @include style (closes: Bug#265299) + * Set up group lpadmin in postinst instead of rules. + Because lpadmin isn't there on initial build environemnt + (closes: Bug#274985) + + -- Kenshi Muto Mon, 4 Oct 2004 23:09:51 +0900 + +cupsys (1.1.21-0.experimental1) experimental; urgency=low + + * Experimental. + * new upstream version. + + -- Kenshi Muto Sun, 3 Oct 2004 18:15:23 +0900 + +cupsys (1.1.20final+rc1-8) unstable; urgency=medium + + * Apply GNU Hurd configure patch for fix FTBFS. (closes: Bug#274599) + * Improve patch test routine. (closes: Bug#272952, Bug#274564) + + -- Kenshi Muto Sun, 3 Oct 2004 13:07:43 +0900 + +cupsys (1.1.20final+rc1-7) unstable; urgency=medium + + * Fix french debconf translation (closes: Bug#272520). + This update is important because previous version shows + illegal debconf choice in French. + + -- Kenshi Muto Tue, 21 Sep 2004 22:31:54 +0900 + +cupsys (1.1.20final+rc1-6) unstable; urgency=high + + * Applied patch from Alvaro Martinez Echevarria to fix + daniel of service [scheduler/dirsvc.c, CAN-2004-0558] + * Apply GNU/Hurd patch (closes: Bug#263526) + * Update pt_PR debconf translation (closes: Bug#264096) + * Remove directory before making symlink (closes: Bug#270741) + + -- Kenshi Muto Tue, 24 Aug 2004 10:31:32 +0900 + +cupsys (1.1.20final+rc1-5) unstable; urgency=low + + * Apply anonymous patch for /jobs. This patch avoids many + client-error-forbidden. (closes: Bug#184361) + cupsd.conf will be automatically modified to use basic user + authentication (Add AuthType Basic + AuthType User). + + -- Kenshi Muto Wed, 4 Aug 2004 09:13:02 +0900 + +cupsys (1.1.20final+rc1-4) unstable; urgency=medium + + * Wait 10 seconds after reload for samba restart problem. + (closes: Bug#260969) + * Update Czech debconf translation (closes: Bug#260862) + * Built against libtiff4. + * Build against libgnutls11. (Though package name is still + libcupsys2-gnutls10) + + -- Kenshi Muto Mon, 26 Jul 2004 22:12:18 +0900 + +cupsys (1.1.20final+rc1-3) unstable; urgency=high + + * Change guess order of USB device name for FHS compliant. + (closes: Bug#259965) + + -- Kenshi Muto Sun, 18 Jul 2004 04:54:58 +0900 + +cupsys (1.1.20final+rc1-2) unstable; urgency=medium + + * Replace set-as-default icon of Japanese. Thanks Tomo-p. + * Provides libcupsys2 dummy package for smooth transition. (closes: #259378) + + -- Kenshi Muto Wed, 14 Jul 2004 19:10:43 +0900 + +cupsys (1.1.20final+rc1-1) unstable; urgency=low + + * Apply a patch for fixing typo in DE templates. (Closes: Bug#250883) + * New upstream source, 2004-07-03 CVS. + * Add netbase dependency for cupsys-bsd. + * Move certs files to /var/lib/cups/certs. (Closes: Bug#254153) + + -- Kenshi Muto Wed, 26 May 2004 08:46:35 +0900 + +cupsys (1.1.20final+cvs20040330-4) unstable; urgency=medium + + * Now libgnutls10 migration starts at 'unstable'/'testing'. + Packages depending libcupsys2 should be rebuit with newer + libcupsys2-dev. + * Fix log rotation problem by adding 'sharedscripts' to + /etc/logrotate.d/cupsys. (Closes: Bug#249023) + + -- Kenshi Muto Tue, 25 May 2004 08:14:44 +0900 + +cupsys (1.1.20final+cvs20040330-3experimental2) experimental; urgency=medium + + * Rename libcupsys2 to libcupsys2-gnutls10. + This package doesn't 'Provides: libcupsys2' to migrate libgnutls10. + Sebastien Bacher plans cups/libgnutls10 migration. + * Add notes about backend configuration to README.Debian. + * Fix (I hope) log rotation problem by adding sharedscripts to + /etc/logrotate.d/cupsys. (Closes: Bug#249024) + + -- Kenshi Muto Sat, 15 May 2004 11:17:16 +0900 + +cupsys (1.1.20final+cvs20040330-3) unstable; urgency=low + + * Remove EXPORT_SSLLIBS variable from cups-config (Closes: Bug#246102). + -lgnutls isn't necessary by software using libcups. + * Apply PJL detection patch from upstream. + * Translations + - Updated Turkish debconf messages (Closes: Bug#246075). Thanks + Recai and Gurkan. + + -- Kenshi Muto Wed, 28 Apr 2004 00:23:59 +0900 + +cupsys (1.1.20final+cvs20040330-2) unstable; urgency=low + + * Fix typo in HOWTO_BUGREPORT.txt. + * Translations + - Update Dutch debconf messages (Closes: Bug#242260). Thanks Tim. + + -- Kenshi Muto Tue, 6 Apr 2004 19:16:48 +0900 + +cupsys (1.1.20final+cvs20040330-1) unstable; urgency=low + + * New upstream CVS + * Revert pstops to old 1.1.20. (Closes: Bug#240792) + * Translations + - Updated Danish debconf messages. + + -- Kenshi Muto Fri, 26 Mar 2004 19:00:01 +0900 + +cupsys (1.1.20final+cvs20040317-4) unstable; urgency=low + + * Chagnge backend question priority to low. (Closes: Bug#238847) + When you use PPC, parallel backend will be removed from default choice + automatically. + If you want to use parallel (and you know what you will do), + please run 'dpkg-reconfigure cupsys'. + * Translations + - Updated Danish debconf messages (Closes: Bug#239256). Thanks Claus. + - Updated French debconf messages (Closes: Bug#239756). Thanks Christian. + + -- Kenshi Muto Wed, 24 Mar 2004 22:30:28 +0900 + +cupsys (1.1.20final+cvs20040317-3) unstable; urgency=low + + * Remove sysvinit. This package is essential. Thanks Thomas. + * Now choice menu is translatable (Closes: Bug#238821). + * Updated French debconf messages. Thanks Christian. + * Add socket to default choice. I think this backend doesn't + cause hang up anywhere. + + -- Kenshi Muto Fri, 19 Mar 2004 17:16:48 +0900 + +cupsys (1.1.20final+cvs20040317-2) unstable; urgency=medium + + * Add sysvinit in dependency. (Closes: Bug#238763) + * Updated Brazilian Portuguese debconf messages. Thanks Andre. + * Fix printers.cgi crash (Closes: Bug#238800) + * Updated Japanese templates & images. + + -- Kenshi Muto Fri, 19 Mar 2004 09:00:04 +0900 + +cupsys (1.1.20final+cvs20040317-1) unstable; urgency=low + + * New CVS release. + * Add asking about backend program. This is not best way to solve + PPC crash / i386 serial hang-up, but at least user can choose what + he/she want to use. serial backend becomes 'not use' by default. + Add notice about 'parallel of PPC may cause a problem'. + (closes: Bug#237613, Bug#233529, Bug#211677, Bug#224760) + * Updated Spanish debconf messages (closes: Bug#236470). Thanks Carlos. + * Updated Danish debconf messages. Thanks Claus. + * Updated French debconf messages. Thanks Christian. + * Updated Czech debconf messages. Thanks Miroslav. + + -- Kenshi Muto Sat, 6 Mar 2004 21:36:35 +0900 + +cupsys (1.1.20final-16) unstable; urgency=low + + * Improved init.d/cupsys message (closes: Bug#235693). Thanks Lee. + * Add Czech debconf messages (closes: Bug#236276). Thanks Miroslav. + + -- Kenshi Muto Tue, 2 Mar 2004 09:13:07 +0900 + +cupsys (1.1.20final-15) unstable; urgency=low + + * Add conflicts lprng for avoid conflicting ipp support. + * Add Danish debconf messages (closes: Bug#233067). Thanks Claus. + * Apply current CVS patch. + + -- Kenshi Muto Sat, 14 Feb 2004 18:10:54 +0900 + +cupsys (1.1.20final-14) unstable; urgency=medium + + * Apply loop avoid patch. (closes: Bug#231676) Thanks Ray. + + -- Kenshi Muto Wed, 11 Feb 2004 14:59:46 +0900 + +cupsys (1.1.20final-13) unstable; urgency=medium + + * Use pidof instead of start-stop-daemon for stopping cupsys. + I hope this will fix Bug#228967. + + -- Kenshi Muto Thu, 22 Jan 2004 09:12:25 +0900 + +cupsys (1.1.20final-12) unstable; urgency=low + + * Fix incorrect root detection routine (closes: Bug#227733). THanks David. + * Continue to install whether deluser is failed (for NIS/LDAP). + * 22ipprewrite.patch has critical bug. Fixed by better patch. + (closes: Bug#162613) + + -- Kenshi Muto Sat, 17 Jan 2004 12:57:47 +0900 + +cupsys (1.1.20final-11) unstable; urgency=low + + * Improved cupsys stop check. + * Apply username patch for Solaris lpd printing (closes: Bug#228078). Thanks + Lionel. + + -- Kenshi Muto Sat, 17 Jan 2004 12:28:15 +0900 + +cupsys (1.1.20final-10) unstable; urgency=low + + * Apply Brazilian Portuguese debconf message (closes: Bug#227445). Thanks + Andre. + * Show verbose message when cups won't stop. + + -- Kenshi Muto Wed, 14 Jan 2004 08:38:55 +0900 + +cupsys (1.1.20final-9) unstable; urgency=low + + * Apply patch for avoid infinite loop (closes: Bug#225625). + * Apply patch for http password authenticaion cache (closes: Bug#227143). + + -- Kenshi Muto Mon, 12 Jan 2004 12:00:17 +0900 + +cupsys (1.1.20final-8) unstable; urgency=low + + * Fix typo in lpadmin.8.gz (one of Bug#226149). Thanks Dan. + * Unfortunately, I heard cupsys won't stop when upgrading. + I implemented Force-stop routine into postinst (closes: Bug#222464, + Bug#226140). + + -- Kenshi Muto Mon, 5 Jan 2004 21:11:30 +0900 + +cupsys (1.1.20final-7) unstable; urgency=low + + * Argh, I forgot to apply default port patch. + + -- Kenshi Muto Tue, 30 Dec 2003 23:01:29 +0900 + +cupsys (1.1.20final-6) unstable; urgency=low + + * Apply Dutch debconf translation (closes: Bug#225410). Thanks Tim. + * Set default port when any Port/Listen isn't defined (closes: Bug#225208). + + -- Kenshi Muto Tue, 30 Dec 2003 08:57:10 +0900 + +cupsys (1.1.20final-5) unstable; urgency=low + + * Add pdftops.conf into /etc/cups/. This file is symlink to + /etc/xpdf/xpdfrc, and configuration for pdftops tool. + + -- Kenshi Muto Sun, 21 Dec 2003 11:45:38 +0900 + +cupsys (1.1.20final-4) unstable; urgency=low + + * Fix cups* commands don't work (closes: Bug#224585). Thanks Rainer. + + -- Kenshi Muto Sat, 20 Dec 2003 20:52:24 +0900 + +cupsys (1.1.20final-3) unstable; urgency=low + + * Apply patch into lpd.c for true compatible with RFC1179 + (closes: Bug#223432). Thanks Lionel. + * Hmm, PJL patch causes a problem. Since I don't have any PJL + printers, I simply unapply PJL patch and reopen Bug#220611 (closes: + Bug#223748) + + -- Kenshi Muto Fri, 12 Dec 2003 18:32:58 +0900 + +cupsys (1.1.20final-2) unstable; urgency=low + + * Apply PJL patch (closes: Bug#220611). Thanks Zed. + + -- Kenshi Muto Sat, 6 Dec 2003 10:42:37 +0900 + +cupsys (1.1.20final-1) unstable; urgency=low + + * New upstream release + * cupsys set UTF-8 as defaultCharset, but it causes some browsing + problem, and looks don't need indeed. I changed defaultCharset to + invalid value. It will fix French screen (closes: Bug#221904). + * Fix dependency with libgnutls7 by dirty trick. + I hope libgnutls7 maintainer will fix Bug#221309. + + -- Kenshi Muto Tue, 25 Nov 2003 19:17:57 +0900 + +cupsys (1.1.20candidate6-6) unstable; urgency=low + + * Set fixed version into Depends for cupsys, cupsys-client. + + -- Kenshi Muto Mon, 17 Nov 2003 21:35:55 +0900 + +cupsys (1.1.20candidate6-5) unstable; urgency=high + + * I'm sorry but openssl license conflicts. I use libgnutls (closes: Bug#220902). + * Add euc-jp text. + + -- Kenshi Muto Sat, 15 Nov 2003 23:55:06 +0900 + +cupsys (1.1.20candidate6-4) unstable; urgency=low + + * Add French translation (closes: Bug#220805). Thanks, Christian. + * openssl, popular SSL implementation, becomes Debian main, so I think + it is no reason for using libgnutls. I changed depends openssl instead of + libgnutls. + + -- Kenshi Muto Sat, 15 Nov 2003 10:24:38 +0900 + +cupsys (1.1.20candidate6-3) unstable; urgency=low + + * Remove -Wl from configure (closes: Bug#194353) + * Remove /etc/sups/raw.* when purged (closes: Bug#198126) + * Remove always Content-Type charset header. This is test (and ad-hoc) + case. I'll unapply if this patch causes a problem. + * Add Japanese resource. + + -- Kenshi Muto Thu, 13 Nov 2003 23:02:40 +0900 + +cupsys (1.1.20candidate6-2) unstable; urgency=medium + + * Fix FTBFS build error (closes: Bug#220534) + + -- Kenshi Muto Thu, 13 Nov 2003 15:52:00 +0900 + +cupsys (1.1.20candidate6-1) unstable; urgency=low + + * New upstream. + * Rename filter, backend man page (closes: Bug#220500). + + -- Kenshi Muto Wed, 12 Nov 2003 23:41:02 +0900 + +cupsys (1.1.19final-4) unstable; urgency=low + + * "Welcome patch" release. + * Transited packaging system to CDBS. + This release wll be final version for 1.1.19. I'll upload + 1.1.20candidate version at next time. + * libcupsimage2.so.2 links libcupsys.so.2. (closes: Bug#193618) + + -- Kenshi Muto Mon, 10 Nov 2003 10:01:58 +0900 + +cupsys (1.1.19final-3) unstable; urgency=low + + * Fix check routine of Printcap. (closes: Bug#200278) + * Removed "suggests qtcups". (closes: Bug#197267) + + -- Kenshi Muto Fri, 7 Nov 2003 21:43:39 +0900 + +cupsys (1.1.19final-2) unstable; urgency=low + + * lpadmin group included root user, but I didn't understand why it needs. + This may cause security problem, so I remove this process and + remove root from lpadmin group. (closes: Bug#214746) + * Support large file. (closes: Bug#215568) + * Support log rotation. (closes: Bug#200704) + * Force enable PAM (closes: Bug#183211, Bug#181512) + + -- Kenshi Muto Thu, 6 Nov 2003 18:31:02 +0900 + +cupsys (1.1.19final-1.5) unstable; urgency=low + + * New maintainer (acknowledged from Jeff Licquia). + Thanks Jeff! + * Changed templates.* to po-debconf style (closes: Bug#199236). + * Added Japanese debconf translation (closes: Bug#202273). + + -- Kenshi Muto Thu, 6 Nov 2003 09:50:29 +0900 + +cupsys (1.1.19final-1.4) unstable; urgency=low + + * Non-maintainer upload + * Removed '#include ' line from image.h from the version + in libcupsimage2-dev with debian/image.h.patch (Closes: #200427) + + -- Roland Stigge Thu, 4 Sep 2003 14:04:15 +0200 + +cupsys (1.1.19final-1.3) unstable; urgency=low + + * Non-maintainer upload + * cupsys Replaces: and Conflicts: cupsys-pstoraster (Closes: #206547) + NOTE: the Conflicts: was made versioned (<< 2) not to Conflict + with gs-esp which provides cupsys-pstoraster. + * Build-Depends: libpam0g-dev (new) instead of libpam-dev (removed from + archive) + + -- Roland Stigge Wed, 3 Sep 2003 19:33:09 +0200 + +cupsys (1.1.19final-1.2) unstable; urgency=low + + * NMU. + * Completely remove dependency on libgnutls5-dev. + + -- Robin Verduijn Wed, 27 Aug 2003 18:08:50 -0100 + +cupsys (1.1.19final-1.1) unstable; urgency=low + + * NMU. + * Built against libgnutls7-dev instead of (obsolete) libgnutls5-dev. + Closes: #203059. + + -- Robin Verduijn Tue, 26 Aug 2003 19:28:21 -0100 + +cupsys (1.1.19final-1) unstable; urgency=high + + * New upstream final release. DoS attack fixed; thus the urgency. + * Rebuilt with the latest libpng-dev, and fixed the explicit deps + in the control file. + * Removed rpath statment from output of cups-config --ldflags. + Closes: #194262. + + -- Jeff Licquia Thu, 29 May 2003 20:44:48 -0500 + +cupsys (1.1.19candidate4-1) unstable; urgency=low + + * New upstream release candidate. + * Includes upstream fix to the problem with 100% CPU consumption. + Closes: #189795. + * Added a dh_makeshlibs call for libcupsimage2. + * Made libcupsys2 conflict with cupsys-driver-gimpprint versions + built before the libcupsimage split. Closes: #189175. + * Move /etc/printcap.cups to /var/run/cups/printcap, since it's + generated and non-editable. Also, take care of the /etc/printcap + symlink. Closes: #187954. + * Per suggestion from the KDE project, suggest the kdeprint package + instead of the kdelibs3-cups package. + + -- Jeff Licquia Sat, 10 May 2003 13:05:33 -0500 + +cupsys (1.1.19candidate1-3) unstable; urgency=low + + * Make libcupsys2 conflict with gs-esp versions built before the + libcupsimage split. This is part of the fix for bug 189175. + * Add a dep on libgnutls-dev for libcupsys2-dev. Closes: #190877. + + -- Jeff Licquia Mon, 28 Apr 2003 10:57:03 -0500 + +cupsys (1.1.19candidate1-2) unstable; urgency=low + + * Set Replaces: on cupsys-client to cover the move of the + French man page for cupstestppd. Closes: #189737, #190042. + * Add cupsys-pt and xpp to Suggests for cupsys-client. + Closes: #168399, #170929. + * Added some more example filters: mailto and pstopdf. + Closes: #152001. + * Pass --system to addgroup when adding the lpadmin group. + Closes: #189835. + * Set section for the -dev packages to "libdevel". + * Fix shlibs files for libcupsys2 and libcupsimage2 to reference + the right package versions. Closes: #174391. + + -- Jeff Licquia Tue, 22 Apr 2003 14:27:43 -0500 + +cupsys (1.1.19candidate1-1) unstable; urgency=low + + * New upstream version. I will try to follow upstream's new + release policy by uploading release candidate versions to + unstable. + * Wrote a new GNU TLS patch, which was accepted by upstream. + Re-enable SSL support based on this. + * Based on recent upstream work, wrote a libpaper patch which has + also been accepted upstream. Closes: #60035, #88597, #101591. + * Upstream fix included to allow SLP-only browsing support to work. + Closes: #178380. + * Updated the Spanish debconf template for cupsys-bsd. + Closes: #167171. + * Added cupstestppd to cupsys-client. Closes: #176941. + * Don't respect TMPDIR if we don't have write permissions to that + directory. Closes: #176725. + + -- Jeff Licquia Sat, 12 Apr 2003 14:36:20 -0500 + +cupsys (1.1.18-3) unstable; urgency=low + + * Split libcupsimage into its own package. Closes: #187897. + * Added versioned build-dep on debhelper >= 2. + + -- Jeff Licquia Tue, 8 Apr 2003 02:59:57 -0500 + +cupsys (1.1.18-2) unstable; urgency=high + + * Disable SSL again. Inexplicably, the GNU TLS people put the + OpenSSL compatibility layer under the GPL, not the LGPL. + This forces the effective license on libcupsys2 to GPL, which + I'm not comfortable with. The urgency reflects possible + license conflicts for apps that link to libcupsys2. + Closes: #168056. + * Add a debconf question to ask whether unrecognized + application/octet-stream jobs should be printed as raw jobs. + * Forward-port some of the security fixes from woody. + * Set the default group for lppasswd to "lpadmin", in keeping + with the default in cupsd. Closes: #172842. + * Replaced the conflict with manpages-fr, versioned this time + to allow for easy upgrades. Also added a Replaces entry for + it. + + -- Jeff Licquia Sun, 5 Jan 2003 23:36:50 -0500 + +cupsys (1.1.18-1) unstable; urgency=high + + * New upstream version. This is a security update for problems that + include remote root exploits - thus the urgency. + * Remove the conflict with manpages-fr per reports that the offending + files are now all gone. Closes: #158500. + + -- Jeff Licquia Fri, 20 Dec 2002 03:27:18 -0500 + +cupsys (1.1.16-4) unstable; urgency=low + + * Documentation updates. + * Change the GNU TLS patch to more explicitly control which SSL + library is linked to, and support switching SSL libraries in + the build. By default, the package will not use OpenSSL, so + autobuilders won't accidentally build it that way. + Closes: #167489. + * Add libgnutls-dev to the Dependencies for libcupsys2-dev. + * Set the proper permissions on cupsys-client man pages. + + -- Jeff Licquia Sat, 9 Nov 2002 16:39:54 -0500 + +cupsys (1.1.16-3) unstable; urgency=low + + * Totally nuke all script modifications for dh_installinit; do it + all manually instead. Closes: #166878. + + -- Jeff Licquia Tue, 29 Oct 2002 23:06:20 -0500 + +cupsys (1.1.16-2) unstable; urgency=low + + * Add libpam-dev to Build-Depends. Closes: #166556. + * Update clean target in debian/rules to clean a few more files + that are missed by the Makefiles. + * Remove SFont.cxx and T1Font.cxx from the pdftops Makefile; + these two files aren't needed, and including them would pull + in a build dep on xlibs-dev, which is bad news. Closes: #166716. + * Tell dh_installdocs to not mess with the postinst/prerm, so + the compatibility symlinks aren't created. + + -- Jeff Licquia Tue, 29 Oct 2002 00:45:38 -0500 + +cupsys (1.1.16-1) unstable; urgency=low + + * New upstream version... Closes: #165631. + * ...which includes bugfixes to several BSD utilities to avoid + segfaulting when certain options are misused. Closes: #159597. + * Add upstream patch to scheduler that fixes certain printer + operations in the web interface. + * Re-enabled SSL support using the OpenSSL compatibility library + in libgnutls. Closes: #150600. + * Use our own logic for stopping/restarting cupsd on upgrade, + instead of relying on dh_installinit. Closes: #160345, #164435. + * Make cupsys-client Recommend cupsys-bsd. Closes: #157974. + * Make sure we remove everything in /var/spool/cups on purge. + Closes: #163571. + * Make force-reload send SIGHUP, since policy prefers that mode + of operation. + * Add dependencies for libcupsys2-dev on the image libraries we + need. Closes: #166451. + + -- Jeff Licquia Sat, 26 Oct 2002 19:37:56 -0500 + +cupsys (1.1.15-4) unstable; urgency=low + + * Fix segfault in lp when passing "-q" by itself as the last + option. Closes: #150819. + * Make the switch to libpng3, now that woody is out. + Closes: #156622. + * It seemed that the rastertoepson filter occasionally lost its + cookies under certain circumstances and passed NULL for a field. + Cancel the pending job if that happens. Closes: #147119. + * Remove .cvsignore files. + * Turned browsing back on by default. With no BrowseAddresses set, + no broadcast packets will go out, but cupsd will recognize and + accept incoming packets. Closes: #155574. + + -- Jeff Licquia Tue, 20 Aug 2002 15:51:45 -0500 + +cupsys (1.1.15-3) unstable; urgency=low + + * Reorganized the French man pages so they appear in the proper + packages. + * Declared a Conflict between cupsys-bsd and manpages-fr, as the + latter package includes man pages for lpr, lpq, and lprm. + * Move lpinfo and lpmove utilities to cupsys-client, where they + belong. + * Added patch from upstream that fixes some problems with + Orientation settings made by some PostScript generators. + Closes: #155534. + * Fixed compiler settings for the static and shared versions of + libcupsys2. + + -- Jeff Licquia Sun, 11 Aug 2002 02:45:02 -0500 + +cupsys (1.1.15-2) unstable; urgency=high + + * Removed SSL support again due to license infection problems. + Closes: #154792. + * Removed the preformatted French man pages. + + -- Jeff Licquia Mon, 29 Jul 2002 19:02:21 -0500 + +cupsys (1.1.15-1) unstable; urgency=low + + * New upstream version. + * Removed cupsys-pstoraster (since it's no longer provided in CUPS), + and rely on gs-esp instead for its functionality. + * Enabled SSL support and updated copyright file to reflect license + change. Closes: #150600. + * Applied patch from upstream that causes the cupsd foreground + process to wait until the daemon is ready before exiting. + Also, changed init script to wait on the daemon before continuing. + Closes: #150426. + * Moved /etc/cups/certs to /var/spool/cups/certs. Closes: #144887. + * Split out German and Portugese debconf templates into separate + files, and added French, Russian, and Spanish files. + Closes: #137630, #138068, #142904. + * Make cupsys Recommend smbclient, and handle symlinking smbspool + to /usr/lib/cups/backend/smb if it's available. Closes: #82690. + * Make cupsys Suggest foomatic-bin for cupsomatic, so that + linuxprinting.org PPDs work. Closes: #146655. + * Add examples/filters directory to cupsys and added the contributed + DVI filter to it. Users can copy the filter and config files into + place themselves to get the functionality. Closes: #55013, #136496. + * Fixed a bug where "-" filters are rejected in some cases. + + -- Jeff Licquia Mon, 29 Jul 2002 00:33:00 -0500 + +cupsys (1.1.14-3) unstable; urgency=low + + * Changed libpng dependency to "libpng2 | libpng" to accomodate the + current libpng policy. + * Changed adduser dep so that the proper adduser (that does root) is + available for the postinst. Closes: #133709. + * Removed spaces from init script output. Closes: #133262. + * Set TZ in init script to REALLY fix timezone problem. + Closes: #130676. + + -- Jeff Licquia Sat, 9 Mar 2002 23:48:41 -0500 + +cupsys (1.1.14-2) unstable; urgency=high + + * Remove all the stuff about setting the lpd backend setuid; per + upstream, we don't need it anymore, and it's a security hole. + + -- Jeff Licquia Sun, 17 Feb 2002 18:52:45 -0500 + +cupsys (1.1.14-1) unstable; urgency=high + + * New upstream version. + * Fixes more buffer overflows not covered in the previous patch; + thus the urgency. + + -- Jeff Licquia Wed, 13 Feb 2002 22:40:50 -0500 + +cupsys (1.1.13-2) unstable; urgency=high + + * Fix potentially exploitable buffer overflow in cups/ipp.c. + + -- Jeff Licquia Sat, 9 Feb 2002 21:27:41 -0500 + +cupsys (1.1.13-1) unstable; urgency=low + + * New upstream version. + * Silly me. fopen() returns NULL, not non-NULL, when it fails. :-) + Closes: #130532, #131433. + + -- Jeff Licquia Sat, 2 Feb 2002 16:10:20 -0500 + +cupsys (1.1.12-5) unstable; urgency=low + + * Fix man page references so, e.g., references go from backend(1) to + cups-backend(1). Closes: #126811. + * Oops! Debian has time_t->tm_gmtoff, which is defined to have the + opposite sign of timezone. Is it that way on BSD? Anyway, + reverse the sense of the sign for time_t->tm_gmtoff if we use + that. Closes: #126195. + * Add header for gs_malloc to pstoraster/gscrdp.c, to prevent + problems with implicit declaration on 64-bit systems. + Closes: #126002. + * cgi-bin/admin.c: Be a little bit more paranoid about one's ability + to write to tempfiles. Closes: #122324. + * Enabled OpenSLP support. + * Cleaned up Priorities and Sections. + + -- Jeff Licquia Sun, 20 Jan 2002 02:14:35 -0500 + +cupsys (1.1.12-4) unstable; urgency=low + + * Move cups-lpd man page to cupsys-bsd. Closes: #122311. + * Oops! Lost the patch to allow "cupsaccept", etc. commands. + Closes: #123280. + * Minor change to the init script output. Closes: #121938. + * Changed choose-uri.tmpl to be a little more clear. + Closes: #117376. + * Moved CUPS document root from /usr/share/doc/cupsys to + /usr/share/cups/doc-root, and created a symlink from + /u/s/d/cupsys/online-docs to it. It turns out that serving + files via CUPS from /usr/share/doc is a policy violation. + Closes: #120923. + * Fixed a small problem when upgrading from potato libcupsys1-dev + to current libcupsys2-dev. + + -- Jeff Licquia Mon, 17 Dec 2001 00:58:41 -0500 + +cupsys (1.1.12-3) unstable; urgency=low + + * Fix libcupsys2 shlibs file to provide the proper dependency + information. Closes: #121405. + * Oops! Make sure SSL support isn't built yet. + + -- Jeff Licquia Wed, 28 Nov 2001 11:41:17 -0500 + +cupsys (1.1.12-2) unstable; urgency=low + + * It helps to run autoconf after making a change to the configure + script. :-) CXX=$CC change wasn't propagated, making the build + fail on hppa. + + -- Jeff Licquia Mon, 26 Nov 2001 12:01:58 -0500 + +cupsys (1.1.12-1) unstable; urgency=low + + * New upstream version. Closes: #119162. + * Updated Standards-Version. + * Made cupsys depend on debconf. + * Removed -Wl,rpath from config-scripts/cups-sharedlibs.m4. + * Removed explicit libcupsys dep from cupsys. + * Removed "CXX=$CC" from config-scripts/cups-compiler.m4. + * Removed .SILENT from Makedefs so the build isn't silent anymore. + * On devfs, look in /dev/printers as well as /dev/parallel. + (Do we still need /dev/parallel?) Closes: #114063. + * Changed internal file: device URI type to test:, since (per + upstream) it's not intended for anything other than to test + filters. See bug #115252 or README.Debian for more info. + + -- Jeff Licquia Sun, 25 Nov 2001 11:21:32 -0500 + +cupsys (1.1.10-4) unstable; urgency=low + + * Switched cupsenable and cupsdisable symlinks to always point to + /usr/sbin/accept to prevent them from breaking when files move + around (as they did recently). Closes: #114006. + * It turns out that libcupsys needs to make temp files in + /var/spool/cups/tmp, so that dir needs to be in the package. + Closes: #115154. + * Related to the above, when creating temp files, don't loop when + the open fails unless the return value is EEXIST. Thanks to Brian + Ristuccia for the suggestion. + * Honor the DEB_BUILD_OPTTIONS "debug" setting. + * Per policy, make sure we build with -D_REENTRANT. + * Don't remove /var/spool/cups in the cupsys postrm when purging. + * Added German description to template. Closes: #113604. + * Added Portuguese description to cupsys-bsd template. + Closes: #106131. + + -- Jeff Licquia Thu, 18 Oct 2001 23:07:34 -0500 + +cupsys (1.1.10-3) unstable; urgency=low + + * Scale back a bit on aggressiveness on purging cupsys, as it can + cause us to remove the cupsys-client conffile. + * It turns out that client.conf is parsed by libcupsys2, not + cupsys-client, so it needs to switch packages. + * Changed PAM code so it attempts to open the "cupsys" PAM config + file, instead of the "cups" one. Not sure how this broke again. + Closes: #110651. + * Per request, implemented the "reload" option in the init script. + + -- Jeff Licquia Wed, 19 Sep 2001 21:53:48 -0500 + +cupsys (1.1.10-2) unstable; urgency=low + + * Added Conflicts: on cupsys-pstoraster with older cupsys packages + because of moved files. Closes: #106107. + * Fixed bug concerning update-inetd handling; it was removing the + inetd entry for the lpd server in cupsys-bsd with every upgrade. + Closes: #109298. + + -- Jeff Licquia Thu, 30 Aug 2001 23:14:08 -0500 + +cupsys (1.1.10-1) unstable; urgency=low + + * New upstream version - with Makefile oops fixed (1.1.10-1 + upstream). + * Fixed lpadmin group creation so NIS-style lpadmin group is + recognized. Closes: #78895, #107744. + * Replaced kups with kdelibs3-cups in Suggests: lines, and + reorganized Suggests line. Closes: #109695. + * Moved Suggests for all add-on clients to cupsys-client. + * Fixed purge so /etc/cups is completely cleaned out. + Closes: #108488. + * Moved filter and backend man pages to cups-filter and + cups-backend to avoid conflicts with other packages. + Closes: #107629. + * Made the lpd backend non-setuid, and created a low-priority + debconf question to handle the few who really need it setuid. + Closes: #77617. + * Altered cupsys-bsd postinst; always remove any inetd lines when + removing the package (we'll put it back later if we're just + upgrading). + + -- Jeff Licquia Tue, 28 Aug 2001 00:43:36 -0500 + +cupsys (1.1.9-1.1) unstable; urgency=low + + * NMU + * Fix gcc 3.0/hppa build problems. Closes: #104620, #105308. + + -- LaMont Jones Wed, 15 Aug 2001 19:28:23 -0600 + +cupsys (1.1.9-1) unstable; urgency=low + + * Return of the Maintainer. :-) + * New upstream version. + * Added dep on adduser (fixed bug #105382). + + -- Jeff Licquia Mon, 30 Jul 2001 00:28:47 -0500 + +cupsys (1.1.8-0.1) unstable; urgency=low + + * Non-maintainer upload. + * i think anyone who wants cupsys in woody will be happy by this nmu + * New upstream release (Closes: #80895, #100156, #94364) + * With the new upstream release the problem with cgi-bin + has been fixed + (Closes: #96055, #98264, #96530, #96055, #99914, #100707, #103095) + * Added cupsys-pstoraster package. + * Added the LOGDIR option to install rule (Closes: #94502) + * Suggests cupsys-driver-gimpprint | cupsomatic-ppd (Closes: #99146) + * Moved to DH_COMPAT=2 + * Added a pointer to http://localhost:631/admin to README.Debian + (Closes: #97964) + * Removed the extra from cupsd.conf (Closes: #96012) + * Not installing copyright for libcupsys2-dev, it will have a link + pointing to libcupsys2 anyways (Closes: #94504) + * Removed maintainer postinst and prerm scripts from cupsys-client + and libcupsys2-dev, by purging either of them you would have + removed your cups documentation. + * added German translation of debconf template to cupsys-bsd + by Sebastian Feltel (Closes: #101467, #100901) + * changed rm -f to rm -rf from cupsys-bsd prerm, and removed the link + handling for /usr/doc, let debhelper worry about that. + (Closes: #94539, #100501, #102669) + + -- Sami Haahtinen Thu, 5 Jul 2001 16:04:42 +0300 + +cupsys (1.1.6-0.1) unstable; urgency=low + + * Non-maintainer upload + * New upstream release, fixing multiple vulnerabilities (Closes: Bug#88932) + * cupsys removes only its own configuration files upon purge (Closes: Bug#84341) + * fixed postinst, so it does not fail when the lpadmin group + already exists (Closes: Bug#84443) + * added a helpful URL to README.Debian (Closes: Bug#63590) + * Suggests gtklp | kups | qtcups (Closes: Bug#82974) + + -- Gergely Nagy <8@free.bsd.hu> Sat, 14 Apr 2001 18:05:23 +0200 + +cupsys (1.1.4-3) unstable; urgency=low + + * Fixed PAM module name confusion (closes bugs #76457, #77114). + * Fixed broken deps w.r.t. cupsys-client Replacing older cupsys + versions (closes bug #75241). + * Fixed broken deps surrounding cupsys-dev (closes bug #75242). + * My shlibs file was badly broken; it referred to the cupsys package + instead of the libcupsys2 package (closes bug #78485). + * Fixed problem with upgrading; --oknodo wasn't passed to + start-stop-daemon, causing the prerm to fail if cupsd wasn't running + (closes bug #70698). + + -- Jeff Licquia Sun, 3 Dec 2000 22:45:29 -0500 + +cupsys (1.1.4-2) unstable; urgency=high + + * Fix misconfiguration in default config; cupsd now refuses connections + to printers and printer classes from all hosts except localhost by + default. The previous default was to allow all hosts to connect to + all printers - not a terribly secure default. :-) + + -- Jeff Licquia Sat, 18 Nov 2000 00:55:48 -0500 + +cupsys (1.0.4-8) stable; urgency=high + + * Security fix: the default configuration now no longer allows people + to connect to printers except from localhost. The previous default + configuration allowed anyone to connect to any printer from any + location; not a smart security move. + + -- Jeff Licquia Sat, 18 Nov 2000 00:37:06 -0500 + +cupsys (1.1.4-1) unstable; urgency=low + + * New upstream version. + * Fixed SystemGroup to point to lpadmin again (closes bug #72155). + + -- Jeff Licquia Sun, 15 Oct 2000 20:36:01 -0500 + +cupsys (1.1.2-4) unstable; urgency=low + + * The scheduler will now accept up to 128 characters for a password + (closes bug #70946). + + -- Jeff Licquia Sun, 15 Oct 2000 14:54:31 -0500 + +cupsys (1.1.2-3) unstable; urgency=low + + * Re-add ppd directory to build (when did it drop out?) (closes bug + #70448). + + -- Jeff Licquia Mon, 28 Aug 2000 20:14:51 -0500 + +cupsys (1.1.2-2) unstable; urgency=low + + * Added debhelper to build deps (closes bug #69677). + * Fixed PAM configuration file (closes bug #69787). + + -- Jeff Licquia Thu, 24 Aug 2000 11:40:56 -0500 + +cupsys (1.1.2-1) unstable; urgency=low + + * Another new upstream version. + * More build fixes. + + -- Jeff Licquia Sat, 19 Aug 2000 17:15:34 -0500 + +cupsys (1.1.1-1) unstable; urgency=low + + * New upstream version - non-beta this time. + * Fixed up build process to reflect upstream changes. + * Removed lots of Debian-specific stuff that isn't needed anymore. + + -- Jeff Licquia Mon, 7 Aug 2000 20:27:29 -0500 + +cupsys (1.1.0-0b3d1) unstable; urgency=low + + * New upstream version. + * Daemon 'cups-lpd' (new to this version) added to cupsys-bsd, with + appropriate update-inetd calls, so cupsys-bsd is now a complete + replacement for lpr. + + -- Jeff Licquia Sun, 14 May 2000 00:08:23 -0500 + +cupsys (1.0.4-7) frozen unstable; urgency=high + + * Additional DoS fixes, included in Easy Software Products' patch for + the bug below. As these are DoS bugs, I HIGHLY recommend including + this in potato. + + -- Jeff Licquia Sun, 18 Jun 2000 22:39:01 -0500 + +cupsys (1.0.4-6) frozen unstable; urgency=high + + * Fixed denial-of-service bug; POSTing non-IPP data would cause the + server to crash. Closes bug #65576 (severity: critical). + + -- Jeff Licquia Tue, 13 Jun 2000 22:04:40 -0500 + +cupsys (1.0.4-5) frozen unstable; urgency=low + + * Backported 1.0.5 bugfix: adding a printer would fail if + /usr/share/cups were mounted on a different partition than /etc/cups. + Closes bug #62267 (severity: grave). + + -- Jeff Licquia Thu, 13 Apr 2000 23:09:40 -0500 + +cupsys (1.0.4-4) frozen unstable; urgency=low + + * Makefile in conf was attempting to remove /etc/printcap during build, and + fails to build if this fails (which it will under fakeroot); disabled + this. Closes bug #60455 (severity: important). + + -- Jeff Licquia Wed, 15 Mar 2000 12:34:20 -0600 + +cupsys (1.0.4-3) frozen unstable; urgency=low + + * Oops - ppd directory move fails in preinst if /var/lib/cups/ppd is + empty. Reported as bug #59993, fixed. + * Missed the library Build-Depends. Closes bug #60090. + * Postrm during purge now removes /etc/cups properly. + * Documentation updates. + + -- Jeff Licquia Fri, 10 Mar 2000 22:59:07 -0600 + +cupsys (1.0.4-2) frozen unstable; urgency=low + + * Fixed documentation corruption in HTML docs (closes bug #59063). + * Moved /var/lib/cups/ppd/* config files (printer definitions) to + /etc/cups/ppd (closes bug #59263). + * Fixed shlibs for libcupsys1 (erroneous information) preventing + packages that link to it from depending properly. + * Changed default for browsing to Off to keep cupsd from probing the + local network continuously (closes bug #59277). + + -- Jeff Licquia Sat, 4 Mar 2000 18:23:01 -0600 + +cupsys (1.0.4-1) unstable; urgency=low + + * New upstream version. + * Changed policy version & tweaked for conformance. + * Fixed symlinks for cupsys-bsd, including /usr/doc symlinks. + * Reverted lp -h hack in favor of upstream fix. + + -- Jeff Licquia Sun, 9 Jan 2000 23:25:06 -0600 + +cupsys (1.0.2-2) unstable; urgency=low + + * Added quick hack to allow for -h option to lp (closes bug #52050). + * Set the lpd backend suid after quick audit; it doesn't appear to have + any egregious errors (closes part of bug #52381). + * Move /var/lib/cups/conf files to /etc/cups, with a symlink in place of + the old location (closes bug #52318). + * Added "Authentication failed" message when authorizing after the first + auth failure (which is likely before the first password request) + (closes rest of bug #50264). + * Made cupsys-bsd doc dir a symlink to the cupsys doc files, per policy + section 6.6 (closes bug #51958). + * Symlinked /var/lib/cups/logs to /var/log/cups (closes bug #51957). + + -- Jeff Licquia Mon, 13 Dec 1999 02:12:40 -0600 + +cupsys (1.0.2-1) unstable; urgency=low + + * New upstream version. + * Conflict with lprng, since lprng includes some SysV printing commands + (closes bug #50539). + * Added "cupsenable", "cupsdisable", "cupsaccept", and "cupsreject" + commands as part of an ongoing effort to reduce namespace pollution. + (addresses part of bug #50661 and #50384) + * Set both the default user and group to "lp" (for permissions fixes). + * Created "lpadmin" group and set SystemGroup to this. This will + fix problems with CUPS not being usable initially. As soon as + bug #50620 gets fixed, I'll set up to add root to the group, which + will make root able to configure CUPS immediately after installation. + + -- Jeff Licquia Mon, 29 Nov 1999 00:16:44 -0600 + +cupsys (1.0.1-3) unstable; urgency=low + + * Fixed wrong symlinks. (closes bug #50279) + * Stopped compression of .pdf files; they didn't gain much, broke + the links in the HTML, and generally caused confusion. (closes + part of bug #50264) + + -- Jeff Licquia Mon, 15 Nov 1999 22:28:56 -0600 + +cupsys (1.0.1-2) unstable; urgency=low + + * cupsys-bsd should conflict with lpr, not "lpd" (whatever that is) + (closes #50047) + + * Changed priority to "extra". + + -- Jeff Licquia Fri, 12 Nov 1999 22:24:15 -0600 + +cupsys (1.0.1-1) unstable; urgency=low + + * Initial Release. + + -- Jeff Licquia Sun, 6 Nov 1999 20:58:02 -0500 + +Local variables: +mode: debian-changelog +End: --- cups-1.3.8.orig/debian/libcups2.postinst +++ cups-1.3.8/debian/libcups2.postinst @@ -0,0 +1,45 @@ +#! /bin/sh +# postinst script for cups +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see /usr/doc/packaging-manual/ +# +# quoting from the policy: +# Any necessary prompting should almost always be confined to the +# post-installation script, and should be protected with a conditional +# so that unnecessary prompting doesn't happen if a package's +# installation fails and the `postinst' is called with `abort-upgrade', +# `abort-remove' or `abort-deconfigure'. + +case "$1" in + configure) + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- cups-1.3.8.orig/debian/cups.links +++ cups-1.3.8/debian/cups.links @@ -0,0 +1,4 @@ +usr/share/fonts/truetype/freefont/FreeMono.ttf usr/share/cups/fonts/FreeMono.ttf +usr/share/fonts/truetype/freefont/FreeMonoOblique.ttf usr/share/cups/fonts/FreeMonoOblique.ttf +usr/share/fonts/truetype/freefont/FreeMonoBold.ttf usr/share/cups/fonts/FreeMonoBold.ttf +usr/share/fonts/truetype/freefont/FreeMonoBoldOblique.ttf usr/share/cups/fonts/FreeMonoBoldOblique.ttf --- cups-1.3.8.orig/debian/cups-bsd.config +++ cups-1.3.8/debian/cups-bsd.config @@ -0,0 +1,9 @@ +#!/bin/sh + +set -e + +# Debconf library +. /usr/share/debconf/confmodule + +db_input medium cups-bsd/setuplpd || true +db_go --- cups-1.3.8.orig/debian/cups-bsd.install +++ cups-1.3.8/debian/cups-bsd.install @@ -0,0 +1,14 @@ +usr/sbin/lpc +usr/bin/lpq +usr/bin/lpr +usr/bin/lprm +usr/share/man/man1/lpr.1.gz +usr/share/man/*/man1/lpr.1.gz +usr/share/man/man1/lprm.1.gz +usr/share/man/*/man1/lprm.1.gz +usr/share/man/man1/lpq.1.gz +usr/share/man/*/man1/lpq.1.gz +usr/share/man/man8/cups-lpd.8.gz +usr/share/man/*/man8/cups-lpd.8.gz +usr/share/man/man8/lpc.8.gz +usr/share/man/*/man8/lpc.8.gz --- cups-1.3.8.orig/debian/libcups2-dev.preinst +++ cups-1.3.8/debian/libcups2-dev.preinst @@ -0,0 +1,40 @@ +#! /bin/sh +# preinst script for libcups2-dev +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' + +case "$1" in + install) + ;; + + upgrade) + if [ ! -L /usr/share/doc/libcups2-dev ]; then + rm -rf /usr/share/doc/libcups2-dev + fi + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- cups-1.3.8.orig/debian/libcups2.dirs +++ cups-1.3.8/debian/libcups2.dirs @@ -0,0 +1,2 @@ +var/spool/cups/tmp +etc/cups --- cups-1.3.8.orig/debian/cups-client.preinst +++ cups-1.3.8/debian/cups-client.preinst @@ -0,0 +1,40 @@ +#! /bin/sh +# preinst script for cups-client +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' + +case "$1" in + install) + ;; + + upgrade) + if [ ! -L /usr/share/doc/cups-client ]; then + rm -rf /usr/share/doc/cups-client + fi + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- cups-1.3.8.orig/debian/libcups2-dev.examples +++ cups-1.3.8/debian/libcups2-dev.examples @@ -0,0 +1 @@ +scripting --- cups-1.3.8.orig/debian/printer.schema +++ cups-1.3.8/debian/printer.schema @@ -0,0 +1,40 @@ +# Definitions for a schema to store CUPS printer information in LDAP +# OID Base is iso(1) org(3) dod(6) internet(1) private(4) enterprise(1) me(5323) cupsSchema(22) + +# Syntaxes are under 1.3.6.1.4.1.5323.22.0 +# Attributes are under 1.3.6.1.4.1.5323.22.1 +# Object Classes are under 1.3.6.1.4.1.5323.22.2 + +attributetype ( 1.3.6.1.4.1.5323.22.1.1 + NAME 'printerDescription' + DESC 'Description of Printer' + EQUALITY caseExactIA5Match + SINGLE-VALUE + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) + +attributetype ( 1.3.6.1.4.1.5323.22.1.2 + NAME 'printerURI' + DESC 'CUPS style URI for printer' + EQUALITY caseExactIA5Match + SINGLE-VALUE + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) + +attributetype ( 1.3.6.1.4.1.5323.22.1.3 + NAME 'printerLocation' + DESC 'Identifier string for Printer Location' + EQUALITY caseExactIA5Match + SINGLE-VALUE + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) + +attributetype ( 1.3.6.1.4.1.5323.22.1.4 + NAME 'printerMakeAndModel' + DESC 'String CUPS uses to figure out driver' + EQUALITY caseExactIA5Match + SINGLE-VALUE + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) + +objectclass ( 1.3.6.1.4.1.5323.22.2.1 + NAME 'cupsPrinter' + SUP top + AUXILIARY + MUST ( printerDescription $ printerURI $ printerLocation $ printerMakeAndModel) ) --- cups-1.3.8.orig/debian/client.conf +++ cups-1.3.8/debian/client.conf @@ -0,0 +1,66 @@ +# Sample client configuration file for the Common UNIX Printing System +# (CUPS). +# +# Copyright 1997-2005 by Easy Software Products, all rights reserved. +# Kenshi Muto modified a bit for Debian distribution. +# +# These coded instructions, statements, and computer programs are the +# property of Easy Software Products and are protected by Federal +# copyright law. Distribution and use rights are outlined in the file +# "LICENSE.txt" which should have been included with this file. If this +# file is missing or damaged please contact Easy Software Products +# at: +# +# Attn: CUPS Licensing Information +# Easy Software Products +# 44141 Airport View Drive, Suite 204 +# Hollywood, Maryland 20636 USA +# +# Voice: (301) 373-9600 +# EMail: cups-info@cups.org +# WWW: http://www.cups.org +# + +######################################################################## +# # +# This is the CUPS client configuration file. This file is used to # +# define client-specific parameters, such as the default server or # +# default encryption settings. # +# # +# Put this file on /etc/cups/client.conf (system use) or # +# ~/.cups/client.conf (personal use). # +# # +######################################################################## + +# +# ServerName: the hostname of your server. By default CUPS will use the +# domain socket /var/run/cups/cups.sock or the value of the CUPS_SERVER +# environment variable. +# ONLY ONE SERVER NAME MAY BE SPECIFIED AT A TIME. To use +# more than one server you must use a local scheduler with browsing +# and possibly polling. +# + +#ServerName /domain/socket +#ServerName myhost.domain.com[:port] +#ServerName ip-address[:port] + +# +# Encryption: whether or not to use encryption; this depends on having +# the OpenSSL library linked into the CUPS library. +# +# Possible values: +# +# Always - Always use encryption (SSL) +# Never - Never use encryption +# Required - Use TLS encryption upgrade +# IfRequested - Use encryption if the server requests it +# +# The default value is "IfRequested". This parameter can also be set +# using the CUPS_ENCRYPTION environment variable. +# + +#Encryption Always +#Encryption Never +#Encryption Required +#Encryption IfRequested --- cups-1.3.8.orig/debian/compat +++ cups-1.3.8/debian/compat @@ -0,0 +1 @@ +5 --- cups-1.3.8.orig/debian/cups-bsd.preinst +++ cups-1.3.8/debian/cups-bsd.preinst @@ -0,0 +1,40 @@ +#! /bin/sh +# preinst script for cups-bsd +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' + +case "$1" in + install) + ;; + + upgrade) + if [ ! -L /usr/share/doc/cups-bsd ]; then + rm -rf /usr/share/doc/cups-bsd + fi + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- cups-1.3.8.orig/debian/watch +++ cups-1.3.8/debian/watch @@ -0,0 +1,3 @@ +version=3 +ftp://ftp.easysw.com/pub/cups/([\d\.]+)/cups-(.*)-source\.tar\.gz \ + debian uupdate --no-symlink --- cups-1.3.8.orig/debian/cups.pam +++ cups-1.3.8/debian/cups.pam @@ -0,0 +1,3 @@ +@include common-auth +@include common-account +@include common-session --- cups-1.3.8.orig/debian/cups.docs +++ cups-1.3.8/debian/cups.docs @@ -0,0 +1,3 @@ +CREDITS.txt +README.txt +debian/HOWTO_BUGREPORT.txt --- cups-1.3.8.orig/debian/rules +++ cups-1.3.8/debian/rules @@ -0,0 +1,111 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. +# +# Modified to make a template file for a multi-binary package with separated +# build-arch and build-indep targets by Bill Allombert 2001 + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +export DEB_BUILD_HARDENING=1 + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/autotools.mk +include /usr/share/cdbs/1/rules/dpatch.mk + +unpatch: deapply-dpatches + +# workaround for http://bugs.debian.org/469517 +ifneq ($(findstring $(DEB_BUILD_ARCH), arm armel),) + CFLAGS += -fno-stack-protector +endif + +DEB_CONFIGURE_EXTRA_FLAGS := --with-optim=$(DEB_OPTFLAGS) --libdir=/usr/lib --mandir=/usr/share/man --with-docdir=/usr/share/cups/doc-root --localedir=/usr/share/cups/locale --enable-slp --enable-libpaper --enable-ssl --enable-gnutls --disable-openssl --enable-threads --enable-static --enable-dbus --enable-gssapi --disable-pdftops --disable-launchd --with-cups-group=lp --with-system-groups=lpadmin --with-printcap=/var/run/cups/printcap --with-log-file-perm=0640 CFLAGS="$(CFLAGS)" +DEB_MAKE_INSTALL_TARGET := install BUILDROOT=$(DEB_DESTDIR) +DEB_INSTALL_CHANGELOGS_ALL := CHANGES.txt +DEB_DH_INSTALLINIT_ARGS := -u'start 20 2 3 4 5 . stop 80 1 .' +DEB_DH_STRIP_ARGS := --dbg-package=cups-dbg +DEB_DH_FIXPERMS_ARGS := -Xusr/lib/cups/backend-available +DEB_DH_COMPRESS_ARGS := -Xusr/share/doc/libcups2-dev/examples/scripting +DEB_DH_INSTALL_SOURCEDIR := debian/tmp +ifneq ($(findstring $(DEB_BUILD_ARCH), arm m68k),) +DEB_MAKE_CHECK_TARGET := check || true +else +DEB_MAKE_CHECK_TARGET := check +endif +LDFLAGS := -Wl,--as-needed + +post-patches:: + # Add source code of extra filters for PDF printing workflow + ( cd debian/local/filters/pdf-filters/; sh ./addtocups ../../../.. ) + touch pdftopdf/Dependencies + +common-post-build-arch:: + # Fix permissions of filters/backends installed from debian/local/ + chmod 755 debian/local/filters/* + chmod 755 debian/local/backends/* + +cleanbuilddir:: + rm -f man/client.conf.man packaging/cups.list + rm -f conf/mime.convs conf/snmp.conf init/org.cups.cups-lpd.plist + -make distclean + # Remove source code of extra filters for PDF printing workflow + ( cd debian/local/filters/pdf-filters/; sh ./removefromcups ../../../.. ) + +common-install-prehook-impl:: + (cd fonts && $(MAKE) install BUILDROOT=$(DEB_DESTDIR)) + +binary-post-install/cups:: + (cd $(DEB_DESTDIR)/../cups/usr/share/doc/cups && ln -sf ../../cups/doc-root online-docs) + + # Install PPDs into /usr/share/ppd/cups-included/, see + # http://wiki.debian.org/PpdFileStructureSpecification + for i in $(DEB_DESTDIR)/../cups/usr/share/cups/model/*.ppd; do \ + m=$$(sed -n -e '/^\*Manufacturer:/s/.*"\([^"]*\)".*/\1/p' $$i); \ + mkdir -p "$(DEB_DESTDIR)/../cups/usr/share/ppd/cups-included/$$m"; \ + mv $$i "$(DEB_DESTDIR)/../cups/usr/share/ppd/cups-included/$$m/"; \ + done + rmdir $(DEB_DESTDIR)/../cups/usr/share/cups/model + + dh_usrlocal + + # Install AppArmor and ufw profile on Ubuntu + if [ "`lsb_release -is 2>/dev/null`" = "Ubuntu" ]; then \ + install -D -m 644 debian/local/apparmor-profile debian/$(cdbs_curpkg)/etc/apparmor.d/usr.sbin.cupsd; \ + install -D -m 644 debian/local/cups.ufw.profile debian/$(cdbs_curpkg)/etc/ufw/applications.d/cups; \ + fi + + # Install documentation of the PDF CUPS filters + install -m 644 debian/local/filters/pdf-filters/README $(DEB_DESTDIR)/../cups/usr/share/doc/cups/README.pdf-filters + install -m 644 debian/local/filters/pdf-filters/filter/test.sh $(DEB_DESTDIR)/../cups/usr/share/doc/cups/examples/texttopdf-text.sh + install -m 644 debian/local/filters/pdf-filters/conf/HP-PhotoSmart_Pro_B8300-hpijs-pdftoijs.ppd $(DEB_DESTDIR)/../cups/usr/share/doc/cups/examples/ + # Move file detection and conversion rules to /usr/share/cups/mime/ so + # that the package manager does not consider them conffiles + install -d $(DEB_DESTDIR)/../cups/usr/share/cups/mime + ( cd $(DEB_DESTDIR)/../cups/etc/cups; mv cpdftocps.* imagetopdf.* pdftopdf.* pdftoraster.* pdf.* texttopdf.* $(DEB_DESTDIR)/../cups/usr/share/cups/mime/ ) + # Simple Ghostscript-based PostScript-to-PDF filter + install -m 0755 debian/filters/pstopdf $(DEB_DESTDIR)/../cups/usr/lib/cups/filter + + # Increase the cost of pstops to prefer the PDF filter chain for + # PostScript printers. + sed -i -r -e '/\spstops$$/ { s/66/100/ }' \ + debian/$(cdbs_curpkg)/etc/cups/mime.convs + +binary-post-install/libcupsimage2-dev:: + rm -r debian/libcupsimage2-dev/usr/share/doc/libcupsimage2-dev + ln -s libcupsimage2 debian/libcupsimage2-dev/usr/share/doc/libcupsimage2-dev +binary-post-install/cups-bsd:: + rm -r debian/cups-bsd/usr/share/doc/cups-bsd + ln -s libcups2 debian/cups-bsd/usr/share/doc/cups-bsd +binary-post-install/libcups2-dev:: + rm -f debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/examples/scripting/php/*.o + rm -f debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/examples/scripting/php/*.so +binary-post-install/cups-client:: + rm -r debian/cups-client/usr/share/doc/cups-client + ln -s libcups2 debian/cups-client/usr/share/doc/cups-client + +binary-post-install/cups-common:: + # Configure fonts for texttopdf + ln -s /usr/share/cups/charsets/pdf.utf-8.simple $(DEB_DESTDIR)/../cups-common/usr/share/cups/charsets/pdf.utf-8 --- cups-1.3.8.orig/debian/libcupsimage2.install +++ cups-1.3.8/debian/libcupsimage2.install @@ -0,0 +1 @@ +usr/lib/libcupsimage.so.* --- cups-1.3.8.orig/debian/libcupsimage2-dev.install +++ cups-1.3.8/debian/libcupsimage2-dev.install @@ -0,0 +1,4 @@ +usr/lib/libcupsimage.so +usr/lib/libcupsimage.a +usr/include/cups/image.h +usr/include/cups/raster.h --- cups-1.3.8.orig/debian/cups.preinst +++ cups-1.3.8/debian/cups.preinst @@ -0,0 +1,86 @@ +#! /bin/sh +# preinst script for cups +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' + +mv_conffile() { + OLD="$1" + NEW="$2" + PKGNAME="cupsys" + if [ -e "$OLD" ]; then + md5sum=$(md5sum "$OLD" | sed -e 's/ .*//') + old_md5sum=$(dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e "\\' $OLD'{s/ obsolete$//;s/.* //p}") + if [ "$md5sum" = "$old_md5sum" ]; then + echo "Removing obsolete unchanged $OLD..." >&2 + rm -f "$OLD" + else + echo "Moving customized $OLD to new location $NEW..." >&2 + mv -f "$OLD" "$NEW" + fi + fi +} + +case "$1" in + install|upgrade) + if [ -e /var/lib/cups/ppd -a ! -L /var/lib/cups/ppd -a ! -e /etc/cups/ppd ]; then + echo -n "Moving printer definition files..." + mkdir -p /etc/cups/ppd || true + if [ `ls /var/lib/cups/ppd | wc -l` -ne " 0" ]; then + cp -a /var/lib/cups/ppd/* /etc/cups/ppd + fi + rm -rf /var/lib/cups/ppd + echo "done." + fi + + if [ -e /var/lib/cups/logs -a ! -L /var/lib/cups/logs ]; then + rmdir /var/lib/cups/logs || true + fi + + # Remove dangling pdftops.conf symlink, which is obsolete anyway + if [ -L /etc/cups/pdftops.conf -a ! -e /etc/cups/pdftops.conf ]; then + rm -f /etc/cups/pdftops.conf + fi + + # fix 'cupsys' -> 'root' file owner mode transition + if dpkg --compare-versions "$2" lt-nl '1.3.0-3'; then + if [ -d /var/run/cups ]; then + chown -R root /var/run/cups + fi + chown -R root /etc/cups /var/log/cups /var/cache/cups /var/spool/cups + fi + + # cupsys -> cups package/file rename + if dpkg --compare-versions "$2" le '1.3.7-7'; then + update-rc.d -f cupsys remove + mv_conffile /etc/default/cupsys /etc/default/cups + mv_conffile /etc/init.d/cupsys /etc/init.d/cups + mv_conffile /etc/pam.d/cupsys /etc/pam.d/cups + mv_conffile /etc/logrotate.d/cupsys /etc/logrotate.d/cups + fi + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- cups-1.3.8.orig/debian/libcupsimage2.postinst +++ cups-1.3.8/debian/libcupsimage2.postinst @@ -0,0 +1,46 @@ +#! /bin/sh +# postinst script for cups +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see /usr/doc/packaging-manual/ +# +# quoting from the policy: +# Any necessary prompting should almost always be confined to the +# post-installation script, and should be protected with a conditional +# so that unnecessary prompting doesn't happen if a package's +# installation fails and the `postinst' is called with `abort-upgrade', +# `abort-remove' or `abort-deconfigure'. + +case "$1" in + configure) + ldconfig + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- cups-1.3.8.orig/debian/cups-bsd.prerm +++ cups-1.3.8/debian/cups-bsd.prerm @@ -0,0 +1,45 @@ +#! /bin/sh +# prerm script for cups-bsd +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see /usr/doc/packaging-manual/ + +if [ -L /etc/printcap ]; then + rm -f /etc/printcap +fi + +case "$1" in + remove|upgrade|deconfigure) + # Remove documentation links + rm -rf /usr/share/doc/cups-bsd + + # Disable inetd entry + update-inetd --pattern cups-lpd --disable printer + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- cups-1.3.8.orig/debian/libcups2.examples +++ cups-1.3.8/debian/libcups2.examples @@ -0,0 +1 @@ +debian/client.conf --- cups-1.3.8.orig/debian/cups.templates +++ cups-1.3.8/debian/cups.templates @@ -0,0 +1,31 @@ +# These templates have been reviewed by debian-l10n-english +# Please do not modify them without asking for a review + +Template: cupsys/raw-print +Type: boolean +Default: true +_Description: Do you want CUPS to print unknown jobs as raw jobs? + The Internet Printing Protocol (IPP) enforces a MIME type for all + print jobs. Since not all sources of print jobs can attach an + appropriate type, many jobs get submitted as the MIME type + application/octet-stream and could be rejected if CUPS cannot guess + the job's format. + . + CUPS can handle all such jobs as "raw" jobs, which causes them to be + sent directly to the printer without processing. + . + It is recommended to choose this option if the server will be + accepting print jobs from Windows computers or Samba servers. + +Template: cupsys/backend +Type: multiselect +__Choices: ipp, lpd, parallel, scsi, serial, socket, usb, snmp, dnssd +Default: ipp, lpd, parallel, scsi, serial, socket, usb, snmp, dnssd +_Description: Printer communication backends: + CUPS uses backend programs to communicate with the printer device or port. + . + Unfortunately, some backend programs are likely to cause some trouble. + For example, some PPC kernels crash with the parallel backend. + . + Please choose the backend program to be used by CUPS. The default choice + should fit the most common environments. --- cups-1.3.8.orig/debian/cups-client.install +++ cups-1.3.8/debian/cups-client.install @@ -0,0 +1,52 @@ +usr/bin/cancel +usr/bin/cupstestppd +usr/bin/cupstestdsc +usr/bin/lp +usr/bin/lpoptions +usr/bin/lppasswd +usr/bin/lpstat +usr/sbin/cupsaddsmb +usr/sbin/lpadmin +usr/sbin/lpinfo +usr/sbin/lpmove +usr/sbin/accept +usr/sbin/reject +usr/sbin/cupsaccept +usr/sbin/cupsreject +usr/sbin/cupsdisable +usr/sbin/cupsenable +usr/sbin/cupsctl +usr/share/man/man1/cupstestppd.1.gz +usr/share/man/*/man1/cupstestppd.1.gz +usr/share/man/man1/cupstestdsc.1.gz +usr/share/man/*/man1/cupstestdsc.1.gz +usr/share/man/man1/lp.1.gz +usr/share/man/*/man1/lp.1.gz +usr/share/man/man1/lpoptions.1.gz +usr/share/man/*/man1/lpoptions.1.gz +usr/share/man/man1/lppasswd.1.gz +usr/share/man/*/man1/lppasswd.1.gz +usr/share/man/man1/lpstat.1.gz +usr/share/man/*/man1/lpstat.1.gz +usr/share/man/man1/cancel.1.gz +usr/share/man/*/man1/cancel.1.gz +usr/share/man/man5/client.conf.5.gz +usr/share/man/*/man5/client.conf.5.gz +usr/share/man/man8/cupsaddsmb.8.gz +usr/share/man/*/man8/cupsaddsmb.8.gz +usr/share/man/man8/cupsenable.8.gz +usr/share/man/*/man8/cupsenable.8.gz +usr/share/man/man8/lpadmin.8.gz +usr/share/man/*/man8/lpadmin.8.gz +usr/share/man/man8/lpinfo.8.gz +usr/share/man/*/man8/lpinfo.8.gz +usr/share/man/man8/lpmove.8.gz +usr/share/man/*/man8/lpmove.8.gz +usr/share/man/man8/cupsreject.8.gz +usr/share/man/*/man8/cupsreject.8.gz +usr/share/man/man8/cupsdisable.8.gz +usr/share/man/*/man8/cupsdisable.8.gz +usr/share/man/man8/cupsaccept.8.gz +usr/share/man/*/man8/cupsaccept.8.gz +usr/share/man/man8/cupsctl.8.gz +usr/share/man/*/man8/cupsctl.8.gz --- cups-1.3.8.orig/debian/cups-bsd.postrm +++ cups-1.3.8/debian/cups-bsd.postrm @@ -0,0 +1,41 @@ +#! /bin/sh +# postrm script for cups-bsd +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' overwrit>r> +# for details, see /usr/doc/packaging-manual/ + +case "$1" in + purge) + # Remove inetd entry + update-inetd --pattern cups-lpd --remove printer 2>/dev/null || true + + ;; + + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 0 + +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + + --- cups-1.3.8.orig/debian/libcups2.install +++ cups-1.3.8/debian/libcups2.install @@ -0,0 +1 @@ +usr/lib/libcups.so.* --- cups-1.3.8.orig/debian/cups-bsd.postinst +++ cups-1.3.8/debian/cups-bsd.postinst @@ -0,0 +1,80 @@ +#! /bin/sh +# postinst script for cups +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see /usr/doc/packaging-manual/ +# +# quoting from the policy: +# Any necessary prompting should almost always be confined to the +# post-installation script, and should be protected with a conditional +# so that unnecessary prompting doesn't happen if a package's +# installation fails and the `postinst' is called with `abort-upgrade', +# `abort-remove' or `abort-deconfigure'. + +# Debconf +. /usr/share/debconf/confmodule + +case "$1" in + configure) + + # Set documentation symlinks + if [ -d /usr/share/doc/cups ]; then + if [ ! -e /usr/share/doc/cups-bsd ]; then + ln -sf cups-common /usr/share/doc/cups-bsd + fi + fi + + # Add cups-lpd to inetd.conf + db_get cups-bsd/setuplpd + if [ "$RET" = "true" ]; then + update-inetd --add 'printer stream tcp nowait lp /usr/lib/cups/daemon/cups-lpd cups-lpd' + fi + + # Manage printcap file and associated symlinks + if [ -e /etc/cups/cupsd.conf ]; then + if [ -e /etc/printcap.cups ]; then + rm -f /etc/printcap.cups + fi + if [ -L /etc/printcap -a ! -e /etc/printcap ]; then + rm -f /etc/printcap + fi + + printcap_file=`egrep '^Printcap ' /etc/cups/cupsd.conf | awk '{print $2}'` + if [ "$printcap_file" != "" ]; then + touch $printcap_file 2>/dev/null || true + if [ ! -e /etc/printcap -a -e $printcap_file ]; then + ln -s $printcap_file /etc/printcap + fi + fi + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- cups-1.3.8.orig/debian/cups.init.d +++ cups-1.3.8/debian/cups.init.d @@ -0,0 +1,102 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: cups +# Required-Start: $syslog +# Required-Stop: $syslog +# Should-Start: $network avahi +# Should-Stop: $network +# X-Start-Before: samba +# X-Stop-After: samba +# Default-Start: 2 3 4 5 +# Default-Stop: 1 +# Short-Description: CUPS Printing spooler and server +### END INIT INFO + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/cupsd +NAME=cupsd +PIDFILE=/var/run/cups/$NAME.pid +DESC="Common Unix Printing System" + +unset TMPDIR + +test -x $DAEMON || exit 0 + +if [ -r /etc/default/cups ]; then + . /etc/default/cups +fi + +. /lib/lsb/init-functions + +# Get the timezone set. +if [ -z "$TZ" -a -e /etc/timezone ]; then + TZ=`cat /etc/timezone` + export TZ +fi + +restart_xprint() { + if [ -n "$success" ] && [ -x /etc/init.d/xprint ]; then + invoke-rc.d xprint force-reload || true + fi +} + +case "$1" in + start) + log_begin_msg "Starting $DESC: $NAME" + chown root:lpadmin /usr/share/ppd/custom 2>/dev/null || true + chmod 3775 /usr/share/ppd/custom 2>/dev/null || true + + mkdir -p `dirname "$PIDFILE"` + if [ "$LOAD_LP_MODULE" = "yes" -a -f /usr/lib/cups/backend/parallel \ + -a -f /proc/devices -a -f /proc/modules -a -x /sbin/modprobe ]; then + modprobe -q lp || true + modprobe -q ppdev || true + fi + + start-stop-daemon --start --quiet --oknodo --pidfile "$PIDFILE" --exec $DAEMON && success=1 + + log_end_msg $? + restart_xprint + ;; + stop) + log_begin_msg "Stopping $DESC: $NAME" + start-stop-daemon --stop --quiet --retry 5 --oknodo --pidfile $PIDFILE --name $NAME && success=1 + log_end_msg $? + restart_xprint + ;; + reload|force-reload) + log_begin_msg "Reloading $DESC: $NAME" + start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME --signal 1 && success=1 + log_end_msg $? + restart_xprint + ;; + restart) + log_begin_msg "Restarting $DESC: $NAME" + if start-stop-daemon --stop --quiet --retry 5 --oknodo --pidfile $PIDFILE --name $NAME; then + start-stop-daemon --start --quiet --pidfile "$PIDFILE" --exec $DAEMON && success=1 + fi + log_end_msg $? + restart_xprint + ;; + status) + echo -n "Status of $DESC: " + if [ ! -r "$PIDFILE" ]; then + echo "$NAME is not running." + exit 3 + fi + if read pid < "$PIDFILE" && ps -p "$pid" > /dev/null 2>&1; then + echo "$NAME is running." + exit 0 + else + echo "$NAME is not running but $PIDFILE exists." + exit 1 + fi + ;; + *) + N=/etc/init.d/${0##*/} + echo "Usage: $N {start|stop|restart|force-reload|status}" >&2 + exit 1 + ;; +esac + +exit 0 --- cups-1.3.8.orig/debian/cups.dirs +++ cups-1.3.8/debian/cups.dirs @@ -0,0 +1,12 @@ +var/run/cups +usr/share/doc/cups +usr/share/cups/drivers +etc/default +etc/cups/ssl +usr/lib/cups/backend +usr/lib/cups/backend-available +var/cache/cups/ppd +usr/share/ppd/cups-included +usr/share/ppd/custom +usr/lib/cups/driver +usr/local/share/ppd --- cups-1.3.8.orig/debian/cups.install +++ cups-1.3.8/debian/cups.install @@ -0,0 +1,62 @@ +var/ +etc/cups/cupsd.conf +etc/cups/cupsd.conf.default +etc/cups/snmp.conf +etc/cups/ppd +etc/cups/*.convs +etc/cups/*.types +etc/dbus-1/ +usr/lib/cups/backend/* usr/lib/cups/backend-available +usr/lib/cups/cgi-bin +usr/lib/cups/monitor +usr/lib/cups/daemon/ +usr/lib/cups/filter/ +usr/lib/cups/notifier +usr/sbin/cupsd +usr/sbin/cupsfilter +usr/share/cups/banners +usr/share/cups/data +usr/share/cups/doc-root +usr/share/cups/fonts +usr/share/cups/model +usr/share/cups/templates +usr/share/man/man7/backend.7.gz +usr/share/man/*/man7/backend.7.gz +usr/share/man/man7/filter.7.gz +usr/share/man/*/man7/filter.7.gz +usr/share/man/man5/classes.conf.5.gz +usr/share/man/*/man5/classes.conf.5.gz +usr/share/man/man5/cupsd.conf.5.gz +usr/share/man/*/man5/cupsd.conf.5.gz +usr/share/man/man5/cups-snmp.conf.5.gz +usr/share/man/*/man5/cups-snmp.conf.5.gz +usr/share/man/man5/mailto.conf.5.gz +usr/share/man/*/man5/mailto.conf.5.gz +usr/share/man/man5/subscriptions.conf.5.gz +usr/share/man/*/man5/subscriptions.conf.5.gz +usr/share/man/man5/mime.convs.5.gz +usr/share/man/*/man5/mime.convs.5.gz +usr/share/man/man5/mime.types.5.gz +usr/share/man/*/man5/mime.types.5.gz +usr/share/man/man5/printers.conf.5.gz +usr/share/man/*/man5/printers.conf.5.gz +usr/share/man/man8/cups-polld.8.gz +usr/share/man/*/man8/cups-polld.8.gz +usr/share/man/man8/cupsd.8.gz +usr/share/man/*/man8/cupsd.8.gz +usr/share/man/man8/cups-deviced.8.gz +usr/share/man/*/man8/cups-deviced.8.gz +usr/share/man/man8/cups-driverd.8.gz +usr/share/man/*/man8/cups-driverd.8.gz +usr/share/man/man8/cupsfilter.8.gz +usr/share/man/*/man8/cupsfilter.8.gz +../presubj usr/share/bug/cups/ +../local/backends/* usr/lib/cups/backend-available/ +../local/filters/cpdftocps usr/lib/cups/filter/ +../local/filters/oopstops usr/lib/cups/filter/ +../local/filters/textonly usr/lib/cups/filter/ +../local/*.ppd usr/share/ppd/cups-included/ +../local/*.types etc/cups/ +../local/*.convs etc/cups/ +../local/pdftops.conf etc/cups/ +../local/acroread.conf etc/cups/ --- cups-1.3.8.orig/debian/suid +++ cups-1.3.8/debian/suid @@ -0,0 +1 @@ +usr/lib/cups/backend/lpd --- cups-1.3.8.orig/debian/cups.config +++ cups-1.3.8/debian/cups.config @@ -0,0 +1,29 @@ +#!/bin/sh + +set -e + +# Debconf library +. /usr/share/debconf/confmodule + +db_get cupsys/raw-print +OLD_RET=$RET + +db_input low cupsys/raw-print || true +db_go + +db_get cupsys/raw-print +if [ "$OLD_RET" != "$RET" ]; then + db_fset cupsys/raw-print changed true +fi + +# remove parallel from PPC default +ARCH=`dpkg --print-architecture` +if [ "$ARCH" = "ppc" -o "$ARCH" = "ppc-none" ]; then + db_fget cupsys/backend seen + if [ "$RET" = "false" ]; then + db_set cupsys/backend "ipp, lpd, socket, usb" + fi +fi + +db_input low cupsys/backend || true +db_go --- cups-1.3.8.orig/debian/libcupsimage2-dev.preinst +++ cups-1.3.8/debian/libcupsimage2-dev.preinst @@ -0,0 +1,40 @@ +#! /bin/sh +# preinst script for libcupsimage2-dev +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' + +case "$1" in + install) + ;; + + upgrade) + if [ ! -L /usr/share/doc/libcupsimage2-dev ]; then + rm -rf /usr/share/doc/libcupsimage2-dev + fi + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- cups-1.3.8.orig/debian/presubj +++ cups-1.3.8/debian/presubj @@ -0,0 +1,3 @@ +Please note that CUPS is never affected by Poppler or XPDF bugs, because +the Debian package relies upon external tools to generate PostScript. +Therefore, avoid filing bugs related to PDF security issues against CUPS. --- cups-1.3.8.orig/debian/cups-common.install +++ cups-1.3.8/debian/cups-common.install @@ -0,0 +1,3 @@ +usr/share/cups/charsets +usr/share/cups/charmaps +usr/share/cups/locale --- cups-1.3.8.orig/debian/cups.doc-base +++ cups-1.3.8/debian/cups.doc-base @@ -0,0 +1,10 @@ +Document: cups +Title: CUPS Documentation +Author: Easy Software Products +Abstract: This documentation covers the use and administration of a CUPS + printing system, and the programming interface for the libcups API. +Section: System/Hardware + +Format: HTML +Index: /usr/share/doc/cups/online-docs/index.html +Files: /usr/share/doc/cups/online-docs/*.html --- cups-1.3.8.orig/debian/cups.examples +++ cups-1.3.8/debian/cups.examples @@ -0,0 +1,2 @@ +debian/filters/* +debian/printer.schema --- cups-1.3.8.orig/debian/README.Debian +++ cups-1.3.8/debian/README.Debian @@ -0,0 +1,244 @@ +cups for Debian +---------------------- + +If you found a problem, please read HOWTO_BUGREPORT.txt and report me +via Debian Bug Tracking System. +-- +Kenshi Muto +kmuto@debian.org + +--------- +This package contains the Common UNIX Printing System(tm), or CUPS(tm) +for short. CUPS is a new printing system for Unix that acts as a +substitute for System V or BSD printing systems; it supports a more +comprehensive driver model, more protocols, and Web administration, +among other things. Internally, CUPS uses the new Internet Printing +Protocol (IPP) described in RFCs 2565 through 2569. + +The terms "CUPS" and "Common UNIX Printing System" are trademarks of +Easy Software Products, the author of the system. This package is a +derivative of the CUPS system, modified for Debian and possibly +containing modifications and fixes that are not present in the +standard CUPS package. For a comprehensive list of changes from the +original source, see the diff file from the source package. For more +information about the legal stuff surrounding this package, see the +Debian copyright file or the CUPS Web site (www.cups.org). + +After installation, CUPS is pretty close to being ready to go. The +last step is to add administrative access; the "lpadmin" group has +been created and granted administrative rights to CUPS. You may need +to add users to this group in order to add printers, modify settings, +etc. By default, the root user has been granted this permission, but +you should only use the root user on the local system. + +The printers can be added with either the lpadmin program or the web +interface, which is located at http://localhost:631/admin by default. + +Backend Configuration +--------------------- + +CUPS supports serial, parallel, USB, SCSI, IPP, HTTP, Socket and Samba +for its backend. But unfortunately, some backends cause a trouble. +For example, serial backend confuses and won't stop when non printer +device connects serial port. Parallel backend is more terrible for PPC, +it may cause kernel crash (kernel bug, sigh). +So, CUPS setting puts serial and SCSI off from backend by default. And +if you use PPC, parallel backend is off also. + +If you want to use these backends, you can configure by using +'dpkg-reconfigure cups'. + +SSL Support +----------- + +CUPS supports SSL via the OpenSSL toolkit, but licensing conflicts +between OpenSSL's license and the GPL make this combination difficult +to use, even though the CUPS license itself allows this. A competing +library, GNU TLS, has an OpenSSL compatibility layer that could work +with these packages, but the compatibility library is licensed under +the GNU GPL, which could conflict with the license of certain programs +that support CUPS. Therefore, the cups packages as shipped do not +support SSL. + +It is possible to build the packages yourself with SSL support. You +can either use the OpenSSL libraries or GNU TLS's OpenSSL +compatibility library. Just set an environment variable: +"CUPS_OPENSSL" for OpenSSL support, or "CUPS_GNUTLS" for GNU TLS +support, and make sure you have the proper development packages +installed (libssl-dev for OpenSSL or libgnutls7-dev for GNU TLS). + +PLEASE NOTE: If you build packages with SSL support and distribute +them, you are responsible for making sure you do not violate the +licenses of any of the software you distribute. + +Important Security Notes +------------------------ + + - By default, cups is configured to only allow connections to + printers from localhost, effectively disabling network printing. + The previous default was to allow anyone to connect to printers + from any location. You can change these defaults by editing + /etc/cups/cupsd.conf; the access controls are at the end of the + file. Be sure you only allow access from the locations you trust, + or require authentication. + + - CUPS used to support a file backend that was handled internally by + cupsd. This was only intended to be used for testing filters, and + not in production use, as it can be a security risk and will drop + jobs under certain circumstances. In keeping with that, the file + "backend" has been renamed to "test", and the lpadmin command no + longer rewrites bare path URIs (either to "file:" or "test:"). If + you need a backend that dumps a completed job to a file on the + filesystem, you should write a separate backend and put it in + /usr/lib/cups/backend. See the CUPS documentation for information + on how to do this. + + - To relieve the burden of local authentication somewhat, CUPS uses + special tokens called "certs" that are passed between client and + server. In normal CUPS installations, these are stored in + /etc/cups/certs. However, this location violates Debian policy, as + the certs are generated and not available to edit. Thus, the real + certs are now stored in /var/spool/cups/certs, with a symlink at + /etc/cups/certs for compatibility. + +Drivers +------- + +The CUPS software includes generic drivers for several brands of +printers. At the moment, this includes HP LaserJets and DeskJets, +various Epson and Okidata printers, and Dymo label printers. + +There are also other packages containing CUPS printer drivers. If any +of those were written explicitly for your printer, chances are that it +will support your printer better than the generic drivers that ship +with CUPS. I try to keep the package Suggestions current regarding +popular CUPS driver packages; to see this list, run this command: + + apt-cache show cups | grep Suggests + +PostScript printers often ship with PPD files supplied by the printer +manufacturer. Any valid PPD for a PostScript printer is a valid CUPS +driver. To enable them for use with CUPS, copy the PPDs into +/usr/share/cups/model; they should then be available for use with +lpadmin -m and the Web interface for adding printers. + +If you find a CUPS driver that isn't packaged for Debian and you'd +like it to be, you can contact me and let me know where the driver is, +and I'll get to it as soon as I can. + +Or, you can package them yourself. See below for details. + +Packaging +--------- + +There are five packages provided by CUPS: the server, the primary +command-line client programs, the BSD client and server compatibility +programs, and the library and development packages. + +The CUPS BSD commands and cups-lpd daemon are separated into their own +package (cups-bsd); the hope is to make it possible to run CUPS and +some other BSD-style printing system (such as lpr) side-by-side for +testing purposes. If you encounter any trouble doing this, file a +bug. It's known that CUPS conflicts with LPRng, since LPRng provides +some System V printing commands as well; this problem will (hopefully) +be dealt with in time. + +Add-ons for CUPS (such as drivers, backends, clients, etc.) should +depend on the proper packages. If your package is CUPS-specific, you +should name it so it can be easily identified as a CUPS package, with +names such as: + + cups-driver-foo (for a driver for Foo printers) + cups-backend-bar (for a backend to print to Bar printers) + cups-client-baz (for a client module to hook Baz into CUPS) + +If you feel your driver/backend/client/whatever package is popular +enough that most CUPS users would be interested in it, please file a +wishlist bug against cups requesting that it be added to the +Suggests line for cups. + +Other Add-Ons +------------- + +I'm also collecting add-ons - filters, backends, etc. - and putting +them in the "examples" directory with the rest of the cups package +documentation files. Check there for some interesting filters and +backends. + +To install a filter from the filters directory, copy the filter itself +into /usr/lib/cups/filter and the associated .types and .convs files +into /etc/cups. Then restart cupsd, and you should be ready to use +it. + +If you have a filter or backend you'd like to contribute, but don't +think it's big enough to warrant its own package, file a wishlist bug +and attach your script. If it's a filter, send along a .convs and +.types file as well. + +Integration with Samba +---------------------- + +It is possible to configure Samba to share CUPS printers to Microsoft +clients. There are two ways to do this: + +1. Recent versions of Samba have direct CUPS support, including +Debian's. With this present, you can configure Samba as follows: + +[global] + printing = cups + printcap name = cups + +2. If, for some reason, you don't want to use Samba's native CUPS +support, you can configure Samba to use System V printing. This can +be done by adding the following information to Samba's smb.conf +(/etc/samba/smb.conf on Debian): + +[global] + printing = sysv + printcap name = lpstat + +[printers] + lpq command = /usr/bin/lpstat %p + lprm command = /usr/bin/cancel %p-%j + print command = /usr/bin/lp -d%p -oraw %s ; /bin/rm -f %s + +This method will require installation of the cups-client package. + +For more tips on integration with Samba, check out the man page for +cupsaddsmb, which is part of the cups-client package. + +Miscellaneous Tips +------------------ + + - CUPS has support for browsing, which uses broadcast traffic to + auto-discover other CUPS servers and printers and make them + available to clients. In the default configuration, cupsd will + accept browse packets in the CUPS format from other CUPS servers, + but will not send any. If sending browse packets is turned on, it + may trigger demand dialers and increase traffic on the network. To + help prevent this, set the BrowseAddress parameter to only + advertise CUPS printers on specific interfaces. As a potentially + more robust option, CUPS also supports SLP (Service Location + Protocol). + + - You may encounter some problems using the "enable" command under + bash, as "enable" is a builtin there. As a workaround, I've + created the "cupsenable" command, which acts exactly as "enable" + does. There are also "cupsdisable", "cupsaccept", and "cupsreject" + commands for consistency. + + - There is an online database with PPDs for lots of different + printers at http://www.linuxprinting.org/. These will often + require the "cupsomatic" utility; this can be found in the + foomatic-bin package. Another case, some PPDs require the + "foomatic-rip" utility; this can be found in the + foomatic-filters package (this package will be installed when you + install foomatic-filters-ppds package). + + - Default location of pid file is /var/run/cups/cupsd.pid. + If you'd like to change this, you can modify by using + "PidFile " directive at your /etc/cups/cupsd.conf. + +Enjoy! + + -- Jeff Licquia and Kenshi Muto --- cups-1.3.8.orig/debian/cups.logrotate +++ cups-1.3.8/debian/cups.logrotate @@ -0,0 +1,15 @@ +/var/log/cups/*log { + daily + missingok + rotate 7 + sharedscripts + postrotate + if [ -e /var/run/cups/cupsd.pid ]; then + invoke-rc.d --quiet cups force-reload > /dev/null + sleep 10 + fi + endscript + compress + notifempty + create 640 root lpadmin +} --- cups-1.3.8.orig/debian/libcups2-dev.install +++ cups-1.3.8/debian/libcups2-dev.install @@ -0,0 +1,18 @@ +usr/bin/cups-config +usr/lib/libcups.so +usr/lib/libcups.a +usr/include/cups/array.h +usr/include/cups/backend.h +usr/include/cups/cups.h +usr/include/cups/dir.h +usr/include/cups/file.h +usr/include/cups/http.h +usr/include/cups/ipp.h +usr/include/cups/language.h +usr/include/cups/ppd.h +usr/include/cups/sidechannel.h +usr/include/cups/transcode.h +usr/include/cups/adminutil.h +../../cups/i18n.h usr/include/cups +usr/share/man/man1/cups-config.1.gz +usr/share/man/*/man1/cups-config.1.gz --- cups-1.3.8.orig/debian/libcupsimage2.shlibs +++ cups-1.3.8/debian/libcupsimage2.shlibs @@ -0,0 +1 @@ +libcupsimage 2 libcupsimage2 (>= 1.3.8) --- cups-1.3.8.orig/debian/control +++ cups-1.3.8/debian/control @@ -0,0 +1,266 @@ +Source: cups +Priority: optional +Section: net +Maintainer: Debian CUPS Maintainers +Standards-Version: 3.8.0 +Build-Depends: libpam0g-dev, libtiff4-dev, libjpeg62-dev, zlib1g-dev, + libpng12-dev, libslp-dev, libgnutls-dev, libpaper-dev, libldap2-dev, + debhelper (>= 5.0), po-debconf, cdbs (>= 0.4.27), sharutils, + dpatch (>= 1.11), libdbus-1-dev, libkrb5-dev | heimdal-dev, + libavahi-compat-libdnssd-dev, libpoppler-dev, poppler-utils | xpdf-utils, + lsb-release, po4a (>= 0.31), autotools-dev, autoconf, automake, libtool, + libijs-dev, hardening-wrapper +Uploaders: Kenshi Muto , + Martin Pitt , Roger Leigh , + Martin-Éric Racine , Masayuki Hatta (mhatta) , + Jeff Licquia +Vcs-Bzr: bzr+ssh://bzr.debian.org/pkg-cups/cups/debian-trunk/ +Vcs-Browser: http://bazaar.launchpad.net/~pitti/cups/debian-trunk + +Package: libcups2 +Priority: optional +Section: libs +Architecture: any +Depends: ${shlibs:Depends} +Suggests: cups-common +Conflicts: libcupsys2 (<< 1.3.7-6) +Replaces: libcupsys2 (<< 1.3.7-6) +Provides: libcupsys2 +Description: Common UNIX Printing System(tm) - libs + The Common UNIX Printing System (or CUPS(tm)) is a printing system and + general replacement for lpd and the like. It supports the Internet + Printing Protocol (IPP), and has its own filtering driver model for + handling various document types. + . + This package provides the base shared libraries for CUPS. + . + The terms "Common UNIX Printing System" and "CUPS" are trademarks of + Easy Software Products (www.easysw.com), and refer to the original + source packages from which these packages are made. + +Package: libcupsimage2 +Priority: optional +Section: libs +Architecture: any +Depends: ${shlibs:Depends} +Description: Common UNIX Printing System(tm) - image libs + The Common UNIX Printing System (or CUPS(tm)) is a printing system and + general replacement for lpd and the like. It supports the Internet + Printing Protocol (IPP), and has its own filtering driver model for + handling various document types. + . + This package provides the image libraries for handling the CUPS + raster format. + . + The terms "Common UNIX Printing System" and "CUPS" are trademarks of + Easy Software Products (www.easysw.com), and refer to the original + source packages from which these packages are made. + +Package: cups +Priority: optional +Section: net +Architecture: any +Depends: ${shlibs:Depends}, debconf (>= 1.2.9) | debconf-2.0, + poppler-utils | xpdf-utils, perl-modules, procps, + ghostscript, lsb-base (>= 3), cups-common, + ssl-cert (>= 1.0.11), adduser, bc +Recommends: cups-client, smbclient (>= 3.0.9), foomatic-filters, avahi-utils, ttf-freefont | gsfonts-x11 +Suggests: cups-bsd, cups-driver-gutenprint, foomatic-db-engine, foomatic-db, + hplip, xpdf-korean | xpdf-japanese | xpdf-chinese-traditional | xpdf-chinese-simplified, + cups-pdf +Replaces: cupsys-bsd (<< 1.3.7-5), cupsys (<< 1.3.7-6) +Conflicts: cupsys-bsd (<< 1.3.7-5), cupsys (<< 1.3.7-6) +Provides: cupsys +Description: Common UNIX Printing System(tm) - server + The Common UNIX Printing System (or CUPS(tm)) is a printing system and + general replacement for lpd and the like. It supports the Internet + Printing Protocol (IPP), and has its own filtering driver model for + handling various document types. + . + This package provides the CUPS scheduler/daemon and related files. + . + The terms "Common UNIX Printing System" and "CUPS" are trademarks of + Easy Software Products (www.easysw.com), and refer to the original + source packages from which these packages are made. + +Package: cups-client +Priority: optional +Section: net +Architecture: any +Depends: ${shlibs:Depends}, cups-common, adduser +Suggests: cups, kdeprint, gtklp, cups-pt, xpp, cups-bsd +Conflicts: lprng, cupsys-client (<< 1.3.7-6) +Replaces: cupsys-client (<< 1.3.7-6) +Provides: cupsys-client +Description: Common UNIX Printing System(tm) - client programs (SysV) + The Common UNIX Printing System (or CUPS(tm)) is a printing system and + general replacement for lpd and the like. It supports the Internet + Printing Protocol (IPP), and has its own filtering driver model for + handling various document types. + . + This package provides the System V style print client programs. + . + The terms "Common UNIX Printing System" and "CUPS" are trademarks of + Easy Software Products (www.easysw.com), and refer to the original + source packages from which these packages are made. + +Package: libcups2-dev +Priority: optional +Section: libdevel +Architecture: any +Depends: libcups2 (= ${binary:Version}), libgnutls-dev, libkrb5-dev | heimdal-dev +Conflicts: libcupsys2-dev (<< 1.3.7-6) +Replaces: libcupsys2-dev (<< 1.3.7-6) +Provides: libcupsys2-dev +Description: Common UNIX Printing System(tm) - development files + The Common UNIX Printing System (or CUPS(tm)) is a printing system and + general replacement for lpd and the like. It supports the Internet + Printing Protocol (IPP), and has its own filtering driver model for + handling various document types. + . + This package provides the files necessary for developing CUPS-aware + applications and CUPS drivers, as well as examples how to communicate + with cups from different programming languages (Perl, Java, and + PHP). + . + The terms "Common UNIX Printing System" and "CUPS" are trademarks of + Easy Software Products (www.easysw.com), and refer to the original + source packages from which these packages are made. + +Package: libcupsimage2-dev +Priority: optional +Section: libdevel +Architecture: any +Depends: libcupsimage2 (= ${binary:Version}), libcups2-dev (= ${binary:Version}), + libpng-dev, libtiff4-dev, libjpeg62-dev, zlib1g-dev +Description: Common UNIX Printing System(tm) - image development files + The Common UNIX Printing System (or CUPS(tm)) is a printing system and + general replacement for lpd and the like. It supports the Internet + Printing Protocol (IPP), and has its own filtering driver model for + handling various document types. + . + This package provides the files necessary for developing applications + that use the CUPS raster image format. + . + The terms "Common UNIX Printing System" and "CUPS" are trademarks of + Easy Software Products (www.easysw.com), and refer to the original + source packages from which these packages are made. + +Package: cups-bsd +Priority: extra +Section: net +Architecture: any +Depends: ${shlibs:Depends}, cups-client (= ${binary:Version}), + debconf | debconf-2.0, update-inetd, cups-common +Recommends: cups +Conflicts: lpr, lprng, cupsys-bsd (<< 1.3.7-6) +Replaces: lpr, cupsys-bsd (<< 1.3.7-6) +Provides: lpr, cupsys-bsd +Description: Common UNIX Printing System(tm) - BSD commands + The Common UNIX Printing System (or CUPS(tm)) is a printing system and + general replacement for lpr, lpd and the like. It supports the + Internet Printing Protocol (IPP), and has its own filtering driver + model for handling various document types. + . + This package provides the BSD commands for interacting with CUPS. It + is provided separately to allow CUPS to coexist with other printing + systems (to a small degree). + . + The terms "Common UNIX Printing System" and "CUPS" are trademarks of + Easy Software Products (www.easysw.com), and refer to the original + source packages from which these packages are made. + +Package: cups-common +Priority: optional +Section: net +Architecture: all +Depends: ${shlibs:Depends}, ${misc:Depends} +Conflicts: cupsys-common (<< 1.3.7-6) +Replaces: cupsys-common (<< 1.3.7-6) +Provides: cupsys-common +Description: Common UNIX Printing System(tm) - common files + The Common UNIX Printing System (or CUPS(tm)) is a printing system and + general replacement for lpd and the like. It supports the Internet + Printing Protocol (IPP), and has its own filtering driver model for + handling various document types. + . + This package provides common files for CUPS server and client packages. + . + The terms "Common UNIX Printing System" and "CUPS" are trademarks of + Easy Software Products (www.easysw.com), and refer to the original + source packages from which these packages are made. + +Package: cups-dbg +Priority: extra +Section: libdevel +Architecture: any +Depends: cups (= ${binary:Version}) +Conflicts: cupsys-dbg (<< 1.3.7-6) +Replaces: cupsys-dbg (<< 1.3.7-6) +Description: Common UNIX Printing System(tm) - debugging symbols + The Common UNIX Printing System (or CUPS(tm)) is a printing system and + general replacement for lpd and the like. It supports the Internet + Printing Protocol (IPP), and has its own filtering driver model for + handling various document types. + . + This package provides the debugging symbols of CUPS. + . + The terms "Common UNIX Printing System" and "CUPS" are trademarks of + Easy Software Products (www.easysw.com), and refer to the original + source packages from which these packages are made. + +Package: cupsys +Priority: extra +Section: oldlibs +Architecture: all +Depends: cups +Description: Common UNIX Printing System (transitional package) + This is a dummy package to ease transition to new package name. + +Package: cupsys-client +Priority: extra +Section: oldlibs +Architecture: all +Depends: cups-client +Description: Common UNIX Printing System (transitional package) + This is a dummy package to ease transition to new package name. + +Package: cupsys-common +Priority: extra +Section: oldlibs +Architecture: all +Depends: cups-common +Description: Common UNIX Printing System (transitional package) + This is a dummy package to ease transition to new package name. + +Package: cupsys-bsd +Priority: extra +Section: oldlibs +Architecture: all +Depends: cups-bsd +Description: Common UNIX Printing System (transitional package) + This is a dummy package to ease transition to new package name. + +Package: cupsys-dbg +Priority: extra +Section: oldlibs +Architecture: all +Depends: cups-dbg +Description: Common UNIX Printing System (transitional package) + This is a dummy package to ease transition to new package name. + +Package: libcupsys2 +Priority: extra +Section: oldlibs +Architecture: all +Depends: libcups2 +Description: Common UNIX Printing System (transitional package) + This is a dummy package to ease transition to new package name. + +Package: libcupsys2-dev +Priority: extra +Section: oldlibs +Architecture: all +Depends: libcups2-dev +Description: Common UNIX Printing System (transitional package) + This is a dummy package to ease transition to new package name. --- cups-1.3.8.orig/debian/cups-client.postinst +++ cups-1.3.8/debian/cups-client.postinst @@ -0,0 +1,52 @@ +#! /bin/sh +# postinst script for cups +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see /usr/doc/packaging-manual/ +# +# quoting from the policy: +# Any necessary prompting should almost always be confined to the +# post-installation script, and should be protected with a conditional +# so that unnecessary prompting doesn't happen if a package's +# installation fails and the `postinst' is called with `abort-upgrade', +# `abort-remove' or `abort-deconfigure'. + +case "$1" in + configure) + if [ -z "`getent group lpadmin`" ]; then + addgroup --system lpadmin + fi + + chown root:lpadmin /usr/bin/lppasswd + chmod u+s /usr/bin/lppasswd + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- cups-1.3.8.orig/debian/cups.postrm +++ cups-1.3.8/debian/cups.postrm @@ -0,0 +1,46 @@ +#! /bin/sh +# postrm script for cups +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' overwrit>r> +# for details, see /usr/doc/packaging-manual/ + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +case "$1" in + purge) + rm -rf /var/lib/cups + rm -rf /var/log/cups + rm -rf /var/run/cups + rm -rf /var/cache/cups + rm -rf /var/spool/cups + rm -rf /etc/cups/interfaces + rm -rf /etc/cups/ppd + rm -rf /etc/cups/passwd.md5 + rm -rf /etc/cups/cups.d + rm -f /etc/cups/printers.conf* /etc/cups/classes.conf.* \ + /var/lib/cups/ppds.dat /etc/cups/raw.convs /etc/cups/raw.types + rmdir /etc/cups 2>/dev/null || true + ;; + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 0 + +esac --- cups-1.3.8.orig/debian/docs +++ cups-1.3.8/debian/docs @@ -0,0 +1,2 @@ +CREDITS.txt +README.txt --- cups-1.3.8.orig/debian/copyright +++ cups-1.3.8/debian/copyright @@ -0,0 +1,255 @@ +This package was debianized by Jeff Licquia on +Sun, 3 Oct 1999 20:58:02 -0500. + +It was downloaded from: + ftp://ftp.easysw.com/pub/cups/ + +Upstream Authors: Easy Software Products + Michael Sweet + +Copyright: + +[From the LICENSE.txt file. GPL and LGPL cut for brevity; for a copy, +look in /usr/share/common-licenses, files GPL and LGPL-2.] + + Common UNIX Printing System License Agreement + + Copyright 2007 by Apple Inc. + 1 Infinite Loop + Cupertino, CA 95014 USA + + WWW: http://www.cups.org/ + + +INTRODUCTION + +The Common UNIX Printing System(tm), ("CUPS(tm)"), is provided +under the GNU General Public License ("GPL") and GNU Library +General Public License ("LGPL"), Version 2, with exceptions for +Apple operating systems and the OpenSSL toolkit. A copy of the +exceptions and licenses follow this introduction. + +The GNU LGPL applies to the CUPS and CUPS Imaging libraries +located in the "cups" and "filter" subdirectories of the CUPS +source distribution and in the "cups" include directory and +library files in the binary distributions. The GNU GPL applies to +the remainder of the CUPS distribution, including the "pdftops" +filter which is based upon Xpdf. + +For those not familiar with the GNU GPL, the license basically +allows you to: + + - Use the CUPS software at no charge. + - Distribute verbatim copies of the software in source or + binary form. + - Sell verbatim copies of the software for a media fee, or + sell support for the software. + +What this license *does not* allow you to do is make changes or +add features to CUPS and then sell a binary distribution without +source code. You must provide source for any changes or additions +to the software, and all code must be provided under the GPL or +LGPL as appropriate. The only exceptions to this are the portions +of the CUPS software covered by the Apple operating system +license exceptions outlined later in this license agreement. + +The GNU LGPL relaxes the "link-to" restriction, allowing you to +develop applications that use the CUPS and CUPS Imaging libraries +under other licenses and/or conditions as appropriate for your +application, driver, or filter. + + +LICENSE EXCEPTIONS + +In addition, as the copyright holder of CUPS, Apple Inc. grants +the following special exceptions: + + 1. Apple Operating System Development License Exception; + + a. Software that is developed by any person or entity + for an Apple Operating System ("Apple OS-Developed + Software"), including but not limited to Apple and + third party printer drivers, filters, and backends + for an Apple Operating System, that is linked to the + CUPS imaging library or based on any sample filters + or backends provided with CUPS shall not be + considered to be a derivative work or collective work + based on the CUPS program and is exempt from the + mandatory source code release clauses of the GNU GPL. + You may therefore distribute linked combinations of + the CUPS imaging library with Apple OS-Developed + Software without releasing the source code of the + Apple OS-Developed Software. You may also use sample + filters and backends provided with CUPS to develop + Apple OS-Developed Software without releasing the + source code of the Apple OS-Developed Software. + + b. An Apple Operating System means any operating system + software developed and/or marketed by Apple Computer, + Inc., including but not limited to all existing + releases and versions of Apple's Darwin, Mac OS X, + and Mac OS X Server products and all follow-on + releases and future versions thereof. + + c. This exception is only available for Apple + OS-Developed Software and does not apply to software + that is distributed for use on other operating + systems. + + d. All CUPS software that falls under this license + exception have the following text at the top of each + source file: + + This file is subject to the Apple OS-Developed + Software exception. + + 2. OpenSSL Toolkit License Exception; + + a. Apple Inc. explicitly allows the compilation and + distribution of the CUPS software with the OpenSSL + Toolkit. + +No developer is required to provide these exceptions in a +derived work. + + +KERBEROS SUPPORT CODE + +The Kerberos support code ("KSC") is copyright 2006 by Jelmer +Vernooij and is provided 'as-is', without any express or implied +warranty. In no event will the author or Apple Inc. be held +liable for any damages arising from the use of the KSC. + +Sources files containing KSC have the following text at the top +of each source file: + + This file contains Kerberos support code, copyright 2006 by + Jelmer Vernooij. + +The KSC copyright and license apply only to Kerberos-related +feature code in CUPS. Such code is typically conditionally +compiled based on the present of the HAVE_GSSAPI preprocessor +definition. + +Permission is granted to anyone to use the KSC for any purpose, +including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + + 1. The origin of the KSC must not be misrepresented; you + must not claim that you wrote the original software. If + you use the KSC in a product, an acknowledgment in the + product documentation would be appreciated but is not + required. + + 2. Altered source versions must be plainly marked as such, + and must not be misrepresented as being the original + software. + + 3. This notice may not be removed or altered from any source + distribution. + + +TRADEMARKS + +Apple Inc. has trademarked the Common UNIX Printing System, CUPS, +and CUPS logo. You may use these names and logos in any direct port +or binary distribution of CUPS. Please contact Apple Inc. for written +permission to use them in derivative products. Our intention is to +protect the value of these trademarks and ensure that any derivative +product meets the same high-quality standards as the original. + +======================================================================= + +INCLUDED THIRD-PARTY CODE + +The Common UNIX Printing System source contains a "pdftops" filter +that is based on the Xpdf software which is + + Copyright 1996-2003 Glyph & Cog, LLC. + Copyright 1985-2001 Adobe Systems Inc. + +For binary distribution licensing of this software, please contact: + + Derek B. Noonburg + Email: derekn@foolabs.com + WWW: http://www.foolabs.com/xpdf/ + +Please note that the Debian cups package does not build/ship/use this +code (see debian/patches/pdftops-cups-1.4.dpatch). + +--- +data/*.txt is Copyright (c) 1991-1999 Unicode, Inc. + +---- +cups/md5.* is Copyright (C) 1999 Aladdin Enterprises. + +---- +fonts/Courier* is Copyright 1999 by (URW)++ Design & Development +fonts/Vera.ttf is Copyright (c) 2003 by Bitstream, Inc. + +---- +scripting/java/src/com/easysw/cups/Base64Coder.java is Copyright 2003: +Christian d'Heureuse, Inventec Informatik AG, Switzerland + +------------------------------------------------------------- + +Copyright for additional components in this Debian package: + +The CUPS filters imagetopdf, pdftopdf, pdftoraster are downloaded +from: http://sourceforge.jp/projects/opfc/files/ + +Copyright: + +pdftopdf: Copyright (c) 2006-2007, BBR Inc. All rights reserved. + +pdftoraster: Copyright (c) 2008, BBR Inc. All rights reserved. + +imagetopdf: + +/* + * Image file to PDF filter for the Common UNIX Printing System (CUPS). + * developed by BBR Inc. 2006-2007 + + * This is based on imagetops.c + * imagetops.c copyright notice is follows + + * "$Id: imagetops.c 5379 2006-04-07 13:48:37Z mike $" + * + * Image file to PostScript filter for the Common UNIX Printing System (CUPS). + * + * Copyright 1993-2006 by Easy Software Products. + * + * These coded instructions, statements, and computer programs are the + * property of Easy Software Products and are protected by Federal + * copyright law. Distribution and use rights are outlined in the file + * "LICENSE.txt" which should have been included with this file. If this + * file is missing or damaged please contact Easy Software Products + * at: + * + * Attn: CUPS Licensing Information + * Easy Software Products + * 44141 Airport View Drive, Suite 204 + * + * Voice: (301) 373-9600 + * EMail: cups-info@cups.org + * WWW: http://www.cups.org + * + * This file is subject to the Apple OS-Developed Software exception. + * + */ + +The license of these filters is the GPL V2, according to their COPYING files. + +---- + +textonly is licensed under the GPL and copyright + +Copyright (C) 2003-2006 Red Hat, Inc. +Copyright (C) 2003-2006 Tim Waugh + +---- + +oopstops is licensed under the GPL V2 or newer. There is no copyright +notice in the file. The file was contributed by Helge Blischke. + +---- --- cups-1.3.8.orig/debian/dirs +++ cups-1.3.8/debian/dirs @@ -0,0 +1,2 @@ +usr/bin +usr/sbin --- cups-1.3.8.orig/debian/HOWTO_BUGREPORT.txt +++ cups-1.3.8/debian/HOWTO_BUGREPORT.txt @@ -0,0 +1,28 @@ +Debian users, + +For making clear your printing problem, I need some information. + +1. Please describe your CUPS version/revision. This will be written + automatically if you use Debian bug system tools. +2. Please describe Your printer vendor and model, and how to connect (usb, + parallel, serial, lpd, ipp, http, socket, smb). +3. Please attach your /etc/cups/printers.conf (only about problematic printer) +4. Set LogLeveld as "debug" in your /etc/cups/cupsd.conf and reload by + /etc/init.d/cups reload. After you do something causes a problem, + please attach gzippped your /var/log/cups/error_log. +5. Please attach gzipped PPD file in /etc/cups/ppd/. + +Before you report... +1. If you use gs as filter, please check /usr/bin/gs indicates gs-esp. + gs-gnu doesn't support some drivers. If gs indicates gs-gnu, please + change by 'update-alternatives --config gs'. +2. Please don't set severity to 'grave' or 'critical' if you couldn't success + to print out. I usually test by my printer, then upload. (it means at + least I can success to print out) + I promise to look over your report. Please use 'important' for + "I can't print out by my printer!". + +Thanks, +-- +Kenshi Muto +kmuto@debian.org --- cups-1.3.8.orig/debian/cups-bsd.templates +++ cups-1.3.8/debian/cups-bsd.templates @@ -0,0 +1,12 @@ +# These templates have been reviewed by debian-l10n-english +# Please do not modify them without asking for a review + +Template: cups-bsd/setuplpd +Type: boolean +Default: false +_Description: Do you want to set up the BSD lpd compatibility server? + The CUPS package contains a server that can accept BSD-style print + jobs and submit them to CUPS. It should only be set up if other + computers are likely to submit jobs over the network via the "BSD" or + "LPR" services, and these computers cannot be converted to use the + IPP protocol that CUPS uses. --- cups-1.3.8.orig/debian/libcupsimage2.preinst +++ cups-1.3.8/debian/libcupsimage2.preinst @@ -0,0 +1,40 @@ +#! /bin/sh +# preinst script for libcupsimage2 +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' + +case "$1" in + install) + ;; + + upgrade) + if [ ! -L /usr/share/doc/libcupsimage2 ]; then + rm -rf /usr/share/doc/libcupsimage2 + fi + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- cups-1.3.8.orig/debian/po/ja.po +++ cups-1.3.8/debian/po/ja.po @@ -0,0 +1,174 @@ +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans +# +# Developers do not need to manually edit POT or PO files. +# +msgid "" +msgstr "" +"Project-Id-Version: cups 1.2\n" +"Report-Msgid-Bugs-To: Source: cups@packages.debian.org\n" +"POT-Creation-Date: 2007-12-16 15:35+0900\n" +"PO-Revision-Date: 2007-12-16 15:35+0900\n" +"Last-Translator: Kenshi Muto \n" +"Language-Team: Japanese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "Do you want to set up the BSD lpd compatibility server?" +msgstr "BSD lpd 互換サーバをセットアップしますか?" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "" +"The CUPS package contains a server that can accept BSD-style print jobs and " +"submit them to CUPS. It should only be set up if other computers are likely " +"to submit jobs over the network via the \"BSD\" or \"LPR\" services, and " +"these computers cannot be converted to use the IPP protocol that CUPS uses." +msgstr "" +"CUPS パッケージは BSD スタイルの印刷ジョブを受け付け、CUPS にそれを送るサーバ" +"を含んでいます。\"BSD\" または \"LPR\" サービス経由でネットワーク越しにジョブ" +"を送るほかのコンピュータがあり、かつそれらのコンピュータは CUPS の使っている " +"IPP プロトコルを使うよう変更できない、という場合にのみセットアップすべきで" +"す。" + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "Do you want CUPS to print unknown jobs as raw jobs?" +msgstr "未知のジョブを生データ (raw) ジョブとして CUPS に印刷させますか?" + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"The Internet Printing Protocol (IPP) enforces a MIME type for all print " +"jobs. Since not all sources of print jobs can attach an appropriate type, " +"many jobs get submitted as the MIME type application/octet-stream and could " +"be rejected if CUPS cannot guess the job's format." +msgstr "" +"Internet Printing Protocol (IPP) でのすべての印刷ジョブは MIME 形式を持ちま" +"す。印刷ジョブのすべてのソースに適切な形式が付いているとは限らず、多くのジョ" +"ブは MIME 形式 application/octet-stream として送られ,CUPS がそのジョブの" +"フォーマットを推測できなかったときには拒否されます。" + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"CUPS can handle all such jobs as \"raw\" jobs, which causes them to be sent " +"directly to the printer without processing." +msgstr "" +"そのようなジョブを、すべて生データ (\"raw\") ジョブとして加工なしに直接プリン" +"タに送るように CUPS を設定できます。" + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"It is recommended to choose this option if the server will be accepting " +"print jobs from Windows computers or Samba servers." +msgstr "" +"サーバが Windows コンピュータあるいは Samba サーバからの印刷ジョブを受け付け" +"る場合は、この選択肢で「はい」と答えることをお勧めします。" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "ipp" +msgstr "IPP" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "lpd" +msgstr "LPD" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "parallel" +msgstr "パラレル" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "scsi" +msgstr "SCSI" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "serial" +msgstr "シリアル" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "socket" +msgstr "ソケット" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "usb" +msgstr "USB" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "snmp" +msgstr "SNMP" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "dnssd" +msgstr "dnssd" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "Printer communication backends:" +msgstr "プリンタ通信バックエンド:" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"CUPS uses backend programs to communicate with the printer device or port." +msgstr "" +"CUPS はプリンタデバイスまたはポートと会話するのにバックエンドプログラムを使い" +"ます。" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Unfortunately, some backend programs are likely to cause some trouble. For " +"example, some PPC kernels crash with the parallel backend." +msgstr "" +"困ったことに、いくつかのバックエンドプログラムは種々の問題を引き起こします。" +"たとえば、ある種の PPC カーネルは parallel バックエンドでクラッシュします。" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Please choose the backend program to be used by CUPS. The default choice " +"should fit the most common environments." +msgstr "" +"CUPS で利用したいバックエンドプログラムを選択してください。デフォルトの選択は" +"たいていの一般的な環境に合っています。" --- cups-1.3.8.orig/debian/po/cs.po +++ cups-1.3.8/debian/po/cs.po @@ -0,0 +1,244 @@ +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans +# +# Developers do not need to manually edit POT or PO files. +# +msgid "" +msgstr "" +"Project-Id-Version: cups\n" +"Report-Msgid-Bugs-To: Source: cups@packages.debian.org\n" +"POT-Creation-Date: 2007-12-16 15:35+0900\n" +"PO-Revision-Date: 2007-12-16 15:37+0900\n" +"Last-Translator: Miroslav Kure \n" +"Language-Team: Czech \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "Do you want to set up the BSD lpd compatibility server?" +msgstr "Chcete spustit server kompatibilní s BSD lpd?" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "" +"The CUPS package contains a server that can accept BSD-style print jobs and " +"submit them to CUPS. It should only be set up if other computers are likely " +"to submit jobs over the network via the \"BSD\" or \"LPR\" services, and " +"these computers cannot be converted to use the IPP protocol that CUPS uses." +msgstr "" +"Tento CUPS balík obsahuje server, který umí přijímat tiskové úlohy ve stylu " +"BSD a přeposílat je systému CUPS. Měli byste jej povolit pouze v případě, že " +"máte na síti počítače, které posílají úlohy přes služby \"BSD\" nebo \"LPR\" " +"a nedají se přemluvit, aby používaly protokol IPP." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "Do you want CUPS to print unknown jobs as raw jobs?" +msgstr "Chcete, aby CUPS tisknul neznámé úlohy jako typ \"raw\"?" + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"The Internet Printing Protocol (IPP) enforces a MIME type for all print " +"jobs. Since not all sources of print jobs can attach an appropriate type, " +"many jobs get submitted as the MIME type application/octet-stream and could " +"be rejected if CUPS cannot guess the job's format." +msgstr "" +"Všechny tiskové úlohy IPP (Internet Printing Protocol) mají přiřazen typ " +"MIME, podle kterého CUPS pozná, v jakém formátu je úloha zaslána. Protože ne " +"všechny zdroje tiskových úloh umí nastavit správný typ, je mnoho úloh " +"zasíláno s MIME typem application/octet-stream a CUPS pak musí hádat, o jaký " +"formát dat se jedná. Pokud CUPS formát neuhodne, implicitně úlohu odmítne." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"CUPS can handle all such jobs as \"raw\" jobs, which causes them to be sent " +"directly to the printer without processing." +msgstr "" +"Zde můžete nastavit, aby CUPS považoval všechny nerozpoznané úlohy jako " +"úlohy typu \"raw\". Takové úlohy se nijak nezpracovávají a jsou odesílány " +"rovnou na tiskárnu." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"It is recommended to choose this option if the server will be accepting " +"print jobs from Windows computers or Samba servers." +msgstr "" +"Jestliže bude server akceptovat tiskové úlohy z Windows počítačů nebo ze " +"Samba serverů, je doporučeno tuto možnost povolit." + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "ipp" +msgstr "ipp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "lpd" +msgstr "lpd" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "parallel" +msgstr "paralelní" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "scsi" +msgstr "scsi" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "serial" +msgstr "sériový" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "socket" +msgstr "socket" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "usb" +msgstr "usb" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "snmp" +msgstr "snmp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "dnssd" +msgstr "dnssd" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "Printer communication backends:" +msgstr "Ovladače pro komunikaci s tiskárnou:" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"CUPS uses backend programs to communicate with the printer device or port." +msgstr "CUPS používá ovladače pro komunikaci s tiskárnou nebo jejím portem." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Unfortunately, some backend programs are likely to cause some trouble. For " +"example, some PPC kernels crash with the parallel backend." +msgstr "" +"Bohužel, některé ovladače nejsou zcela stabilní. Například některá PPC jádra " +"v kombinaci s paralelním ovladačem spadnou." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Please choose the backend program to be used by CUPS. The default choice " +"should fit the most common environments." +msgstr "" +"Vyberte ovladač, který má CUPS použít. Implicitní volba se hodí do většiny " +"běžných prostředí." + +#~ msgid "" +#~ "If you will be accepting print jobs from Windows computers, you probably " +#~ "want this option set, as Windows gives all IPP print jobs processed by a " +#~ "local driver the MIME type application/octet-stream. Samba also submits " +#~ "its print jobs this way." +#~ msgstr "" +#~ "Pokud budete přijímat tisky z windowsových počítačů, pravděpodobně budete " +#~ "chtít tuto volbu zapnout, protože Windows nastavují všem tiskům přes IPP " +#~ "(zpracovaných lokálním ovladačem) MIME typ application/octet-stream. " +#~ "Stejně pracuje i Samba." + +#~ msgid "Port or/and host name where CUPS will listen to:" +#~ msgstr "Port a/nebo jméno počítače, na kterém má CUPS naslouchat:" + +#~ msgid "" +#~ "Please specify the port or the host name CUPS daemon will listen to. The " +#~ "following formats are allowed:" +#~ msgstr "" +#~ "Zadejte prosím port nebo jméno počítače, na kterém má daemon CUPS " +#~ "naslouchat příchozím spojením. Povoleny jsou následující formáty:" + +#~ msgid "" +#~ " - Port number (631);\n" +#~ " - Host name (debian.example.com);\n" +#~ " - Host:Port (debian.example.com:631);\n" +#~ " - File domain socket (/var/run/cups/cups.sock)." +#~ msgstr "" +#~ " - Číslo portu (631);\n" +#~ " - Jméno počítače (debian.priklad.cz);\n" +#~ " - Počítač:Port (debian.priklad.cz:631). - Socket (/var/run/" +#~ "cups/cups.sock)." + +#~ msgid "" +#~ "You can combine any of these by delimiting in a space-separated list." +#~ msgstr "Můžete jich zadat libovolný počet, stačí je oddělit mezerami." + +#~ msgid "" +#~ "The default port 631 is reserved for the Internet Printing Protocol " +#~ "(IPP). \"localhost:631\" is recommended to setup a standalone environment " +#~ "for security reasons." +#~ msgstr "" +#~ "Výchozí port 631 je rezervovaný právě pro Internet Printing Protocol " +#~ "(IPP). Pro samostatný počítač se z bezpečnostních důvodů doporučuje " +#~ "nastavení \"localhost:631\"." + +#~ msgid "Broadcast and/or listen for CUPS printer information on the network?" +#~ msgstr "Vysílat a/nebo poslouchat na síti informace o CUPS tiskárnách?" + +#~ msgid "" +#~ "CUPS daemon can broadcast printer information for clients on the network, " +#~ "and detect printers on the network automatically." +#~ msgstr "" +#~ "Daemon CUPS může do sítě vysílat své informace o tiskárnách a také umí na " +#~ "síti zjišťovat tiskárny nové." + +#~ msgid "" +#~ "If you choose this option, the CUPS daemon will periodically send UDP " +#~ "broadcasts to detect printers." +#~ msgstr "" +#~ "Povolíte-li tuto volbu, daemon CUPS bude periodicky vysílat celoplošné " +#~ "UDP dotazy, kterými bude zjišťovat nové tiskárny." + +#~ msgid "Incorrect value entered" +#~ msgstr "Zadána chybná hodnota" + +#~ msgid "an error occurred while parsing the port number or the host name." +#~ msgstr "Při zpracovávání čísla portu nebo názvu počítače se vyskytla chyba." + +#~ msgid "Please correct your input." +#~ msgstr "Opravte prosím svou odpověď." --- cups-1.3.8.orig/debian/po/gl.po +++ cups-1.3.8/debian/po/gl.po @@ -0,0 +1,243 @@ +# Galician translation of cups' debconf templates. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the cups package. +# Jacobo Tarrio , 2006, 2007. +# +msgid "" +msgstr "" +"Project-Id-Version: cups\n" +"Report-Msgid-Bugs-To: Source: cups@packages.debian.org\n" +"POT-Creation-Date: 2007-12-16 15:35+0900\n" +"PO-Revision-Date: 2007-12-16 15:35+0900\n" +"Last-Translator: Jacobo Tarrio \n" +"Language-Team: Galician \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "Do you want to set up the BSD lpd compatibility server?" +msgstr "" +"causan problemas (por exemplo, algúns núcleos para PPC fallan co adaptador " +"paralelo).<" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "" +"The CUPS package contains a server that can accept BSD-style print jobs and " +"submit them to CUPS. It should only be set up if other computers are likely " +"to submit jobs over the network via the \"BSD\" or \"LPR\" services, and " +"these computers cannot be converted to use the IPP protocol that CUPS uses." +msgstr "" +"O paquete CUPS contén un servidor que pode aceptar traballos de impresión " +"estilo BSD e envialos a CUPS. Só se debería activar se ten outros " +"ordenadores que poidan enviar traballos pola rede mediante os servizos \"BSD" +"\" ou \"LPR\", e se eses ordenadores non se poden configurar para que " +"empreguen o protocolo IPP que emprega CUPS." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "Do you want CUPS to print unknown jobs as raw jobs?" +msgstr "" +"¿Quere que CUPS imprima os traballos descoñecidos coma traballos en cru?" + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"The Internet Printing Protocol (IPP) enforces a MIME type for all print " +"jobs. Since not all sources of print jobs can attach an appropriate type, " +"many jobs get submitted as the MIME type application/octet-stream and could " +"be rejected if CUPS cannot guess the job's format." +msgstr "" +"O protocolo de impresión por Internet (IPP) obriga a que tódolos traballos " +"de impresión teñan un tipo MIME. Como non todas as fontes de traballos de " +"impresión poden indicar un tipo axeitado, moitos traballos envíanse co tipo " +"MIME application/octet-stream, e poden quedar rexeitados se CUPS non pode " +"determinar o formato do traballo." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"CUPS can handle all such jobs as \"raw\" jobs, which causes them to be sent " +"directly to the printer without processing." +msgstr "" +"CUPS pode tratar todos eses traballos coma traballos \"en cru\", o que fai " +"que se envíen directamente á impresora sen os procesar." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"It is recommended to choose this option if the server will be accepting " +"print jobs from Windows computers or Samba servers." +msgstr "" +"Recoméndase que escolla esta opción se o servidor ha aceptar traballos de " +"impresión de ordenadores Windows ou servidores Samba." + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "ipp" +msgstr "ipp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "lpd" +msgstr "lpd" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "parallel" +msgstr "paralelo" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "scsi" +msgstr "scsi" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "serial" +msgstr "serie" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "socket" +msgstr "socket" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "usb" +msgstr "usb" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "snmp" +msgstr "snmp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "dnssd" +msgstr "dnssd" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "Printer communication backends:" +msgstr "Sistemas de comunicación coa impresora:" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"CUPS uses backend programs to communicate with the printer device or port." +msgstr "" +"CUPS emprega programas \"motor\" para se comunicar co dispositivo ou porto " +"da impresora." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Unfortunately, some backend programs are likely to cause some trouble. For " +"example, some PPC kernels crash with the parallel backend." +msgstr "" +"Por desgracia, algúns destes programas \"motor\" poden causar problemas. Por " +"exemplo, algúns núcleos para PPC fallan co motor de porto paralelo." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Please choose the backend program to be used by CUPS. The default choice " +"should fit the most common environments." +msgstr "" +"Escolla o programa que debe empregar CUPS. A opción por defecto debería " +"axustarse aos ambientes máis habituais." + +#~ msgid "" +#~ "If you will be accepting print jobs from Windows computers, you probably " +#~ "want this option set, as Windows gives all IPP print jobs processed by a " +#~ "local driver the MIME type application/octet-stream. Samba also submits " +#~ "its print jobs this way." +#~ msgstr "" +#~ "Se vai aceptar traballos de impresión de ordenadores con Windows, " +#~ "probablemente sexa mellor activar esta opción, xa que Windows envía os " +#~ "traballos de impresión IPP procesados cun controlador local co tipo MIME " +#~ "application/octet-stream. Samba tamén envía os seus traballos de " +#~ "impresión do mesmo xeito." + +#~ msgid "Port or/and host name where CUPS will listen to:" +#~ msgstr "Porto e/ou nome de servidor no que CUPS ha escoitar:" + +#~ msgid "" +#~ "Please specify the port or the host name CUPS daemon will listen to. The " +#~ "following formats are allowed:" +#~ msgstr "" +#~ "Especifique o porto ou nome de servidor no que ha escoitar o servizo de " +#~ "CUPS. Admítense os seguintes formatos:" + +#, fuzzy +#~ msgid "" +#~ " - Port number (631);\n" +#~ " - Host name (debian.example.com);\n" +#~ " - Host:Port (debian.example.com:631);\n" +#~ " - File domain socket (/var/run/cups/cups.sock)." +#~ msgstr "" +#~ " - Número de porto (631);\n" +#~ " - Nome de servidor (debian.exemplo.com);\n" +#~ " - Servidor:Porto (debian.exemplo.com:631)." + +#~ msgid "" +#~ "You can combine any of these by delimiting in a space-separated list." +#~ msgstr "" +#~ "Pode combinalos facendo unha lista de elementos separados por comas." + +#~ msgid "" +#~ "The default port 631 is reserved for the Internet Printing Protocol " +#~ "(IPP). \"localhost:631\" is recommended to setup a standalone environment " +#~ "for security reasons." +#~ msgstr "" +#~ "O porto por defecto, 631, está reservado para o Protocolo de Impresión de " +#~ "Internet (IPP). Recoméndase que empregue \"localhost:631\" para crear un " +#~ "sistema aillado por motivos de seguridade." + +#~ msgid "Broadcast and/or listen for CUPS printer information on the network?" +#~ msgstr "¿Emitir e/ou escoitar información de impresoras de CUPS na rede?" + +#~ msgid "" +#~ "CUPS daemon can broadcast printer information for clients on the network, " +#~ "and detect printers on the network automatically." +#~ msgstr "" +#~ "O servizo CUPS pode emitir información de impresoras para os clientes da " +#~ "rede, e pode detectar automaticamente as impresoras da rede." + +#~ msgid "" +#~ "If you choose this option, the CUPS daemon will periodically send UDP " +#~ "broadcasts to detect printers." +#~ msgstr "" +#~ "Se escolle esta opción, o servizo CUPS ha enviar paquetes \"broadcast\" " +#~ "UDP para detectar as impresoras." + +#~ msgid "Incorrect value entered" +#~ msgstr "Introduciuse un valor incorrecto" + +#~ msgid "an error occurred while parsing the port number or the host name." +#~ msgstr "houbo un erro ao analizar o número de porto ou o nome do servidor." + +#~ msgid "Please correct your input." +#~ msgstr "Corrixa o que introduciu." --- cups-1.3.8.orig/debian/po/pt.po +++ cups-1.3.8/debian/po/pt.po @@ -0,0 +1,181 @@ +# Portuguese translation for cups's debconf messages +# Copyright (C) 2007 Carlos Lisboa +# This file is distributed under the same license as the cups package. +# Carlos Lisboa , 2007. +# Miguel Figueiredo , 2007. +# +msgid "" +msgstr "" +"Project-Id-Version: cups\n" +"Report-Msgid-Bugs-To: Source: cups@packages.debian.org\n" +"POT-Creation-Date: 2007-12-16 15:35+0900\n" +"PO-Revision-Date: 2007-04-08 23:35+0100\n" +"Last-Translator: Miguel Figueiredo \n" +"Language-Team: Portuguese \n" +"MIME-Version: 1.0n\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "Do you want to set up the BSD lpd compatibility server?" +msgstr "Deseja configurar o servidor de compatibilidade lpd BSD?" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "" +"The CUPS package contains a server that can accept BSD-style print jobs and " +"submit them to CUPS. It should only be set up if other computers are likely " +"to submit jobs over the network via the \"BSD\" or \"LPR\" services, and " +"these computers cannot be converted to use the IPP protocol that CUPS uses." +msgstr "" +"O pacote cups contém um servidor que pode aceitar trabalhos de impressão " +"do estilo BSD e submetê-los ao CUPS. Deve ser apenas configurado se possui " +"outros computadores que submetam trabalhos na rede através de serviços \"BSD" +"\" ou \"LPR\", e que esses computadores não possam ser convertidos para usar " +"o protocolo IPP que o CUPS usa." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "Do you want CUPS to print unknown jobs as raw jobs?" +msgstr "" +"Deseja que o CUPS imprima trabalhos desconhecidos como trabalhos 'raw'?" + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"The Internet Printing Protocol (IPP) enforces a MIME type for all print " +"jobs. Since not all sources of print jobs can attach an appropriate type, " +"many jobs get submitted as the MIME type application/octet-stream and could " +"be rejected if CUPS cannot guess the job's format." +msgstr "" +"O Internet Printing Protocol (IPP) adopta um tipo MIME para todos os " +"trabalhos de impressão. Como nem todas as fontes de trabalhos de impressão " +"podem anexar o tipo apropriado, muitos trabalhos são submetidos com do tipo " +"MIME application/octet-stream e podem ser rejeitados se o CUPS não puder " +"adivinhar o formato do trabalho." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"CUPS can handle all such jobs as \"raw\" jobs, which causes them to be sent " +"directly to the printer without processing." +msgstr "" +"O CUPS pode lidar com tais trabalhos como trabalhos \"raw\", o que faz com " +"que sejam enviados directamente para a impressora sem que sejam processados." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"It is recommended to choose this option if the server will be accepting " +"print jobs from Windows computers or Samba servers." +msgstr "" +"É recomendado escolher esta opção se o servidor irá aceitar trabalhos de " +"impressão a partir de computodores com Windows ou de servidores Samba." + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "ipp" +msgstr "ipp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "lpd" +msgstr "lpd" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "parallel" +msgstr "paralela" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "scsi" +msgstr "scsi" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "serial" +msgstr "série" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "socket" +msgstr "socket" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "usb" +msgstr "usb" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "snmp" +msgstr "snmp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "dnssd" +msgstr "dnssd" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "Printer communication backends:" +msgstr "'Backends' de comunicação com a impressora" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"CUPS uses backend programs to communicate with the printer device or port." +msgstr "" +"O CUPS usa programas de 'backend' para comunicar com a porta ou dispositivo " +"da impressora." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Unfortunately, some backend programs are likely to cause some trouble. For " +"example, some PPC kernels crash with the parallel backend." +msgstr "" +"Infelizmente, alguns programas de 'backend' podem causar alguns problemas. " +"Por exemplo, alguns kernels PPC bloqueiam' com o 'backend' paralelo." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Please choose the backend program to be used by CUPS. The default choice " +"should fit the most common environments." +msgstr "" +"Escolha qual o 'backend' a ser usado pelo CUPS. A escolha por omissão deve " +"servir a maioria dos ambientes mais comuns." + +#~ msgid "" +#~ "If you will be accepting print jobs from Windows computers, you probably " +#~ "want this option set, as Windows gives all IPP print jobs processed by a " +#~ "local driver the MIME type application/octet-stream. Samba also submits " +#~ "its print jobs this way." +#~ msgstr "" +#~ "Se for aceitar trabalhos de impressão de computadores Windows, " +#~ "provavelmente quererá esta opção configurada, já que o Windows anexa a " +#~ "todos os trabalhos de impressão processados por uma impressora local o " +#~ "tipo MIME 'application/octet-stream'. Os trabalhos de impressão do samba " +#~ "também são submetidos desta forma." --- cups-1.3.8.orig/debian/po/nl.po +++ cups-1.3.8/debian/po/nl.po @@ -0,0 +1,258 @@ +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans +# +# Developers do not need to manually edit POT or PO files. +# +msgid "" +msgstr "" +"Project-Id-Version: cups 1.1.20candidate6\n" +"Report-Msgid-Bugs-To: Source: cups@packages.debian.org\n" +"POT-Creation-Date: 2007-12-16 15:35+0900\n" +"PO-Revision-Date: 2007-03-30 17:47+0100\n" +"Last-Translator: Bart Cornelis \n" +"Language-Team: Debian Dutch \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Dutch\n" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "Do you want to set up the BSD lpd compatibility server?" +msgstr "" +"Wilt u de server die zorgt voor compatibiliteit met de BSD-lpd instellen?" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "" +"The CUPS package contains a server that can accept BSD-style print jobs and " +"submit them to CUPS. It should only be set up if other computers are likely " +"to submit jobs over the network via the \"BSD\" or \"LPR\" services, and " +"these computers cannot be converted to use the IPP protocol that CUPS uses." +msgstr "" +"Het pakket 'cups-bsd' bevat een server die BSD-stijl afdrukopdrachten " +"accepteert en naar CUPS doorstuurt. Deze server dient enkel ingesteld te " +"worden als er andere computers zijn die afdrukopdrachten over het netwerk " +"sturen via \"BSD\"- of \"LPR\"-diensten, EN deze computers niet kunnen " +"worden ingesteld om het IPP-protocol te gebruiken (CUPS gebruikt dit " +"protocol zelf ook)." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "Do you want CUPS to print unknown jobs as raw jobs?" +msgstr "Wilt u dat CUPS onbekende opdrachten onbewerkt naar de printer stuurt?" + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"The Internet Printing Protocol (IPP) enforces a MIME type for all print " +"jobs. Since not all sources of print jobs can attach an appropriate type, " +"many jobs get submitted as the MIME type application/octet-stream and could " +"be rejected if CUPS cannot guess the job's format." +msgstr "" +"Het 'Internet Printing Protocol' (IPP) vereist dat alle printtaken een MIME-" +"type hebben. Niet alle printtaken komen van een bron die in staat is om een " +"geschikt MIME-type aan de printtaak te hangen, in zo'n geval worden ze " +"aangeboden met het type application/octet-stream. Als CUPS niet in staat is " +"om het correcte formaat van de taak te raden worden deze printtaak-aanvragen " +"afgewezen." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"CUPS can handle all such jobs as \"raw\" jobs, which causes them to be sent " +"directly to the printer without processing." +msgstr "" +"CUPS kan deze printtaken als 'raw'-taken afhandelen, wat inhoudt dat ze " +"zonder verdere bewerking direct naar de printer gestuurd worden." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"It is recommended to choose this option if the server will be accepting " +"print jobs from Windows computers or Samba servers." +msgstr "" +"Deze optie is aan te raden wanneer deze server printtaken dient te " +"aanvaarden van Windows-computers of Samba-servers." + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "ipp" +msgstr "ipp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "lpd" +msgstr "lpd" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "parallel" +msgstr "parallel" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "scsi" +msgstr "scsi" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "serial" +msgstr "serieel" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "socket" +msgstr "socket" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "usb" +msgstr "usb" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "snmp" +msgstr "snmp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "dnssd" +msgstr "dnssd" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "Printer communication backends:" +msgstr "Backends voor printercommunicatie:" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"CUPS uses backend programs to communicate with the printer device or port." +msgstr "" +"CUPS gebruikt backend-programma's voor de communicatie met de printer en de " +"printerpoort." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Unfortunately, some backend programs are likely to cause some trouble. For " +"example, some PPC kernels crash with the parallel backend." +msgstr "" +"Helaas kunnen sommige backend-programma's problemen veroorzaken. (Bv. " +"sommige PPC-kernels kunnen vastlopen bij gebruik van het 'parallel'-backend.)" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Please choose the backend program to be used by CUPS. The default choice " +"should fit the most common environments." +msgstr "" +"Welk backend-programma wilt u CUPS laten gebruiken?. De standaardwaarde zou " +"voor de meeste omgevingen moeten voldoen." + +#~ msgid "" +#~ "If you will be accepting print jobs from Windows computers, you probably " +#~ "want this option set, as Windows gives all IPP print jobs processed by a " +#~ "local driver the MIME type application/octet-stream. Samba also submits " +#~ "its print jobs this way." +#~ msgstr "" +#~ "Als u printopdrachten van Windows-computers wilt accepteren, dan kunt u " +#~ "deze optie het beste aanzetten. Windows geeft namelijk alle " +#~ "afdrukopdrachten die zijn verwerkt door een lokaal stuurprogramma het " +#~ "MIME-type application/octet-stream. Ook Samba verstuurt afdrukopdrachten " +#~ "op deze manier." + +#~ msgid "Port or/and host name where CUPS will listen to:" +#~ msgstr "Poort en/of domeinnaam waarnaar CUPS moet luisteren:" + +#~ msgid "" +#~ "Please specify the port or the host name CUPS daemon will listen to. The " +#~ "following formats are allowed:" +#~ msgstr "" +#~ "Gelieve de poort of domeinnaam te specificeren waarnaar de CUPS-" +#~ "achtergronddienst moet luisteren. Volgende formaten zijn toegestaan:" + +#~ msgid "" +#~ " - Port number (631);\n" +#~ " - Host name (debian.example.com);\n" +#~ " - Host:Port (debian.example.com:631);\n" +#~ " - File domain socket (/var/run/cups/cups.sock)." +#~ msgstr "" +#~ " - Poortnummer (631);\n" +#~ " - Domeinnaam (debian.example.com);\n" +#~ " - Domeinnaam:Poort (debian.example.com:631)." + +#~ msgid "" +#~ "You can combine any of these by delimiting in a space-separated list." +#~ msgstr "" +#~ "U kunt om het even welk hiervan combineren door deze met een spatie te " +#~ "scheiden." + +#~ msgid "" +#~ "The default port 631 is reserved for the Internet Printing Protocol " +#~ "(IPP). \"localhost:631\" is recommended to setup a standalone environment " +#~ "for security reasons." +#~ msgstr "" +#~ "Standaardpoort 631 is gereserveerd voor het Internet Printing Protocol " +#~ "(IPP). Om veiligheidsredenen is \"localhost:631\" aangewezen om in een " +#~ "afzonderlijke omgeving te installeren." + +#~ msgid "Broadcast and/or listen for CUPS printer information on the network?" +#~ msgstr "" +#~ "Uitzenden en/of luisteren naar CUPS-printerinformatie op het netwerk?" + +#~ msgid "" +#~ "CUPS daemon can broadcast printer information for clients on the network, " +#~ "and detect printers on the network automatically." +#~ msgstr "" +#~ "De CUPS-achtergronddienst kan voor clients op het netwerk automatisch, " +#~ "printerinformatie uitzenden en printers detecteren." + +#~ msgid "" +#~ "If you choose this option, the CUPS daemon will periodically send UDP " +#~ "broadcasts to detect printers." +#~ msgstr "" +#~ "Indien u deze optie kiest, zal de CUPS-achtergronddienst periodiek UDP-" +#~ "uitzendingen verzenden om printers te detecteren." + +#~ msgid "Incorrect value entered" +#~ msgstr "Ongeldige waarde ingevoerd" + +#~ msgid "an error occurred while parsing the port number or the host name." +#~ msgstr "" +#~ "Er is een fout voorgekomen tijdens het inlezen van het poortnummer of de " +#~ "domeinnaam" + +#~ msgid "Please correct your input." +#~ msgstr "U dient uw ingevoerde gegevens te verbeteren." + +#~ msgid "Select the backends you want." +#~ msgstr "Selecteer de backends die u wilt." --- cups-1.3.8.orig/debian/po/fi.po +++ cups-1.3.8/debian/po/fi.po @@ -0,0 +1,170 @@ +# translation of cups_1.3.2-1_templates.po to Finnish +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Esko Arajärvi , 2007. +msgid "" +msgstr "" +"Project-Id-Version: cups_1.3.2-1_templates\n" +"Report-Msgid-Bugs-To: Source: cups@packages.debian.org\n" +"POT-Creation-Date: 2007-12-16 15:35+0900\n" +"PO-Revision-Date: 2007-10-15 13:13+0200\n" +"Last-Translator: Esko Arajärvi \n" +"Language-Team: Finnish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Finnish\n" +"X-Poedit-Country: FINLAND\n" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "Do you want to set up the BSD lpd compatibility server?" +msgstr "Haluatko pystyttää ”BSD lpd”-yhteensopivuuspalvelimen?" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "" +"The CUPS package contains a server that can accept BSD-style print jobs and " +"submit them to CUPS. It should only be set up if other computers are likely " +"to submit jobs over the network via the \"BSD\" or \"LPR\" services, and " +"these computers cannot be converted to use the IPP protocol that CUPS uses." +msgstr "" +"CUPS-paketti sisältää palvelimen, joka voi vastaanottaa BSD-tyylisiä " +"tulostustöitä ja lähettää ne CUPSille. Palvelinta tulisi käyttää vain, jos " +"on todennäköistä, että muut tietokoneet lähettävät töitä verkon yli käyttäen " +"BSD- tai LPR-palveluita, eikä näitä tietokoneita voida asettaa käyttämään " +"CUPSin IPP-protokollaa." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "Do you want CUPS to print unknown jobs as raw jobs?" +msgstr "Tuleeko CUPSin tulostaa tuntemattomat työt raakatöinä?" + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"The Internet Printing Protocol (IPP) enforces a MIME type for all print " +"jobs. Since not all sources of print jobs can attach an appropriate type, " +"many jobs get submitted as the MIME type application/octet-stream and could " +"be rejected if CUPS cannot guess the job's format." +msgstr "" +"Internet Printing Protocol (IPP) vaatii, että tulostustöille on määritelty " +"MIME-tyyppi. Koska kaikki tulostustöitä lähettävät tahot eivät pysty " +"asettamaan sopivaa tyyppiä, monet työt tulevat lähetetyiksi MIME-tyypillä " +"application/octet-stream ja saattavat tulla hylätyiksi, jos CUPS ei pysty " +"arvaamaan niiden tyyppiä." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"CUPS can handle all such jobs as \"raw\" jobs, which causes them to be sent " +"directly to the printer without processing." +msgstr "" +"CUPS pystyy käsittelemään kaikki tällaiset työt ”raakatöinä”. Tällöin ne " +"lähetetään suoraan tulostimelle ilman käsittelyä." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"It is recommended to choose this option if the server will be accepting " +"print jobs from Windows computers or Samba servers." +msgstr "" +"On suositeltavaa käyttää tätä optiota, jos palvelin ottaa vastaa töitä " +"Windows-tietokoneilta tai Samba-palvelimilta." + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "ipp" +msgstr "ipp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "lpd" +msgstr "lpd" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "parallel" +msgstr "rinnakkainen" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "scsi" +msgstr "scsi" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "serial" +msgstr "sarjallinen" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "socket" +msgstr "pistoke" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "usb" +msgstr "usb" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "snmp" +msgstr "snmp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "dnssd" +msgstr "dnssd" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "Printer communication backends:" +msgstr "Tulostusviestinnän taustaliitännät:" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"CUPS uses backend programs to communicate with the printer device or port." +msgstr "" +"CUPS käyttää taustaliitäntäohjelmia viestiessään tulostinlaitteelle tai " +"tulostusporttiin." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Unfortunately, some backend programs are likely to cause some trouble. For " +"example, some PPC kernels crash with the parallel backend." +msgstr "" +"Ikävä kyllä jotkin taustaliitäntäohjelmat aiheuttavat usein ongelmia. " +"Esimerkiksi jotkin PPC-ytimet kaatuvat käytettäessä " +"rinnakkaistaustaliitäntää." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Please choose the backend program to be used by CUPS. The default choice " +"should fit the most common environments." +msgstr "" +"Valitse taustaliitäntäohjelma, jota CUPSin tulisi käyttää. Oletusvalinnan " +"pitäisi toimia yleisimmissä ympäristöissä." --- cups-1.3.8.orig/debian/po/it.po +++ cups-1.3.8/debian/po/it.po @@ -0,0 +1,167 @@ +# Italian (it) translation of debconf templates for cups +# Copyright (C) 2006 Software in the Public Interest +# This file is distributed under the same license as the cups package. +# Luca Monducci , 2006, 2007. +# +msgid "" +msgstr "" +"Project-Id-Version: cups 1.2.7 italian debconf templates\n" +"Report-Msgid-Bugs-To: Source: cups@packages.debian.org\n" +"POT-Creation-Date: 2007-12-16 15:35+0900\n" +"PO-Revision-Date: 2007-03-27 20:09+0200\n" +"Last-Translator: Luca Monducci \n" +"Language-Team: Italian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "Do you want to set up the BSD lpd compatibility server?" +msgstr "Si vuole configurare il server di compatibilit con lpd di BSD?" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "" +"The CUPS package contains a server that can accept BSD-style print jobs and " +"submit them to CUPS. It should only be set up if other computers are likely " +"to submit jobs over the network via the \"BSD\" or \"LPR\" services, and " +"these computers cannot be converted to use the IPP protocol that CUPS uses." +msgstr "" +"Il pacchetto CUPS contiene un server che pu accettare job di stampa in " +"formato BSD per poi girarli a CUPS. Questo server dovrebbe essere attivato " +"solo se in rete ci sono altri computer che potrebbero inviare job tramite i " +"servizi \"BSD\" o \"LPR\" e che non possono essere configurati per usare il " +"protocollo IPP, cio quello usato da CUPS." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "Do you want CUPS to print unknown jobs as raw jobs?" +msgstr "Si vuole che CUPS stampi i job sconosciuti come job \"raw\"?" + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"The Internet Printing Protocol (IPP) enforces a MIME type for all print " +"jobs. Since not all sources of print jobs can attach an appropriate type, " +"many jobs get submitted as the MIME type application/octet-stream and could " +"be rejected if CUPS cannot guess the job's format." +msgstr "" +"Il protocollo IPP (Internet Printing Protocol) assegna un tipo MIME a tutti " +"i job di stampa. Dato che non tutte le sorgenti dichiarano il tipo corretto, " +"molti dei job inviati hanno tipo application/octect-stream e potrebbero " +"essere rifiutati se CUPS non riesce a indovinarne il giusto formato del job." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"CUPS can handle all such jobs as \"raw\" jobs, which causes them to be sent " +"directly to the printer without processing." +msgstr "" +"CUPS pu trattare tutti questi job come job \"raw\", ci comporta l'invio " +"diretto alla stampante, senza ulteriori elaborazioni." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"It is recommended to choose this option if the server will be accepting " +"print jobs from Windows computers or Samba servers." +msgstr "" +"Si raccomanda di attivare questa opzione se il server deve accettare job di " +"stampa da computer con Windows oppure da server Samba." + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "ipp" +msgstr "ipp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "lpd" +msgstr "lpd" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "parallel" +msgstr "parallela" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "scsi" +msgstr "scsi" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "serial" +msgstr "seriale" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "socket" +msgstr "socket" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "usb" +msgstr "usb" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "snmp" +msgstr "snmp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "dnssd" +msgstr "dnssd" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "Printer communication backends:" +msgstr "Backend di comunicazione con la stampante:" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"CUPS uses backend programs to communicate with the printer device or port." +msgstr "" +"CUPS usa dei programmi di backend per comunicare con il device o la porta " +"della stampante." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Unfortunately, some backend programs are likely to cause some trouble. For " +"example, some PPC kernels crash with the parallel backend." +msgstr "" +"Sfortunatamente alcuni programmi di backend porebbero causare dei problemi. " +"Per esempio alcuni kernel per PPC si bloccano con il backend per la porta " +"parallela." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Please choose the backend program to be used by CUPS. The default choice " +"should fit the most common environments." +msgstr "" +"Scegliere quale programma di backend deve usare CUPS. La scelta predefinita " +"dovrebbe essere adatta per la maggioranza dei casi." --- cups-1.3.8.orig/debian/po/tr.po +++ cups-1.3.8/debian/po/tr.po @@ -0,0 +1,187 @@ +# Turkish translation of cups. +# This file is distributed under the same license as the cups package. +# Gürkan Aslan , 2004. +# Mert Dirik , 2008. +# +msgid "" +msgstr "" +"Project-Id-Version: cups\n" +"Report-Msgid-Bugs-To: Source: cups@packages.debian.org\n" +"POT-Creation-Date: 2007-12-16 15:35+0900\n" +"PO-Revision-Date: 2008-07-05 16:48+0200\n" +"Last-Translator: Mert Dirik \n" +"Language-Team: Turkish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "Do you want to set up the BSD lpd compatibility server?" +msgstr "BSD lpd uyumlu sunucuyu ayarlamak ister misiniz?" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "" +"The CUPS package contains a server that can accept BSD-style print jobs and " +"submit them to CUPS. It should only be set up if other computers are likely " +"to submit jobs over the network via the \"BSD\" or \"LPR\" services, and " +"these computers cannot be converted to use the IPP protocol that CUPS uses." +msgstr "" +"CUPS paketi BSD türü baskı görevlerini kabul edebilen ve onları CUPS'a " +"gönderen bir sunucu içerir. Bu sunucu yalnızca diğer bilgisayarlar \"BSD\" " +"veya \"LPR\" servisleri ile ağ üzerinden görevler gönderiyor ve bu " +"bilgisayarların CUPS'ın kullandığı IPP protokolünü kullanmalarını sağlamak " +"mümkün olmuyorsa kurulmalıdır." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "Do you want CUPS to print unknown jobs as raw jobs?" +msgstr "" +"CUPS'ın bilinmeyen görevleri ham (raw) görev olarak yazdırmasını istiyor " +"musunuz?" + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"The Internet Printing Protocol (IPP) enforces a MIME type for all print " +"jobs. Since not all sources of print jobs can attach an appropriate type, " +"many jobs get submitted as the MIME type application/octet-stream and could " +"be rejected if CUPS cannot guess the job's format." +msgstr "" +"Internet Yazdırma Protokolü (IPP), tüm yazdırma görevlerine bir MIME türü " +"atamayı zorunlu tutar. Her yazdırma görevine uygun bir MIME türü " +"atanamayabileceğinden, bir çok görev application/octet-stream MIME tipiyle " +"gönderilir. CUPS bir görevin biçimini tahmin edemezse bu görev iptal edilir." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"CUPS can handle all such jobs as \"raw\" jobs, which causes them to be sent " +"directly to the printer without processing." +msgstr "" +"CUPS bu tür görevlere \"ham\" görevler olarak muamele edebilir. Böylece bu " +"tür görevler herhangi bir işleme tâbî tutulmadan, doğrudan yazıcıya " +"gönderilecektir." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"It is recommended to choose this option if the server will be accepting " +"print jobs from Windows computers or Samba servers." +msgstr "" +"Eğer sunucu Windows kullanan bilgisayarlardan ya da Samba sunucularından " +"gelen yazdırma görevlerini kabul edecekse bu seçeneği seçmeniz önerilir." + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "ipp" +msgstr "ipp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "lpd" +msgstr "lpd" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "parallel" +msgstr "paralel" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "scsi" +msgstr "scsi" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "serial" +msgstr "seri" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "socket" +msgstr "soket" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "usb" +msgstr "usb" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "snmp" +msgstr "snmp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "dnssd" +msgstr "dnssd" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "Printer communication backends:" +msgstr "Yazıcı bağlantı arka uçları:" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"CUPS uses backend programs to communicate with the printer device or port." +msgstr "" +"CUPS, yazıcı aygıtı veya portu ile iletişim kurmak için arka uç programları " +"kullanır." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Unfortunately, some backend programs are likely to cause some trouble. For " +"example, some PPC kernels crash with the parallel backend." +msgstr "" +"Maalesef bazı arka uç programları sorun çıkarmaya meyillidir. (Örneğin, bazı " +"PPC çekirdekleri paralel arka uçla kullanıldığında çökebilir.)" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Please choose the backend program to be used by CUPS. The default choice " +"should fit the most common environments." +msgstr "" +"Lütfen CUPS tarafından kullanılacak arka uç programını seçin. Öntanımlı " +"seçim çoğu ortam için uygundur." + +#~ msgid "" +#~ "If you will be accepting print jobs from Windows computers, you probably " +#~ "want this option set, as Windows gives all IPP print jobs processed by a " +#~ "local driver the MIME type application/octet-stream. Samba also submits " +#~ "its print jobs this way." +#~ msgstr "" +#~ "Eğer Windows bilgisayarlardan gelen yazıcı görevlerini kabul etmek " +#~ "istiyorsanız, muhtemelen bu seçeneği tercih edeceksiniz. Zira Windows " +#~ "yerel sürücüdeki tüm IPP yazıcı görevlerine application/octet-stream MIME " +#~ "tipini atar. Samba da görevleri bu şekilde gönderir." + +#~ msgid "ipp, lpd, parallel, scsi, serial, socket, usb" +#~ msgstr "ipp, lpd, paralel, scsi, seri, soket, usb" + +#~ msgid "Select the backends you want." +#~ msgstr "İstediğiniz arkayüzü seçin." --- cups-1.3.8.orig/debian/po/ro.po +++ cups-1.3.8/debian/po/ro.po @@ -0,0 +1,174 @@ +# translation of ro.po to Romanian +# Romanian translation of cupsys. +# Copyright (C) 2006 THE cupsys'S COPYRIGHT HOLDER +# This file is distributed under the same license as the cupsys package. +# +# Stan Ioan-Eugen , 2006. +# Eddy Petrișor , 2008. +msgid "" +msgstr "" +"Project-Id-Version: ro\n" +"Report-Msgid-Bugs-To: Source: cups@packages.debian.org\n" +"POT-Creation-Date: 2007-12-16 15:35+0900\n" +"PO-Revision-Date: 2008-06-30 03:23+0300\n" +"Last-Translator: Eddy Petrișor \n" +"Language-Team: Romanian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < 20)) ? 1 : 2;\n" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "Do you want to set up the BSD lpd compatibility server?" +msgstr "Vreți să instalați serverul de compatibilitate BSD lpd?" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "" +"The CUPS package contains a server that can accept BSD-style print jobs and " +"submit them to CUPS. It should only be set up if other computers are likely " +"to submit jobs over the network via the \"BSD\" or \"LPR\" services, and " +"these computers cannot be converted to use the IPP protocol that CUPS uses." +msgstr "" +"Acest pachet conține un server care poate să accepte și sarcini de " +"imprimare în stil BSD pe care să le transmită la CUPS. Ar trebui să fie " +"instalat doar dacă există calculatoare în rețea care trimit sarcini prin " +"serviciile „BSD” sau „LPR”,iar aceste calculatoare nu pot fi modificate " +"să folosească protocolul IPP folosit de CUPS." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "Do you want CUPS to print unknown jobs as raw jobs?" +msgstr "" +"Doriți ca sarcinile necunoscute să fie imprimate de CUPS folosind formatul " +"brut?" + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"The Internet Printing Protocol (IPP) enforces a MIME type for all print " +"jobs. Since not all sources of print jobs can attach an appropriate type, " +"many jobs get submitted as the MIME type application/octet-stream and could " +"be rejected if CUPS cannot guess the job's format." +msgstr "Protocolul de tipărire prin Internet (IPP) impune ca sarcinile de imprimare să aibă un tip MIME. Deoarece nu toate sursele de sarcini de imprimare pot atașa un tip potrivit, multe sarcini ajung să fie trimise cu tipul MIME application/octet-stream și ar putea refuzate în cazul în care CUPS nu ar reuși să ghicească formatul." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"CUPS can handle all such jobs as \"raw\" jobs, which causes them to be sent " +"directly to the printer without processing." +msgstr "CUPS poate trata toate sarcinile de acest fel ca sarcini cu format „brut”, ceea ce va face să fie trimise direct la imprimantă, fără procesare." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"It is recommended to choose this option if the server will be accepting " +"print jobs from Windows computers or Samba servers." +msgstr "Se recomandă alegerea acestei opțiuni, dacă serverul va accepta sarcini de imprimare de la calculatoare Windows sau de la servere Samba." + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "ipp" +msgstr "ipp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "lpd" +msgstr "lpd" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "parallel" +msgstr "portul paralel" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "scsi" +msgstr "scsi" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "serial" +msgstr "portul serial" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "socket" +msgstr "socket" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "usb" +msgstr "usb" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "snmp" +msgstr "snmp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "dnssd" +msgstr "dnssd" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "Printer communication backends:" +msgstr "Module de comunicare cu imprimanta:" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "CUPS uses backend programs to communicate with the printer device or port." +msgstr "CUPS folosește diverse module/aplicații-suport pentru comunicarea cu imprimanta sau cu portul de imprimantă." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Unfortunately, some backend programs are likely to cause some trouble. For " +"example, some PPC kernels crash with the parallel backend." +msgstr "" +"Din păcate, unele aplicații-suport pot cauza probleme. De exemplu, unele nuclee " +"pentru PPC se defectează atunci când este folosit modulul paralel." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Please choose the backend program to be used by CUPS. The default choice " +"should fit the most common environments." +msgstr "" +"Alegeți modulul pe care să-l folosească CUPS. Valoarea implicit selectată ar " +"trebui să fie potrivită pentru majoritatea mediilor obișnuite." + +#~ msgid "" +#~ "If you will be accepting print jobs from Windows computers, you probably " +#~ "want this option set, as Windows gives all IPP print jobs processed by a " +#~ "local driver the MIME type application/octet-stream. Samba also submits " +#~ "its print jobs this way." +#~ msgstr "" +#~ "Dacă veți accepta lucrări de imprimare de la calculatoare cu Windows, " +#~ "veți doriprobabil să selectați această opțiune, deoarece Windows " +#~ "stabilește tuturor lucrărilor de imprimare IPP procesate de driverul " +#~ "local tipul MIME aplicație/sir-de-octeți. Și Samba trimite lucrările de " +#~ "imprimare în acest mod." + --- cups-1.3.8.orig/debian/po/eu.po +++ cups-1.3.8/debian/po/eu.po @@ -0,0 +1,166 @@ +# translation of cups-eu.po to librezale +# Piarres Beobide , 2005, 2007. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +msgid "" +msgstr "" +"Project-Id-Version: cups-eu\n" +"Report-Msgid-Bugs-To: Source: cups@packages.debian.org\n" +"POT-Creation-Date: 2007-12-16 15:35+0900\n" +"PO-Revision-Date: 2007-03-27 15:56+0200\n" +"Last-Translator: Piarres Beobide \n" +"Language-Team: librezale \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "Do you want to set up the BSD lpd compatibility server?" +msgstr "BSD lpd bateragarritasun zerbitzaria konfiguratu nahi al duzu?" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "" +"The CUPS package contains a server that can accept BSD-style print jobs and " +"submit them to CUPS. It should only be set up if other computers are likely " +"to submit jobs over the network via the \"BSD\" or \"LPR\" services, and " +"these computers cannot be converted to use the IPP protocol that CUPS uses." +msgstr "" +"CUPS paketeak BSD-moduko inprimatze lanak onartu eta CUPS-era bidaltzen " +"dituen zerbitzari bat du. Berau \"BSD\" edo \"LPR\" zerbitzuen bidez sare " +"bidez lanak bidaltzen dituzten eta CUPS-ek erabiltzen duen IPP protokoloa " +"erabili ezin duten ordenagailuak badituzu bakarrik konfiguratu behar da." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "Do you want CUPS to print unknown jobs as raw jobs?" +msgstr "CUPS-ek lan ezezagunak lan gordinak bezala inprimatzea nahi duzu?" + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"The Internet Printing Protocol (IPP) enforces a MIME type for all print " +"jobs. Since not all sources of print jobs can attach an appropriate type, " +"many jobs get submitted as the MIME type application/octet-stream and could " +"be rejected if CUPS cannot guess the job's format." +msgstr "" +"Internet Inprimatze Protokoloak (IPP) MIME mota bat indartzen du inprimatze " +"lan guztientzat. Inprimatze lan jatorri guztiek ezin dutenez mota zuzena " +"ezarri, lan asko application/octet-stream MIME mota bezala bidaltzen dira " +"eta ukatu egin daitezke CUPS ez bada lan formatu bezeroa ezagutzeko gauza." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"CUPS can handle all such jobs as \"raw\" jobs, which causes them to be sent " +"directly to the printer without processing." +msgstr "" +"Posible da CUPS-ek lan hauek guztiak lan \"gordinak\" bezala kudea ditzan, " +"honela lan hauek prozesatu gabe bidaliko dira inprimagailura." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"It is recommended to choose this option if the server will be accepting " +"print jobs from Windows computers or Samba servers." +msgstr "" +"Gomendagarria da aukera hau hautatzea zerbitzariak windows duten ordenagailu " +"edo Samba zerbitzarietatik lanak jasoko baditu." + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "ipp" +msgstr "ipp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "lpd" +msgstr "lds" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "parallel" +msgstr "paraleloa" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "scsi" +msgstr "scsi" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "serial" +msgstr "seriea" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "socket" +msgstr "socket" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "usb" +msgstr "usb" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "snmp" +msgstr "snmp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "dnssd" +msgstr "dnssd" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "Printer communication backends:" +msgstr "Inprimagailu komunikazio motorea:" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"CUPS uses backend programs to communicate with the printer device or port." +msgstr "" +"CUPS-ek inprimagailu gailu edo atakarekin komunikazioa lortzeko interfaze " +"programakerabiltzen ditu." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Unfortunately, some backend programs are likely to cause some trouble. For " +"example, some PPC kernels crash with the parallel backend." +msgstr "" +"Zoritxarrez, zenbait interaze programek arazoak zor ditzakete. (Adibidez " +"zenbait PPC kernel haustura motore paraleloaz)" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Please choose the backend program to be used by CUPS. The default choice " +"should fit the most common environments." +msgstr "" +"Mesedez hautatu CUPS-ek erabiliko duen komunikazio motorea. Aukera " +"lehenetsiak ingurune arruntenetan funtzionatu beharko luke." --- cups-1.3.8.orig/debian/po/de.po +++ cups-1.3.8/debian/po/de.po @@ -0,0 +1,178 @@ +# translation of po-debconf template to German +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans# +# Developers do not need to manually edit POT or PO files. +# +# Jens Nachtigall , 2004, 2005. +# Matthias Julius , 2007. +msgid "" +msgstr "" +"Project-Id-Version: de\n" +"Report-Msgid-Bugs-To: Source: cups@packages.debian.org\n" +"POT-Creation-Date: 2007-12-16 15:35+0900\n" +"PO-Revision-Date: 2007-03-31 11:14-0400\n" +"Last-Translator: Matthias Julius \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "Do you want to set up the BSD lpd compatibility server?" +msgstr "Möchten Sie den Kompatibilitäts-Server für BSD lpd einrichten?" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "" +"The CUPS package contains a server that can accept BSD-style print jobs and " +"submit them to CUPS. It should only be set up if other computers are likely " +"to submit jobs over the network via the \"BSD\" or \"LPR\" services, and " +"these computers cannot be converted to use the IPP protocol that CUPS uses." +msgstr "" +"Dieses Paket enthält einen Server, der BSD-artige Druckaufträge " +"entgegennimmt und diese an CUPS weiterleitet. Sie sollten diesen Server nur " +"einsetzen, wenn andere Rechner über Ihren Rechner Druckaufträge via »bsd« " +"oder »lpr« absetzen und diese Rechner nicht auf das von CUPS verwendete IPP-" +"Protokoll umgestellt werden können." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "Do you want CUPS to print unknown jobs as raw jobs?" +msgstr "" +"Möchten Sie, dass CUPS unbekannte Druckaufträge unbearbeitet (raw) druckt?" + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"The Internet Printing Protocol (IPP) enforces a MIME type for all print " +"jobs. Since not all sources of print jobs can attach an appropriate type, " +"many jobs get submitted as the MIME type application/octet-stream and could " +"be rejected if CUPS cannot guess the job's format." +msgstr "" +"Das Internet Printing Protokoll (IPP) erfordert einen MIME-Typ für alle " +"Druckaufträge. Da nicht jeder Erzeuger von Druckaufträgen den geeigneten Typ " +"einfügen kann, werden viele Aufträge mit dem MIME-Typ »application/octet-" +"stream« abgesendet. Diese Druckaufträge können abgewiesen werden, falls CUPS " +"dessen Format nicht ermitteln kann." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"CUPS can handle all such jobs as \"raw\" jobs, which causes them to be sent " +"directly to the printer without processing." +msgstr "" +"CUPS kann all diese Aufträge als »rohe« (engl.: »raw«) Aufträge behandeln. " +"Das bewirkt, dass sie ohne Bearbeitung direkt an den Drucker gesendet werden." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"It is recommended to choose this option if the server will be accepting " +"print jobs from Windows computers or Samba servers." +msgstr "" +"Es wird empfohlen, diese Option zu wählen, falls der Server Druckaufträge " +"von Windows-Rechnern oder Samba-Servern akzeptieren wird." + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "ipp" +msgstr "IPP" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "lpd" +msgstr "lpd" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "parallel" +msgstr "parallel" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "scsi" +msgstr "SCSI" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "serial" +msgstr "seriell" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "socket" +msgstr "Socket" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "usb" +msgstr "USB" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "snmp" +msgstr "SNMP" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "dnssd" +msgstr "dnssd" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "Printer communication backends:" +msgstr "Backends für die Kommunikation mit dem Drucker:" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"CUPS uses backend programs to communicate with the printer device or port." +msgstr "" +"CUPS verwendet Backend-Programme zur Kommunikation mit dem Drucker oder Port." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Unfortunately, some backend programs are likely to cause some trouble. For " +"example, some PPC kernels crash with the parallel backend." +msgstr "" +"Leider verursachen manche Backend-Programme Probleme. Zum Beispiel stürzen " +"einige PPC-Kernel mit dem Parallel-Backend ab." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Please choose the backend program to be used by CUPS. The default choice " +"should fit the most common environments." +msgstr "" +"Bitte wählen Sie das Backend-Programm zur Verwendung mit CUPS. Die " +"Voreinstellung sollte den meisten Umgebungen gerecht werden." --- cups-1.3.8.orig/debian/po/da.po +++ cups-1.3.8/debian/po/da.po @@ -0,0 +1,246 @@ +# translation of cups_1.1.20final+cvs20040317-3_da.po to Danish +# translation of da.po to Danish +# translation of Debian cups debconf to Danish +# +# Claus Hindsgaul , 2004. +# Claus Hindsgaul , 2006, 2007. +msgid "" +msgstr "" +"Project-Id-Version: da\n" +"Report-Msgid-Bugs-To: Source: cups@packages.debian.org\n" +"POT-Creation-Date: 2007-12-16 15:35+0900\n" +"PO-Revision-Date: 2007-03-27 20:59+0200\n" +"Last-Translator: Claus Hindsgaul \n" +"Language-Team: Danish\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "Do you want to set up the BSD lpd compatibility server?" +msgstr "nsker du at stte BSD lpd-kompatibilitetsserveren op?" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "" +"The CUPS package contains a server that can accept BSD-style print jobs and " +"submit them to CUPS. It should only be set up if other computers are likely " +"to submit jobs over the network via the \"BSD\" or \"LPR\" services, and " +"these computers cannot be converted to use the IPP protocol that CUPS uses." +msgstr "" +"CUPS-pakken indeholder en server, der kan modtage print-jobs p BSD-form og " +"sende dem videre til CUPS. Den br kun sttes op, hvis det er muligt, at " +"andre computere sender jobs over netvrket via servicerne \"BSD\" eller \"LPR" +"\", og disse computere ikke kan overg til at benytte den IPP-protokol, som " +"CUPS benytter." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "Do you want CUPS to print unknown jobs as raw jobs?" +msgstr "nsker du at CUPS skal udskrive ukendte jobs som r jobs?" + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"The Internet Printing Protocol (IPP) enforces a MIME type for all print " +"jobs. Since not all sources of print jobs can attach an appropriate type, " +"many jobs get submitted as the MIME type application/octet-stream and could " +"be rejected if CUPS cannot guess the job's format." +msgstr "" +"Internet Printing Protocol IPP krver, at der angives MIME-type for alle " +"printjobs. Da ikke alle printjob-kilder kan medsende den relevante type, vil " +"mange jobs blive sendt med MIME-typen \"application/octet-stream\", og kunne " +"blive afvist, sfremt CUPS ikke kan gtte jobbets format." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"CUPS can handle all such jobs as \"raw\" jobs, which causes them to be sent " +"directly to the printer without processing." +msgstr "" +"CUPS kan hndtere sdanne jobs som \"r\" jobs, hvilket betyder, at de " +"sendes direkte til printeren uden yderligere behandling." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"It is recommended to choose this option if the server will be accepting " +"print jobs from Windows computers or Samba servers." +msgstr "" +"Det anbefales at vlge denne indstilling, hvis serveren kommer til at " +"modtage printjobs fra Windows-computere eller Samba-servere." + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "ipp" +msgstr "ipp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "lpd" +msgstr "lpd" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "parallel" +msgstr "parallel" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "scsi" +msgstr "scsi" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "serial" +msgstr "seriel" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "socket" +msgstr "sokkel" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "usb" +msgstr "usb" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "snmp" +msgstr "snmp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "dnssd" +msgstr "dnssd" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "Printer communication backends:" +msgstr "Printer-kommunikationsveje:" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"CUPS uses backend programs to communicate with the printer device or port." +msgstr "" +"CUPS bruger bagvedliggende programmer til at kommunikere med printerenheden " +"eller -porten." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Unfortunately, some backend programs are likely to cause some trouble. For " +"example, some PPC kernels crash with the parallel backend." +msgstr "" +"Desvrre giver nogle af disse bagvedliggende programmer ofte visse problemer " +"(f.eks. bryder kernen sammen p nogle PPC-maskiner med parallel-programmet)." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Please choose the backend program to be used by CUPS. The default choice " +"should fit the most common environments." +msgstr "" +"Vlg det bagvedliggende program, CUPS skal bruge. Det forvalgte burde vre " +"passende under de mest almindelige forhold." + +#~ msgid "" +#~ "If you will be accepting print jobs from Windows computers, you probably " +#~ "want this option set, as Windows gives all IPP print jobs processed by a " +#~ "local driver the MIME type application/octet-stream. Samba also submits " +#~ "its print jobs this way." +#~ msgstr "" +#~ "Hvis du vil acceptere printjobs fra Windows-computere, br du acceptere " +#~ "denne funktion, da Windows giver alle IPP-printjobs, som hndteres af en " +#~ "lokal driver MIME-typen \"application/octet-stream\". Samba sender sine " +#~ "jobs p samme mde." + +#~ msgid "Port or/and host name where CUPS will listen to:" +#~ msgstr "Port og/eller vrtsnavn, CUPS skal lytte p:" + +#~ msgid "" +#~ "Please specify the port or the host name CUPS daemon will listen to. The " +#~ "following formats are allowed:" +#~ msgstr "" +#~ "Angiv port eller vrtsnavn, CUPS-dmonen skal lytte p. Flgende formater " +#~ "er gyldige:" + +#~ msgid "" +#~ " - Port number (631);\n" +#~ " - Host name (debian.example.com);\n" +#~ " - Host:Port (debian.example.com:631);\n" +#~ " - File domain socket (/var/run/cups/cups.sock)." +#~ msgstr "" +#~ " - Portnummer (631);\n" +#~ " - vrtsnavn (debian.eksempel.dk);\n" +#~ " - Vrt:Port (debian.eksempel.dk:631);\n" +#~ " - Fildomnesokkel (/var/run/cups/cups.sock)." + +#~ msgid "" +#~ "You can combine any of these by delimiting in a space-separated list." +#~ msgstr "Du kan kombinere disse i en liste adskilt med mellemrum." + +#~ msgid "" +#~ "The default port 631 is reserved for the Internet Printing Protocol " +#~ "(IPP). \"localhost:631\" is recommended to setup a standalone environment " +#~ "for security reasons." +#~ msgstr "" +#~ "Standardporten 631 er reserveret til Internet-PrinterProtokollen (IPP). " +#~ "\"localhost:631\" anbefales af sikkerhedsgrunde for at stte et " +#~ "selvstndigt milj op." + +#~ msgid "Broadcast and/or listen for CUPS printer information on the network?" +#~ msgstr "Rundsend og/eller lyt efter CUPS-printeroplysninger p netvrket?" + +#~ msgid "" +#~ "CUPS daemon can broadcast printer information for clients on the network, " +#~ "and detect printers on the network automatically." +#~ msgstr "" +#~ "CUPS-dmonen kan rundsende printeroplysninger til klienter p netvrket " +#~ "og detektere printere p netvrket automatisk." + +#~ msgid "" +#~ "If you choose this option, the CUPS daemon will periodically send UDP " +#~ "broadcasts to detect printers." +#~ msgstr "" +#~ "Hvis du vlger denne indstilling, vil CUPS-dmonen periodisk sende UDP-" +#~ "rundsendinger for at detektere printere." + +#~ msgid "Incorrect value entered" +#~ msgstr "Ugyldig vrdi indtastet" + +#~ msgid "an error occurred while parsing the port number or the host name." +#~ msgstr "der opstod en fejl under tolkningaf portnummer eller vrtsnavn." + +#~ msgid "Please correct your input." +#~ msgstr "Ret venligst din indtastning." + +#~ msgid "ipp, lpd, parallel, scsi, serial, socket, usb" +#~ msgstr "ipp, lpd, parallel, scsi, seriel, sokkel, usb" + +#~ msgid "Select the backends you want." +#~ msgstr "Vlg det bagvedliggende program, du nsker." --- cups-1.3.8.orig/debian/po/ml.po +++ cups-1.3.8/debian/po/ml.po @@ -0,0 +1,170 @@ +# Malayalam translation of cups debconf template. +# Copyright (C) 2007 THE cups' COPYRIGHT HOLDER +# This file is distributed under the same license as the cups package. +# Praveen|പ്രവീണ്‍ A|എ , 2007. +# +# +msgid "" +msgstr "" +"Project-Id-Version: cups 20070331\n" +"Report-Msgid-Bugs-To: Source: cups@packages.debian.org\n" +"POT-Creation-Date: 2007-12-16 15:35+0900\n" +"PO-Revision-Date: 2007-03-31 07:18+0530\n" +"Last-Translator: Praveen|പ്രവീണ്‍ A|എ \n" +"Language-Team: Swathanthra|സ്വതന്ത്ര Malayalam|മലയാളം Computing|കമ്പ്യൂട്ടിങ്ങ് \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "Do you want to set up the BSD lpd compatibility server?" +msgstr "BSD lpd പൊരുത്ത സേവകന്‍ സജ്ജീകരിയ്ക്കാന്‍ നിങ്ങളാഗ്രഹിയ്ക്കുന്നുണ്ടോ?" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "" +"The CUPS package contains a server that can accept BSD-style print jobs and " +"submit them to CUPS. It should only be set up if other computers are likely " +"to submit jobs over the network via the \"BSD\" or \"LPR\" services, and " +"these computers cannot be converted to use the IPP protocol that CUPS uses." +msgstr "" +"BSD-സ്റ്റൈലിലുള്ള അച്ചടി ജോലികള്‍ സ്വീകരിയ്ക്കാനും CUPS ന് സമര്‍പ്പിയ്ക്കാനും കഴിവുള്ള ഒരു സേവകന്‍ " +"CUPS പാക്കേജ് ഉള്‍ക്കൊള്ളുന്നുണ്ട്. മറ്റ് കമ്പ്യൂട്ടറുകള്‍ \"BSD\" അല്ലെങ്കില്‍ \"LPR\" സേവനങ്ങള്‍ വഴി " +"നെറ്റ്‌വര്‍ക്കിലൂടെ ജോലികള്‍ സമര്‍പ്പിയ്ക്കാനുള്ള സാധ്യതയുണ്ട് എന്ന് മാത്രമല്ല ഈ കമ്പ്യൂട്ടറുകള്‍ CUPS " +"ഉപയോഗിയ്ക്കുന്ന IPP പെരുമാറ്റച്ചട്ടം ഉപയോഗിയ്ക്കാനായി പരിവര്‍ത്തനം ചെയ്യാന്‍ സാധ്യവുമല്ല എന്ന " +"അവസരത്തില്‍ മാത്രമേ ഇത് സജ്ജീകരിയ്ക്കേണ്ടതുള്ളൂ." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "Do you want CUPS to print unknown jobs as raw jobs?" +msgstr "" +"മനസിലാവാത്ത ജോലികള്‍ അസംസ്കൃത ജോലികളായി CUPS അച്ചടിയ്ക്കണമെന്ന് നിങ്ങളാഗ്രഹിയ്ക്കുന്നുണ്ടോ?" + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"The Internet Printing Protocol (IPP) enforces a MIME type for all print " +"jobs. Since not all sources of print jobs can attach an appropriate type, " +"many jobs get submitted as the MIME type application/octet-stream and could " +"be rejected if CUPS cannot guess the job's format." +msgstr "" +"ഇന്റര്‍നെറ്റ് അച്ചടി പെരുമാറ്റച്ചട്ടം (IPP) എല്ലാ അച്ചടി ജോലികള്‍ക്കും ഒരു MIME തരം " +"നിര്‍ബന്ധമാക്കുന്നു. അച്ചടി ജോലികളുടെ എല്ലാ സ്രോതസ്സുകള്‍ക്കും അത്തരമൊരു അനുയോജ്യമായ തരത്തിലുള്ളത് " +"കൂട്ടിവയ്ക്കാന്‍ പറ്റാത്തതിനാല്‍ പല ജോലികളും application/octet-stream എന്ന തരത്തിലാണ് " +"സമര്‍പ്പിയ്ക്കപ്പെടുന്നത് എന്നതിനാല്‍ CUPS ന് ജോലിയുടെ ഫോര്‍മാറ്റ് ഊഹിയ്ക്കാന്‍ സാധിച്ചില്ലെങ്കില്‍ " +"തള്ളിക്കളയപ്പെട്ടേയ്ക്കാം." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"CUPS can handle all such jobs as \"raw\" jobs, which causes them to be sent " +"directly to the printer without processing." +msgstr "" +"അത്തരത്തിലുള്ള ജോലികള്‍ CUPS ന് \"അസംസ്കൃത\" ജോലികള്‍ എന്ന രീതിയില്‍ കൈകാര്യം ചെയ്യാം, അത് " +"പരിശോധിയ്ക്കാതെ തന്നെ അച്ചടി യന്ത്രത്തിലേയ്ക്ക് നേരിട്ട് അയയ്ക്കാന്‍ കാരണമാകുന്നു." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"It is recommended to choose this option if the server will be accepting " +"print jobs from Windows computers or Samba servers." +msgstr "" +"വിന്‍ഡോസ് കമ്പ്യൂട്ടറുകളില്‍ നിന്നോ സാംബ സേവകരില്‍ നിന്നോ അച്ചടി ജോലികള്‍ സ്വീകരിയ്ക്കുന്നതാണെങ്കില്‍ " +"ഇത് തിരഞ്ഞെടുക്കാന്‍ ശുപാര്‍ശ ചെയ്തിരിയ്ക്കുന്നു." + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "ipp" +msgstr "ipp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "lpd" +msgstr "lpd" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "parallel" +msgstr "parallel" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "scsi" +msgstr "scsi" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "serial" +msgstr "serial" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "socket" +msgstr "socket" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "usb" +msgstr "usb" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "snmp" +msgstr "snmp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "dnssd" +msgstr "dnssd" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "Printer communication backends:" +msgstr "അച്ചടി യന്ത്ര ആശയവിനിമയ ബാക്കെന്‍ഡുകള്‍:" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"CUPS uses backend programs to communicate with the printer device or port." +msgstr "" +"അച്ചടി ഉപകരണവുമായോ അല്ലെങ്കില്‍ പോര്‍ട്ടുമായോ ആശയവിനിമയം ചെയ്യാന്‍ ബാക്കെന്‍ഡ് പ്രോഗ്രാമുകളാണ് " +"CUPS ഉപയോഗിയ്ക്കുന്നത്." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Unfortunately, some backend programs are likely to cause some trouble. For " +"example, some PPC kernels crash with the parallel backend." +msgstr "" +"നിര്‍ഭാഗ്യവശാല്‍ ചില ബാക്കെന്‍ഡ് പ്രോഗ്രാമുകള്‍ ചില പ്രശ്നങ്ങളുണ്ടാക്കാന്‍ സാധ്യതയുണ്ട്. ഉദാഹരണത്തിന്, " +"ചില PPC കെര്‍ണലുകള്‍ parallel ബാക്കെന്‍ഡുമായി ക്രാഷ് ചെയ്യും." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Please choose the backend program to be used by CUPS. The default choice " +"should fit the most common environments." +msgstr "" +"ദയവായി CUPS ഉപയോഗിയ്ക്കുന്ന ബാക്കെന്‍ഡ് പ്രോഗ്രാം തിരഞ്ഞെടുക്കുക. ഡിഫാള്‍ട്ടായി തിരഞ്ഞെടുത്ത വില " +"സാധാരണയായുള്ള അധിക പരിസ്ഥിതികളിലും ചേരും." --- cups-1.3.8.orig/debian/po/POTFILES.in +++ cups-1.3.8/debian/po/POTFILES.in @@ -0,0 +1,2 @@ +[type: gettext/rfc822deb] cups-bsd.templates +[type: gettext/rfc822deb] cups.templates --- cups-1.3.8.orig/debian/po/ru.po +++ cups-1.3.8/debian/po/ru.po @@ -0,0 +1,253 @@ +# translation of cups-ru.po to Russian +# translation of cups_1.1.23-12_ru.po to Russian +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans +# +# Developers do not need to manually edit POT or PO files. +# Yuri Kozlov , 2005. +# +# Translator: Yuri Kozlov " +msgid "" +msgstr "" +"Project-Id-Version: cups_1.2.7-4_ru.po\n" +"Report-Msgid-Bugs-To: Source: cups@packages.debian.org\n" +"POT-Creation-Date: 2007-12-16 15:35+0900\n" +"PO-Revision-Date: 2007-04-05 11:27+0300\n" +"Last-Translator: Sergey Alyoshin \n" +"Language-Team: Russian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.9.1\n" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "Do you want to set up the BSD lpd compatibility server?" +msgstr "Хотите установить сервер совместимости с BSD lpd?" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "" +"The CUPS package contains a server that can accept BSD-style print jobs and " +"submit them to CUPS. It should only be set up if other computers are likely " +"to submit jobs over the network via the \"BSD\" or \"LPR\" services, and " +"these computers cannot be converted to use the IPP protocol that CUPS uses." +msgstr "" +"Этот пакет CUPS содержит сервер, который может принимать задания печати в " +"стиле BSD и посылать их в CUPS. Его рекомендуется устанавливать только в том " +"случае, если в сети есть другие компьютеры, которые отправляют задания по " +"сети с помощью \"BSD\" или \"LPR\" сервисов, и эти компьютеры не могут " +"работать с протоколом IPP, который используется в CUPS." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "Do you want CUPS to print unknown jobs as raw jobs?" +msgstr "" +"Хотите чтобы CUPS печатал неизвестные задания как необработанные задания?" + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"The Internet Printing Protocol (IPP) enforces a MIME type for all print " +"jobs. Since not all sources of print jobs can attach an appropriate type, " +"many jobs get submitted as the MIME type application/octet-stream and could " +"be rejected if CUPS cannot guess the job's format." +msgstr "" +"Все задания печати с помощью интернет протокола печати (IPP) имеют тип MIME. " +"Так как не все источники заданий печати могут назначать соответствующий тип, " +"многие задания посылаются с MIME типом приложение/поток-октетов и могут быть " +"отклонены, если CUPS не определит формат заданий." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"CUPS can handle all such jobs as \"raw\" jobs, which causes them to be sent " +"directly to the printer without processing." +msgstr "" +"CUPS может обслуживать все такие задания как \"необработанные\", что ведет к " +"их посылке напрямую к устройству печати без обработки." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"It is recommended to choose this option if the server will be accepting " +"print jobs from Windows computers or Samba servers." +msgstr "" +"Рекомендуется выбрать этот параметр если сервер будет получать задания " +"печати от компьютеров с Windows или от серверов Samba." + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "ipp" +msgstr "ipp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "lpd" +msgstr "lpd" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "parallel" +msgstr "parallel" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "scsi" +msgstr "scsi" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "serial" +msgstr "serial" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "socket" +msgstr "socket" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "usb" +msgstr "usb" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "snmp" +msgstr "snmp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "dnssd" +msgstr "dnssd" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "Printer communication backends:" +msgstr "Интерфейсные программы для связи с принтером:" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"CUPS uses backend programs to communicate with the printer device or port." +msgstr "" +"CUPS использует интерфейсные программы для связи с устройством печати или " +"портом." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Unfortunately, some backend programs are likely to cause some trouble. For " +"example, some PPC kernels crash with the parallel backend." +msgstr "" +"К сожалению, некоторые интерфейсные программы могут вызывать проблемы. " +"Например, некоторые ядра PPC рушатся при использовании интерфейса parallel." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Please choose the backend program to be used by CUPS. The default choice " +"should fit the most common environments." +msgstr "" +"Выберите интерфейсную программу, которая будет использоваться CUPS. Выбор по " +"умолчанию должен работать с большинством оборудования." + +#~ msgid "" +#~ "If you will be accepting print jobs from Windows computers, you probably " +#~ "want this option set, as Windows gives all IPP print jobs processed by a " +#~ "local driver the MIME type application/octet-stream. Samba also submits " +#~ "its print jobs this way." +#~ msgstr "" +#~ "Если вы получаете задания печати с компьютеров с Windows, то, вероятно, " +#~ "лучше установить этот параметр, так как Windows присваивает всем заданиям " +#~ "печати IPP, обработанным локальным драйверов MIME тип application/octet-" +#~ "stream. Samba также отправляет свои задания печати в таком виде." + +#~ msgid "Port or/and host name where CUPS will listen to:" +#~ msgstr "" +#~ "Порт или/и имя машины через который будет осуществляться подключение к " +#~ "CUPS:" + +#~ msgid "" +#~ "Please specify the port or the host name CUPS daemon will listen to. The " +#~ "following formats are allowed:" +#~ msgstr "" +#~ "Укажите порт или имя машины на котором будет работать демон CUPS. " +#~ "Допустимы следующие форматы:" + +#, fuzzy +#~ msgid "" +#~ " - Port number (631);\n" +#~ " - Host name (debian.example.com);\n" +#~ " - Host:Port (debian.example.com:631);\n" +#~ " - File domain socket (/var/run/cups/cups.sock)." +#~ msgstr "" +#~ " - Номер порта (631);\n" +#~ " - Имя машины (debian.example.com);\n" +#~ " - Машина:Порт (debian.example.com:631)." + +#~ msgid "" +#~ "You can combine any of these by delimiting in a space-separated list." +#~ msgstr "Можно использовать несколько любых типов, разделяя их пробелом." + +#~ msgid "" +#~ "The default port 631 is reserved for the Internet Printing Protocol " +#~ "(IPP). \"localhost:631\" is recommended to setup a standalone environment " +#~ "for security reasons." +#~ msgstr "" +#~ "Порт по умолчанию 631 зарезервирован для протокола печати в Интернет " +#~ "(Internet Printing Protocol, IPP). В целях безопасности для автономных " +#~ "систем рекомендуется использовать настройку \"localhost:631\"." + +#~ msgid "Broadcast and/or listen for CUPS printer information on the network?" +#~ msgstr "Анонсировать и/или слушать CUPS информацию о принтере в сети?" + +#~ msgid "" +#~ "CUPS daemon can broadcast printer information for clients on the network, " +#~ "and detect printers on the network automatically." +#~ msgstr "" +#~ "Демон CUPS может анонсировать информацию о принтере для сетевых клиентов, " +#~ "и обнаруживать другие принтеры в сети автоматически." + +#~ msgid "" +#~ "If you choose this option, the CUPS daemon will periodically send UDP " +#~ "broadcasts to detect printers." +#~ msgstr "" +#~ "При выборе этого параметра демон CUPS будет периодически посылать " +#~ "широковещательные UDP пакеты для обнаружения принтеров." + +#~ msgid "Incorrect value entered" +#~ msgstr "Введено недопустимое значение" + +#~ msgid "an error occurred while parsing the port number or the host name." +#~ msgstr "при разборе номера порта или имени машины произошла ошибка." + +#~ msgid "Please correct your input." +#~ msgstr "Пожалуйста исправьте вводимые данные." --- cups-1.3.8.orig/debian/po/vi.po +++ cups-1.3.8/debian/po/vi.po @@ -0,0 +1,247 @@ +# Vietnamese Translation for CupSys. +# Copyright © 2007 Free Software Foundation, Inc. +# Clytie Siddall , 2007. +# +msgid "" +msgstr "" +"Project-Id-Version: cups_1.2.11-2\n" +"Report-Msgid-Bugs-To: Source: cups@packages.debian.org\n" +"POT-Creation-Date: 2007-12-16 15:35+0900\n" +"PO-Revision-Date: 2007-05-31 15:31+0930\n" +"Last-Translator: Clytie Siddall \n" +"Language-Team: Vietnamese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: LocFactoryEditor 1.6.3b1\n" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "Do you want to set up the BSD lpd compatibility server?" +msgstr "Bạn có muốn thiết lập trình phục vụ tương thích với lpd BSD không?" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "" +"The CUPS package contains a server that can accept BSD-style print jobs and " +"submit them to CUPS. It should only be set up if other computers are likely " +"to submit jobs over the network via the \"BSD\" or \"LPR\" services, and " +"these computers cannot be converted to use the IPP protocol that CUPS uses." +msgstr "" +"Gói CUPS chứa một trình phục vụ có khả năng chấp nhận việc in kiểu BSD, cũng " +"đệ trình nó vào CUPS. Chỉ nên đặt gói này nếu máy khác sẽ đệ trình việc in " +"qua mạng bằng dịch vụ « BSD » hay « LPR », và máy khác này không thể được " +"chuyển đổi để sử dụng giao thức IPP mà CUPS dùng." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "Do you want CUPS to print unknown jobs as raw jobs?" +msgstr "Bạn có muốn CUPS in việc in lạ như là việc thô không?" + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"The Internet Printing Protocol (IPP) enforces a MIME type for all print " +"jobs. Since not all sources of print jobs can attach an appropriate type, " +"many jobs get submitted as the MIME type application/octet-stream and could " +"be rejected if CUPS cannot guess the job's format." +msgstr "" +"Giao thức In Mạng (Internet Printing Protocol: IPP) ép buộc kiểu MIME cho " +"mọi việc in. Vì không phải tất cả các nguồn việc in có khả năng đính kèm " +"kiểu thích hợp, nhiều việc được đệ trình như kiểu MIME « application/octet-" +"stream » và có thể bị từ chối nếu CUPS không thể đoán được định dạng của " +"việc in đó." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"CUPS can handle all such jobs as \"raw\" jobs, which causes them to be sent " +"directly to the printer without processing." +msgstr "" +"CUPS có khả năng quản lý các việc như vậy như là việc « thô », mà gây ra " +"chúng được gửi trực tiếp cho máy in, không xử lý gì." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"It is recommended to choose this option if the server will be accepting " +"print jobs from Windows computers or Samba servers." +msgstr "" +"Khuyên bạn bật tùy chọn này nếu trình phục vụ sẽ chấp nhận việc in từ máy " +"Windows hay trình phục vụ Samba." + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "ipp" +msgstr "ipp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "lpd" +msgstr "lpd" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "parallel" +msgstr "song song" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "scsi" +msgstr "scsi" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "serial" +msgstr "nối tiếp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "socket" +msgstr "ổ cắm" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "usb" +msgstr "usb" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "snmp" +msgstr "snmp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "dnssd" +msgstr "dnssd" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "Printer communication backends:" +msgstr "Hậu phương liên lạc với máy in:" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"CUPS uses backend programs to communicate with the printer device or port." +msgstr "" +"Phần mềm CUPS dùng một số chương trình hậu phương để liên lạc với thiết bị/" +"cổng máy in." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Unfortunately, some backend programs are likely to cause some trouble. For " +"example, some PPC kernels crash with the parallel backend." +msgstr "" +"Rất tiếc là một số chương trình hậu phương có thể gây ra lỗi. Chẳng hạn, một " +"số hạt nhân PPC sẽ sụp đổ khi chạy cùng với hậu phương song song." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Please choose the backend program to be used by CUPS. The default choice " +"should fit the most common environments." +msgstr "" +"Hãy chọn chương trình hậu phương CUPS cần dùng. Sự chọn mặc định nên thích " +"hợp với phần lớn môi trường thường dùng." + +#~ msgid "" +#~ "If you will be accepting print jobs from Windows computers, you probably " +#~ "want this option set, as Windows gives all IPP print jobs processed by a " +#~ "local driver the MIME type application/octet-stream. Samba also submits " +#~ "its print jobs this way." +#~ msgstr "" +#~ "Nếu bạn sẽ cần phải nhận việc in từ máy tính chạy hệ điều hành Windows " +#~ "thì rất có thể là bạn muốn lập tùy chọn này, vì phần mềm Windows gán mọi " +#~ "việc in IPP được xử lý bởi trình điều khiển địa phương, kiểu MIME « " +#~ "application/octet-stream ». Phần mềm Samba cũng đệ trình các việc in bằng " +#~ "cách đó." + +#~ msgid "Port or/and host name where CUPS will listen to:" +#~ msgstr "Cổng và/hay tên máy nơi CUPS se lắng nghe:" + +#~ msgid "" +#~ "Please specify the port or the host name CUPS daemon will listen to. The " +#~ "following formats are allowed:" +#~ msgstr "" +#~ "Hãy gõ cổng hay tên máy trên mà trình nền CUPS sẽ lắng nghe. Cho phép " +#~ "những khuôn dạng theo đây:" + +#~ msgid "" +#~ " - Port number (631);\n" +#~ " - Host name (debian.example.com);\n" +#~ " - Host:Port (debian.example.com:631);\n" +#~ " - File domain socket (/var/run/cups/cups.sock)." +#~ msgstr "" +#~ " • sổ cổng (v.d. 631)\n" +#~ " • tên máy (v.d. ví_dụ.vnoss.org)\n" +#~ " • máy:cổng (v.d. ví_dụ.vnoss.org:631) • ổ cắm miền tập tin (v.d. /var/" +#~ "run/cups/cups.sock)" + +#~ msgid "" +#~ "You can combine any of these by delimiting in a space-separated list." +#~ msgstr "" +#~ "Bạn có thể kết hợp vài khuôn dạng phân cách bởi khoảng trắng trong danh " +#~ "sách." + +#~ msgid "" +#~ "The default port 631 is reserved for the Internet Printing Protocol " +#~ "(IPP). \"localhost:631\" is recommended to setup a standalone environment " +#~ "for security reasons." +#~ msgstr "" +#~ "Cổng mặc định 631 dành cho Giao thức In Mạng (Internet Printing Protocol: " +#~ "IPP). Khuyên bạn dùng « localhost:631 » để thiết lập môi trường độc lập " +#~ "vì lý do bảo mật. " + +#~ msgid "Broadcast and/or listen for CUPS printer information on the network?" +#~ msgstr "Phát thanh và/hay lắng nghe thông tin máy in CUPS trên mạng không?" + +#~ msgid "" +#~ "CUPS daemon can broadcast printer information for clients on the network, " +#~ "and detect printers on the network automatically." +#~ msgstr "" +#~ "Trình nền CUPS có thể phát thanh thông tin về máy in cho trình khách trên " +#~ "mạng nghe, và tự động phát hiện máy in nào trên mạng." + +#~ msgid "" +#~ "If you choose this option, the CUPS daemon will periodically send UDP " +#~ "broadcasts to detect printers." +#~ msgstr "" +#~ "Nếu bạn lập tùy chọn này, trình nền CUPS sẽ gởi định kỳ việc phát thanh " +#~ "UDP để phát hiện máy in." + +#~ msgid "Incorrect value entered" +#~ msgstr "Gõ sai giá trị" + +#~ msgid "an error occurred while parsing the port number or the host name." +#~ msgstr "gặp lỗi khi phân tách số cổng hay tên máy." + +#~ msgid "Please correct your input." +#~ msgstr "Hãy sửa dữ liệu gõ." + +#~ msgid "ipp, lpd, parallel, scsi, serial, socket, usb" +#~ msgstr "ipp, lpd, song song, scsi, nối tiếp, ổ cắm, usb" + +#~ msgid "Select the backends you want." +#~ msgstr "Hãy chọn hậu phương nào bạn muốn." --- cups-1.3.8.orig/debian/po/pt_BR.po +++ cups-1.3.8/debian/po/pt_BR.po @@ -0,0 +1,255 @@ +# Brazilian Portuguese translation of cups +# This file is distributed under the same license as the aiccu package. +# André Luis Lopes (andrelop) , 2005-2006. +# Felipe Augusto van de Wiel (faw) , 2006-2007. +msgid "" +msgstr "" +"Project-Id-Version: cups\n" +"Report-Msgid-Bugs-To: Source: cups@packages.debian.org\n" +"POT-Creation-Date: 2007-12-16 15:35+0900\n" +"PO-Revision-Date: 2007-12-16 15:36+0900\n" +"Last-Translator: Felipe Augusto van de Wiel (faw) \n" +"Language-Team: l10n portuguese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"pt_BR utf-8\n" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "Do you want to set up the BSD lpd compatibility server?" +msgstr "Você quer configurar o servidor de compatibilidade BSD lpd?" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "" +"The CUPS package contains a server that can accept BSD-style print jobs and " +"submit them to CUPS. It should only be set up if other computers are likely " +"to submit jobs over the network via the \"BSD\" or \"LPR\" services, and " +"these computers cannot be converted to use the IPP protocol that CUPS uses." +msgstr "" +"O pacote CUPS contém um servidor que pode aceitar trabalhos de impressão no " +"estilo BSD e enviá-los ao CUPS. Isto deverá ser configurado somente se você " +"possui outros computadores enviando trabalhos de impressão pela rede via " +"serviços \"BSD\" ou \"LPR\" e estes computadores não puderem ser convertidos " +"para usar o protocolo IPP que o CUPS utiliza." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "Do you want CUPS to print unknown jobs as raw jobs?" +msgstr "" +"Você deseja que o CUPS imprima trabalhos desconhecidos como trabalhos \"raw" +"\"?" + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"The Internet Printing Protocol (IPP) enforces a MIME type for all print " +"jobs. Since not all sources of print jobs can attach an appropriate type, " +"many jobs get submitted as the MIME type application/octet-stream and could " +"be rejected if CUPS cannot guess the job's format." +msgstr "" +"O Internet Printing Protocol (IPP - Protocolo de Impressão da Internet) " +"força um tipo MIME para todos os trabalhos de impressão. Como nem todas as " +"fontes de trabalhos de impressão podem anexar um tipo apropriado, muitos " +"trabalhos são enviados como o tipo MIME application/octet-stream e podem " +"ser rejeitados se o CUPS não adivinhar o formato do trabalho." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"CUPS can handle all such jobs as \"raw\" jobs, which causes them to be sent " +"directly to the printer without processing." +msgstr "" +"O CUPS pode manipular todos estes trabalhos como trabalhos \"raw\", o que " +"faz com que eles sejam enviados diretamente para a impressora sem " +"processamento." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"It is recommended to choose this option if the server will be accepting " +"print jobs from Windows computers or Samba servers." +msgstr "" +"É recomendado escolher esta opção se o servidor vai aceitar trabalhos de " +"impressão de computadores Windows ou servidores Samba." + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "ipp" +msgstr "ipp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "lpd" +msgstr "lpd" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "parallel" +msgstr "paralelo" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "scsi" +msgstr "scsi" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "serial" +msgstr "serial" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "socket" +msgstr "socket" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "usb" +msgstr "usb" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "snmp" +msgstr "snmp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "dnssd" +msgstr "dnssd" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "Printer communication backends:" +msgstr "\"Backends\" de comunicação com impressoras:" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"CUPS uses backend programs to communicate with the printer device or port." +msgstr "" +"O CUPS utiliza um programa \"backend\" para comunicação com o dispositivo ou " +"porta de impressão." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Unfortunately, some backend programs are likely to cause some trouble. For " +"example, some PPC kernels crash with the parallel backend." +msgstr "" +"Infelizmente, alguns programas \"backend\" causam alguns problemas. Por " +"exemplo, alguns núcleos (\"kernels\") PPC travam com o \"backend parallel" +"\" (paralelo)." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Please choose the backend program to be used by CUPS. The default choice " +"should fit the most common environments." +msgstr "" +"Por favor, selecione o programa \"backend\" a ser usado pelo CUPS. A escolha " +"padrão deve se encaixar na maiorias dos ambientes." + +#~ msgid "" +#~ "If you will be accepting print jobs from Windows computers, you probably " +#~ "want this option set, as Windows gives all IPP print jobs processed by a " +#~ "local driver the MIME type application/octet-stream. Samba also submits " +#~ "its print jobs this way." +#~ msgstr "" +#~ "Caso você esteja planejando aceitar trabalhos de impressão de " +#~ "computadores Windows, você provavelmente irá precisar dessa opção " +#~ "habilitada, uma vez que o Windows atribui a todos os trabalhos de " +#~ "impressão IPP processados por um driver local o tipo MIME application/" +#~ "octet-stream. O Samba também envia seus trabalhos de impressão desta " +#~ "maneira." + +#~ msgid "Port or/and host name where CUPS will listen to:" +#~ msgstr "Porta e/ou nome de host onde o CUPS irá ouvir :" + +#~ msgid "" +#~ "Please specify the port or the host name CUPS daemon will listen to. The " +#~ "following formats are allowed:" +#~ msgstr "" +#~ "Por favor, especifique em qual porta ou nome de host o daemon CUPS irá " +#~ "ouvir. Os formatos a seguir são suportados :" + +#~ msgid "" +#~ " - Port number (631);\n" +#~ " - Host name (debian.example.com);\n" +#~ " - Host:Port (debian.example.com:631);\n" +#~ " - File domain socket (/var/run/cups/cups.sock)." +#~ msgstr "" +#~ " - Número de porta (631);\n" +#~ " - Nome de host (debian.exemplo.com);\n" +#~ " - Host:Porta (debian.exemplo.com:631);\n" +#~ " - Socket de domínio em arquivo (/var/run/cups/cups.sock)." + +#~ msgid "" +#~ "You can combine any of these by delimiting in a space-separated list." +#~ msgstr "" +#~ "Você pode combinar quaisquer um desses formatos especificando os mesmos " +#~ "em uma lista separada por espaços." + +#~ msgid "" +#~ "The default port 631 is reserved for the Internet Printing Protocol " +#~ "(IPP). \"localhost:631\" is recommended to setup a standalone environment " +#~ "for security reasons." +#~ msgstr "" +#~ "A porta padrão 631 é reservada para o Protocolo de Impressão Internet " +#~ "(IPP). \"localhost:631\" é o recomendado para configuração de um ambiente " +#~ "de trabalho fora de uma rede por razões de segurança." + +#~ msgid "Broadcast and/or listen for CUPS printer information on the network?" +#~ msgstr "" +#~ "Enviar broadcast e/ou ouvir por informações de impressoras CUPS na rede ?" + +#~ msgid "" +#~ "CUPS daemon can broadcast printer information for clients on the network, " +#~ "and detect printers on the network automatically." +#~ msgstr "" +#~ "O daemon CUPS pode enviar informações sobre impressoras via broadcasts " +#~ "para clientes na rede e também detectar impressoras na rede " +#~ "automaticamente." + +#~ msgid "" +#~ "If you choose this option, the CUPS daemon will periodically send UDP " +#~ "broadcasts to detect printers." +#~ msgstr "" +#~ "Caso você habilite esta opção, o daemon CUPS irá periodicamente enviar " +#~ "broadcasts UDP para detectar impressoras." + +#~ msgid "Incorrect value entered" +#~ msgstr "Valor incorreto informado" + +#~ msgid "an error occurred while parsing the port number or the host name." +#~ msgstr "" +#~ "um erro ocorreu durante a leitura do número de porta ou do nome de host." + +#~ msgid "Please correct your input." +#~ msgstr "Por favor, corrija o que foi informado." + +#~ msgid "ipp, lpd, parallel, scsi, serial, socket, usb" +#~ msgstr "ipp, lpd, parallel, scsi, serial, socket, usb" + +#~ msgid "Select the backends you want." +#~ msgstr "Selecione o backend desejado." --- cups-1.3.8.orig/debian/po/ca.po +++ cups-1.3.8/debian/po/ca.po @@ -0,0 +1,181 @@ +# +# Catalan translation for cups package. +# Copyright (C) 2007 Debian CUPS Maintainers. +# This file is distributed under the same license as the cups package. +# +# Jordà Polo , 2007. +# +msgid "" +msgstr "" +"Project-Id-Version: 1.2.7-4\n" +"Report-Msgid-Bugs-To: Source: cups@packages.debian.org\n" +"POT-Creation-Date: 2007-12-16 15:35+0900\n" +"PO-Revision-Date: 2007-03-27 11:01+0200\n" +"Last-Translator: Jordà Polo \n" +"Language-Team: Català \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "Do you want to set up the BSD lpd compatibility server?" +msgstr "Voleu configurar el servidor compatible amb l'lpd de BSD?" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "" +"The CUPS package contains a server that can accept BSD-style print jobs and " +"submit them to CUPS. It should only be set up if other computers are likely " +"to submit jobs over the network via the \"BSD\" or \"LPR\" services, and " +"these computers cannot be converted to use the IPP protocol that CUPS uses." +msgstr "" +"Aquest paquet inclou un servidor que pot acceptar tasques d'impressió de " +"tipus BSD, i enviar-les a CUPS. Només s'hauria d'utilitzar si teniu altres " +"ordinadors que enviïn tasques mitjançant els serveis «BSD» o «LPR», i no " +"podeu convertir-los al protocol IPP que utilitza CUPS." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "Do you want CUPS to print unknown jobs as raw jobs?" +msgstr "" +"Voleu que CUPS imprimeixi les tasques desconegudes com tasques en brut?" + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"The Internet Printing Protocol (IPP) enforces a MIME type for all print " +"jobs. Since not all sources of print jobs can attach an appropriate type, " +"many jobs get submitted as the MIME type application/octet-stream and could " +"be rejected if CUPS cannot guess the job's format." +msgstr "" +"El protocol d'impressió d'Internet (IPP, «Internet Printing Protocol») força " +"l'existència d'un tipus MIME en totes les tasques d'impressió. Com no sempre " +"s'indica un tipus adequat, moltes d'aquestes tasques s'envien amb el MIME " +"«application/octet-stream» i poden ser rebutjades si CUPS no és capaç de " +"trobar quin és el seu format." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"CUPS can handle all such jobs as \"raw\" jobs, which causes them to be sent " +"directly to the printer without processing." +msgstr "" +"CUPS pot tractar totes aquestes tasques com tasques en brut, que fa que " +"s'enviïn directament a la impressora sense cap mena de processament." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"It is recommended to choose this option if the server will be accepting " +"print jobs from Windows computers or Samba servers." +msgstr "" +"És recomanable que trieu aquesta opció si el servidor ha d'acceptar tasques " +"d'impressió d'ordinadors Windows o servidors Samba." + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "ipp" +msgstr "ipp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "lpd" +msgstr "lpd" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "parallel" +msgstr "paral·lel" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "scsi" +msgstr "scsi" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "serial" +msgstr "sèrie" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "socket" +msgstr "sòcol" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "usb" +msgstr "usb" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "snmp" +msgstr "snmp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "dnssd" +msgstr "" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "Printer communication backends:" +msgstr "Mecanisme de comunicació amb la impressora:" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"CUPS uses backend programs to communicate with the printer device or port." +msgstr "" +"CUPS utilitza programes externs per comunicar-se amb el dispositiu o port " +"d'impressora." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Unfortunately, some backend programs are likely to cause some trouble. For " +"example, some PPC kernels crash with the parallel backend." +msgstr "" +"Malauradament, alguns d'aquests programes poden ser problemàtics. (Per " +"exemple, algun nucli PPC falla si s'utilitza el port paral·lel.)" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Please choose the backend program to be used by CUPS. The default choice " +"should fit the most common environments." +msgstr "" +"Si us plau, trieu el programa que CUPS hauria d'utilitzar per comunicar-se " +"amb la impressora. L'opció predeterminada és vàlida en la majoria d'entorns." + +#~ msgid "" +#~ "If you will be accepting print jobs from Windows computers, you probably " +#~ "want this option set, as Windows gives all IPP print jobs processed by a " +#~ "local driver the MIME type application/octet-stream. Samba also submits " +#~ "its print jobs this way." +#~ msgstr "" +#~ "Si heu d'acceptar tasques d'ordinadors amb Windows, probablement us " +#~ "interessi activar aquesta opció, ja que Windows assigna el tipus MIME " +#~ "«application/octet-stream» a totes les tasques d'impressió IPP que són " +#~ "processades per un controlador local. Samba també envia les impressions " +#~ "d'aquesta manera." --- cups-1.3.8.orig/debian/po/sv.po +++ cups-1.3.8/debian/po/sv.po @@ -0,0 +1,281 @@ +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans +# +# Developers do not need to manually edit POT or PO files. +# +msgid "" +msgstr "" +"Project-Id-Version: cups 1.1.23-13\n" +"Report-Msgid-Bugs-To: Source: cups@packages.debian.org\n" +"POT-Creation-Date: 2007-12-16 15:35+0900\n" +"PO-Revision-Date: 2007-03-27 08:57+0100\n" +"Last-Translator: Daniel Nylander \n" +"Language-Team: Swedish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "Do you want to set up the BSD lpd compatibility server?" +msgstr "Vill du konfigurera den BSD-kompatibla lpd-servern?" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "" +"The CUPS package contains a server that can accept BSD-style print jobs and " +"submit them to CUPS. It should only be set up if other computers are likely " +"to submit jobs over the network via the \"BSD\" or \"LPR\" services, and " +"these computers cannot be converted to use the IPP protocol that CUPS uses." +msgstr "" +"CUPS-paketet innehller en server som kan acceptera utskriftsjobb av BSD-" +"stil och skicka dem till CUPS. Den br endast konfigureras om du har andra " +"datorer som kommer att skicka jobb ver ntverket via \"BSD\" eller \"LPR\"-" +"tjnster och dessa datorer inte kan konverteras till att anvnda IPP-" +"protokollet som CUPS anvnder." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "Do you want CUPS to print unknown jobs as raw jobs?" +msgstr "Vill du att CUPS ska skriva ut oknda jobb som rjobb?" + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"The Internet Printing Protocol (IPP) enforces a MIME type for all print " +"jobs. Since not all sources of print jobs can attach an appropriate type, " +"many jobs get submitted as the MIME type application/octet-stream and could " +"be rejected if CUPS cannot guess the job's format." +msgstr "" +"Internet Printing Protocol (IPP) anvnder en MIME-typ fr alla sorters " +"utskriftsjobb. Eftersom inte alla kllor fr utskriftsjobb kan skicka med en " +"lmplig typ blir mnga jobb skickade som MIME-typen \"application/octet-" +"stream\" och kan bli nekade om CUPS inte kan gissa jobbtypen." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"CUPS can handle all such jobs as \"raw\" jobs, which causes them to be sent " +"directly to the printer without processing." +msgstr "" +"CUPS kan hantera alla sdan jobb som \"raw\"-jobb vilket orsakar att de " +"skickas direkt till skrivaren utan att frst behandlas." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"It is recommended to choose this option if the server will be accepting " +"print jobs from Windows computers or Samba servers." +msgstr "" +"Det r rekommenderat att vlja det hr alternativet om servern ska acceptera " +"utskriftsjobb frn Windows-datorer eller Samba-servrar." + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "ipp" +msgstr "ipp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "lpd" +msgstr "lpd" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "parallel" +msgstr "parallell" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "scsi" +msgstr "scsi" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "serial" +msgstr "seriell" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "socket" +msgstr "uttag" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "usb" +msgstr "usb" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "snmp" +msgstr "snmp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "dnssd" +msgstr "dnssd" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "Printer communication backends:" +msgstr "Bakndar fr skrivarkommunikation:" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"CUPS uses backend programs to communicate with the printer device or port." +msgstr "" +"CUPS anvnder bakndesprogram fr att kommunicera med skrivarenheten eller " +"porten." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Unfortunately, some backend programs are likely to cause some trouble. For " +"example, some PPC kernels crash with the parallel backend." +msgstr "" +"Tyvrr kan vissa bakndesprogram orsaka en del problem. Till exempel kan " +"vissa PPC-krnor krascha nr den parallella baknden anvnds." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Please choose the backend program to be used by CUPS. The default choice " +"should fit the most common environments." +msgstr "" +"Vlj det bakndesprogram som ska anvndas av CUPS. Standardvalet br passa " +"de flesta vanliga miljer." + +#~ msgid "" +#~ "If you will be accepting print jobs from Windows computers, you probably " +#~ "want this option set, as Windows gives all IPP print jobs processed by a " +#~ "local driver the MIME type application/octet-stream. Samba also submits " +#~ "its print jobs this way." +#~ msgstr "" +#~ "Om du vill att utskriftsjobb ska accepteras frn Windows-datorer br du " +#~ "antagligen vlja denna funktion eftersom Windows stter alla IPP-" +#~ "utskriftsjobb som hanteras av en lokal drivare till MIME-typen " +#~ "\"application/octet-stream\". Samba skickar ocks sina utskriftsjobb p " +#~ "detta stt." + +#~ msgid "Port or/and host name where CUPS will listen to:" +#~ msgstr "Port och/eller vrdnamn som CUPS lyssnar p:" + +#~ msgid "" +#~ "Please specify the port or the host name CUPS daemon will listen to. The " +#~ "following formats are allowed:" +#~ msgstr "" +#~ "Vnligen ange porten eller vrdnamnet som CUPS-demonen ska lyssna p. " +#~ "Fljande format r tilltna:" + +#, fuzzy +#~ msgid "" +#~ " - Port number (631);\n" +#~ " - Host name (debian.example.com);\n" +#~ " - Host:Port (debian.example.com:631);\n" +#~ " - File domain socket (/var/run/cups/cups.sock)." +#~ msgstr "" +#~ " - Portnummer (631);\n" +#~ " - Vrdnamn (debian.exempel.se);\n" +#~ " - Vrd:Port (debian.exempel.se:631)." + +#~ msgid "" +#~ "You can combine any of these by delimiting in a space-separated list." +#~ msgstr "Du kan kombinera flera av dessa genom att avgrnsa med mellanslag." + +#~ msgid "" +#~ "The default port 631 is reserved for the Internet Printing Protocol " +#~ "(IPP). \"localhost:631\" is recommended to setup a standalone environment " +#~ "for security reasons." +#~ msgstr "" +#~ "Standardport 631 r reserverad fr Internet Printing Protocol (IPP). " +#~ "\"localhost:631\" r rekommenderad fr att stlla in en fristende milj " +#~ "av skerhetsskl." + +#~ msgid "Broadcast and/or listen for CUPS printer information on the network?" +#~ msgstr "" +#~ "Vill du snda ut och/eller lyssna efter skrivarinformation fr CUPS p " +#~ "ntverket?" + +#~ msgid "" +#~ "CUPS daemon can broadcast printer information for clients on the network, " +#~ "and detect printers on the network automatically." +#~ msgstr "" +#~ "CUPS-demonen kan snda ut skrivarinformation fr klienter p ntverket " +#~ "och automatiskt identifiera skrivare p ntverket." + +#~ msgid "" +#~ "If you choose this option, the CUPS daemon will periodically send UDP " +#~ "broadcasts to detect printers." +#~ msgstr "" +#~ "Om du valde detta alternativ kommer CUPS-demonen att med jmna mellanrum " +#~ "snda UDP-broadcast fr att identifiera skrivare." + +#~ msgid "Incorrect value entered" +#~ msgstr "Felaktigt vrde angivet" + +#~ msgid "an error occurred while parsing the port number or the host name." +#~ msgstr "ett fel intrffade vid tolkning av portnumret eller vrdnamnet." + +#~ msgid "Please correct your input." +#~ msgstr "Vnligen rtt till det." + +#~ msgid "ipp, lpd, parallel, scsi, serial, socket, usb" +#~ msgstr "ipp, lpd, parallell, scsi, seriell, socket, usb" + +#~ msgid "Select the backends you want." +#~ msgstr "Vlj det baksystem du vill anvnda." + +#~ msgid "Specify the port or/and host name that wants to be listened." +#~ msgstr "Ange port och/eller vrdnamn som ska lyssnas p." + +#~ msgid "- Port number (631)" +#~ msgstr "- Portnummer (631)" + +#~ msgid "- Host name (debian.example.com)" +#~ msgstr "- Vrdnamn (debian.exempel.se)" + +#~ msgid "- Host:Port (debian.example.com:631)" +#~ msgstr "- Vrd:Port (debian.exempel.se:631)" + +#~ msgid "It is possible to combine by delimiting two or more values in space." +#~ msgstr "" +#~ "Det r mjligt att kombinera genom att avgrnsa tv eller fler vrden med " +#~ "mellanslag." + +#~ msgid "" +#~ "When this option is accepted, CUPS daemon will broadcast and detect by " +#~ "using UDP periodically." +#~ msgstr "" +#~ "Nr denna funktion accepteras kommer CUPS-demonen att snda ut och " +#~ "identifiera genom att anvnda UDP med jmna mellanrum." + +#~ msgid "The wrong value is found in the input." +#~ msgstr "Fel vrde matades in." --- cups-1.3.8.orig/debian/po/nb.po +++ cups-1.3.8/debian/po/nb.po @@ -0,0 +1,167 @@ +# translation of nb.po_[sQSfZa].po to Norwegian Bokmål +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Bjørn Steensrud , 2007. +msgid "" +msgstr "" +"Project-Id-Version: nb.po_[sQSfZa]\n" +"Report-Msgid-Bugs-To: Source: cups@packages.debian.org\n" +"POT-Creation-Date: 2007-12-16 15:35+0900\n" +"PO-Revision-Date: 2007-03-27 19:04+0200\n" +"Last-Translator: Bjørn Steensrud \n" +"Language-Team: Norwegian Bokmål \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "Do you want to set up the BSD lpd compatibility server?" +msgstr "Vil du sette opp en tjener kompatibel med BSD lpd?" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "" +"The CUPS package contains a server that can accept BSD-style print jobs and " +"submit them to CUPS. It should only be set up if other computers are likely " +"to submit jobs over the network via the \"BSD\" or \"LPR\" services, and " +"these computers cannot be converted to use the IPP protocol that CUPS uses." +msgstr "" +"CUPS-pakka inneholder en tjener som kan ta imot utskriftsjobber som er i BSD-" +"stil og sende dem over til CUPS. Du bør bare sette den opp dersom du har " +"andre datamaskiner som sender utskrifter over nettverket via «BSD» eller " +"«LPR»-tjenester, og disse maskinene ikke kan endres til å bruke IPP - " +"Internet Printing Protocol - som CUPS bruker." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "Do you want CUPS to print unknown jobs as raw jobs?" +msgstr "Vil du at CUPS skal skrive ut ukjente jobber som rå utskrift?" + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"The Internet Printing Protocol (IPP) enforces a MIME type for all print " +"jobs. Since not all sources of print jobs can attach an appropriate type, " +"many jobs get submitted as the MIME type application/octet-stream and could " +"be rejected if CUPS cannot guess the job's format." +msgstr "" +"Alle utskriftsjobber i IPP får en MIME-type. Siden ikke alle kilder som " +"sender utskriftsjobber kan legge på en passende type, så blir mange jobber " +"levert som MIME-typen application/octet-stream og kan bli avvist hvis CUPS " +"ikke kan gjette seg til den rette typen." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"CUPS can handle all such jobs as \"raw\" jobs, which causes them to be sent " +"directly to the printer without processing." +msgstr "" +"CUPS kan behandle alle slike jobber som «rå» utskrift, noe som gjør at de " +"sendes direkte til skriveren uten behandling." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"It is recommended to choose this option if the server will be accepting " +"print jobs from Windows computers or Samba servers." +msgstr "" +"Hvis tjeneren kommer til å behandle utskriftsjobber fra Windows-maskiner " +"eller Samba-tjenere anbefales det at dette slås på." + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "ipp" +msgstr "ipp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "lpd" +msgstr "lpd" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "parallel" +msgstr "parallell" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "scsi" +msgstr "scsi" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "serial" +msgstr "seriell" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "socket" +msgstr "sokkel" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "usb" +msgstr "usb" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "snmp" +msgstr "snmp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "dnssd" +msgstr "dnssd" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "Printer communication backends:" +msgstr "Kommunikasjonsmotorer for skriver:" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"CUPS uses backend programs to communicate with the printer device or port." +msgstr "" +"CUPS bruker bakgrunns-«motorer» til å kommunisere med skriverenheten eller " +"porten." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Unfortunately, some backend programs are likely to cause some trouble. For " +"example, some PPC kernels crash with the parallel backend." +msgstr "" +"Dessverre lager noen motorer vanskeligheter. Noen PPD-kjerner, for eksempel, " +"krasjer med parallell-motoren." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Please choose the backend program to be used by CUPS. The default choice " +"should fit the most common environments." +msgstr "" +"Velg motor-program som CUPS skal bruke. Standardvalget passer antakelig i de " +"vanligste miljøene." --- cups-1.3.8.orig/debian/po/templates.pot +++ cups-1.3.8/debian/po/templates.pot @@ -0,0 +1,148 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: Source: cups@packages.debian.org\n" +"POT-Creation-Date: 2007-12-16 15:35+0900\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "Do you want to set up the BSD lpd compatibility server?" +msgstr "" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "" +"The CUPS package contains a server that can accept BSD-style print jobs and " +"submit them to CUPS. It should only be set up if other computers are likely " +"to submit jobs over the network via the \"BSD\" or \"LPR\" services, and " +"these computers cannot be converted to use the IPP protocol that CUPS uses." +msgstr "" + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "Do you want CUPS to print unknown jobs as raw jobs?" +msgstr "" + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"The Internet Printing Protocol (IPP) enforces a MIME type for all print " +"jobs. Since not all sources of print jobs can attach an appropriate type, " +"many jobs get submitted as the MIME type application/octet-stream and could " +"be rejected if CUPS cannot guess the job's format." +msgstr "" + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"CUPS can handle all such jobs as \"raw\" jobs, which causes them to be sent " +"directly to the printer without processing." +msgstr "" + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"It is recommended to choose this option if the server will be accepting " +"print jobs from Windows computers or Samba servers." +msgstr "" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "ipp" +msgstr "" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "lpd" +msgstr "" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "parallel" +msgstr "" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "scsi" +msgstr "" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "serial" +msgstr "" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "socket" +msgstr "" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "usb" +msgstr "" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "snmp" +msgstr "" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "dnssd" +msgstr "" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "Printer communication backends:" +msgstr "" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"CUPS uses backend programs to communicate with the printer device or port." +msgstr "" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Unfortunately, some backend programs are likely to cause some trouble. For " +"example, some PPC kernels crash with the parallel backend." +msgstr "" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Please choose the backend program to be used by CUPS. The default choice " +"should fit the most common environments." +msgstr "" --- cups-1.3.8.orig/debian/po/es.po +++ cups-1.3.8/debian/po/es.po @@ -0,0 +1,196 @@ +# cups debconf translation to spanish +# Copyright (C) 2003, 2004, 2006, 2007 Software in the Public Interest +# This file is distributed under the same license as the cups package. +# +# Changes: +# - Initial translation +# Carlos Valdivia Yage , 2003, 2004, 2006 +# - Translation update +# Javier Fernandez-Sanguino , 2007 +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans +# +# Developers do not need to manually edit POT or PO files. +# +msgid "" +msgstr "" +"Project-Id-Version: cups 1.2.2-1\n" +"Report-Msgid-Bugs-To: Source: cups@packages.debian.org\n" +"POT-Creation-Date: 2007-12-16 15:35+0900\n" +"PO-Revision-Date: 2007-06-21 18:51+0200\n" +"Last-Translator: Carlos Valdivia Yage \n" +"Language-Team: Debian L10n Spanish Team \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-15\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "Do you want to set up the BSD lpd compatibility server?" +msgstr "Desea configurar el servidor de compatibilidad lpd de BSD?" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "" +"The CUPS package contains a server that can accept BSD-style print jobs and " +"submit them to CUPS. It should only be set up if other computers are likely " +"to submit jobs over the network via the \"BSD\" or \"LPR\" services, and " +"these computers cannot be converted to use the IPP protocol that CUPS uses." +msgstr "" +"Este paquete incluye un servidor que acepta trabajos de impresin al estilo " +"BSD y se los enva a CUPS. Configrelo nicamente en el caso de que haya " +"otras mquinas que enven trabajos de impresin mediante la red, usando los " +"servicios \"BSD\" o \"LPR\" y no se puede hacer que estos utilice el " +"protocolo IPP que utiliza CUPS." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "Do you want CUPS to print unknown jobs as raw jobs?" +msgstr "Quiere que CUPS imprima en bruto los trabajos desconocidos?" + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"The Internet Printing Protocol (IPP) enforces a MIME type for all print " +"jobs. Since not all sources of print jobs can attach an appropriate type, " +"many jobs get submitted as the MIME type application/octet-stream and could " +"be rejected if CUPS cannot guess the job's format." +msgstr "" +"En IPP todos los trabajos de impresin tienen un tipo MIME. Puesto que no " +"todas las fuentes de trabajos de impresin asignan correctamente algn tipo " +"MIME, muchos llegan con el tipo application/octet-stream y podran " +"rechazarse si CUPS no puede adivinar el formato del trabajo." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"CUPS can handle all such jobs as \"raw\" jobs, which causes them to be sent " +"directly to the printer without processing." +msgstr "" +"Es posible hacer que CUPS trate todos estos trabajos como trabajos en " +"crudo, con lo que se mandan directamente a la impresora sin procesar." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"It is recommended to choose this option if the server will be accepting " +"print jobs from Windows computers or Samba servers." +msgstr "" +"Se recomienda que escoga esta opcin si el servidor va a aceptar trabajos de " +"impresin de ordenadores con Windows o servidores Samba." + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "ipp" +msgstr "ipp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "lpd" +msgstr "lpd" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "parallel" +msgstr "paralelo" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "scsi" +msgstr "scsi" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "serial" +msgstr "serie" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "socket" +msgstr "socket" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "usb" +msgstr "usb" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "snmp" +msgstr "snmp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "dnssd" +msgstr "dnssd" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "Printer communication backends:" +msgstr "Motores de comunicacin con la impresora:" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"CUPS uses backend programs to communicate with the printer device or port." +msgstr "" +"CUPS utiliza diversos motores para comunicarse con el puerto o dispositivo " +"de la impresora." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Unfortunately, some backend programs are likely to cause some trouble. For " +"example, some PPC kernels crash with the parallel backend." +msgstr "" +"Desafortunadamente, ciertos motores pueden causar problemas. Por ejemplo, " +"con el motor del puerto paralelo se producen algunas cadas del ncleo en la " +"arquitectura PPC." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Please choose the backend program to be used by CUPS. The default choice " +"should fit the most common environments." +msgstr "" +"Por favor, elija el motor que utilizar CUPS. La opcin predeterminada " +"debera ser apta para los entornos ms comunes." + +#~ msgid "" +#~ "If you will be accepting print jobs from Windows computers, you probably " +#~ "want this option set, as Windows gives all IPP print jobs processed by a " +#~ "local driver the MIME type application/octet-stream. Samba also submits " +#~ "its print jobs this way." +#~ msgstr "" +#~ "Si va a recibir trabajos de impresin desde sistemas Windows es muy " +#~ "probable que desee activar esta opcin, ya que Windows da a los trabajos " +#~ "de impresin IPP que procesa localmente el tipo application/octet-stream. " +#~ "Samba tambin enva los trabajos de impresin de esta manera." --- cups-1.3.8.orig/debian/po/sk.po +++ cups-1.3.8/debian/po/sk.po @@ -0,0 +1,131 @@ +# Slovak translation of cups +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the cups package. +# Ivan Masár , 2008. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: Source: cups@packages.debian.org\n" +"POT-Creation-Date: 2007-12-16 15:35+0900\n" +"PO-Revision-Date: \n" +"Last-Translator: Ivan Masár \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "Do you want to set up the BSD lpd compatibility server?" +msgstr "Chcete nastaviť server pre kompatibilitu s BSD lpd?" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "The CUPS package contains a server that can accept BSD-style print jobs and submit them to CUPS. It should only be set up if other computers are likely to submit jobs over the network via the \"BSD\" or \"LPR\" services, and these computers cannot be converted to use the IPP protocol that CUPS uses." +msgstr "Balík CUPS obsahuje server, ktorý dokáže prijímať tlačové úlohy v štýle BSD a poslať ich systému CUPS. Mali by ste ho nastaviť iba v prípade, že iné počítače budú pravdepodobne posielať úlohy sieťou pomocou služieb „BSD” alebo „LPR” a nemožno ich nastaviť, aby používali protokol IPP, ktorý používa CUPS." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "Do you want CUPS to print unknown jobs as raw jobs?" +msgstr "Chcete, aby CUPS obsluhoval neznáme úlohy ako nespracované (raw)?" + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "The Internet Printing Protocol (IPP) enforces a MIME type for all print jobs. Since not all sources of print jobs can attach an appropriate type, many jobs get submitted as the MIME type application/octet-stream and could be rejected if CUPS cannot guess the job's format." +msgstr "Internet Printing Protocol (IPP) vyžaduje MIME typ pre všetky tlačové úlohy. Keďže nie všetky zdroje tlačových úloh dokážu pripojiť správny typ, mnohé úlohy bývajú odoslané s MIME typom application/octet-stream a je možné, že budú zamietnuté ak CUPS nedokáže uhádnuť formát úlohy." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "CUPS can handle all such jobs as \"raw\" jobs, which causes them to be sent directly to the printer without processing." +msgstr "CUPS dokáže s takými úlohami pracovať v „nespracovanom” (raw) formáte, čo spôsobí ich odoslanie priamo na tlačiareň bez spracovania." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "It is recommended to choose this option if the server will be accepting print jobs from Windows computers or Samba servers." +msgstr "Odporúča sa túto voľbu zapnúť ak bude server prijímať tlačové úlohy od počítačov s Windows alebo od Samba serverov." + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "ipp" +msgstr "ipp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "lpd" +msgstr "lpd" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "parallel" +msgstr "paralelný" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "scsi" +msgstr "scsi" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "serial" +msgstr "sériový" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "socket" +msgstr "socket" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "usb" +msgstr "usb" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "snmp" +msgstr "snmp" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "dnssd" +msgstr "dnssd" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "Printer communication backends:" +msgstr "Backendy pre komunikáciu s tlačiarňou:" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "CUPS uses backend programs to communicate with the printer device or port." +msgstr "CUPS používa na komunikáciu so zariadením alebo portom tlačiarne pomocné backend programy." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "Unfortunately, some backend programs are likely to cause some trouble. For example, some PPC kernels crash with the parallel backend." +msgstr "Bohužiaľ niektoré pomocné programy pravdepodobne spôsobia isté problémy. Napríklad niektoré jadrá PPC havarujú pri použití programu pre paralelný port." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "Please choose the backend program to be used by CUPS. The default choice should fit the most common environments." +msgstr "Prosím, vyberte, ktorý pomocný program má CUPS používať. Štandardná voľba by mala vyhovovať väčšine bežných prostredí." + --- cups-1.3.8.orig/debian/po/fr.po +++ cups-1.3.8/debian/po/fr.po @@ -0,0 +1,170 @@ +# Translation of cups debconf templates to French +# Copyright (C) 2004-2007 Christian Perrier +# This file is distributed under the same license as the cups package. +# +# +# Christian Perrier , 2004, 2005, 2006, 2007. +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: Source: cups@packages.debian.org\n" +"POT-Creation-Date: 2007-12-14 11:54+0530\n" +"PO-Revision-Date: 2007-12-14 11:57+0530\n" +"Last-Translator: Christian Perrier \n" +"Language-Team: French \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: Plural-Forms: nplurals=2; plural=n>1;\n" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "Do you want to set up the BSD lpd compatibility server?" +msgstr "Faut-il installer le serveur compatible avec le démon lpd de BSD ?" + +#. Type: boolean +#. Description +#: ../cups-bsd.templates:2001 +msgid "" +"The CUPS package contains a server that can accept BSD-style print jobs and " +"submit them to CUPS. It should only be set up if other computers are likely " +"to submit jobs over the network via the \"BSD\" or \"LPR\" services, and " +"these computers cannot be converted to use the IPP protocol that CUPS uses." +msgstr "" +"Le paquet de CUPS fournit un serveur capable d'accepter des demandes " +"d'impression au style BSD et de les donner à CUPS. Ne le configurez que si " +"des postes du réseau ne sont capable de communiquer avec le serveur qu'avec " +"les services « BSD » ou « LPR » et ne gèrent pas le protocole IPP utilisé par " +"CUPS." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "Do you want CUPS to print unknown jobs as raw jobs?" +msgstr "CUPS doit-il imprimer les demandes sans type MIME sous forme brute ?" + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"The Internet Printing Protocol (IPP) enforces a MIME type for all print " +"jobs. Since not all sources of print jobs can attach an appropriate type, " +"many jobs get submitted as the MIME type application/octet-stream and could " +"be rejected if CUPS cannot guess the job's format." +msgstr "" +"Selon le protocole IPP (« Internet Printing Protocol »), chaque demande " +"d'impression doit comporter un type MIME. Comme certaines sources de " +"demandes d'impression ne peuvent pas affecter un type MIME adapté, de " +"nombreuses demandes sont soumises avec le type MIME application/octet-" +"stream. Elles peuvent alors être rejetées si CUPS ne peut en déterminer le " +"format." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"CUPS can handle all such jobs as \"raw\" jobs, which causes them to be sent " +"directly to the printer without processing." +msgstr "" +"CUPS peut traiter toutes ces demandes sans type reconnu comme des demandes " +"au format brut et les envoyer sans aucun traitement à l'imprimante." + +#. Type: boolean +#. Description +#: ../cups.templates:2001 +msgid "" +"It is recommended to choose this option if the server will be accepting " +"print jobs from Windows computers or Samba servers." +msgstr "" +"Il est recommandé de choisir cette option si le serveur est amené à traiter " +"des demandes d'impression d'ordinateurs Windows ou de serveurs Samba." + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "ipp" +msgstr "IPP" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "lpd" +msgstr "lpd" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "parallel" +msgstr "parallèle" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "scsi" +msgstr "SCSI" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "serial" +msgstr "série" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "socket" +msgstr "socket" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "usb" +msgstr "USB" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "snmp" +msgstr "SNMP" + +#. Type: multiselect +#. Choices +#: ../cups.templates:3001 +msgid "dnssd" +msgstr "dnssd" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "Printer communication backends:" +msgstr "Mode de communication avec les imprimantes :" + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"CUPS uses backend programs to communicate with the printer device or port." +msgstr "" +"CUPS utilise différentes méthodes de communication pour ses échanges avec " +"les imprimantes ou les ports d'impression." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Unfortunately, some backend programs are likely to cause some trouble. For " +"example, some PPC kernels crash with the parallel backend." +msgstr "" +"Malheureusement, certaines de ces méthodes sont connues pour provoquer des " +"difficultés comme le gel de certains noyaux PowerPC avec la communication " +"parallèle." + +#. Type: multiselect +#. Description +#: ../cups.templates:3002 +msgid "" +"Please choose the backend program to be used by CUPS. The default choice " +"should fit the most common environments." +msgstr "Le choix par défaut est adapté à la majorité des environnements." --- cups-1.3.8.orig/debian/patches/ubuntu-disable-browsing.dpatch +++ cups-1.3.8/debian/patches/ubuntu-disable-browsing.dpatch @@ -0,0 +1,27 @@ +#! /bin/sh -e +## ubuntu-disable-browsing.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Disable Browsing by default on Ubuntu (not sanctioned yet by +## DP: https://wiki.ubuntu.com/DefaultNetworkServices). This is only applied +## DP: when building on Ubuntu. + +[ "`lsb_release -is 2>/dev/null`" = "Ubuntu" ] || { echo -n '(ignored)' >&2; exit 0; } +. /usr/share/dpatch/dpatch-run + +@DPATCH@ +diff -urNad cups-1.3.0~rc2~/conf/cupsd.conf.in cups-1.3.0~rc2/conf/cupsd.conf.in +--- cups-1.3.0~rc2~/conf/cupsd.conf.in 2007-07-25 01:40:03.000000000 +0100 ++++ cups-1.3.0~rc2/conf/cupsd.conf.in 2007-08-01 15:27:56.000000000 +0100 +@@ -19,9 +19,10 @@ + @CUPS_LISTEN_DOMAINSOCKET@ + + # Show shared printers on the local network. +-Browsing On ++Browsing Off + BrowseOrder allow,deny + BrowseAllow all ++BrowseAddress @LOCAL + + # Default authentication type, when authentication is required... + DefaultAuthType Basic --- cups-1.3.8.orig/debian/patches/quiesce-bonjour-warning.dpatch +++ cups-1.3.8/debian/patches/quiesce-bonjour-warning.dpatch @@ -0,0 +1,21 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## quiesce-bonjour-warning.dpatch by +## +## DP: Silence Avahi Bonjour compat warning, since this can cause SIGPIPE +## DP: crashes if stderr is not available. +## DP: http://bugs.debian.org/497492, http://www.cups.org/str.php?L2931 + +@DPATCH@ +diff -urNad trunk~/scheduler/printers.c trunk/scheduler/printers.c +--- trunk~/scheduler/printers.c 2008-09-06 11:47:42.000000000 +0200 ++++ trunk/scheduler/printers.c 2008-09-06 11:52:39.000000000 +0200 +@@ -2353,6 +2353,9 @@ + } + + #ifdef HAVE_DNSSD ++ /* silence Avahi Bonjour compat warning, since this can cause SIGPIPE ++ * crashes if stderr is not available */ ++ setenv("AVAHI_COMPAT_NOWARN", "1", 0); + cupsdSetString(&p->product, ppd->product); + #endif /* HAVE_DNSSD */ + --- cups-1.3.8.orig/debian/patches/pidfile.dpatch +++ cups-1.3.8/debian/patches/pidfile.dpatch @@ -0,0 +1,114 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 47_pid.dpatch by Kenshi Muto +## +## DP: Add support for creating pid files. +## DP: (http://www.cups.org/str.php?L2465) + +@DPATCH@ +diff -urNad trunk~/scheduler/conf.c trunk/scheduler/conf.c +--- trunk~/scheduler/conf.c 2008-03-16 14:26:26.000000000 +0100 ++++ trunk/scheduler/conf.c 2008-03-16 14:26:26.000000000 +0100 +@@ -168,7 +168,8 @@ + #endif /* HAVE_AUTHORIZATION_H */ + { "TempDir", &TempDir, CUPSD_VARTYPE_PATHNAME }, + { "Timeout", &Timeout, CUPSD_VARTYPE_INTEGER }, +- { "UseNetworkDefault", &UseNetworkDefault, CUPSD_VARTYPE_BOOLEAN } ++ { "UseNetworkDefault", &UseNetworkDefault, CUPSD_VARTYPE_BOOLEAN }, ++ { "PidFile", &PidFile, CUPSD_VARTYPE_STRING } + }; + #define NUM_VARS (sizeof(variables) / sizeof(variables[0])) + +@@ -414,6 +415,7 @@ + cupsdSetString(&RemoteRoot, "remroot"); + cupsdSetString(&ServerHeader, "CUPS/1.2"); + cupsdSetString(&StateDir, CUPS_STATEDIR); ++ cupsdSetString(&PidFile, "/var/run/cups/cupsd.pid"); + #ifdef HAVE_GSSAPI + cupsdSetString(&GSSServiceName, CUPS_DEFAULT_GSSSERVICENAME); + #endif /* HAVE_GSSAPI */ +diff -urNad trunk~/scheduler/conf.h trunk/scheduler/conf.h +--- trunk~/scheduler/conf.h 2008-03-16 14:21:55.000000000 +0100 ++++ trunk/scheduler/conf.h 2008-03-16 14:26:26.000000000 +0100 +@@ -189,6 +189,7 @@ + /* Server key file */ + # endif /* HAVE_LIBSSL || HAVE_GNUTLS */ + #endif /* HAVE_SSL */ ++VAR char *PidFile VALUE(NULL); /* Debian CUPS pid file */ + + #ifdef HAVE_LAUNCHD + VAR int LaunchdTimeout VALUE(DEFAULT_TIMEOUT); +diff -urNad trunk~/scheduler/main.c trunk/scheduler/main.c +--- trunk~/scheduler/main.c 2008-03-16 14:21:55.000000000 +0100 ++++ trunk/scheduler/main.c 2008-03-16 14:26:26.000000000 +0100 +@@ -89,6 +89,8 @@ + static void sigterm_handler(int sig); + static long select_timeout(int fds); + static void usage(int status); ++int write_pid(void); ++int remove_pid(void); + + + /* +@@ -595,6 +597,11 @@ + } + #endif /* __sgi */ + ++ if (write_pid() == 0) { ++ cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to write pid file"); ++ return (1); ++ } ++ + /* + * Initialize authentication certificates... + */ +@@ -1145,9 +1152,39 @@ + + cupsdStopSelect(); + ++ remove_pid(); ++ + return (!stop_scheduler); + } + ++/* 'write_pid()' - Write PID file. ++ 'remove_pid()' - Delete PID file. ++*/ ++int ++write_pid() ++{ ++ FILE *f; ++ int fd; ++ int pid; ++ if (((fd = open(PidFile, O_RDWR|O_CREAT, 0644)) == -1) ++ || ((f = fdopen(fd, "r+")) == NULL) ) { ++ return 0; ++ } ++ pid = getpid(); ++ if (!fprintf(f, "%d\n", pid)) { ++ close(fd); ++ return 0; ++ } ++ fflush(f); ++ close(fd); ++ ++ return pid; ++} ++ ++int remove_pid() { ++ return unlink(PidFile); ++} ++ + + /* + * 'cupsdClosePipe()' - Close a pipe as necessary. +diff -urNad trunk~/test/run-stp-tests.sh trunk/test/run-stp-tests.sh +--- trunk~/test/run-stp-tests.sh 2007-07-11 23:46:42.000000000 +0200 ++++ trunk/test/run-stp-tests.sh 2008-03-16 14:26:48.000000000 +0100 +@@ -302,6 +302,7 @@ + DocumentRoot $root/doc + RequestRoot /tmp/cups-$user/spool + TempDir /tmp/cups-$user/spool/temp ++PidFile /tmp/cups-$user/cupsd.pid + MaxLogSize 0 + AccessLog /tmp/cups-$user/log/access_log + ErrorLog /tmp/cups-$user/log/error_log --- cups-1.3.8.orig/debian/patches/dont-chown-symlinked-ssl.dpatch +++ cups-1.3.8/debian/patches/dont-chown-symlinked-ssl.dpatch @@ -0,0 +1,90 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## dont-chown-symlinked-ssl.dpatch by Martin Pitt +## +## DP: Do not clobber permissions of configuration files if they are symbolic +## DP: links. (http://www.cups.org/str.php?L2937, upstream svn trunk r7912) + +@DPATCH@ +diff -urNad trunk~/scheduler/conf.c trunk/scheduler/conf.c +--- trunk~/scheduler/conf.c 2008-09-08 09:22:50.000000000 +0200 ++++ trunk/scheduler/conf.c 2008-09-08 09:24:02.000000000 +0200 +@@ -217,6 +217,7 @@ + int dir_created = 0; /* Did we create a directory? */ + char pathname[1024]; /* File name with prefix */ + struct stat fileinfo; /* Stat buffer */ ++ int is_symlink; /* Is "filename" a symlink? */ + + + /* +@@ -233,7 +234,7 @@ + * See if we can stat the file/directory... + */ + +- if (stat(filename, &fileinfo)) ++ if (lstat(filename, &fileinfo)) + { + if (errno == ENOENT && create_dir) + { +@@ -260,8 +261,18 @@ + return (create_dir ? -1 : 1); + } + ++ if ((is_symlink = S_ISLNK(fileinfo.st_mode)) != 0) ++ { ++ if (stat(filename, &fileinfo)) ++ { ++ cupsdLogMessage(CUPSD_LOG_ERROR, "\"%s\" is a bad symlink - %s", ++ filename, strerror(errno)); ++ return (-1); ++ } ++ } ++ + /* +- * Make sure it's a regular file... ++ * Make sure it's a regular file or a directory as needed... + */ + + if (!dir_created && !is_dir && !S_ISREG(fileinfo.st_mode)) +@@ -281,6 +292,13 @@ + } + + /* ++ * If the filename is a symlink, do not change permissions (STR #2937)... ++ */ ++ ++ if (is_symlink) ++ return (0); ++ ++ /* + * Fix owner, group, and mode as needed... + */ + +@@ -757,21 +775,18 @@ + if (ServerCertificate[0] != '/') + cupsdSetStringf(&ServerCertificate, "%s/%s", ServerRoot, ServerCertificate); + +- if (!strncmp(ServerRoot, ServerCertificate, strlen(ServerRoot))) +- { +- chown(ServerCertificate, RunUser, Group); +- chmod(ServerCertificate, 0600); +- } ++ if (!strncmp(ServerRoot, ServerCertificate, strlen(ServerRoot)) && ++ cupsdCheckPermissions(ServerCertificate, NULL, 0600, RunUser, Group, ++ 0, 0) < 0) ++ return (0); + + # if defined(HAVE_LIBSSL) || defined(HAVE_GNUTLS) + if (ServerKey[0] != '/') + cupsdSetStringf(&ServerKey, "%s/%s", ServerRoot, ServerKey); + +- if (!strncmp(ServerRoot, ServerKey, strlen(ServerRoot))) +- { +- chown(ServerKey, RunUser, Group); +- chmod(ServerKey, 0600); +- } ++ if (!strncmp(ServerRoot, ServerKey, strlen(ServerRoot)) && ++ cupsdCheckPermissions(ServerKey, NULL, 0600, RunUser, Group, 0, 0) < 0) ++ return (0); + # endif /* HAVE_LIBSSL || HAVE_GNUTLS */ + #endif /* HAVE_SSL */ + --- cups-1.3.8.orig/debian/patches/pdftops-cups-1.4.dpatch +++ cups-1.3.8/debian/patches/pdftops-cups-1.4.dpatch @@ -0,0 +1,390 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## pdftops-cups-1.4.dpatch by +## +## DP: 1.4 uses a small filter/pdftops.c wrapper instead of xpdf. Backport this +## DP: since it generally works much better than the 1.3 current one. +## DP: Test suite fix is http://www.cups.org/str.php?L2759 + +@DPATCH@ +diff -urNad trunk~/filter/Makefile trunk/filter/Makefile +--- trunk~/filter/Makefile 2008-04-06 11:14:48.000000000 -0500 ++++ trunk/filter/Makefile 2008-04-09 23:00:00.000000000 -0500 +@@ -19,7 +19,7 @@ + + + FILTERS = gziptoany hpgltops texttops pstops $(IMGFILTERS) \ +- rastertolabel rastertoepson rastertohp ++ rastertolabel rastertoepson rastertohp pdftops + TARGETS = $(FILTERS) \ + $(LIBCUPSIMAGE) \ + libcupsimage.a \ +@@ -41,7 +41,7 @@ + OBJS = $(HPGLOBJS) $(IMAGEOBJS) $(FORMOBJS) \ + gziptoany.o imagetops.o imagetoraster.o common.o pstops.o \ + rasterbench.o rastertoepson.o rastertohp.o rastertolabel.o \ +- testimage.o testraster.o textcommon.o texttops.o ++ testimage.o testraster.o textcommon.o texttops.o pdftops.o + + + # +@@ -322,6 +322,9 @@ + echo Linking $@... + $(CC) $(LDFLAGS) -o $@ pstops.o common.o $(LIBS) -lm + ++pdftops: pdftops.o common.o ../cups/$(LIBCUPS) ++ echo Linking $@... ++ $(CC) $(LDFLAGS) -o $@ pdftops.o common.o $(LIBS) -lm + + # + # rastertolabel +diff -urNad trunk~/filter/pdftops.c trunk/filter/pdftops.c +--- trunk~/filter/pdftops.c 1969-12-31 18:00:00.000000000 -0600 ++++ trunk/filter/pdftops.c 2008-04-09 23:00:12.000000000 -0500 +@@ -0,0 +1,335 @@ ++/* ++ * "$Id$" ++ * ++ * PDF to PostScript filter front-end for the Common UNIX Printing ++ * System (CUPS). ++ * ++ * Copyright 2007-2008 by Apple Inc. ++ * Copyright 1997-2006 by Easy Software Products. ++ * ++ * These coded instructions, statements, and computer programs are the ++ * property of Apple Inc. and are protected by Federal copyright ++ * law. Distribution and use rights are outlined in the file "LICENSE.txt" ++ * which should have been included with this file. If this file is ++ * file is missing or damaged, see the license at "http://www.cups.org/". ++ * ++ * Contents: ++ * ++ * main() - Main entry for filter... ++ * cancel_job() - Flag the job as canceled. ++ */ ++ ++/* ++ * Include necessary headers... ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++ ++/* ++ * Local functions... ++ */ ++ ++static void cancel_job(int sig); ++ ++ ++/* ++ * Local globals... ++ */ ++ ++static int job_canceled = 0; ++ ++ ++/* ++ * 'main()' - Main entry for filter... ++ */ ++ ++int /* O - Exit status */ ++main(int argc, /* I - Number of command-line args */ ++ char *argv[]) /* I - Command-line arguments */ ++{ ++ int fd; /* Copy file descriptor */ ++ char *filename, /* PDF file to convert */ ++ tempfile[1024]; /* Temporary file */ ++ char buffer[8192]; /* Copy buffer */ ++ int bytes; /* Bytes copied */ ++ int num_options; /* Number of options */ ++ cups_option_t *options; /* Options */ ++ const char *val; /* Option value */ ++ int orientation; /* Output orientation */ ++ ppd_file_t *ppd; /* PPD file */ ++ ppd_size_t *size; /* Current page size */ ++ int pdfpid, /* Process ID for pdftops */ ++ pdfwaitpid, /* Process ID from wait() */ ++ pdfstatus, /* Status from pdftops */ ++ pdfargc; /* Number of args for pdftops */ ++ char *pdfargv[100], /* Arguments for pdftops */ ++ pdfwidth[255], /* Paper width */ ++ pdfheight[255]; /* Paper height */ ++#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET) ++ struct sigaction action; /* Actions for POSIX signals */ ++#endif /* HAVE_SIGACTION && !HAVE_SIGSET */ ++ ++ ++ /* ++ * Make sure status messages are not buffered... ++ */ ++ ++ setbuf(stderr, NULL); ++ ++ /* ++ * Make sure we have the right number of arguments for CUPS! ++ */ ++ ++ if (argc < 6 || argc > 7) ++ { ++ fprintf(stderr, ++ _("Usage: %s job user title copies options [filename]\n"), ++ argv[0]); ++ return (1); ++ } ++ ++ /* ++ * Register a signal handler to cleanly cancel a job. ++ */ ++ ++#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */ ++ sigset(SIGTERM, cancel_job); ++#elif defined(HAVE_SIGACTION) ++ memset(&action, 0, sizeof(action)); ++ ++ sigemptyset(&action.sa_mask); ++ action.sa_handler = cancel_job; ++ sigaction(SIGTERM, &action, NULL); ++#else ++ signal(SIGTERM, cancel_job); ++#endif /* HAVE_SIGSET */ ++ ++ /* ++ * Copy stdin if needed... ++ */ ++ ++ if (argc == 6) ++ { ++ /* ++ * Copy stdin to a temp file... ++ */ ++ ++ if ((fd = cupsTempFd(tempfile, sizeof(tempfile))) < 0) ++ { ++ perror(_("ERROR: Unable to copy PDF file")); ++ return (1); ++ } ++ ++ fprintf(stderr, "DEBUG: pdftops - copying to temp print file \"%s\"\n", ++ tempfile); ++ ++ while ((bytes = fread(buffer, 1, sizeof(buffer), stdin)) > 0) ++ write(fd, buffer, bytes); ++ ++ close(fd); ++ ++ filename = tempfile; ++ } ++ else ++ { ++ /* ++ * Use the filename on the command-line... ++ */ ++ ++ filename = argv[6]; ++ tempfile[0] = '\0'; ++ } ++ ++ /* ++ * Load the PPD file and mark options... ++ */ ++ ++ ppd = ppdOpenFile(getenv("PPD")); ++ num_options = cupsParseOptions(argv[5], 0, &options); ++ ++ ppdMarkDefaults(ppd); ++ cupsMarkOptions(ppd, num_options, options); ++ ++ /* ++ * Build the command-line for the pdftops filter... ++ */ ++ ++ pdfargv[0] = (char *)"pdftops"; ++ pdfargc = 1; ++ ++ if (ppd) ++ { ++ /* ++ * Set language level and TrueType font handling... ++ */ ++ ++ if (ppd->language_level == 1) ++ { ++ pdfargv[pdfargc++] = (char *)"-level1"; ++ pdfargv[pdfargc++] = (char *)"-noembtt"; ++ } ++ else if (ppd->language_level == 2) ++ { ++ pdfargv[pdfargc++] = (char *)"-level2"; ++ if (!ppd->ttrasterizer) ++ pdfargv[pdfargc++] = (char *)"-noembtt"; ++ } ++ else ++ pdfargv[pdfargc++] = (char *)"-level3"; ++ ++ /* ++ * Set output page size... ++ */ ++ ++ size = ppdPageSize(ppd, NULL); ++ if (size) ++ { ++ /* ++ * Got the size, now get the orientation... ++ */ ++ ++ orientation = 0; ++ ++ if ((val = cupsGetOption("landscape", num_options, options)) != NULL) ++ { ++ if (strcasecmp(val, "no") != 0 && strcasecmp(val, "off") != 0 && ++ strcasecmp(val, "false") != 0) ++ orientation = 1; ++ } ++ else if ((val = cupsGetOption("orientation-requested", num_options, options)) != NULL) ++ { ++ /* ++ * Map IPP orientation values to 0 to 3: ++ * ++ * 3 = 0 degrees = 0 ++ * 4 = 90 degrees = 1 ++ * 5 = -90 degrees = 3 ++ * 6 = 180 degrees = 2 ++ */ ++ ++ orientation = atoi(val) - 3; ++ if (orientation >= 2) ++ orientation ^= 1; ++ } ++ ++ if (orientation & 1) ++ { ++ snprintf(pdfwidth, sizeof(pdfwidth), "%.0f", size->length); ++ snprintf(pdfheight, sizeof(pdfheight), "%.0f", size->width); ++ } ++ else ++ { ++ snprintf(pdfwidth, sizeof(pdfwidth), "%.0f", size->width); ++ snprintf(pdfheight, sizeof(pdfheight), "%.0f", size->length); ++ } ++ ++ pdfargv[pdfargc++] = (char *)"-paperw"; ++ pdfargv[pdfargc++] = pdfwidth; ++ pdfargv[pdfargc++] = (char *)"-paperh"; ++ pdfargv[pdfargc++] = pdfheight; ++ } ++ } ++ ++ if ((val = cupsGetOption("fitplot", num_options, options)) != NULL && ++ strcasecmp(val, "no") && strcasecmp(val, "off") && ++ strcasecmp(val, "false")) ++ pdfargv[pdfargc++] = (char *)"-expand"; ++ ++ pdfargv[pdfargc++] = filename; ++ pdfargv[pdfargc++] = (char *)"-"; ++ pdfargv[pdfargc] = NULL; ++ ++ if ((pdfpid = fork()) == 0) ++ { ++ /* ++ * Child comes here... ++ */ ++ ++ execv("/usr/bin/pdftops", pdfargv); ++ perror(_("ERROR: Unable to execute pdftops filter")); ++ exit(1); ++ } ++ else if (pdfpid < 0) ++ { ++ /* ++ * Unable to fork! ++ */ ++ ++ perror(_("ERROR: Unable to execute pdftops filter")); ++ pdfstatus = 1; ++ } ++ else ++ { ++ /* ++ * Parent comes here... ++ */ ++ ++ while ((pdfwaitpid = wait(&pdfstatus)) < 0 && errno == EINTR) ++ { ++ /* ++ * Wait until we get a valid process ID or the job is canceled... ++ */ ++ ++ if (job_canceled) ++ break; ++ } ++ ++ if (pdfwaitpid != pdfpid) ++ { ++ kill(pdfpid, SIGTERM); ++ pdfstatus = 1; ++ } ++ else if (pdfstatus) ++ { ++ if (WIFEXITED(pdfstatus)) ++ { ++ pdfstatus = WEXITSTATUS(pdfstatus); ++ ++ fprintf(stderr, ++ _("ERROR: pdftops filter exited with status %d!\n"), ++ pdfstatus); ++ } ++ else ++ { ++ pdfstatus = WTERMSIG(pdfstatus); ++ ++ fprintf(stderr, ++ _("ERROR: pdftops filter crashed on signal %d!\n"), ++ pdfstatus); ++ } ++ } ++ } ++ ++ /* ++ * Cleanup and exit... ++ */ ++ ++ if (tempfile[0]) ++ unlink(tempfile); ++ ++ return (pdfstatus); ++} ++ ++ ++/* ++ * 'cancel_job()' - Flag the job as canceled. ++ */ ++ ++static void ++cancel_job(int sig) /* I - Signal number (unused) */ ++{ ++ (void)sig; ++ ++ job_canceled = 1; ++} ++ ++ ++/* ++ * End of "$Id$". ++ */ +diff -urNad trunk~/test/run-stp-tests.sh trunk/test/run-stp-tests.sh +--- trunk~/test/run-stp-tests.sh 2008-04-09 22:59:59.000000000 -0500 ++++ trunk/test/run-stp-tests.sh 2008-04-09 23:00:00.000000000 -0500 +@@ -273,7 +273,7 @@ + else + ln -s $root/filter/imagetops /tmp/cups-$user/bin/filter + ln -s $root/filter/imagetoraster /tmp/cups-$user/bin/filter +- ln -s $root/pdftops/pdftops /tmp/cups-$user/bin/filter ++ ln -s $root/filter/pdftops /tmp/cups-$user/bin/filter + fi + + # --- cups-1.3.8.orig/debian/patches/cupsaccept.dpatch +++ cups-1.3.8/debian/patches/cupsaccept.dpatch @@ -0,0 +1,313 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## cupsaccept.dpatch by Martin Pitt +## +## DP: Allow to invoke accept command as cupsaccept/cupsreject, too, for less +## DP: namespace clobbering and consistency with disable/enable. +## DP: (http://www.cups.org/str.php?L2936, upstream svn trunk 7929 to 7932) + +@DPATCH@ +diff -urNad trunk~/doc/Makefile trunk/doc/Makefile +--- trunk~/doc/Makefile 2008-02-20 22:04:09.000000000 +0100 ++++ trunk/doc/Makefile 2008-09-11 11:58:07.000000000 +0200 +@@ -119,7 +119,7 @@ + help/glossary.html \ + help/kerberos.html \ + help/license.html \ +- help/man-accept.html \ ++ help/man-cupsaccept.html \ + help/man-backend.html \ + help/man-cancel.html \ + help/man-classes.conf.html \ +diff -urNad trunk~/man/Makefile trunk/man/Makefile +--- trunk~/man/Makefile 2008-09-08 09:21:41.000000000 +0200 ++++ trunk/man/Makefile 2008-09-11 11:58:27.000000000 +0200 +@@ -42,7 +42,7 @@ + subscriptions.conf.$(MAN5EXT) + MAN7 = backend.$(MAN7EXT) \ + filter.$(MAN7EXT) +-MAN8 = accept.$(MAN8EXT) \ ++MAN8 = cupsaccept.$(MAN8EXT) \ + cupsaddsmb.$(MAN8EXT) \ + cupsctl.$(MAN8EXT) \ + cupsfilter.$(MAN8EXT) \ +@@ -118,8 +118,8 @@ + echo Installing $$file in $(AMANDIR)/man$(MAN8DIR)...; \ + $(INSTALL_MAN) $$file $(AMANDIR)/man$(MAN8DIR); \ + done +- $(RM) $(AMANDIR)/man$(MAN8DIR)/reject.$(MAN8EXT) +- $(LN) accept.$(MAN8EXT) $(AMANDIR)/man$(MAN8DIR)/reject.$(MAN8EXT) ++ $(RM) $(AMANDIR)/man$(MAN8DIR)/cupsreject.$(MAN8EXT) ++ $(LN) cupsaccept.$(MAN8EXT) $(AMANDIR)/man$(MAN8DIR)/cupsreject.$(MAN8EXT) + $(RM) $(AMANDIR)/man$(MAN8DIR)/cupsdisable.$(MAN8EXT) + $(LN) cupsenable.$(MAN8EXT) $(AMANDIR)/man$(MAN8DIR)/cupsdisable.$(MAN8EXT) + +diff -urNad trunk~/man/accept.man trunk/man/accept.man +--- trunk~/man/accept.man 2007-07-11 23:46:42.000000000 +0200 ++++ trunk/man/accept.man 1970-01-01 01:00:00.000000000 +0100 +@@ -1,79 +0,0 @@ +-.\" +-.\" "$Id: accept.man 6649 2007-07-11 21:46:42Z mike $" +-.\" +-.\" accept/reject man page for the Common UNIX Printing System (CUPS). +-.\" +-.\" Copyright 2007 by Apple Inc. +-.\" Copyright 1997-2006 by Easy Software Products. +-.\" +-.\" These coded instructions, statements, and computer programs are the +-.\" property of Apple Inc. and are protected by Federal copyright +-.\" law. Distribution and use rights are outlined in the file "LICENSE.txt" +-.\" which should have been included with this file. If this file is +-.\" file is missing or damaged, see the license at "http://www.cups.org/". +-.\" +-.TH accept 8 "Common UNIX Printing System" "12 February 2006" "Apple Inc." +-.SH NAME +-accept/reject \- accept/reject jobs sent to a destination +-.SH SYNOPSIS +-.B accept +-[ -E ] [ -U +-.I username +-] [ -h +-.I hostname[:port] +-] destination(s) +-.br +-.B reject +-[ -E ] [ -U +-.I username +-] [ -h +-.I hostname[:port] +-] [ -r +-.I reason +-] destination(s) +-.SH DESCRIPTION +-\fIaccept\fR instructs the printing system to accept print jobs to the +-specified destinations. +-.LP +-\fIreject\fR instructs the printing system to reject print jobs to the +-specified destinations. The \fI-r\fR option sets the reason for rejecting +-print jobs. If not specified the reason defaults to "Reason Unknown". +-.SH OPTIONS +-The following options are supported by both \fIaccept\fR and +-\fIreject\fR: +-.TP 5 +--E +-.br +-Forces encryption when connecting to the server. +-.TP 5 +--U username +-.br +-Sets the username that is sent when connecting to the server. +-.TP 5 +--h hostname[:port] +-.br +-Chooses an alternate server. +-.TP 5 +--r "reason" +-.br +-Sets the reason string that is shown for a printer that is +-rejecting jobs. +-.SH COMPATIBILITY +-Unlike the System V printing system, CUPS allows printer names to +-contain any printable character except SPACE, TAB, "/", or "#". +-Also, printer and class names are \fInot\fR case-sensitive. +-.LP +-The CUPS versions of \fIaccept\fR and \fIreject\fR may ask the +-user for an access password depending on the printing system +-configuration. This differs from the System V versions which +-require the root user to execute these commands. +-.SH SEE ALSO +-\fIcancel(1)\fR, \fIcupsenable(8)\fR, \fIlp(1)\fR, +-\fIlpadmin(8)\fR, \fIlpstat(1)\fR, +-.br +-http://localhost:631/help +-.SH COPYRIGHT +-Copyright 2007 by Apple Inc. +-.\" +-.\" End of "$Id: accept.man 6649 2007-07-11 21:46:42Z mike $". +-.\" +diff -urNad trunk~/man/cupsaccept.man trunk/man/cupsaccept.man +--- trunk~/man/cupsaccept.man 1970-01-01 01:00:00.000000000 +0100 ++++ trunk/man/cupsaccept.man 2008-09-11 11:58:07.000000000 +0200 +@@ -0,0 +1,79 @@ ++.\" ++.\" "$Id: accept.man 6649 2007-07-11 21:46:42Z mike $" ++.\" ++.\" accept/reject man page for the Common UNIX Printing System (CUPS). ++.\" ++.\" Copyright 2007 by Apple Inc. ++.\" Copyright 1997-2006 by Easy Software Products. ++.\" ++.\" These coded instructions, statements, and computer programs are the ++.\" property of Apple Inc. and are protected by Federal copyright ++.\" law. Distribution and use rights are outlined in the file "LICENSE.txt" ++.\" which should have been included with this file. If this file is ++.\" file is missing or damaged, see the license at "http://www.cups.org/". ++.\" ++.TH accept 8 "Common UNIX Printing System" "12 February 2006" "Apple Inc." ++.SH NAME ++accept/reject \- accept/reject jobs sent to a destination ++.SH SYNOPSIS ++.B accept ++[ -E ] [ -U ++.I username ++] [ -h ++.I hostname[:port] ++] destination(s) ++.br ++.B reject ++[ -E ] [ -U ++.I username ++] [ -h ++.I hostname[:port] ++] [ -r ++.I reason ++] destination(s) ++.SH DESCRIPTION ++\fIaccept\fR instructs the printing system to accept print jobs to the ++specified destinations. ++.LP ++\fIreject\fR instructs the printing system to reject print jobs to the ++specified destinations. The \fI-r\fR option sets the reason for rejecting ++print jobs. If not specified the reason defaults to "Reason Unknown". ++.SH OPTIONS ++The following options are supported by both \fIaccept\fR and ++\fIreject\fR: ++.TP 5 ++-E ++.br ++Forces encryption when connecting to the server. ++.TP 5 ++-U username ++.br ++Sets the username that is sent when connecting to the server. ++.TP 5 ++-h hostname[:port] ++.br ++Chooses an alternate server. ++.TP 5 ++-r "reason" ++.br ++Sets the reason string that is shown for a printer that is ++rejecting jobs. ++.SH COMPATIBILITY ++Unlike the System V printing system, CUPS allows printer names to ++contain any printable character except SPACE, TAB, "/", or "#". ++Also, printer and class names are \fInot\fR case-sensitive. ++.LP ++The CUPS versions of \fIaccept\fR and \fIreject\fR may ask the ++user for an access password depending on the printing system ++configuration. This differs from the System V versions which ++require the root user to execute these commands. ++.SH SEE ALSO ++\fIcancel(1)\fR, \fIcupsenable(8)\fR, \fIlp(1)\fR, ++\fIlpadmin(8)\fR, \fIlpstat(1)\fR, ++.br ++http://localhost:631/help ++.SH COPYRIGHT ++Copyright 2007 by Apple Inc. ++.\" ++.\" End of "$Id: accept.man 6649 2007-07-11 21:46:42Z mike $". ++.\" +diff -urNad trunk~/packaging/cups.list.in trunk/packaging/cups.list.in +--- trunk~/packaging/cups.list.in 2008-06-25 19:06:24.000000000 +0200 ++++ trunk/packaging/cups.list.in 2008-09-11 11:58:07.000000000 +0200 +@@ -288,16 +288,18 @@ + d 0755 root sys $BINDIR - + l 0755 root sys $BINDIR/enable $SBINDIR/accept + l 0755 root sys $LIBDIR/accept $SBINDIR/accept +-d 0755 root sys $SBINDIR - +-l 0755 root sys $SBINDIR/cupsdisable accept +-l 0755 root sys $SBINDIR/cupsenable accept + l 0755 root sys $BINDIR/disable $SBINDIR/accept + d 0755 root sys $LIBDIR - + l 0755 root sys $LIBDIR/lpadmin $SBINDIR/lpadmin + l 0755 root sys $LIBDIR/reject accept ++d 0755 root sys $SBINDIR - + f 0755 root sys $SBINDIR/accept systemv/accept ++l 0755 root sys $SBINDIR/cupsaccept accept + f 0755 root sys $SBINDIR/cupsaddsmb systemv/cupsaddsmb + f 0755 root sys $SBINDIR/cupsctl systemv/cupsctl ++l 0755 root sys $SBINDIR/cupsdisable accept ++l 0755 root sys $SBINDIR/cupsenable accept ++l 0755 root sys $SBINDIR/cupsreject accept + f 0755 root sys $SBINDIR/lpadmin systemv/lpadmin + f 0755 root sys $SBINDIR/lpc berkeley/lpc + f 0755 root sys $SBINDIR/lpinfo systemv/lpinfo +@@ -647,8 +649,8 @@ + f 0644 root sys $MANDIR/man7/backend.$MAN7EXT man/backend.$MAN7EXT + f 0644 root sys $MANDIR/man7/filter.$MAN7EXT man/filter.$MAN7EXT + +-f 0644 root sys $AMANDIR/man$MAN8DIR/accept.$MAN8EXT man/accept.$MAN8EXT +-l 0644 root sys $AMANDIR/man$MAN8DIR/reject.$MAN8EXT accept.$MAN8EXT ++f 0644 root sys $AMANDIR/man$MAN8DIR/cupsaccept.$MAN8EXT man/cupsaccept.$MAN8EXT ++l 0644 root sys $AMANDIR/man$MAN8DIR/cupsreject.$MAN8EXT cupsaccept.$MAN8EXT + f 0644 root sys $AMANDIR/man$MAN8DIR/cupsaddsmb.$MAN8EXT man/cupsaddsmb.$MAN8EXT + f 0644 root sys $AMANDIR/man$MAN8DIR/cupsctl.$MAN8EXT man/cupsctl.$MAN8EXT + f 0644 root sys $AMANDIR/man$MAN8DIR/cupsfilter.$MAN8EXT man/cupsfilter.$MAN8EXT +diff -urNad trunk~/systemv/Makefile trunk/systemv/Makefile +--- trunk~/systemv/Makefile 2007-07-11 23:46:42.000000000 +0200 ++++ trunk/systemv/Makefile 2008-09-11 11:58:07.000000000 +0200 +@@ -34,7 +34,8 @@ + # + + clean: +- $(RM) $(OBJS) $(TARGETS) cupsdisable cupsenable reject ++ $(RM) $(OBJS) $(TARGETS) ++ $(RM) cupsaccept cupsdisable cupsenable cupsreject reject + + + # +@@ -63,10 +64,14 @@ + $(INSTALL_BIN) cancel $(BINDIR) + $(INSTALL_BIN) cupstestdsc $(BINDIR) + $(INSTALL_BIN) cupstestppd $(BINDIR) ++ $(RM) $(SBINDIR)/cupsaccept ++ $(LN) accept $(SBINDIR)/cupsaccept + $(RM) $(SBINDIR)/cupsdisable + $(LN) accept $(SBINDIR)/cupsdisable + $(RM) $(SBINDIR)/cupsenable + $(LN) accept $(SBINDIR)/cupsenable ++ $(RM) $(SBINDIR)/cupsreject ++ $(LN) accept $(SBINDIR)/cupsreject + $(INSTALL_BIN) lp $(BINDIR) + $(INSTALL_BIN) lpoptions $(BINDIR) + $(INSTALL_BIN) lpstat $(BINDIR) +@@ -94,8 +99,10 @@ + -$(RMDIR) $(BINDIR) + $(RM) $(SBINDIR)/accept + $(RM) $(SBINDIR)/cupsaddsmb ++ $(RM) $(SBINDIR)/cupsaccept + $(RM) $(SBINDIR)/cupsdisable + $(RM) $(SBINDIR)/cupsenable ++ $(RM) $(SBINDIR)/cupsreject + $(RM) $(SBINDIR)/lpadmin + $(RM) $(SBINDIR)/lpinfo + $(RM) $(SBINDIR)/lpmove +@@ -110,10 +117,12 @@ + accept: accept.o ../cups/$(LIBCUPS) + echo Linking $@... + $(CC) $(LDFLAGS) -o accept accept.o $(LIBS) +- $(RM) reject cupsenable cupsdisable ++ $(RM) cupsaccept cupsenable cupsdisable cupsreject reject + $(LN) accept reject ++ $(LN) accept cupsaccept + $(LN) accept cupsenable + $(LN) accept cupsdisable ++ $(LN) accept cupsreject + + + # +diff -urNad trunk~/systemv/accept.c trunk/systemv/accept.c +--- trunk~/systemv/accept.c 2008-09-08 09:21:41.000000000 +0200 ++++ trunk/systemv/accept.c 2008-09-11 11:58:07.000000000 +0200 +@@ -62,9 +62,9 @@ + + cancel = 0; + +- if (!strcmp(command, "accept")) ++ if (!strcmp(command, "cupsaccept") || !strcmp(command, "accept")) + op = CUPS_ACCEPT_JOBS; +- else if (!strcmp(command, "reject")) ++ else if (!strcmp(command, "cupsreject") || !strcmp(command, "reject")) + op = CUPS_REJECT_JOBS; + else if (!strcmp(command, "cupsdisable") || !strcmp(command, "disable")) + op = IPP_PAUSE_PRINTER; --- cups-1.3.8.orig/debian/patches/manpage-translations.dpatch +++ cups-1.3.8/debian/patches/manpage-translations.dpatch @@ -0,0 +1,8743 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## manpage-translations.dpatch by +## +## DP: po4a infrastructure and translations for manpages. +## DP: By Nicolas FRANCOIS, in http://bugs.debian.org/478597 + +@DPATCH@ +diff -urNad trunk~/man/Makefile trunk/man/Makefile +--- trunk~/man/Makefile 2008-09-11 13:13:21.000000000 +0200 ++++ trunk/man/Makefile 2008-09-11 13:13:22.000000000 +0200 +@@ -62,7 +62,12 @@ + # Make everything... + # + +-all: $(MAN1) $(MAN5) $(MAN7) $(MAN8) html ++all: $(MAN1) $(MAN5) $(MAN7) $(MAN8) html translations ++ ++translations: ++ # Update the translations and build the translated material ++ po4a --previous po4a/cups.cfg ++ $(MAKE) -C fr + + + # +@@ -84,6 +89,11 @@ + for file in $(MAN8); do \ + $(RM) ../doc/help/man-`basename $$file .$(MAN8EXT)`.html; \ + done ++ $(MAKE) -C fr clean ++ # Make sure the PO files are updated and remove generated ++ # translations. ++ po4a --previous --rm-translations po4a/cups.cfg ++ $(RM) po4a/po/cups.pot + + + # +@@ -122,6 +132,7 @@ + $(LN) cupsaccept.$(MAN8EXT) $(AMANDIR)/man$(MAN8DIR)/cupsreject.$(MAN8EXT) + $(RM) $(AMANDIR)/man$(MAN8DIR)/cupsdisable.$(MAN8EXT) + $(LN) cupsenable.$(MAN8EXT) $(AMANDIR)/man$(MAN8DIR)/cupsdisable.$(MAN8EXT) ++ $(MAKE) -C fr install + + + # +@@ -147,6 +158,7 @@ + $(RM) $(AMANDIR)/man$(MAN8DIR)/reject.$(MAN8EXT) + $(RM) $(AMANDIR)/man$(MAN8DIR)/cupsdisable.$(MAN8EXT) + -$(RMDIR) $(AMANDIR)/man$(MAN8DIR) ++ $(MAKE) -C fr uninstall + + + # +diff -urNad trunk~/man/Makefile.l10n trunk/man/Makefile.l10n +--- trunk~/man/Makefile.l10n 1970-01-01 01:00:00.000000000 +0100 ++++ trunk/man/Makefile.l10n 2008-09-11 13:13:22.000000000 +0200 +@@ -0,0 +1,209 @@ ++# ++# "$Id: $" ++# ++# Man page makefile for the Common UNIX Printing System (CUPS). ++# ++# Copyright 2007 by Apple Inc. ++# Copyright 1993-2006 by Easy Software Products. ++# ++# These coded instructions, statements, and computer programs are the ++# property of Apple Inc. and are protected by Federal copyright ++# law. Distribution and use rights are outlined in the file "LICENSE.txt" ++# which should have been included with this file. If this file is ++# file is missing or damaged, see the license at "http://www.cups.org/". ++# ++ ++include ../../Makedefs ++ ++ ++# ++# Man pages... ++# ++ ++MAN1 = cancel.$(MAN1EXT) \ ++ cups-config.$(MAN1EXT) \ ++ cupstestdsc.$(MAN1EXT) \ ++ cupstestppd.$(MAN1EXT) \ ++ lp.$(MAN1EXT) \ ++ lpoptions.$(MAN1EXT) \ ++ lppasswd.$(MAN1EXT) \ ++ lpq.$(MAN1EXT) \ ++ lprm.$(MAN1EXT) \ ++ lpr.$(MAN1EXT) \ ++ lpstat.$(MAN1EXT) ++MAN5 = classes.conf.$(MAN5EXT) \ ++ client.conf.$(MAN5EXT) \ ++ cups-snmp.conf.$(MAN5EXT) \ ++ cupsd.conf.$(MAN5EXT) \ ++ mailto.conf.$(MAN5EXT) \ ++ mime.convs.$(MAN5EXT) \ ++ mime.types.$(MAN5EXT) \ ++ printers.conf.$(MAN5EXT) \ ++ subscriptions.conf.$(MAN5EXT) ++MAN7 = backend.$(MAN7EXT) \ ++ filter.$(MAN7EXT) ++MAN8 = cupsaccept.$(MAN8EXT) \ ++ cupsaddsmb.$(MAN8EXT) \ ++ cupsctl.$(MAN8EXT) \ ++ cupsfilter.$(MAN8EXT) \ ++ cups-deviced.$(MAN8EXT) \ ++ cups-driverd.$(MAN8EXT) \ ++ cups-lpd.$(MAN8EXT) \ ++ cups-polld.$(MAN8EXT) \ ++ cupsd.$(MAN8EXT) \ ++ cupsenable.$(MAN8EXT) \ ++ lpadmin.$(MAN8EXT) \ ++ lpinfo.$(MAN8EXT) \ ++ lpmove.$(MAN8EXT) \ ++ lpc.$(MAN8EXT) ++ ++ ++# ++# Make everything... ++# ++ ++all: manpages.gz html ++ ++# Prepare all the existing manpages, and compress them. ++# But do not fail if a manpage was not generated. ++manpages.gz: manpages.gz-stamp ++manpages.gz-stamp: ++ for file in $(MAN1) $(MAN5) $(MAN7) $(MAN8); do \ ++ $(MAKE) $$file || true; \ ++ done ++ touch $@ ++ ++# ++# Clean all config and object files... ++# ++ ++clean: ++ $(RM) $(MAN1) $(MAN5) $(MAN7) $(MAN8) ++ for file in $(MAN1); do \ ++ $(RM) ../../doc/help/man-`basename $$file .$(MAN1EXT)`.$(LANGUAGE).html; \ ++ done ++ for file in $(MAN5); do \ ++ $(RM) ../../doc/help/man-`basename $$file .$(MAN5EXT)`.$(LANGUAGE).html; \ ++ done ++ for file in $(MAN7); do \ ++ $(RM) ../../doc/help/man-`basename $$file .$(MAN7EXT)`.$(LANGUAGE).html; \ ++ done ++ for file in $(MAN8); do \ ++ $(RM) ../../doc/help/man-`basename $$file .$(MAN8EXT)`.$(LANGUAGE).html; \ ++ done ++ for file in *.man.in; do \ ++ $(RM) `basename $$file .in`; \ ++ done ++ $(RM) manpages.gz-stamp ++ ++ ++# ++# Dummy depend target... ++# ++ ++depend: ++ ++ ++# ++# Install files... ++# ++ ++MANDIR := $(MANDIR)/$(LANGUAGE) ++AMANDIR := $(AMANDIR)/$(LANGUAGE) ++ ++install: all ++ $(INSTALL_DIR) -m 755 $(MANDIR)/man1 ++ for file in $(wildcard $(MAN1)); do \ ++ echo Installing $$file in $(MANDIR)/man1...; \ ++ $(INSTALL_MAN) $$file $(MANDIR)/man1; \ ++ done ++ $(INSTALL_DIR) -m 755 $(MANDIR)/man5 ++ for file in $(wildcard $(MAN5)); do \ ++ echo Installing $$file in $(MANDIR)/man5...; \ ++ $(INSTALL_MAN) $$file $(MANDIR)/man5; \ ++ done ++ $(INSTALL_DIR) -m 755 $(MANDIR)/man7 ++ for file in $(wildcard $(MAN7)); do \ ++ echo Installing $$file in $(MANDIR)/man7...; \ ++ $(INSTALL_MAN) $$file $(MANDIR)/man7; \ ++ done ++ $(INSTALL_DIR) -m 755 $(AMANDIR)/man$(MAN8DIR) ++ for file in $(wildcard $(MAN8)); do \ ++ echo Installing $$file in $(AMANDIR)/man$(MAN8DIR)...; \ ++ $(INSTALL_MAN) $$file $(AMANDIR)/man$(MAN8DIR); \ ++ done ++ if [ -f cupsreject.$(MAN8EXT) ]; then \ ++ $(RM) $(AMANDIR)/man$(MAN8DIR)/cupsreject.$(MAN8EXT); \ ++ fi ++ if [ -f cupsaccept.$(MAN8EXT) ]; then \ ++ $(LN) cupsaccept.$(MAN8EXT) $(AMANDIR)/man$(MAN8DIR)/cupsreject.$(MAN8EXT); \ ++ fi ++ if [ -f cupsdisable.$(MAN8EXT) ]; then \ ++ $(RM) $(AMANDIR)/man$(MAN8DIR)/cupsdisable.$(MAN8EXT); \ ++ fi ++ if [ -f cupsenable.$(MAN8EXT) ]; then \ ++ $(LN) cupsenable.$(MAN8EXT) $(AMANDIR)/man$(MAN8DIR)/cupsdisable.$(MAN8EXT); \ ++ fi ++ ++ ++# ++# Uninstall files... ++# ++ ++uninstall: ++ for file in $(MAN1); do \ ++ $(RM) $(MANDIR)/man1/$$file; \ ++ done ++ -$(RMDIR) $(MANDIR)/man1 ++ for file in $(MAN5); do \ ++ $(RM) $(MANDIR)/man5/$$file; \ ++ done ++ -$(RMDIR) $(MANDIR)/man5 ++ for file in $(MAN7); do \ ++ $(RM) $(MANDIR)/man7/$$file; \ ++ done ++ -$(RMDIR) $(MANDIR)/man7 ++ for file in $(MAN8); do \ ++ $(RM) $(AMANDIR)/man$(MAN8DIR)/$$file; \ ++ done ++ $(RM) $(AMANDIR)/man$(MAN8DIR)/cupsreject.$(MAN8EXT) ++ $(RM) $(AMANDIR)/man$(MAN8DIR)/cupsdisable.$(MAN8EXT) ++ -$(RMDIR) $(AMANDIR)/man$(MAN8DIR) ++ ++ ++# ++# Make html versions of man pages... ++# ++ ++MANTOHTML = ../mantohtml ++html: manpages.gz $(MANTOHTML) ++ echo Converting man pages to HTML... ++ for file in $(wildcard $(MAN1)); do \ ++ echo " $$file..."; \ ++ $(MANTOHTML) `basename $$file .$(MAN1EXT)`.man >../../doc/help/man-`basename $$file .$(MAN1EXT)`.$(LANGUAGE).html; \ ++ done ++ for file in $(wildcard $(MAN5)); do \ ++ echo " $$file..."; \ ++ $(MANTOHTML) `basename $$file .$(MAN5EXT)`.man >../../doc/help/man-`basename $$file .$(MAN5EXT)`.$(LANGUAGE).html; \ ++ done ++ for file in $(wildcard $(MAN7)); do \ ++ echo " $$file..."; \ ++ $(MANTOHTML) `basename $$file .$(MAN7EXT)`.man >../../doc/help/man-`basename $$file .$(MAN7EXT)`.$(LANGUAGE).html; \ ++ done ++ for file in $(wildcard $(MAN8)); do \ ++ echo " $$file..."; \ ++ $(MANTOHTML) `basename $$file .$(MAN8EXT)`.man >../../doc/help/man-`basename $$file .$(MAN8EXT)`.$(LANGUAGE).html; \ ++ done ++ ++.SUFFIXES: .man.in .man ++# Keep the generated .man because they are needed for the html rule ++.PRECIOUS: %.man ++ ++.man.in.man: ++ sed -e 's:@CUPS_DATADIR@:$(DATADIR):' \ ++ -e 's:@CUPS_SERVERROOT@:$(SERVERROOT):' \ ++ -e 's:@CUPS_SERVERBIN@:$(SERVERBIN):' $< > $@ ++ ++# ++# End of "$Id: $". ++# +diff -urNad trunk~/man/fr/Makefile trunk/man/fr/Makefile +--- trunk~/man/fr/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ trunk/man/fr/Makefile 2008-09-11 13:13:22.000000000 +0200 +@@ -0,0 +1,13 @@ ++# ++# "$Id: $" ++# ++# Man page makefile for the Common UNIX Printing System (CUPS). ++# ++ ++LANGUAGE=fr ++ ++include ../Makefile.l10n ++ ++# ++# End of "$Id: $". ++# +diff -urNad trunk~/man/po4a/cups.cfg trunk/man/po4a/cups.cfg +--- trunk~/man/po4a/cups.cfg 1970-01-01 01:00:00.000000000 +0100 ++++ trunk/man/po4a/cups.cfg 2008-09-11 13:13:22.000000000 +0200 +@@ -0,0 +1,39 @@ ++[po4a_paths] po4a/po/cups.pot fr:po4a/po/fr.po ++ ++[type: man] cupsaccept.man fr:fr/cupsaccept.man ++[type: man] backend.man fr:fr/backend.man ++[type: man] cancel.man fr:fr/cancel.man ++[type: man] classes.conf.man fr:fr/classes.conf.man ++[type: man] client.conf.man.in fr:fr/client.conf.man.in ++[type: man] cupsaddsmb.man.in fr:fr/cupsaddsmb.man.in ++[type: man] cups-config.man fr:fr/cups-config.man ++[type: man] cupsctl.man fr:fr/cupsctl.man ++[type: man] cupsd.conf.man.in fr:fr/cupsd.conf.man.in ++[type: man] cups-deviced.man.in fr:fr/cups-deviced.man.in ++[type: man] cupsd.man.in fr:fr/cupsd.man.in ++[type: man] cups-driverd.man.in fr:fr/cups-driverd.man.in ++[type: man] cupsenable.man fr:fr/cupsenable.man ++[type: man] cupsfilter.man fr:fr/cupsfilter.man ++[type: man] cups-lpd.man.in fr:fr/cups-lpd.man.in ++[type: man] cups-polld.man fr:fr/cups-polld.man ++[type: man] cups-snmp.conf.man fr:fr/cups-snmp.conf.man ++[type: man] cupstestdsc.man fr:fr/cupstestdsc.man ++[type: man] cupstestppd.man fr:fr/cupstestppd.man ++[type: man] filter.man fr:fr/filter.man ++[type: man] lpadmin.man fr:fr/lpadmin.man ++[type: man] lpc.man fr:fr/lpc.man ++[type: man] lpinfo.man fr:fr/lpinfo.man ++[type: man] lp.man fr:fr/lp.man ++[type: man] lpmove.man fr:fr/lpmove.man ++[type: man] lpoptions.man.in fr:fr/lpoptions.man.in ++[type: man] lppasswd.man fr:fr/lppasswd.man ++[type: man] lpq.man fr:fr/lpq.man ++[type: man] lpr.man fr:fr/lpr.man ++[type: man] lprm.man fr:fr/lprm.man ++[type: man] lpstat.man fr:fr/lpstat.man ++[type: man] mailto.conf.man fr:fr/mailto.conf.man ++[type: man] mime.convs.man fr:fr/mime.convs.man ++[type: man] mime.types.man fr:fr/mime.types.man ++[type: man] printers.conf.man fr:fr/printers.conf.man ++[type: man] subscriptions.conf.man fr:fr/subscriptions.conf.man ++ +diff -urNad trunk~/man/po4a/po/fr.po trunk/man/po4a/po/fr.po +--- trunk~/man/po4a/po/fr.po 1970-01-01 01:00:00.000000000 +0100 ++++ trunk/man/po4a/po/fr.po 2008-09-11 13:13:38.000000000 +0200 +@@ -0,0 +1,8414 @@ ++# Translation of the cups manpages into French. ++# ++# Original translations from: ++#  Gilles QUERRET , 2003, 2005. ++# Vérifier cupsd.8 ++# Nicolas François , 2007. ++# ++msgid "" ++msgstr "" ++"Project-Id-Version: cups\n" ++"POT-Creation-Date: 2008-09-11 12:06+0200\n" ++"PO-Revision-Date: 2008-05-02 02:50+0200\n" ++"Last-Translator: Nicolas François \n" ++"Language-Team: French \n" ++"MIME-Version: 1.0\n" ++"Content-Type: text/plain; charset=UTF-8\n" ++"Content-Transfer-Encoding: 8bit\n" ++ ++# type: TH ++#: cupsaccept.man:15 ++#, no-wrap ++msgid "accept" ++msgstr "accept" ++ ++# type: TH ++#: cupsaccept.man:15 backend.man:15 cancel.man:15 classes.conf.man:15 ++#: client.conf.man.in:15 cupsaddsmb.man.in:15 cups-config.man:15 ++#: cupsctl.man:15 cupsd.conf.man.in:15 cups-deviced.man.in:15 cupsd.man.in:15 ++#: cups-driverd.man.in:15 cupsenable.man:16 cupsfilter.man:14 ++#: cups-lpd.man.in:15 cups-polld.man:15 cups-snmp.conf.man:15 ++#: cupstestdsc.man:15 cupstestppd.man:15 filter.man:15 lpadmin.man:15 ++#: lpc.man:15 lpinfo.man:15 lp.man:15 lpmove.man:15 lpoptions.man.in:15 ++#: lppasswd.man:15 lpq.man:15 lpr.man:15 lprm.man:15 lpstat.man:15 ++#: mailto.conf.man:15 mime.convs.man:15 mime.types.man:15 printers.conf.man:15 ++#: subscriptions.conf.man:15 ++#, no-wrap ++msgid "Common UNIX Printing System" ++msgstr "Common UNIX Printing System" ++ ++# type: TH ++#: cupsaccept.man:15 classes.conf.man:15 cupsd.man.in:15 cupsenable.man:16 ++#: cups-polld.man:15 lpc.man:15 lpinfo.man:15 lpmove.man:15 lpr.man:15 ++#: lprm.man:15 mime.types.man:15 printers.conf.man:15 ++#, no-wrap ++msgid "12 February 2006" ++msgstr "12 février 2006" ++ ++# type: TH ++#: cupsaccept.man:15 backend.man:15 cancel.man:15 classes.conf.man:15 ++#: client.conf.man.in:15 cupsaddsmb.man.in:15 cups-config.man:15 ++#: cupsctl.man:15 cupsd.conf.man.in:15 cups-deviced.man.in:15 cupsd.man.in:15 ++#: cups-driverd.man.in:15 cupsenable.man:16 cupsfilter.man:14 ++#: cups-lpd.man.in:15 cups-polld.man:15 cups-snmp.conf.man:15 ++#: cupstestdsc.man:15 cupstestppd.man:15 filter.man:15 lpadmin.man:15 ++#: lpc.man:15 lpinfo.man:15 lp.man:15 lpmove.man:15 lpoptions.man.in:15 ++#: lppasswd.man:15 lpq.man:15 lpr.man:15 lprm.man:15 lpstat.man:15 ++#: mailto.conf.man:15 mime.convs.man:15 mime.types.man:15 printers.conf.man:15 ++#: subscriptions.conf.man:15 ++#, no-wrap ++msgid "Apple Inc." ++msgstr "Apple Inc." ++ ++# type: SH ++#: cupsaccept.man:16 backend.man:17 cancel.man:16 classes.conf.man:16 ++#: client.conf.man.in:16 cupsaddsmb.man.in:16 cups-config.man:16 ++#: cupsctl.man:16 cupsd.conf.man.in:16 cups-deviced.man.in:16 cupsd.man.in:16 ++#: cups-driverd.man.in:16 cupsenable.man:17 cupsfilter.man:15 ++#: cups-lpd.man.in:16 cups-polld.man:16 cups-snmp.conf.man:16 ++#: cupstestdsc.man:16 cupstestppd.man:16 filter.man:16 lpadmin.man:16 ++#: lpc.man:16 lpinfo.man:16 lp.man:16 lpmove.man:16 lpoptions.man.in:16 ++#: lppasswd.man:16 lpq.man:16 lpr.man:16 lprm.man:16 lpstat.man:16 ++#: mailto.conf.man:16 mime.convs.man:16 mime.types.man:16 printers.conf.man:16 ++#: subscriptions.conf.man:16 ++#, no-wrap ++msgid "NAME" ++msgstr "NOM" ++ ++# type: Plain text ++#: cupsaccept.man:18 ++msgid "accept/reject - accept/reject jobs sent to a destination" ++msgstr "" ++"accept/reject - Accepter/refuser les travaux d'impression envoyés à une " ++"destination." ++ ++# type: SH ++#: cupsaccept.man:18 backend.man:20 cancel.man:18 cupsaddsmb.man.in:19 ++#: cups-config.man:18 cupsctl.man:18 cups-deviced.man.in:18 cupsd.man.in:18 ++#: cups-driverd.man.in:18 cupsenable.man:19 cupsfilter.man:17 ++#: cups-lpd.man.in:18 cups-polld.man:18 cupstestdsc.man:18 cupstestppd.man:18 ++#: filter.man:18 lpadmin.man:18 lpc.man:18 lpinfo.man:18 lp.man:18 ++#: lpmove.man:18 lpoptions.man.in:18 lppasswd.man:18 lpq.man:18 lpr.man:18 ++#: lprm.man:18 lpstat.man:18 ++#, no-wrap ++msgid "SYNOPSIS" ++msgstr "SYNOPSIS" ++ ++# type: Plain text ++#: cupsaccept.man:25 ++msgid "" ++"B [ -E ] [ -U I ] [ -h I ] destination(s)" ++msgstr "" ++"B [ -E ] [ -U I ] [ -h I ] destination" ++"(s)" ++ ++# type: Plain text ++#: cupsaccept.man:34 ++msgid "" ++"B [ -E ] [ -U I ] [ -h I ] [ -r " ++"I ] destination(s)" ++msgstr "" ++"B [ -E ] [ -U I ] [ -h I ] [ -r " ++"I ] destination(s)" ++ ++# type: SH ++#: cupsaccept.man:34 backend.man:28 cancel.man:33 classes.conf.man:18 ++#: client.conf.man.in:18 cupsaddsmb.man.in:38 cups-config.man:50 ++#: cupsctl.man:29 cupsd.conf.man.in:18 cups-deviced.man.in:21 cupsd.man.in:23 ++#: cups-driverd.man.in:26 cupsenable.man:35 cupsfilter.man:33 ++#: cups-lpd.man.in:23 cups-polld.man:21 cups-snmp.conf.man:18 ++#: cupstestdsc.man:26 cupstestppd.man:32 filter.man:23 lpadmin.man:42 ++#: lpc.man:25 lpinfo.man:32 lp.man:62 lpmove.man:34 lpoptions.man.in:62 ++#: lppasswd.man:33 lpq.man:29 lpr.man:35 lprm.man:29 lpstat.man:39 ++#: mailto.conf.man:18 mime.convs.man:18 mime.types.man:18 printers.conf.man:18 ++#: subscriptions.conf.man:18 ++#, no-wrap ++msgid "DESCRIPTION" ++msgstr "DESCRIPTION" ++ ++# type: Plain text ++#: cupsaccept.man:37 ++msgid "" ++"I instructs the printing system to accept print jobs to the " ++"specified destinations." ++msgstr "" ++"B envoie l'ordre au système d'impression d'accepter les travaux " ++"d'impression vers les destinations spécifiées." ++ ++# type: Plain text ++#: cupsaccept.man:41 ++msgid "" ++"I instructs the printing system to reject print jobs to the " ++"specified destinations. The I<-r> option sets the reason for rejecting print " ++"jobs. If not specified the reason defaults to \"Reason Unknown\"." ++msgstr "" ++"B envoie l'ordre au système d'impression de refuser les travaux " ++"d'impression vers les destinations spécifiées. L'option B<-r> permet de " ++"spécifier la raison du rejet des travaux d'impression. Si cette raison n'est " ++"pas fournie, la raison par défaut est « Reason Unknown » (« Raison inconnue »)." ++ ++# type: SH ++#: cupsaccept.man:41 cancel.man:36 cupsaddsmb.man.in:45 cups-config.man:55 ++#: cupsctl.man:33 cupsd.man.in:29 cupsfilter.man:37 cups-lpd.man.in:60 ++#: cupstestppd.man:42 lpinfo.man:37 lp.man:65 lpmove.man:44 lppasswd.man:41 ++#: lpq.man:37 lpr.man:41 lprm.man:35 lpstat.man:43 ++#, no-wrap ++msgid "OPTIONS" ++msgstr "OPTIONS" ++ ++# type: Plain text ++#: cupsaccept.man:44 ++msgid "The following options are supported by both I and I:" ++msgstr "Les options suivantes sont reconnues par B et B :" ++ ++# type: TP ++#: cupsaccept.man:44 cancel.man:38 cupsctl.man:35 cupsenable.man:40 ++#: lpadmin.man:172 lpinfo.man:39 lp.man:72 lpmove.man:46 lpoptions.man.in:66 ++#: lpq.man:39 lpr.man:43 lprm.man:37 lpstat.man:45 ++#, no-wrap ++msgid "-E" ++msgstr "B<-E>" ++ ++# type: Plain text ++#: cupsaccept.man:48 cancel.man:42 lpinfo.man:43 lp.man:76 lpmove.man:50 ++#: lpq.man:43 lpr.man:47 lprm.man:41 lpstat.man:49 ++msgid "Forces encryption when connecting to the server." ++msgstr "Forcer le chiffrement lors de la connexion au serveur." ++ ++# type: TP ++#: cupsaccept.man:48 cancel.man:42 cupsenable.man:44 lpinfo.man:43 lp.man:76 ++#: lpmove.man:50 lpoptions.man.in:70 lpq.man:47 lpr.man:63 lprm.man:45 ++#: lpstat.man:53 ++#, no-wrap ++msgid "-U username" ++msgstr "B<-U> I" ++ ++# type: Plain text ++#: cupsaccept.man:52 ++msgid "Sets the username that is sent when connecting to the server." ++msgstr "Indiquer l'utilisateur utilisé pour se connecter au serveur." ++ ++# type: TP ++#: cupsaccept.man:52 cancel.man:51 lp.man:92 ++#, no-wrap ++msgid "-h hostname[:port]" ++msgstr "B<-h> I" ++ ++# type: Plain text ++#: cupsaccept.man:56 cancel.man:55 lp.man:96 ++msgid "Chooses an alternate server." ++msgstr "Utiliser un autre serveur." ++ ++# type: TP ++#: cupsaccept.man:56 cupsenable.man:56 ++#, no-wrap ++msgid "-r \"reason\"" ++msgstr "B<-r> I" ++ ++# type: Plain text ++#: cupsaccept.man:61 ++msgid "" ++"Sets the reason string that is shown for a printer that is rejecting jobs." ++msgstr "" ++"Configurer la raison qui est affichée par l'imprimante lorsqu'elle refuse un " ++"travail." ++ ++# type: SH ++#: cupsaccept.man:61 cancel.man:59 cupsd.man.in:54 cupsenable.man:61 ++#: cups-lpd.man.in:98 filter.man:208 lpadmin.man:187 lpc.man:59 lpinfo.man:55 ++#: lp.man:226 lpoptions.man.in:119 lpr.man:106 lprm.man:53 lpstat.man:123 ++#, no-wrap ++msgid "COMPATIBILITY" ++msgstr "COMPATIBILITÉ" ++ ++# type: Plain text ++#: cupsaccept.man:65 cancel.man:63 cupsenable.man:65 lp.man:230 ++msgid "" ++"Unlike the System V printing system, CUPS allows printer names to contain " ++"any printable character except SPACE, TAB, \"/\", or \"#\". Also, printer " ++"and class names are I case-sensitive." ++msgstr "" ++"Contrairement au système d'impression System V, les imprimantes CUPS peuvent " ++"contenir n'importe quel caractère imprimable sauf ESPACE, TABULATION, « / » " ++"ou « # ». De même, les noms d'imprimantes et de classes ne sont I " ++"sensibles à la casse." ++ ++# type: Plain text ++#: cupsaccept.man:70 ++msgid "" ++"The CUPS versions of I and I may ask the user for an access " ++"password depending on the printing system configuration. This differs from " ++"the System V versions which require the root user to execute these commands." ++msgstr "" ++"Les versions CUPS d'B et B peuvent demander à l'utilisateur " ++"de s'identifier suivant la configuration du système d'impression, à la " ++"différence des versions System V, qui demandent le mot de passe root." ++ ++# type: SH ++#: cupsaccept.man:70 backend.man:170 cancel.man:67 classes.conf.man:109 ++#: client.conf.man.in:43 cupsaddsmb.man.in:204 cups-config.man:104 ++#: cupsctl.man:97 cupsd.conf.man.in:608 cups-deviced.man.in:36 cupsd.man.in:58 ++#: cups-driverd.man.in:97 cupsenable.man:74 cupsfilter.man:65 ++#: cups-lpd.man.in:109 cups-polld.man:30 cups-snmp.conf.man:67 ++#: cupstestdsc.man:41 cupstestppd.man:133 filter.man:213 lpadmin.man:198 ++#: lpc.man:62 lpinfo.man:57 lp.man:235 lpmove.man:58 lpoptions.man.in:127 ++#: lppasswd.man:53 lpq.man:63 lpr.man:109 lprm.man:56 lpstat.man:131 ++#: mailto.conf.man:51 mime.convs.man:37 mime.types.man:85 ++#: printers.conf.man:113 subscriptions.conf.man:80 ++#, no-wrap ++msgid "SEE ALSO" ++msgstr "VOIR AUSSI" ++ ++# type: Plain text ++#: cupsaccept.man:73 ++msgid "I, I, I, I, I," ++msgstr "B(1), B(8), B(1), B(8), B(1)," ++ ++# type: Plain text ++#: cupsaccept.man:75 backend.man:174 cancel.man:71 classes.conf.man:114 ++#: client.conf.man.in:45 cups-config.man:106 cupsctl.man:101 ++#: cupsd.conf.man.in:614 cups-deviced.man.in:40 cupsd.man.in:65 ++#: cups-driverd.man.in:101 cupsenable.man:79 cupsfilter.man:69 ++#: cups-lpd.man.in:114 cups-polld.man:34 cups-snmp.conf.man:69 ++#: cupstestdsc.man:43 cupstestppd.man:137 filter.man:217 lpadmin.man:203 ++#: lpc.man:67 lpinfo.man:61 lp.man:239 lpmove.man:62 lpoptions.man.in:131 ++#: lppasswd.man:57 lpq.man:68 lpr.man:114 lprm.man:61 lpstat.man:135 ++#: mailto.conf.man:56 mime.convs.man:42 mime.types.man:90 ++#: printers.conf.man:118 subscriptions.conf.man:85 ++msgid "http://localhost:631/help" ++msgstr "http://localhost:631/help" ++ ++# type: SH ++#: cupsaccept.man:75 backend.man:175 cancel.man:71 classes.conf.man:114 ++#: client.conf.man.in:45 cupsaddsmb.man.in:210 cups-config.man:106 ++#: cupsctl.man:101 cupsd.conf.man.in:614 cups-deviced.man.in:40 ++#: cupsd.man.in:65 cups-driverd.man.in:101 cupsenable.man:79 cupsfilter.man:69 ++#: cups-lpd.man.in:114 cups-polld.man:34 cups-snmp.conf.man:69 ++#: cupstestdsc.man:46 cupstestppd.man:139 filter.man:217 lpadmin.man:203 ++#: lpc.man:67 lpinfo.man:61 lp.man:239 lpmove.man:62 lpoptions.man.in:131 ++#: lppasswd.man:57 lpq.man:68 lpr.man:114 lprm.man:61 lpstat.man:135 ++#: mailto.conf.man:56 mime.convs.man:42 mime.types.man:90 ++#: printers.conf.man:118 subscriptions.conf.man:85 ++#, no-wrap ++msgid "COPYRIGHT" ++msgstr "COPYRIGHT" ++ ++# type: Plain text ++#: cupsaccept.man:76 backend.man:176 cancel.man:72 classes.conf.man:115 ++#: client.conf.man.in:46 cupsaddsmb.man.in:211 cupsctl.man:102 cupsd.man.in:66 ++#: cupsenable.man:81 cupsfilter.man:70 cups-lpd.man.in:115 cups-polld.man:35 ++#: cups-snmp.conf.man:70 cupstestdsc.man:47 cupstestppd.man:140 filter.man:218 ++#: lpc.man:68 lpinfo.man:62 lp.man:240 lpmove.man:63 lpoptions.man.in:132 ++#: lppasswd.man:58 lpr.man:115 lprm.man:62 lpstat.man:136 mailto.conf.man:57 ++#: mime.convs.man:43 mime.types.man:91 printers.conf.man:119 ++#: subscriptions.conf.man:86 ++msgid "Copyright 2007 by Apple Inc." ++msgstr "Copyright 2007 by Apple Inc." ++ ++# type: TH ++#: backend.man:15 ++#, no-wrap ++msgid "backend" ++msgstr "backend" ++ ++# type: TH ++#: backend.man:15 cancel.man:15 cupstestdsc.man:15 lpoptions.man.in:15 ++#: lppasswd.man:15 mime.convs.man:15 ++#, no-wrap ++msgid "20 March 2006" ++msgstr "20 mars 2006" ++ ++# type: Plain text ++#: backend.man:19 ++msgid "backend - cups backend transmission interfaces" ++msgstr "backend - Programme de transmission de CUPS." ++ ++# type: Plain text ++#: backend.man:22 ++msgid "B" ++msgstr "B" ++ ++# type: Plain text ++#: backend.man:27 ++msgid "B job user title num-copies options [ I ]" ++msgstr "B travail utilisateur titre copies options [ I ]" ++ ++# type: Plain text ++#: backend.man:31 ++msgid "" ++"Backends are a special type of I which is used to send print data " ++"to and discover different devices on the system." ++msgstr "" ++"Les programmes de transmission de CUPS sont des filtres particuliers " ++"(consultez B(7) qui sont utilisés pour envoyer les données à " ++"imprimer et découvrir les différents périphériques d'impression du système." ++ ++# type: Plain text ++#: backend.man:37 ++msgid "" ++"Like filters, backends must be capable of reading from a filename on the " ++"command-line or from the standard input, copying the standard input to a " ++"temporary file as required by the physical interface." ++msgstr "" ++"Comme les filtres, ils doivent être capables de lire depuis un fichier " ++"fournit sur la ligne de commande ou depuis l'entrée standard, en copiant " ++"l'entrée standard vers un fichier temporaire si nécessaire pour l'interface " ++"physique." ++ ++# type: Plain text ++#: backend.man:46 ++msgid "" ++"The command name (argv[0]) is set to the device URI of the destination " ++"printer. Starting with CUPS 1.1.22, any authentication information in argv" ++"[0] is removed, so backend developers are urged to use the DEVICE_URI " ++"environment variable whenever authentication information is required. The " ++"CUPS API includes a I function for retrieving the " ++"correct device URI." ++msgstr "" ++"Le nom de la commande (argv[0]) est fixé à la valeur de l'URI du " ++"périphérique de l'imprimante de destination. À partir de la version 1.1.22 " ++"de CUPS, les informations d'identification sont retirées de argv[0]. Il est " ++"donc demandé aux développeurs des dorsaux d'utiliser la variable " ++"d'environnement DEVICE_URI pour obtenir les informations d'identification " ++"quand cela est nécessaire. L'API CUPS propose la fonction " ++"B pour récupérer la valeur correcte de l'URI du " ++"périphérique." ++ ++# type: Plain text ++#: backend.man:51 ++msgid "" ++"Back-channel data from the device should be relayed to the job filters by " ++"writing to file descriptor 3. The CUPS API includes the " ++"I function for this purpose." ++msgstr "" ++"Les données en retour du périphérique doivent être envoyées au filtres des " ++"travaux en écrivant sur le descripteur de fichiers 3. L'API CUPS propose la " ++"fonction I pour cela." ++ ++# type: SH ++#: backend.man:52 ++#, no-wrap ++msgid "DEVICE DISCOVERY" ++msgstr "DÉCOUVERTE DES PÉRIPHÉRIQUES" ++ ++# type: Plain text ++#: backend.man:57 ++msgid "" ++"When run with no arguments, the backend should list the devices and schemes " ++"it supports or is advertising to stdout. The output consists of zero or more " ++"lines consisting of any of the following forms:" ++msgstr "" ++"Quand il est exécuté sans paramètre, le programme dorsal doit lister sur la " ++"sortie standard les périphériques et schémas qu'il gère ou qu'il annonce. La " ++"sortie consiste en zéro ou plus de lignes de la forme suivante :" ++ ++# type: Plain text ++#: backend.man:62 ++#, no-wrap ++msgid "" ++" device-class scheme \"Unknown\" \"device-info\"\n" ++" device-class device-uri \"device-make-and-model\" \"device-info\"\n" ++" device-class device-uri \"device-make-and-model\" \"device-info\" \"device-id\"\n" ++msgstr "" ++" classe_périphérique schéma \"Unknown\" \"info_périphérique\"\n" ++" classe_périphérique uri_périphérique \"marque_et_modèle_périphérique\" \"info_périphérique\"\n" ++" classe_périphérique uri_périphérique \"marque_et_modèle_périphérique\" \"info_périphérique\" \"id_périphérique\"\n" ++ ++# type: Plain text ++#: backend.man:66 ++msgid "The I field is one of the following values:" ++msgstr "Le champ I peut prendre une de ces valeurs :" ++ ++# type: TP ++#: backend.man:67 ++#, no-wrap ++msgid "direct" ++msgstr "B" ++ ++# type: Plain text ++#: backend.man:72 ++msgid "" ++"The device-uri refers to a specific direct-access device with no options, " ++"such as a parallel, USB, or SCSI device." ++msgstr "" ++"L'uri du périphérique se réfère à un accès direct au périphérique, sans " ++"option, comme pour un périphérique sur port parallèle, USB ou SCSI." ++ ++# type: TP ++#: backend.man:73 ++#, no-wrap ++msgid "file" ++msgstr "B" ++ ++# type: Plain text ++#: backend.man:77 ++msgid "The device-uri refers to a file on disk." ++msgstr "L'uri du périphérique se réfère à un fichier sur le disque." ++ ++# type: TP ++#: backend.man:78 ++#, no-wrap ++msgid "network" ++msgstr "B" ++ ++# type: Plain text ++#: backend.man:83 ++msgid "" ++"The device-uri refers to a networked device and conforms to the general form " ++"for network URIs." ++msgstr "" ++"L'uri du périphérique se réfère à un périphérique réseau et respecte les " ++"formes générales des URI réseau." ++ ++# type: TP ++#: backend.man:84 ++#, no-wrap ++msgid "serial" ++msgstr "B" ++ ++# type: Plain text ++#: backend.man:90 ++msgid "" ++"The device-uri refers to a serial device with configurable baud rate and " ++"other options. If the device-uri contains a baud value, it represents the " ++"maximum baud rate supported by the device." ++msgstr "" ++"L'uri du périphérique se réfère à un périphérique série avec une vitesse " ++"configurable et d'autres options. Si l'uri du périphérique contient la " ++"vitesse, elle représente la vitesse maximale gérée par le périphérique." ++ ++# type: Plain text ++#: backend.man:97 ++msgid "" ++"The I field provides the URI scheme that is supported by the " ++"backend. Backends should use this form only when the backend supports any " ++"URI using that scheme. The I field specifies the full URI to use " ++"when communicating with the device." ++msgstr "" ++"Le champ I fournit le schéma d'URI géré par le dorsal. Les dorsaux " ++"ne doivent utiliser cette forme que s'ils supportent toute URI utilisant ce " ++"schéma. Le champ I spécifie l'URI complète à utiliser pour " ++"la communication avec le périphérique." ++ ++# type: Plain text ++#: backend.man:102 ++msgid "" ++"The I field specifies the make and model of the " ++"device, e.g. \"Acme Foojet 2000\". If the make and model is not known, you " ++"must report \"Unknown\"." ++msgstr "" ++"Le champ I précise la marque et le modèle du " ++"périphérique, par exemple « Acme Foojet 2000 ». Si la marque et le modèle ne " ++"sont pas connus, vous devez indiquer « Unknown »." ++ ++# type: Plain text ++#: backend.man:108 ++msgid "" ++"The I field specifies additional information about the device. " ++"Typically this includes the make and model along with the port number or " ++"network address, e.g. \"Acme Foojet 2000 USB #1\"." ++msgstr "" ++"Le champ I ajoute des informations à propos du " ++"périphérique. Typiquement cela comprend la marque et le modèle avec le " ++"numéro de port ou l'adresse réseau, par exemple « Acme Foojet 2000 USB #1 »." ++ ++# type: Plain text ++#: backend.man:113 ++msgid "" ++"The optional I field specifies the IEEE-1284 device ID string for " ++"the device, which is used to select a matching driver." ++msgstr "" ++"Le champ optionnel I indique l'identifiant IEEE-1284 du " ++"périphérique, qui est utilisé pour sélectionner le pilote correspondant." ++ ++# type: SH ++#: backend.man:114 ++#, no-wrap ++msgid "PERMISSIONS" ++msgstr "PERMISSIONS" ++ ++# type: Plain text ++#: backend.man:118 ++msgid "" ++"Backends without world execute permissions are run as the root user. " ++"Otherwise, the backend is run using the unprivileged user account, typically " ++"\"lp\"." ++msgstr "" ++"Les dorsaux sans les droits d'exécution pour tout le monde sont exécuté en " ++"tant que root. Sinon, le dorsal est exécuté en utilisant le compte non " ++"privilégié, généralement « lp »." ++ ++# type: SH ++#: backend.man:119 ++#, no-wrap ++msgid "EXIT CODES" ++msgstr "CODES DE SORTIE" ++ ++# type: Plain text ++#: backend.man:123 ++msgid "" ++"The following exit codes are defined for backends; C API constants defined " ++"in the Ecups/backend.hE header file are defined in parenthesis:" ++msgstr "" ++"Les dorsaux renvoient les codes de retour suivants ; les constantes définie " ++"par l'API C dans Ecups/backend.hE sont indiquées entre parenthèses :" ++ ++# type: TP ++#: backend.man:124 ++#, no-wrap ++msgid "0 (CUPS_BACKEND_OK)" ++msgstr "0 (CUPS_BACKEND_OK)" ++ ++# type: Plain text ++#: backend.man:129 ++msgid "" ++"The print file was successfully transmitted to the device or remote server." ++msgstr "" ++"Le fichier à imprimer a été transmis avec succès au périphérique ou au " ++"serveur distant." ++ ++# type: TP ++#: backend.man:130 ++#, no-wrap ++msgid "1 (CUPS_BACKEND_FAILED)" ++msgstr "1 (CUPS_BACKEND_FAILED)" ++ ++# type: Plain text ++#: backend.man:137 ++msgid "" ++"The print file was not successfully transmitted to the device or remote " ++"server. The scheduler will respond to this by canceling the job, retrying " ++"the job, or stopping the queue depending on the state of the error-policy " ++"attribute." ++msgstr "" ++"Le fichier à imprimer n'a pas été transmis correctement au périphérique ou " ++"au serveur distant. L'ordonanceur annulera le travail, réessayera " ++"l'impression ou stoppera la queue en fonction de l'état de l'attribut error-" ++"policy." ++ ++# type: TP ++#: backend.man:138 ++#, no-wrap ++msgid "2 (CUPS_BACKEND_AUTH_REQUIRED)" ++msgstr "2 (CUPS_BACKEND_AUTH_REQUIRED)" ++ ++# type: Plain text ++#: backend.man:145 ++msgid "" ++"The print file was not successfully transmitted because valid authentication " ++"information is required. The scheduler will respond to this by holding the " ++"job and adding the authentication-required job-reasons keyword." ++msgstr "" ++"Le fichier à imprimer n'a pas été transmis correctement parce que des donnée " ++"d'identifications valables sont nécessaires. L'ordonanceur suspendra le " ++"travail et ajoutera le mot clé authentication-required à l'attribut job-" ++"reasons." ++ ++# type: TP ++#: backend.man:146 ++#, no-wrap ++msgid "3 (CUPS_BACKEND_HOLD)" ++msgstr "3 (CUPS_BACKEND_HOLD)" ++ ++# type: Plain text ++#: backend.man:152 ++msgid "" ++"The print file was not successfully transmitted because it cannot be printed " ++"at this time. The scheduler will respond to this by holding the job." ++msgstr "" ++"Le fichier à imprimer n'a pas pu être transmis parce qu'il ne pouvait pas " ++"être imprimé à ce moment. L'ordonnaceur concervera le travail d'impression." ++ ++# type: TP ++#: backend.man:153 ++#, no-wrap ++msgid "4 (CUPS_BACKEND_STOP)" ++msgstr "4 (CUPS_BACKEND_STOP)" ++ ++# type: Plain text ++#: backend.man:159 ++msgid "" ++"The print file was not successfully transmitted because it cannot be printed " ++"at this time. The scheduler will respond to this by stopping the queue." ++msgstr "" ++"Le fichier à imprimer n'a pas été transmis car il ne peut pas être imprimer " ++"en ce moment. L'ordonnanceur stopera la queue." ++ ++# type: TP ++#: backend.man:160 ++#, no-wrap ++msgid "5 (CUPS_BACKEND_CANCEL)" ++msgstr "5 (CUPS_BACKEND_CANCEL)" ++ ++# type: Plain text ++#: backend.man:166 ++msgid "" ++"The print file was not successfully transmitted because one or more " ++"attributes are not supported. The scheduler will respond to this by " ++"canceling the job." ++msgstr "" ++"Le fichier à imprimer n'a pas été transmis parce qu'un atribut n'est pas " ++"géré. L'ordonanceur répond à cela en annulant le travail d'impression." ++ ++# type: Plain text ++#: backend.man:169 ++msgid "All other exit code values are reserved." ++msgstr "Tous les autres codes de sortie sont réservés." ++ ++# type: Plain text ++#: backend.man:172 ++msgid "I, I, I" ++msgstr "B(8), B(5), B(7)" ++ ++# type: TH ++#: cancel.man:15 ++#, no-wrap ++msgid "cancel" ++msgstr "cancel" ++ ++# type: Plain text ++#: cancel.man:18 ++msgid "cancel - cancel jobs" ++msgstr "cancel - Annuler des travaux d'impression." ++ ++# type: Plain text ++#: cancel.man:33 ++msgid "" ++"B [ -E ] [ -U I ] [ -a ] [ -h I ] [ -u " ++"I ] [ I ] [ I ] [ I ]" ++msgstr "" ++"B [ -E ] [ -U I ] [ -a ] [ -h I ] [ -u " ++"I ] [ I ] [ I ] [ I ]" ++ ++# type: Plain text ++#: cancel.man:36 ++msgid "" ++"I cancels existing print jobs. The I<-a> option will remove all jobs " ++"from the specified destination." ++msgstr "" ++"B annule un travail d'impression. L'option B<-a> supprime tous les " ++"travaux d'impression d'une destination." ++ ++# type: Plain text ++#: cancel.man:38 ++msgid "The following options are recognized by I:" ++msgstr "Les options suivantes sont reconnues par B :" ++ ++# type: Plain text ++#: cancel.man:46 lp.man:80 ++msgid "Specifies the username to use when connecting to the server." ++msgstr "Spécifier l'utilisateur à utiliser pour les connexions au serveur." ++ ++# type: TP ++#: cancel.man:46 cupsaddsmb.man.in:58 lpq.man:51 ++#, no-wrap ++msgid "-a" ++msgstr "B<-a>" ++ ++# type: Plain text ++#: cancel.man:51 ++msgid "" ++"Cancel all jobs on the named destination, or all jobs on all destinations if " ++"none is provided." ++msgstr "" ++"Annuler tous les travaux sur la destination donnée, ou tous les travaux sur " ++"toutes les destinations si aucune destination n'est fournie." ++ ++# type: TP ++#: cancel.man:55 lp.man:125 ++#, no-wrap ++msgid "-u username" ++msgstr "B<-u> I" ++ ++# type: Plain text ++#: cancel.man:59 ++msgid "Cancels jobs owned by I." ++msgstr "Annuler les travaux d'impression de l'I." ++ ++# type: SH ++#: cancel.man:63 ++#, no-wrap ++msgid "NOTES" ++msgstr "NOTES" ++ ++# type: Plain text ++#: cancel.man:67 ++msgid "" ++"Administrators wishing to prevent unauthorized cancellation of jobs via the " ++"I<-u> option should require authentication for Cancel-Jobs operations in " ++"I." ++msgstr "" ++"Les administrateurs qui souhaitent empêcher des annulation non autorisée de " ++"travaux à l'aide de l'option B<-u> devraient forcer l'identification pour " ++"les opérations dans le fichier B(5)." ++ ++# type: Plain text ++#: cancel.man:69 ++msgid "I, I, I," ++msgstr "B(1), B(8), B(1)," ++ ++# type: TH ++#: classes.conf.man:15 ++#, no-wrap ++msgid "classes.conf" ++msgstr "classes.conf" ++ ++# type: Plain text ++#: classes.conf.man:18 ++msgid "classes.conf - class configuration file for cups" ++msgstr "classes.conf - Fichier de configuration des classes de CUPS." ++ ++# type: Plain text ++#: classes.conf.man:23 ++msgid "" ++"The I file defines the local printer classes that are " ++"available. It is normally located in the I directory and is " ++"generated automatically by the I program when printer classes are " ++"added or deleted." ++msgstr "" ++"Le fichier I définit les classes d'imprimantes disponibles. Il " ++"est habituellement situé dans le répertoire I et est généré " ++"automatiquement par le programme B(8) lorsque des classes " ++"d'imprimantes sont créées ou supprimées." ++ ++# type: Plain text ++#: classes.conf.man:26 mailto.conf.man:24 printers.conf.man:26 ++#: subscriptions.conf.man:26 ++msgid "" ++"Each line in the file can be a configuration directive, a blank line, or a " ++"comment. Comment lines start with the # character." ++msgstr "" ++"Chaque ligne du fichier est une directive de configuration, une ligne vide " ++"ou un commentaire. Les commentaires commencent par le symbole #." ++ ++# type: SH ++#: classes.conf.man:26 client.conf.man.in:24 cupsd.conf.man.in:26 ++#: cups-snmp.conf.man:30 mailto.conf.man:24 printers.conf.man:26 ++#: subscriptions.conf.man:26 ++#, no-wrap ++msgid "DIRECTIVES" ++msgstr "DIRECTIVES" ++ ++# type: TP ++#: classes.conf.man:27 ++#, no-wrap ++msgid "EClass nameE ... E/ClassE" ++msgstr "EClass nomE ... E/ClassE" ++ ++# type: Plain text ++#: classes.conf.man:31 ++msgid "Defines a specific printer class." ++msgstr "Définir une classe d'imprimantes." ++ ++# type: TP ++#: classes.conf.man:31 ++#, no-wrap ++msgid "EDefaultClass nameE ... E/ClassE" ++msgstr "EDefaultClass nomE ... E/ClassE" ++ ++# type: Plain text ++#: classes.conf.man:35 ++msgid "Defines a default printer class." ++msgstr "Définir une classe d'imprimantes par défaut." ++ ++# type: TP ++#: classes.conf.man:35 printers.conf.man:35 ++#, no-wrap ++msgid "Accepting Yes" ++msgstr "Accepting Yes" ++ ++# type: TP ++#: classes.conf.man:37 printers.conf.man:37 ++#, no-wrap ++msgid "Accepting No" ++msgstr "Accepting No" ++ ++# type: Plain text ++#: classes.conf.man:41 printers.conf.man:41 ++msgid "Specifies whether the printer is accepting new jobs." ++msgstr "Définir si l'imprimante accepte de nouveaux travaux d'impression." ++ ++# type: TP ++#: classes.conf.man:41 printers.conf.man:41 ++#, no-wrap ++msgid "AllowUser [ user @group ... ]" ++msgstr "AllowUser [ utilisateur @groupe ... ]" ++ ++# type: Plain text ++#: classes.conf.man:45 printers.conf.man:45 ++msgid "Allows specific users and groups to print to the printer." ++msgstr "" ++"Permettre à certains utilisateurs ou groupes d'imprimer sur l'imprimante." ++ ++# type: TP ++#: classes.conf.man:45 printers.conf.man:45 ++#, no-wrap ++msgid "DenyUser [ user @group ... ]" ++msgstr "DenyUser [ utilisateur @groupe ... ]" ++ ++# type: Plain text ++#: classes.conf.man:49 printers.conf.man:49 ++msgid "Prevents specific users and groups from printing to the printer." ++msgstr "Empêcher certains utilisateurs ou groupes d'imprimer sur l'imprimante." ++ ++# type: TP ++#: classes.conf.man:49 printers.conf.man:53 ++#, no-wrap ++msgid "ErrorPolicy abort-job" ++msgstr "ErrorPolicy abort-job" ++ ++# type: TP ++#: classes.conf.man:51 printers.conf.man:55 ++#, no-wrap ++msgid "ErrorPolicy retry-job" ++msgstr "ErrorPolicy retry-job" ++ ++# type: TP ++#: classes.conf.man:53 printers.conf.man:57 ++#, no-wrap ++msgid "ErrorPolicy stop-printer" ++msgstr "ErrorPolicy stop-printer" ++ ++# type: Plain text ++#: classes.conf.man:57 printers.conf.man:61 ++msgid "Specifies the error policy for the printer." ++msgstr "Définir la politique à appliquer en cas d'erreur pour l'imprimante." ++ ++# type: TP ++#: classes.conf.man:57 printers.conf.man:61 ++#, no-wrap ++msgid "Info text" ++msgstr "Info texte" ++ ++# type: Plain text ++#: classes.conf.man:61 printers.conf.man:65 ++msgid "Specifies human-readable text describing the printer." ++msgstr "" ++"Définir des informations à destination des utilisateurs pour décrir " ++"l'imprimante." ++ ++# type: TP ++#: classes.conf.man:61 printers.conf.man:65 ++#, no-wrap ++msgid "JobSheets banner banner" ++msgstr "JobSheets banner banner" ++ ++# type: Plain text ++#: classes.conf.man:65 printers.conf.man:69 ++msgid "Specifies the banner pages to use for the printer." ++msgstr "Définir les pages de banière à utiliser pour l'imprimante." ++ ++# type: TP ++#: classes.conf.man:65 printers.conf.man:69 ++#, no-wrap ++msgid "KLimit number" ++msgstr "KLimit nombre" ++ ++# type: Plain text ++#: classes.conf.man:69 printers.conf.man:73 ++msgid "Specifies the job-k-limit value for the printer." ++msgstr "Définir la valeur job-k-limit pour l'imprimante." ++ ++# type: TP ++#: classes.conf.man:69 printers.conf.man:73 ++#, no-wrap ++msgid "Location text" ++msgstr "Location texte" ++ ++# type: Plain text ++#: classes.conf.man:73 printers.conf.man:77 ++msgid "Specifies human-readable text describing the location of the printer." ++msgstr "" ++"Définir des informations à destination des utilisateurs concernant la " ++"localisation physique de l'imprimante." ++ ++# type: TP ++#: classes.conf.man:73 printers.conf.man:77 ++#, no-wrap ++msgid "OpPolicy name" ++msgstr "OpPolicy nom" ++ ++# type: Plain text ++#: classes.conf.man:77 printers.conf.man:81 ++msgid "Specifies the operation policy for the printer." ++msgstr "Indiquer la politiques des opérations pour l'imprimante." ++ ++# type: TP ++#: classes.conf.man:77 printers.conf.man:81 ++#, no-wrap ++msgid "PageLimit number" ++msgstr "PageLimit nombre" ++ ++# type: Plain text ++#: classes.conf.man:81 printers.conf.man:85 ++msgid "Specifies the job-page-limit value for the printer." ++msgstr "Définir la valeur job-page-limit pour l'imprimante." ++ ++# type: TP ++#: classes.conf.man:81 ++#, no-wrap ++msgid "Printer" ++msgstr "Printer" ++ ++# type: Plain text ++#: classes.conf.man:85 ++msgid "Specifies a printer that is a member of the printer class." ++msgstr "Indiquer une imprimante qui est membre de la classe d'imprimantes." ++ ++# type: TP ++#: classes.conf.man:85 printers.conf.man:89 ++#, no-wrap ++msgid "QuotaPeriod seconds" ++msgstr "QuotaPeriod secondes" ++ ++# type: Plain text ++#: classes.conf.man:89 printers.conf.man:93 ++msgid "Specifies the job-quota-period value for the printer." ++msgstr "Définir la valeur job-quota-period pour l'imprimante." ++ ++# type: TP ++#: classes.conf.man:89 printers.conf.man:93 ++#, no-wrap ++msgid "Shared Yes" ++msgstr "Shared Yes" ++ ++# type: TP ++#: classes.conf.man:91 printers.conf.man:95 ++#, no-wrap ++msgid "Shared No" ++msgstr "Shared No" ++ ++# type: Plain text ++#: classes.conf.man:95 printers.conf.man:99 ++msgid "Specifies whether the printer is shared." ++msgstr "Définir si l'imprimante est partagée." ++ ++# type: TP ++#: classes.conf.man:95 printers.conf.man:99 ++#, no-wrap ++msgid "State idle" ++msgstr "State idle" ++ ++# type: TP ++#: classes.conf.man:97 printers.conf.man:101 ++#, no-wrap ++msgid "State stopped" ++msgstr "State stopped" ++ ++# type: Plain text ++#: classes.conf.man:101 printers.conf.man:105 ++msgid "Specifies the initial state of the printer (Idle or Stopped)" ++msgstr "Définir l'état initial de l'imprimante (Idle ou Stopped)." ++ ++# type: TP ++#: classes.conf.man:101 printers.conf.man:105 ++#, no-wrap ++msgid "StateMessage text" ++msgstr "StateMessage texte" ++ ++# type: Plain text ++#: classes.conf.man:105 printers.conf.man:109 ++msgid "Specifies the message associated with the state." ++msgstr "Définir le message associé à l'état." ++ ++# type: TP ++#: classes.conf.man:105 printers.conf.man:109 ++#, no-wrap ++msgid "StateTime seconds" ++msgstr "StateTime secondes" ++ ++# type: Plain text ++#: classes.conf.man:109 printers.conf.man:113 ++msgid "Specifies the date/time associated with the state." ++msgstr "Indiquer la date/l'heure associée à l'état." ++ ++# type: Plain text ++#: classes.conf.man:112 ++msgid "" ++"I, I, I, I, " ++"I," ++msgstr "" ++"B(8), B(5), B(5), B(5), " ++"B(5)," ++ ++# type: TH ++#: client.conf.man.in:15 ++#, no-wrap ++msgid "client.conf" ++msgstr "client.conf" ++ ++# type: TH ++#: client.conf.man.in:15 ++#, no-wrap ++msgid "25 February 2006" ++msgstr "25 février 2006" ++ ++# type: Plain text ++#: client.conf.man.in:18 ++msgid "client.conf - client configuration file for cups" ++msgstr "client.conf - Fichier de configuration de CUPS." ++ ++# type: Plain text ++#: client.conf.man.in:24 ++msgid "" ++"The I file configures the CUPS client and is normally located " ++"in the I<@CUPS_SERVERROOT@> or I<~/.cups> directory. Each line in the file " ++"can be a configuration directive, a blank line, or a comment. Comment lines " ++"start with the # character." ++msgstr "" ++"Le fichier I configure le client CUPS et est normalement situé " ++"dans le répertoire I<@CUPS_SERVERROOT@> ou I<~/.cups>. Chaque ligne du " ++"fichier est une directive de configuration, une ligne vide ou un " ++"commentaire. Les commentaires commencent par le symbole #." ++ ++# type: Plain text ++#: client.conf.man.in:27 ++msgid "" ++"The following directives are understood by the client. Consult the on-line " ++"help for detailed descriptions:" ++msgstr "" ++"Les directives suivantes sont comprises par le client. Veuillez vous " ++"reporter à l'aide en ligne pour une description plus détaillée." ++ ++# type: TP ++#: client.conf.man.in:27 cupsd.conf.man.in:262 ++#, no-wrap ++msgid "Encryption IfRequested" ++msgstr "Encryption IfRequested" ++ ++# type: TP ++#: client.conf.man.in:29 cupsd.conf.man.in:264 ++#, no-wrap ++msgid "Encryption Never" ++msgstr "Encryption Never" ++ ++# type: TP ++#: client.conf.man.in:31 cupsd.conf.man.in:266 ++#, no-wrap ++msgid "Encryption Required" ++msgstr "Encryption Required" ++ ++# type: Plain text ++#: client.conf.man.in:36 cupsd.conf.man.in:271 ++msgid "" ++"Specifies the level of encryption that is required for a particular location." ++msgstr "Définir le niveau de chiffrement nécessaire pour un emplacement donné." ++ ++# type: TP ++#: client.conf.man.in:36 ++#, no-wrap ++msgid "ServerName hostname-or-ip-address[:port]" ++msgstr "ServerName serveur-ou-adresse_ip[:port]" ++ ++# type: TP ++#: client.conf.man.in:38 ++#, no-wrap ++msgid "ServerName /domain/socket" ++msgstr "ServerName /domaine/socket" ++ ++# type: Plain text ++#: client.conf.man.in:43 ++msgid "" ++"Specifies the address and optionally the port to use when connecting to the " ++"server" ++msgstr "" ++"Définir l'adresse et éventuellement le port à utiliser pour se connecter au " ++"serveur." ++ ++# type: TH ++#: cupsaddsmb.man.in:15 ++#, no-wrap ++msgid "cupsaddsmb" ++msgstr "cupsaddsmb" ++ ++# type: TH ++#: cupsaddsmb.man.in:15 ++#, no-wrap ++msgid "25 July 2007" ++msgstr "25 juillet 2007" ++ ++# type: Plain text ++#: cupsaddsmb.man.in:18 ++msgid "cupsaddsmb - export printers to samba for windows clients" ++msgstr "" ++"cupsaddsmb - Exporter des imprimantes vers Samba pour les clients Windows." ++ ++# type: Plain text ++#: cupsaddsmb.man.in:28 ++msgid "" ++"B [ -H I ] [ -U I ] " ++"[ -h I ] [ -v ] -a" ++msgstr "" ++"B [ -H I ] [ -U I ] [ -h I ] [ -v ] -a" ++ ++# type: Plain text ++#: cupsaddsmb.man.in:37 ++msgid "" ++"B [ -H I ] [ -U I ] " ++"[ -h I ] [ -v ] printer [ ... printer ]" ++msgstr "" ++"B [ -H I ] [ -U I ] [ -h I ] [ -v ] imprimante [ ... " ++"imprimante ]" ++ ++# type: Plain text ++#: cupsaddsmb.man.in:44 ++msgid "" ++"I exports printers to the SAMBA software (version 2.2.0 or " ++"higher) for use with Windows clients. Depending on the SAMBA configuration, " ++"you may need to provide a password to export the printers. This program " ++"requires the Windows printer driver files described below." ++msgstr "" ++"B permet l'export d'imprimantes vers SAMBA (version 2.2.0 ou " ++"supérieure) pour l'utilisation par des clients Windows. Suivant la " ++"configuration de SAMBA, il est possible qu'un mot de passe soit demandé pour " ++"l'export. Ce programme requiert les fichiers du driver Windows, comme " ++"indiqué plus bas." ++ ++# type: Plain text ++#: cupsaddsmb.man.in:47 ++msgid "I supports the following options:" ++msgstr "B gère les options suivantes :" ++ ++# type: TP ++#: cupsaddsmb.man.in:47 ++#, no-wrap ++msgid "-H samba-server" ++msgstr "B<-H> I" ++ ++# type: Plain text ++#: cupsaddsmb.man.in:51 ++msgid "Specifies the SAMBA server which defaults to the CUPS server." ++msgstr "Préciser le serveur SAMBA par défaut pour le serveur CUPS." ++ ++# type: TP ++#: cupsaddsmb.man.in:51 ++#, no-wrap ++msgid "-U samba-user[%samba-password]" ++msgstr "B<-U> I" ++ ++# type: Plain text ++#: cupsaddsmb.man.in:58 ++msgid "" ++"Specifies the SAMBA print admin username which defaults to your current " ++"username. If the username contains a percent (%) character, then the text " ++"following the percent is treated as the SAMBA password to use." ++msgstr "" ++"Spécifier le nom d'utilisateur de l'administrateur d'impression SAMBA, qui " ++"est par défaut l'utilisateur courant. Si l'utilisateur contient un caractère " ++"« % », ce qui suite le pourcent est considéré comme le mot de passe SAMBA à " ++"utiliser." ++ ++# type: Plain text ++#: cupsaddsmb.man.in:63 ++msgid "" ++"Exports all known printers. Otherwise only the named printers are exported." ++msgstr "" ++"Exporter toutes les imprimantes connues. Sinon, seules les imprimantes " ++"fournies sur la ligne de commande sont exportées." ++ ++# type: TP ++#: cupsaddsmb.man.in:63 ++#, no-wrap ++msgid "-h cups-server[:port]" ++msgstr "B<-h> I" ++ ++# type: Plain text ++#: cupsaddsmb.man.in:67 ++msgid "Specifies a different CUPS server to use." ++msgstr "Définir un autre serveur CUPS à utiliser." ++ ++# type: TP ++#: cupsaddsmb.man.in:67 cupstestppd.man:83 ++#, no-wrap ++msgid "-v" ++msgstr "B<-v>" ++ ++# type: Plain text ++#: cupsaddsmb.man.in:72 ++msgid "" ++"Specifies that verbose information should be shown. This is useful for " ++"debugging SAMBA configuration problems." ++msgstr "" ++"Spécifier que des informations détaillées doivent être affichées. Ceci peut " ++"être utile pour le débogage des configurations de SAMBA." ++ ++# type: SH ++#: cupsaddsmb.man.in:73 ++#, no-wrap ++msgid "SAMBA CONFIGURATION" ++msgstr "CONFIGURATION DE SAMBA" ++ ++# type: Plain text ++#: cupsaddsmb.man.in:80 ++msgid "" ++"I uses the new RPC-based printing support in SAMBA 2.2.x to " ++"provide printer drivers and PPD files to Windows client machines. In order " ++"to use this functionality, you must first configure the SAMBA I " ++"file to support printing through CUPS and provide a printer driver download " ++"share, as follows:" ++msgstr "" ++"B utilise le nouveau mode d'impression RPC de SAMBA 2.2.x pour " ++"fournir aux clients Windows les drivers d'impression et les fichiers PPD. " ++"Pour utiliser cette fonctionnalité, vous devez configurer SAMBA (via le " ++"fichier I(5)) pour qu'il utilise l'impression via CUPS, et fournir " ++"un driver à télécharger. Ceci est fait de la manière suivante :" ++ ++# type: Plain text ++#: cupsaddsmb.man.in:86 ++#, no-wrap ++msgid "" ++" [global]\n" ++"\tload printers = yes\n" ++"\tprinting = cups\n" ++"\tprintcap name = cups\n" ++msgstr "" ++" [global]\n" ++"\tload printers = yes\n" ++"\tprinting = cups\n" ++"\tprintcap name = cups\n" ++ ++# type: Plain text ++#: cupsaddsmb.man.in:95 ++#, no-wrap ++msgid "" ++" [printers]\n" ++"\tcomment = All Printers\n" ++"\tpath = /var/spool/samba\n" ++"\tbrowseable = no\n" ++"\tpublic = yes\n" ++"\tguest ok = yes\n" ++"\twritable = no\n" ++"\tprintable = yes\n" ++msgstr "" ++" [printers]\n" ++"\tcomment = All Printers\n" ++"\tpath = /var/spool/samba\n" ++"\tbrowseable = no\n" ++"\tpublic = yes\n" ++"\tguest ok = yes\n" ++"\twritable = no\n" ++"\tprintable = yes\n" ++ ++# type: Plain text ++#: cupsaddsmb.man.in:103 ++#, no-wrap ++msgid "" ++" [print$]\n" ++"\tcomment = Printer Drivers\n" ++"\tpath = /etc/samba/drivers\n" ++"\tbrowseable = yes\n" ++"\tguest ok = no\n" ++"\tread only = yes\n" ++"\twrite list = root\n" ++msgstr "" ++" [print$]\n" ++"\tcomment = Printer Drivers\n" ++"\tpath = /etc/samba/drivers\n" ++"\tbrowseable = yes\n" ++"\tguest ok = no\n" ++"\tread only = yes\n" ++"\twrite list = root\n" ++ ++# type: Plain text ++#: cupsaddsmb.man.in:108 ++msgid "" ++"This configuration assumes a FHS-compliant installation of SAMBA; adjust the " ++"[printers] and [print$] share paths accordingly on your system as needed." ++msgstr "" ++"Cette configuration suppose une installation de SAMBA conforme au standard " ++"FHS. Modifiez les chemins des partages [printers] et [print$] suivant votre " ++"installation." ++ ++# type: SH ++#: cupsaddsmb.man.in:109 ++#, no-wrap ++msgid "MICROSOFT POSTSCRIPT DRIVERS FOR WINDOWS" ++msgstr "PILOTES POSTSCRIPT MICROSOFT POUR WINDOWS" ++ ++# type: Plain text ++#: cupsaddsmb.man.in:117 ++msgid "" ++"The base driver for Windows 2000 and higher is the Microsoft PostScript " ++"driver, which is available on any system running Windows 2000 or higher in " ++"the %WINDIR%\\eSYSTEM32\\eSPOOL\\eDRIVERS\\eW32X86\\e3 folder for 32-bit " ++"drivers and %WINDIR%\\eSYSTEM32\\eSPOOL\\eDRIVERS\\eX64\\e3 folder for 64-" ++"bit drivers." ++msgstr "" ++"Le pilote de base de Windows 2000 et des versions ultérieures est le pilote " ++"PostScript Microsoft, qui est disponible sur tous les systèmes avec " ++"Windows 2000 ou une version ultérieure dans le répertoire %WINDIR%\\eSYSTEM32" ++"\\eSPOOL\\eDRIVERS\\eW32X86\\e3 pour les pilotes 32 bits et dans le " ++"répertoire %WINDIR%\\eSYSTEM32\\eSPOOL\\eDRIVERS\\eX64\\e3 pour les pilotes " ++"64 bits." ++ ++# type: Plain text ++#: cupsaddsmb.man.in:125 ++msgid "" ++"The CUPS printer driver is preferred over the Microsoft driver since it " ++"supports the page-label, job-billing, and job-hold-until options fully on " ++"all printers. However, currently only Windows 2000 and higher is supported " ++"by the Microsoft driver, so you will also need to get the Adobe driver to " ++"support Windows 95, 98, and Me clients. The Adobe and Microsoft drivers for " ++"Windows 2000 are identical." ++msgstr "" ++"Il est recommandé d'utiliser le pilote CUPS plutôt que celui de Microsoft " ++"puisqu'il permet, pour toutes les imprimantes, l'étiquetage des pages, la " ++"facturation des travaux et l'interruption. Cependant, seuls Windows 2000 et " ++"les versions ultérieures sont supportés par le pilote Microsoft, donc vous " ++"devrez utiliser le pilote Adobe pour les clients Windows 95, 98 et Me. Les " ++"pilotes Adobe et Microsoft pour Windows 2000 sont identiques." ++ ++# type: Plain text ++#: cupsaddsmb.man.in:130 cupsaddsmb.man.in:159 ++msgid "" ++"Once you have extracted the driver files, copy the 32-bit drivers to the " ++"I<@CUPS_DATADIR@/drivers> directory and the 64-bit drivers to the " ++"I<@CUPS_DATADIR@/drivers/x64> directory exactly as named below:" ++msgstr "" ++"Après avoir extrait les fichiers du pilote, copier les pilotes 32 bits dans " ++"le répertoire I<@CUPS_DATADIR@/drivers> et les pilotes 64 bits dans le " ++"répertoire I<@CUPS_DATADIR@/drivers/x64>, en les nommant exactement comme " ++"ceci :" ++ ++# type: Plain text ++#: cupsaddsmb.man.in:137 ++#, no-wrap ++msgid "" ++" [Windows 2000 and higher]\n" ++" ps5ui.dll\n" ++" pscript.hlp\n" ++" pscript.ntf\n" ++" pscript5.dll\n" ++msgstr "" ++" [Windows 2000 et supérieurs]\n" ++" ps5ui.dll\n" ++" pscript.hlp\n" ++" pscript.ntf\n" ++" pscript5.dll\n" ++ ++# type: Plain text ++#: cupsaddsmb.man.in:142 cupsaddsmb.man.in:175 ++msgid "" ++"B Unlike Windows, case is significant - make sure that you use the " ++"lowercase filenames shown above, otherwise I will fail to export " ++"the drivers." ++msgstr "" ++"B Contrairement à Windows, la casse est importante. Assurez vous " ++"d'utiliser des noms de fichiers en minuscule, comme ci-dessus. Sinon, " ++"B échouera lors de l'export des pilotes." ++ ++# type: SH ++#: cupsaddsmb.man.in:143 ++#, no-wrap ++msgid "CUPS POSTSCRIPT DRIVERS FOR WINDOWS" ++msgstr "PILOTES POSTSCRIPT CUPS POUR WINDOWS" ++ ++# type: Plain text ++#: cupsaddsmb.man.in:147 ++msgid "" ++"I can use the CUPS v6 PostScript printer driver for Windows, " ++"which is available for download from the CUPS web site." ++msgstr "" ++"B peut utiliser les pilotes PostScript CUPS V6 pour Windows, " ++"disponibles en téléchargement sur le site web de CUPS." ++ ++# type: Plain text ++#: cupsaddsmb.man.in:154 ++msgid "" ++"The CUPS printer driver is preferred over the Adobe and Microsoft drivers " ++"since it supports the page-label, job-billing, and job-hold-until options " ++"fully on all printers. However, currently only Windows 2000 and higher is " ++"supported by the CUPS driver, so you will also need to get the Adobe driver " ++"to support Windows 95, 98, and Me clients." ++msgstr "" ++"Il est recommandé d'utiliser le pilote CUPS plutôt que ceux d'Adobe et de " ++"Microsoft puisqu'il permet, pour toutes les imprimantes, l'étiquetage des " ++"pages, la facturation des travaux et l'interruption des travaux. Cependant, " ++"seuls Windows 2000 et les versions ultérieures sont supportés le pilote " ++"CUPS, donc vous devrez utiliser le pilote Adobe pour les clients Windows 95, " ++"98 et Me." ++ ++# type: Plain text ++#: cupsaddsmb.man.in:170 ++#, no-wrap ++msgid "" ++" [Windows 2000 and higher]\n" ++" cups6.inf (from www.cups.org)\n" ++" cups6.ini (from www.cups.org)\n" ++" cupsps6.dll (from www.cups.org)\n" ++" cupsui6.dll (from www.cups.org)\n" ++" ps5ui.dll (from your Windows system)\n" ++" pscript.hlp (from your Windows system)\n" ++" pscript.ntf (from your Windows system)\n" ++" pscript5.dll (from your Windows system)\n" ++msgstr "" ++" [Windows 2000 et supérieurs]\n" ++" cups6.inf (from www.cups.org)\n" ++" cups6.ini (from www.cups.org)\n" ++" cupsps6.dll (from www.cups.org)\n" ++" cupsui6.dll (from www.cups.org)\n" ++" ps5ui.dll (from your Windows system)\n" ++" pscript.hlp (from your Windows system)\n" ++" pscript.ntf (from your Windows system)\n" ++" pscript5.dll (from your Windows system)\n" ++ ++# type: SH ++#: cupsaddsmb.man.in:176 ++#, no-wrap ++msgid "ADOBE POSTSCRIPT DRIVERS FOR WINDOWS 95, 98, AND ME" ++msgstr "PILOTES POSTSCRIPT ADOBE POUR WINDOWS 95, 98 et ME" ++ ++# type: Plain text ++#: cupsaddsmb.man.in:180 ++msgid "" ++"I can use the Adobe PostScript printer driver for Windows 95, " ++"98, and ME, which are available for download from the Adobe web site (http://" ++"www.adobe.com)." ++msgstr "" ++"B peut utiliser le pilote des imprimantes PostScript d'Adobe " ++"pour Windows 95, 98 et ME, qui sont disponibles en téléchargement sur le " ++"site d'Adobe (http://www.adobe.com)." ++ ++# type: Plain text ++#: cupsaddsmb.man.in:183 ++msgid "" ++"The Adobe driver does not support the page-label, job-billing, or job-hold-" ++"until options." ++msgstr "" ++"Le pilote Adobe ne permet pas l'étiquetage des pages, la facturation des " ++"travaux et l'interruption des travaux." ++ ++# type: Plain text ++#: cupsaddsmb.man.in:187 ++msgid "" ++"Once you have installed the driver on a Windows system, copy the following " ++"files to the I<@CUPS_DATADIR@/drivers> directory exactly as named below:" ++msgstr "" ++"Une fois que vous avec les pilotes sur un système Windows, copiez les " ++"fichiers suivants dans le répertoire I<@CUPS_DATADIR@/drivers>, en " ++"respectant les noms indiqués :" ++ ++# type: Plain text ++#: cupsaddsmb.man.in:195 ++#, no-wrap ++msgid "" ++" [Windows 95, 98, and Me]\n" ++" ADFONTS.MFM\n" ++" ADOBEPS4.DRV\n" ++" ADOBEPS4.HLP\n" ++" ICONLIB.DLL\n" ++" PSMON.DLL\n" ++msgstr "" ++" [Windows 95, 98 et Me]\n" ++" ADFONTS.MFM\n" ++" ADOBEPS4.DRV\n" ++" ADOBEPS4.HLP\n" ++" ICONLIB.DLL\n" ++" PSMON.DLL\n" ++ ++# type: Plain text ++#: cupsaddsmb.man.in:200 ++msgid "" ++"B Unlike Windows, case is significant - make sure that you use the " ++"UPPERCASE filenames shown above, otherwise I will fail to export " ++"the drivers." ++msgstr "" ++"B Contrairement à Windows, la casse est importante. Assurez vous " ++"d'utiliser des noms de fichiers en MAJUSCULE, comme ci-dessus. Sinon, " ++"B échouera lors de l'export des pilotes." ++ ++# type: SH ++#: cupsaddsmb.man.in:201 cupsfilter.man:62 ++#, no-wrap ++msgid "KNOWN ISSUES" ++msgstr "PROBLÈMES CONNUS" ++ ++# type: Plain text ++#: cupsaddsmb.man.in:203 ++msgid "Getting the full set of Windows driver files should be easier." ++msgstr "" ++"Récupérer l'ensemble complet des pilotes Windows devrait être plus simple." ++ ++# type: Plain text ++#: cupsaddsmb.man.in:207 ++msgid "I, I, http://localhost:631/help" ++msgstr "B(8), B(5), http://localhost:631/help" ++ ++# type: Plain text ++#: cupsaddsmb.man.in:209 ++msgid "http://www.cups.org/windows/" ++msgstr "http://www.cups.org/windows/" ++ ++# type: TH ++#: cups-config.man:15 ++#, no-wrap ++msgid "cups-config" ++msgstr "cups-config" ++ ++# type: TH ++#: cups-config.man:15 cupsd.conf.man.in:15 cups-deviced.man.in:15 ++#: cups-driverd.man.in:15 lpq.man:15 ++#, no-wrap ++msgid "16 June 2008" ++msgstr "16 juin 2008" ++ ++# type: Plain text ++#: cups-config.man:18 ++msgid "cups-config - get cups api, compiler, directory, and link information." ++msgstr "" ++"cups-config - Obtenir les informations sur l'API, les répertoires, la " ++"compilation et l'édition des liens pour CUPS." ++ ++# type: Plain text ++#: cups-config.man:21 ++msgid "B --api-version" ++msgstr "B --api-version" ++ ++# type: Plain text ++#: cups-config.man:24 ++msgid "B --cflags" ++msgstr "B --cflags" ++ ++# type: Plain text ++#: cups-config.man:27 ++msgid "B --datadir" ++msgstr "B --datadir" ++ ++# type: Plain text ++#: cups-config.man:30 ++msgid "B --help" ++msgstr "B --help" ++ ++# type: Plain text ++#: cups-config.man:33 ++msgid "B --ldflags" ++msgstr "B --ldflags" ++ ++# type: Plain text ++#: cups-config.man:40 ++msgid "B [ I<--image> ] [ I<--static> ] --libs" ++msgstr "B [ --image ] [ --static ] --libs" ++ ++# type: Plain text ++#: cups-config.man:43 ++msgid "B --serverbin" ++msgstr "B --serverbin" ++ ++# type: Plain text ++#: cups-config.man:46 ++msgid "B --serverroot" ++msgstr "B --serverroot" ++ ++# type: Plain text ++#: cups-config.man:49 ++msgid "B --version" ++msgstr "B --version" ++ ++# type: Plain text ++#: cups-config.man:55 ++msgid "" ++"B is the CUPS program configuration utility. It should be used " ++"by application developers to determine the necessary command-line options " ++"for the compiler and linker, as well as determining installation directories " ++"for filters, configuration files, and drivers." ++msgstr "" ++"B est l'utilitaire de configuration pour les programmes CUPS. " ++"Il devrait être utilisé par les développeurs d'application pour déterminer " ++"les options en ligne de commande pour le compilateur ou l'éditeur de liens, " ++"comme pour déterminer les répertoires des filtres, fichiers de " ++"configurations et pilotes." ++ ++# type: TP ++#: cups-config.man:56 ++#, no-wrap ++msgid "--api-version" ++msgstr "B<--api-version>" ++ ++# type: Plain text ++#: cups-config.man:60 ++msgid "Displays the current API version (major.minor)." ++msgstr "Afficher la version d'API actuelle (majeur.mineur)." ++ ++# type: TP ++#: cups-config.man:60 ++#, no-wrap ++msgid "--cflags" ++msgstr "B<--cflags>" ++ ++# type: Plain text ++#: cups-config.man:64 ++msgid "Displays the necessary compiler options." ++msgstr "Afficher les options de compilations nécessaires." ++ ++# type: TP ++#: cups-config.man:64 ++#, no-wrap ++msgid "--datadir" ++msgstr "B<--datadir>" ++ ++# type: Plain text ++#: cups-config.man:68 ++msgid "Displays the default CUPS data directory." ++msgstr "Afficher le répertoire de données par défaut de CUPS." ++ ++# type: TP ++#: cups-config.man:68 ++#, no-wrap ++msgid "--help" ++msgstr "B<--help>" ++ ++# type: Plain text ++#: cups-config.man:72 ++msgid "Displays the program usage message." ++msgstr "Afficher un message d'aide." ++ ++# type: TP ++#: cups-config.man:72 ++#, no-wrap ++msgid "--image" ++msgstr "B<--image>" ++ ++# type: Plain text ++#: cups-config.man:77 ++msgid "" ++"When used with I<--libs>, adds the CUPS imaging library to the list of " ++"displayed libraries." ++msgstr "" ++"Lorsqu'elle est utilisée avec B<--libs>, cette option ajoute la bibliothèque " ++"de gestion des images CUPS des bibliothèques affichées." ++ ++# type: TP ++#: cups-config.man:77 ++#, no-wrap ++msgid "--ldflags" ++msgstr "B<--ldflags>" ++ ++# type: Plain text ++#: cups-config.man:81 ++msgid "Displays the necessary linker options." ++msgstr "Afficher les options nécessaires pour l'édition des liens." ++ ++# type: TP ++#: cups-config.man:81 ++#, no-wrap ++msgid "--libs" ++msgstr "B<--libs>" ++ ++# type: Plain text ++#: cups-config.man:85 ++msgid "Displays the necessary librarys to link to." ++msgstr "Afficher les bibliothèques nécessaires pour l'édition des liens." ++ ++# type: TP ++#: cups-config.man:85 ++#, no-wrap ++msgid "--serverbin" ++msgstr "B<--serverbin>" ++ ++# type: Plain text ++#: cups-config.man:90 ++msgid "" ++"Displays the default CUPS binary directory, where filters and backends are " ++"stored." ++msgstr "" ++"Afficher le répertoires par défaut des binaires, où se trouvent les filtres " ++"et dorsaux." ++ ++# type: TP ++#: cups-config.man:90 ++#, no-wrap ++msgid "--serverroot" ++msgstr "B<--serverroot>" ++ ++# type: Plain text ++#: cups-config.man:94 ++msgid "Displays the default CUPS configuration file directory." ++msgstr "Afficher le répertoire de configuration par défaut d eCUPS." ++ ++# type: TP ++#: cups-config.man:94 ++#, no-wrap ++msgid "--static" ++msgstr "B<--static>" ++ ++# type: Plain text ++#: cups-config.man:99 ++msgid "" ++"When used with I<--libs>, shows the static libraries instead of the default " ++"(shared) libraries." ++msgstr "" ++"Lorsqu'elle est utilisée avec B<--libs>, les bibliothèques statiques seront " ++"affichées au lieu des bibliothèques partagées qui sont affichées par défaut." ++ ++# type: TP ++#: cups-config.man:99 ++#, no-wrap ++msgid "--version" ++msgstr "B<--version>" ++ ++# type: Plain text ++#: cups-config.man:104 ++msgid "" ++"Displays the full version number of the CUPS installation (major.minor." ++"patch)." ++msgstr "" ++"Afficher la version complète de l'installation CUPS (majeur.mineur.patch)." ++ ++# type: Plain text ++#: cups-config.man:107 cupsd.conf.man.in:615 cups-deviced.man.in:41 ++#: cups-driverd.man.in:102 lpadmin.man:204 lpq.man:69 ++msgid "Copyright 2007-2008 by Apple Inc." ++msgstr "Copyright 2007-2008 par Apple Inc." ++ ++# type: TH ++#: cupsctl.man:15 ++#, no-wrap ++msgid "cupsctl" ++msgstr "cupsctl" ++ ++# type: TH ++#: cupsctl.man:15 ++#, no-wrap ++msgid "5 July 2007" ++msgstr "5 juillet 2007" ++ ++# type: Plain text ++#: cupsctl.man:18 ++msgid "cupsctl - configure cupsd.conf options" ++msgstr "cupsctl - Configurer les options de cupsd.conf" ++ ++# type: Plain text ++#: cupsctl.man:29 ++msgid "" ++"B [ -E ] [-U I ] [ -h I ] [ --[no-]debug-" ++"logging ] [ --[no-]remote-admin ] [ --[no-]remote-any ] [ --[no-]remote-" ++"printers ] [ --[no-]share-printers ] [ --[no-]user-cancel-any ] " ++"[ I ]" ++msgstr "" ++"B [ -E ] [-U I ] [ -h I ] [ --[no-]" ++"debug-logging ] [ --[no-]remote-admin ] [ --[no-]remote-any ] [ --[no-]" ++"remote-printers ] [ --[no-]share-printers ] [ --[no-]user-cancel-any ] " ++"[ I ]" ++ ++# type: Plain text ++#: cupsctl.man:33 ++msgid "" ++"I updates or queries the B file for a server. When no " ++"changes are requested, the current configuration values are written to the " ++"standard output in the format \"name=value\", one per line." ++msgstr "" ++"I met à jour ou interroge le fichier B d'un serveur. " ++"Quand aucun changement n'est demandé, les valeurs de configuration actuelles " ++"sont affichées sur la sortie standard sous la forme « nom=valeur », une par " ++"ligne." ++ ++# type: Plain text ++#: cupsctl.man:35 ++msgid "The following options are recognized:" ++msgstr "Les options suivantes sont reconnues :" ++ ++# type: Plain text ++#: cupsctl.man:39 ++msgid "Enables encryption on the connection to the scheduler." ++msgstr "Activer le chiffrement de la connexion à l'ordonnanceur." ++ ++# type: TP ++#: cupsctl.man:39 ++#, no-wrap ++msgid "-U I" ++msgstr "B<-U> I" ++ ++# type: Plain text ++#: cupsctl.man:43 ++msgid "" ++"Specifies an alternate username to use when authenticating with the " ++"scheduler." ++msgstr "" ++"Spécifier un autre utilisateur à utiliser pour l'identification auprès de " ++"l'ordonnanceur." ++ ++# type: TP ++#: cupsctl.man:43 ++#, no-wrap ++msgid "-h I" ++msgstr "B<-h> I" ++ ++# type: Plain text ++#: cupsctl.man:47 ++msgid "Specifies the server address." ++msgstr "Définir l'adresse du serveur." ++ ++# type: TP ++#: cupsctl.man:47 ++#, no-wrap ++msgid "--[no-]debug-logging" ++msgstr "B<--[no-]debug-logging>" ++ ++# type: Plain text ++#: cupsctl.man:51 ++msgid "Enables or disables debug logging in the B file." ++msgstr "" ++"Activer ou désactiver la journalisation d'informations de débogage dans le " ++"fichier B." ++ ++# type: TP ++#: cupsctl.man:51 ++#, no-wrap ++msgid "--[no-]remote-admin" ++msgstr "B<--[no-]remote-admin>" ++ ++# type: Plain text ++#: cupsctl.man:55 ++msgid "Enables or disables remote administration." ++msgstr "Activer ou désactiver l'administration à distance." ++ ++# type: TP ++#: cupsctl.man:55 ++#, no-wrap ++msgid "--[no-]remote-any" ++msgstr "B<--[no-]remote-any>" ++ ++# type: Plain text ++#: cupsctl.man:59 ++msgid "Enables or disables printing from any address, e.g. the Internet." ++msgstr "" ++"Activer ou désactiver l'impression depuis n'importe quelle adresse, comme " ++"par exemple depuis Internet." ++ ++# type: TP ++#: cupsctl.man:59 ++#, no-wrap ++msgid "--[no-]remote-printers" ++msgstr "B<--[no-]remote-printers>" ++ ++# type: Plain text ++#: cupsctl.man:64 ++msgid "" ++"Enables or disables the display of remote printers shared via the CUPS, " ++"LDAP, or SLP protocols." ++msgstr "" ++"Activer ou désactiver l'affichage d'imprimantes distantes partagées par les " ++"protocoles CUPS, LDAP ou SLP." ++ ++# type: TP ++#: cupsctl.man:64 ++#, no-wrap ++msgid "--[no-]share-printers" ++msgstr "B<--[no-]share-printers>" ++ ++# type: Plain text ++#: cupsctl.man:68 ++msgid "Enables or disables sharing of local printers with other computers." ++msgstr "" ++"Activer ou désactiver le partage d'imprimantes locales avec d'autres " ++"ordinateurs." ++ ++# type: TP ++#: cupsctl.man:68 ++#, no-wrap ++msgid "--[no-]user-cancel-any" ++msgstr "B<--[no-]user-cancel-any>" ++ ++# type: Plain text ++#: cupsctl.man:72 ++msgid "Allows or prevents users from canceling jobs owned by others." ++msgstr "" ++"Permettre ou interdire aux utilisateurs d'annuler les travaux d'autres " ++"utilisateurs." ++ ++# type: SH ++#: cupsctl.man:72 cupstestppd.man:115 lp.man:210 ++#, no-wrap ++msgid "EXAMPLES" ++msgstr "EXEMPLES" ++ ++# type: Plain text ++#: cupsctl.man:74 ++msgid "Display the current settings:" ++msgstr "Afficher la configuration actuelle :" ++ ++# type: Plain text ++#: cupsctl.man:76 ++#, no-wrap ++msgid " cupsctl\n" ++msgstr " cupsctl\n" ++ ++# type: Plain text ++#: cupsctl.man:79 ++msgid "Enable debug logging:" ++msgstr "Activer la journalisation d'informations de débogage." ++ ++# type: Plain text ++#: cupsctl.man:81 ++#, no-wrap ++msgid " cupsctl --debug-logging\n" ++msgstr " cupsctl --debug-logging\n" ++ ++# type: Plain text ++#: cupsctl.man:84 ++msgid "Get the current debug logging state:" ++msgstr "Récupérer l'état de la journalisation d'informations de débogage :" ++ ++# type: Plain text ++#: cupsctl.man:86 ++#, no-wrap ++msgid " cupsctl | grep '^_debug_logging' | awk -F= '{print $2}'\n" ++msgstr " cupsctl | grep '^_debug_logging' | awk -F= '{print $2}'\n" ++ ++# type: Plain text ++#: cupsctl.man:89 ++msgid "Disable printer sharing:" ++msgstr "Désactiver le partage d'imprimantes :" ++ ++# type: Plain text ++#: cupsctl.man:91 ++#, no-wrap ++msgid " cupsctl --no-shared-printers\n" ++msgstr " cupsctl --no-shared-printers\n" ++ ++# type: Plain text ++#: cupsctl.man:94 ++msgid "Enable printing using the file: pseudo-device:" ++msgstr "Activer l'impression dans le fichier « pseudo-périphérique » :" ++ ++# type: TP ++#: cupsctl.man:96 ++#, no-wrap ++msgid " cupsctl FileDevice=Yes\n" ++msgstr " cupsctl FileDevice=Yes\n" ++ ++# type: Plain text ++#: cupsctl.man:99 ++msgid "I, I," ++msgstr "B(5), B(8)," ++ ++# type: TH ++#: cupsd.conf.man.in:15 ++#, no-wrap ++msgid "cupsd.conf" ++msgstr "cupsd.conf" ++ ++# type: Plain text ++#: cupsd.conf.man.in:18 ++msgid "cupsd.conf - server configuration file for cups" ++msgstr "cupsd.conf - Fichier de configuration du serveur CUPS." ++ ++# type: Plain text ++#: cupsd.conf.man.in:21 ++msgid "" ++"The I file configures the CUPS scheduler, I. It is " ++"normally located in the I<@CUPS_SERVERROOT@> directory." ++msgstr "" ++"Le fichier I configure l'ordonnanceur CUPS, B(8). Il est " ++"généralement situé dans le répertoire I<@CUPS_SERVERROOT@>." ++ ++# type: Plain text ++#: cupsd.conf.man.in:26 ++msgid "" ++"Each line in the file can be a configuration directive, a blank line, or a " ++"comment. Comment lines start with the # character. The configuration " ++"directives are intentionally similar to those used by the popular Apache web " ++"server software and are described below." ++msgstr "" ++"Chaque ligne de ce fichier est soit une directive de configuration, une " ++"ligne vide, ou un commentaire. Les lignes de commentaire commencent par le " ++"caractère #. Les directives de configuration sont volontairement similaires " ++"à celles utilisées par le serveur web Apache, et sont décrites ci-dessous." ++ ++# type: Plain text ++#: cupsd.conf.man.in:29 ++msgid "" ++"The following directives are understood by I. Consult the on-line " ++"help for detailed descriptions:" ++msgstr "" ++"Les directives suivantes sont comprises par B(8). Veuillez vous " ++"reporter à l'aide en ligne pour une description plus détaillée." ++ ++# type: TP ++#: cupsd.conf.man.in:29 ++#, no-wrap ++msgid "AccessLog filename" ++msgstr "AccessLog fichier" ++ ++# type: TP ++#: cupsd.conf.man.in:31 ++#, no-wrap ++msgid "AccessLog syslog" ++msgstr "AccessLog syslog" ++ ++# type: Plain text ++#: cupsd.conf.man.in:35 ++msgid "Defines the access log filename." ++msgstr "Définir le fichier traçant les accès." ++ ++# type: TP ++#: cupsd.conf.man.in:35 ++#, no-wrap ++msgid "Allow all" ++msgstr "Allow all" ++ ++# type: TP ++#: cupsd.conf.man.in:37 ++#, no-wrap ++msgid "Allow none" ++msgstr "Allow none" ++ ++# type: TP ++#: cupsd.conf.man.in:39 ++#, no-wrap ++msgid "Allow host.domain.com" ++msgstr "Allow serveur.domaine.com" ++ ++# type: TP ++#: cupsd.conf.man.in:41 ++#, no-wrap ++msgid "Allow *.domain.com" ++msgstr "Allow *.domaine.com" ++ ++# type: TP ++#: cupsd.conf.man.in:43 ++#, no-wrap ++msgid "Allow ip-address" ++msgstr "Allow adresse_ip" ++ ++# type: TP ++#: cupsd.conf.man.in:45 ++#, no-wrap ++msgid "Allow ip-address/netmask" ++msgstr "Allow adresse_ip/masque_sous_réseau" ++ ++# type: TP ++#: cupsd.conf.man.in:47 ++#, no-wrap ++msgid "Allow ip-address/mm" ++msgstr "Allow adresse_ip/mm" ++ ++# type: TP ++#: cupsd.conf.man.in:49 ++#, no-wrap ++msgid "Allow @IF(name)" ++msgstr "Allow @IF(nom)" ++ ++# type: TP ++#: cupsd.conf.man.in:51 ++#, no-wrap ++msgid "Allow @LOCAL" ++msgstr "Allow @LOCAL" ++ ++# type: Plain text ++#: cupsd.conf.man.in:55 ++msgid "Allows access from the named hosts or addresses." ++msgstr "Permettre l'accès depuis des machines nommées ou des adresses IP." ++ ++# type: TP ++#: cupsd.conf.man.in:55 ++#, no-wrap ++msgid "AuthClass User" ++msgstr "AuthClass User" ++ ++# type: TP ++#: cupsd.conf.man.in:57 ++#, no-wrap ++msgid "AuthClass Group" ++msgstr "AuthClass Group" ++ ++# type: TP ++#: cupsd.conf.man.in:59 ++#, no-wrap ++msgid "AuthClass System" ++msgstr "AuthClass System" ++ ++# type: Plain text ++#: cupsd.conf.man.in:64 ++msgid "" ++"Specifies the authentication class (User, Group, System) - B." ++msgstr "" ++"Définir la classe d'identification (User, Group, System). B" ++ ++# type: TP ++#: cupsd.conf.man.in:64 ++#, no-wrap ++msgid "AuthGroupName group-name" ++msgstr "AuthGroupName groupe" ++ ++# type: Plain text ++#: cupsd.conf.man.in:69 ++msgid "Specifies the authentication group - B." ++msgstr "Définir le groupe d'identification. B" ++ ++# type: TP ++#: cupsd.conf.man.in:69 ++#, no-wrap ++msgid "AuthType None" ++msgstr "AuthType None" ++ ++# type: TP ++#: cupsd.conf.man.in:71 ++#, no-wrap ++msgid "AuthType Basic" ++msgstr "AuthType Basic" ++ ++# type: TP ++#: cupsd.conf.man.in:73 ++#, no-wrap ++msgid "AuthType BasicDigest" ++msgstr "AuthType BasicDigest" ++ ++# type: TP ++#: cupsd.conf.man.in:75 ++#, no-wrap ++msgid "AuthType Digest" ++msgstr "AuthType Digest" ++ ++# type: TP ++#: cupsd.conf.man.in:77 ++#, no-wrap ++msgid "AuthType Negotiate" ++msgstr "AuthType Negotiate" ++ ++# type: Plain text ++#: cupsd.conf.man.in:81 ++msgid "" ++"Specifies the authentication type (None, Basic, BasicDigest, Digest, " ++"Negotiate)" ++msgstr "" ++"Définir le type d'identification (None, Basic, BasicDigest, Digest, " ++"Negotiate)." ++ ++# type: TP ++#: cupsd.conf.man.in:81 ++#, no-wrap ++msgid "AutoPurgeJobs Yes" ++msgstr "AutoPurgeJobs Yes" ++ ++# type: TP ++#: cupsd.conf.man.in:83 ++#, no-wrap ++msgid "AutoPurgeJobs No" ++msgstr "AutoPurgeJobs No" ++ ++# type: Plain text ++#: cupsd.conf.man.in:88 ++msgid "" ++"Specifies whether to purge job history data automatically when it is no " ++"longer required for quotas." ++msgstr "" ++"Définir s'il faut purger automatiquement l'historique des travaux lorsque " ++"les données ne sont plus nécessaires pour l'application des quotas." ++ ++# type: TP ++#: cupsd.conf.man.in:88 ++#, no-wrap ++msgid "BrowseAddress ip-address" ++msgstr "BrowseAddress adresse_ip" ++ ++# type: TP ++#: cupsd.conf.man.in:90 ++#, no-wrap ++msgid "BrowseAddress @IF(name)" ++msgstr "BrowseAddress @IF(nom)" ++ ++# type: TP ++#: cupsd.conf.man.in:92 ++#, no-wrap ++msgid "BrowseAddress @LOCAL" ++msgstr "BrowseAddress @LOCAL" ++ ++# type: Plain text ++#: cupsd.conf.man.in:96 ++msgid "Specifies a broadcast address for outgoing printer information packets." ++msgstr "" ++"Définir une adresse où broadcaster les informations sur les imprimantes." ++ ++# type: TP ++#: cupsd.conf.man.in:96 ++#, no-wrap ++msgid "BrowseAllow all" ++msgstr "BrowseAllow all" ++ ++# type: TP ++#: cupsd.conf.man.in:98 ++#, no-wrap ++msgid "BrowseAllow none" ++msgstr "BrowseAllow none" ++ ++# type: TP ++#: cupsd.conf.man.in:100 ++#, no-wrap ++msgid "BrowseAllow host.domain.com" ++msgstr "BrowseAllow serveur.domaine.com" ++ ++# type: TP ++#: cupsd.conf.man.in:102 ++#, no-wrap ++msgid "BrowseAllow *.domain.com" ++msgstr "BrowseAllow *.domaine.com" ++ ++# type: TP ++#: cupsd.conf.man.in:104 ++#, no-wrap ++msgid "BrowseAllow ip-address" ++msgstr "BrowseAllow adresse_ip" ++ ++# type: TP ++#: cupsd.conf.man.in:106 ++#, no-wrap ++msgid "BrowseAllow ip-address/netmask" ++msgstr "BrowseAllow adresse_ip/masque_sous_réseau" ++ ++# type: TP ++#: cupsd.conf.man.in:108 ++#, no-wrap ++msgid "BrowseAllow ip-address/mm" ++msgstr "BrowseAllow adresse_ip/mm" ++ ++# type: TP ++#: cupsd.conf.man.in:110 ++#, no-wrap ++msgid "BrowseAllow @IF(name)" ++msgstr "BrowseAllow @IF(nom)" ++ ++# type: TP ++#: cupsd.conf.man.in:112 ++#, no-wrap ++msgid "BrowseAllow @LOCAL" ++msgstr "BrowseAllow @LOCAL" ++ ++# type: Plain text ++#: cupsd.conf.man.in:116 ++msgid "" ++"Allows incoming printer information packets from the named host or address." ++msgstr "Accepter les paquets arrivant des machines ou adresses IP indiquées." ++ ++# type: TP ++#: cupsd.conf.man.in:116 ++#, no-wrap ++msgid "BrowseDeny all" ++msgstr "BrowseDeny all" ++ ++# type: TP ++#: cupsd.conf.man.in:118 ++#, no-wrap ++msgid "BrowseDeny none" ++msgstr "BrowseDeny none" ++ ++# type: TP ++#: cupsd.conf.man.in:120 ++#, no-wrap ++msgid "BrowseDeny host.domain.com" ++msgstr "BrowseDeny serveur.domaine.com" ++ ++# type: TP ++#: cupsd.conf.man.in:122 ++#, no-wrap ++msgid "BrowseDeny *.domain.com" ++msgstr "BrowseDeny *.domaine.com" ++ ++# type: TP ++#: cupsd.conf.man.in:124 ++#, no-wrap ++msgid "BrowseDeny ip-address" ++msgstr "BrowseDeny adresse_ip" ++ ++# type: TP ++#: cupsd.conf.man.in:126 ++#, no-wrap ++msgid "BrowseDeny ip-address/netmask" ++msgstr "BrowseDeny adresse_ip/masque_sous_réseau" ++ ++# type: TP ++#: cupsd.conf.man.in:128 ++#, no-wrap ++msgid "BrowseDeny ip-address/mm" ++msgstr "BrowseDeny addresse_ip/mm" ++ ++# type: TP ++#: cupsd.conf.man.in:130 ++#, no-wrap ++msgid "BrowseDeny @IF(name)" ++msgstr "BrowseDeny @IF(nom)" ++ ++# type: TP ++#: cupsd.conf.man.in:132 ++#, no-wrap ++msgid "BrowseDeny @LOCAL" ++msgstr "BrowseDeny @LOCAL" ++ ++# type: Plain text ++#: cupsd.conf.man.in:136 ++msgid "" ++"Denies incoming printer information packets from the named host or address." ++msgstr "" ++"Refuser les paquets d'informations sur les imprimantes arrivant de machines " ++"ou d'adresses IP données." ++ ++# type: TP ++#: cupsd.conf.man.in:136 ++#, no-wrap ++msgid "BrowseInterval seconds" ++msgstr "BrowseInterval secondes" ++ ++# type: Plain text ++#: cupsd.conf.man.in:140 ++msgid "Specifies the maximum interval between printer information broadcasts." ++msgstr "" ++"Définir l'intervalle maximum entre les envois d'information sur les " ++"imprimantes." ++ ++# type: TP ++#: cupsd.conf.man.in:140 ++#, no-wrap ++msgid "BrowseOrder allow,deny" ++msgstr "BrowseOrder allow,deny" ++ ++# type: TP ++#: cupsd.conf.man.in:142 ++#, no-wrap ++msgid "BrowseOrder deny,allow" ++msgstr "BrowseOrder deny,allow" ++ ++# type: Plain text ++#: cupsd.conf.man.in:146 ++msgid "" ++"Specifies the order of printer information access control (allow,deny or " ++"deny,allow)" ++msgstr "" ++"Définir l'ordre du contrôle d'accès aux informations des imprimantes (allow," ++"deny ou deny,allow)." ++ ++# type: TP ++#: cupsd.conf.man.in:146 ++#, no-wrap ++msgid "BrowsePoll host-or-ip-address" ++msgstr "BrowsePoll serveur-ou-adresse_ip" ++ ++# type: Plain text ++#: cupsd.conf.man.in:150 ++msgid "Specifies a server to poll for printer information." ++msgstr "" ++"Définir un serveur à interroger régulièrement pour les informations sur les " ++"imprimantes." ++ ++# type: TP ++#: cupsd.conf.man.in:150 ++#, no-wrap ++msgid "BrowsePort port" ++msgstr "BrowsePort port" ++ ++# type: Plain text ++#: cupsd.conf.man.in:154 ++msgid "Specifies the port to listen to for printer information packets." ++msgstr "" ++"Définir le port utilisé pour écouter les informations sur les imprimantes." ++ ++# type: TP ++#: cupsd.conf.man.in:154 ++#, no-wrap ++msgid "BrowseProtocols [All] [CUPS] [DNSSD] [LDAP] [SLP]" ++msgstr "BrowseProtocols [All] [CUPS] [DNSSD] [LDAP] [SLP]" ++ ++# type: Plain text ++#: cupsd.conf.man.in:158 ++msgid "Specifies the protocols to use for printer browsing." ++msgstr "" ++"Définir les protocoles réseaux à utiliser pour la recherche d'imprimantes." ++ ++# type: TP ++#: cupsd.conf.man.in:158 ++#, no-wrap ++msgid "BrowseLocalProtocols [All] [CUPS] [DNSSD] [LDAP] [SLP]" ++msgstr "BrowseLocalProtocols [All] [CUPS] [DNSSD] [LDAP] [SLP]" ++ ++# type: Plain text ++#: cupsd.conf.man.in:162 ++msgid "Specifies the protocols to use for local printer browsing." ++msgstr "" ++"Définir les protocoles réseaux à utiliser pour la recherche d'imprimantes " ++"locales." ++ ++# type: TP ++#: cupsd.conf.man.in:162 ++#, no-wrap ++msgid "BrowseRemoteProtocols [All] [CUPS] [DNSSD] [LDAP] [SLP]" ++msgstr "BrowseRemoteProtocols [All] [CUPS] [DNSSD] [LDAP] [SLP]" ++ ++# type: Plain text ++#: cupsd.conf.man.in:166 ++msgid "Specifies the protocols to use for remote printer browsing." ++msgstr "" ++"Définir les protocoles réseaux à utiliser pour la recherche d'imprimantes " ++"distantes." ++ ++# type: TP ++#: cupsd.conf.man.in:166 ++#, no-wrap ++msgid "BrowseRelay from-address to-address" ++msgstr "BrowseRelay depuis_adresse vers_adresse" ++ ++# type: Plain text ++#: cupsd.conf.man.in:171 ++msgid "" ++"Specifies that printer information packets should be relayed from one host " ++"or network to another." ++msgstr "" ++"Indiquer que les informations sur les imprimantes doivent être relayés " ++"depuis une machine ou un réseau vers un autre." ++ ++# type: TP ++#: cupsd.conf.man.in:171 ++#, no-wrap ++msgid "BrowseShortNames Yes" ++msgstr "BrowseShortNames Yes" ++ ++# type: TP ++#: cupsd.conf.man.in:173 ++#, no-wrap ++msgid "BrowseShortNames No" ++msgstr "BrowseShortNames No" ++ ++# type: Plain text ++#: cupsd.conf.man.in:179 ++msgid "" ++"Specifies whether remote printers will use short names (\"printer\") or not " ++"(\"printer@server\"). This option is ignored if more than one remote printer " ++"exists with the same name." ++msgstr "" ++"Définir si les imprimantes distantes utilisent les noms abrégés " ++"(« imprimante ») ou non (« imprimante@serveur »). Cette option est ignorée si " ++"plus d'une imprimante distante a le même nom." ++ ++# type: TP ++#: cupsd.conf.man.in:179 ++#, no-wrap ++msgid "BrowseTimeout seconds" ++msgstr "BrowseTimeout secondes" ++ ++# type: Plain text ++#: cupsd.conf.man.in:184 ++msgid "" ++"Specifies the maximum interval between printer information updates before " ++"remote printers will be removed from the list of available printers." ++msgstr "" ++"Définir l'intervalle maximum de temps entre deux mises à jour d'informations " ++"des imprimantes distantes avant que celles-ci ne soient supprimées de la " ++"liste des imprimantes disponibles." ++ ++# type: TP ++#: cupsd.conf.man.in:184 ++#, no-wrap ++msgid "Browsing Yes" ++msgstr "Browsing Yes" ++ ++# type: TP ++#: cupsd.conf.man.in:186 ++#, no-wrap ++msgid "Browsing No" ++msgstr "Browsing No" ++ ++# type: Plain text ++#: cupsd.conf.man.in:190 ++msgid "Specifies whether or not remote printer browsing should be enabled." ++msgstr "Définir si la recherche des imprimantes distantes doit être activée." ++ ++# NOTE: bannière à traduire ? ++# type: TP ++#: cupsd.conf.man.in:190 ++#, no-wrap ++msgid "Classification banner" ++msgstr "Classification bannière" ++ ++# type: Plain text ++#: cupsd.conf.man.in:194 ++msgid "Specifies the security classification of the server." ++msgstr "Définir le niveau de classification du serveur." ++ ++# type: TP ++#: cupsd.conf.man.in:194 ++#, no-wrap ++msgid "ClassifyOverride Yes" ++msgstr "ClassifyOverride Yes" ++ ++# type: TP ++#: cupsd.conf.man.in:196 ++#, no-wrap ++msgid "ClassifyOverride No" ++msgstr "ClassifyOverride No" ++ ++# type: Plain text ++#: cupsd.conf.man.in:201 ++msgid "" ++"Specifies whether to allow users to override the classification of " ++"individual print jobs." ++msgstr "" ++"Définir si les utilisateurs sont autorisés à modifier la classification de " ++"leurs travaux d'impression." ++ ++# type: TP ++#: cupsd.conf.man.in:201 ++#, no-wrap ++msgid "ConfigFilePerm mode" ++msgstr "ConfigFilePerm mode" ++ ++# type: Plain text ++#: cupsd.conf.man.in:206 ++msgid "" ++"Specifies the permissions for all configuration files that the scheduler " ++"writes." ++msgstr "" ++"Définir les permissions à utiliser pour les fichiers de configuration écrits " ++"par l'ordonnanceur." ++ ++# type: TP ++#: cupsd.conf.man.in:206 ++#, no-wrap ++msgid "DataDir path" ++msgstr "DataDir path" ++ ++# type: Plain text ++#: cupsd.conf.man.in:210 ++msgid "Specified the directory where data files can be found." ++msgstr "Définir le répertoire où se trouvent les fichiers de données." ++ ++# type: TP ++#: cupsd.conf.man.in:210 ++#, no-wrap ++msgid "DefaultAuthType Basic" ++msgstr "DefaultAuthType Basic" ++ ++# type: TP ++#: cupsd.conf.man.in:212 ++#, no-wrap ++msgid "DefaultAuthType BasicDigest" ++msgstr "DefaultAuthType BasicDigest" ++ ++# type: TP ++#: cupsd.conf.man.in:214 ++#, no-wrap ++msgid "DefaultAuthType Digest" ++msgstr "DefaultAuthType Digest" ++ ++# type: TP ++#: cupsd.conf.man.in:216 ++#, no-wrap ++msgid "DefaultAuthType Negotiate" ++msgstr "DefaultAuthType Negotiate" ++ ++# type: Plain text ++#: cupsd.conf.man.in:220 ++msgid "Specifies the default type of authentication to use." ++msgstr "Définir le type d'identification à utiliser par défaut." ++ ++# type: TP ++#: cupsd.conf.man.in:220 ++#, no-wrap ++msgid "DefaultCharset charset" ++msgstr "DefaultCharset jeux_de_caractères" ++ ++# type: Plain text ++#: cupsd.conf.man.in:224 ++msgid "Specifies the default character set to use for text." ++msgstr "Définir le jeu de caractères par défaut à utiliser pour le texte." ++ ++# type: TP ++#: cupsd.conf.man.in:224 ++#, no-wrap ++msgid "DefaultLanguage locale" ++msgstr "DefaultLanguage locale" ++ ++# type: Plain text ++#: cupsd.conf.man.in:228 ++msgid "Specifies the default language to use for text and web content." ++msgstr "" ++"Définir la langue par défaut à utiliser pour les textes et le site web." ++ ++# type: TP ++#: cupsd.conf.man.in:228 ++#, no-wrap ++msgid "DefaultPolicy policy-name" ++msgstr "DefaultPolicy nom" ++ ++# type: Plain text ++#: cupsd.conf.man.in:232 ++msgid "Specifies the default access policy to use." ++msgstr "Indiquer la politique d'accès par défaut." ++ ++# type: TP ++#: cupsd.conf.man.in:232 ++#, no-wrap ++msgid "DefaultShared Yes" ++msgstr "DefaultShared Yes" ++ ++# type: TP ++#: cupsd.conf.man.in:234 ++#, no-wrap ++msgid "DefaultShared No" ++msgstr "DefaultShared No" ++ ++# type: Plain text ++#: cupsd.conf.man.in:238 ++msgid "Specifies whether local printers are shared by default." ++msgstr "Définir si les imprimantes locales sont partagées par défaut." ++ ++# type: TP ++#: cupsd.conf.man.in:238 ++#, no-wrap ++msgid "Deny all" ++msgstr "Deny all" ++ ++# type: TP ++#: cupsd.conf.man.in:240 ++#, no-wrap ++msgid "Deny none" ++msgstr "Deny none" ++ ++# type: TP ++#: cupsd.conf.man.in:242 ++#, no-wrap ++msgid "Deny host.domain.com" ++msgstr "Deny serveur.domaine.com" ++ ++# type: TP ++#: cupsd.conf.man.in:244 ++#, no-wrap ++msgid "Deny *.domain.com" ++msgstr "Deny *.domaine.com" ++ ++# type: TP ++#: cupsd.conf.man.in:246 ++#, no-wrap ++msgid "Deny ip-address" ++msgstr "Deny adresse_ip" ++ ++# type: TP ++#: cupsd.conf.man.in:248 ++#, no-wrap ++msgid "Deny ip-address/netmask" ++msgstr "Deny adresse_ip/masque_sous_réseau" ++ ++# type: TP ++#: cupsd.conf.man.in:250 ++#, no-wrap ++msgid "Deny ip-address/mm" ++msgstr "Deny adresse_ip/mm" ++ ++# type: TP ++#: cupsd.conf.man.in:252 ++#, no-wrap ++msgid "Deny @IF(name)" ++msgstr "Deny @IF(nom)" ++ ++# type: TP ++#: cupsd.conf.man.in:254 ++#, no-wrap ++msgid "Deny @LOCAL" ++msgstr "Deny @LOCAL" ++ ++# type: Plain text ++#: cupsd.conf.man.in:258 ++msgid "Denies access to the named host or address." ++msgstr "Interdire l'accès à une machine ou à une adresse IP donnée." ++ ++# type: TP ++#: cupsd.conf.man.in:258 ++#, no-wrap ++msgid "DocumentRoot directory" ++msgstr "DocumentRoot répertoire" ++ ++# type: Plain text ++#: cupsd.conf.man.in:262 ++msgid "Specifies the root directory for the internal web server documents." ++msgstr "Définir le répertoire racine des documents du serveur web interne." ++ ++# type: TP ++#: cupsd.conf.man.in:271 ++#, no-wrap ++msgid "ErrorLog filename" ++msgstr "ErrorLog fichier" ++ ++# type: TP ++#: cupsd.conf.man.in:273 ++#, no-wrap ++msgid "ErrorLog syslog" ++msgstr "ErrorLog syslog" ++ ++# type: Plain text ++#: cupsd.conf.man.in:277 ++msgid "Specifies the error log filename." ++msgstr "Définir le nom du fichier traçant les erreurs." ++ ++# type: TP ++#: cupsd.conf.man.in:277 ++#, no-wrap ++msgid "FileDevice Yes" ++msgstr "FileDevice Yes" ++ ++# type: TP ++#: cupsd.conf.man.in:279 ++#, no-wrap ++msgid "FileDevice No" ++msgstr "FileDevice No" ++ ++# type: Plain text ++#: cupsd.conf.man.in:284 ++msgid "" ++"Specifies whether the file pseudo-device can be used for new printer queues." ++msgstr "" ++"Indiquer si un fichier de pseudo-périphérique peut être utilisé pour les " ++"queues d'impression." ++ ++# type: TP ++#: cupsd.conf.man.in:284 ++#, no-wrap ++msgid "FilterLimit limit" ++msgstr "FilterLimit limite" ++ ++# type: Plain text ++#: cupsd.conf.man.in:288 ++msgid "Specifies the maximum cost of filters that are run concurrently." ++msgstr "Définir le coût maximum des filtres lancés simultanément." ++ ++# type: TP ++#: cupsd.conf.man.in:288 ++#, no-wrap ++msgid "FilterNice nice-value" ++msgstr "FilterNice priorité" ++ ++# type: Plain text ++#: cupsd.conf.man.in:293 ++msgid "" ++"Specifies the scheduling priority (\"nice\" value) of filters that are run " ++"to print a job." ++msgstr "" ++"Définir la priorité (valeur «\\ nice\\ ») des filtres exécutés pour une " ++"impression." ++ ++# type: TP ++#: cupsd.conf.man.in:293 ++#, no-wrap ++msgid "FontPath directory[:directory:...]" ++msgstr "FontPath répertoire[:répertoire:...]" ++ ++# type: Plain text ++#: cupsd.conf.man.in:297 ++msgid "Specifies the search path for fonts." ++msgstr "Définir le chemin de recherche des polices." ++ ++# type: TP ++#: cupsd.conf.man.in:297 ++#, no-wrap ++msgid "Group group-name-or-number" ++msgstr "Group nom_groupe-ou-identifiant_numérique" ++ ++# type: Plain text ++#: cupsd.conf.man.in:302 ++msgid "" ++"Specifies the group name or ID that will be used when executing external " ++"programs." ++msgstr "" ++"Définir le nom du groupe ou l'identifiant numérique du groupe qui sera " ++"utilisé lors de l'exécution de programmes externes." ++ ++# type: TP ++#: cupsd.conf.man.in:302 ++#, no-wrap ++msgid "HideImplicitMembers Yes" ++msgstr "HideImplicitMembers Yes" ++ ++# type: TP ++#: cupsd.conf.man.in:304 ++#, no-wrap ++msgid "HideImplicitMembers No" ++msgstr "HideImplicitMembers No" ++ ++# type: Plain text ++#: cupsd.conf.man.in:308 ++msgid "Specifies whether to hide members of implicit classes." ++msgstr "Définir s'il faut cacher ou non les membres des classes implicites." ++ ++# type: TP ++#: cupsd.conf.man.in:308 ++#, no-wrap ++msgid "HostNameLookups On" ++msgstr "HostNameLookups On" ++ ++# type: TP ++#: cupsd.conf.man.in:310 ++#, no-wrap ++msgid "HostNameLookups Off" ++msgstr "HostNameLookups Off" ++ ++# type: TP ++#: cupsd.conf.man.in:312 ++#, no-wrap ++msgid "HostNameLookups Double" ++msgstr "HostNameLookups Double" ++ ++# type: Plain text ++#: cupsd.conf.man.in:316 ++msgid "Specifies whether or not to do reverse lookups on client addresses." ++msgstr "" ++"Définir s'il faut effectuer des recherches de noms à partir des adresses des " ++"clients." ++ ++# type: TP ++#: cupsd.conf.man.in:316 ++#, no-wrap ++msgid "ImplicitAnyClasses Yes" ++msgstr "ImplicitAnyClasses Yes" ++ ++# type: TP ++#: cupsd.conf.man.in:318 ++#, no-wrap ++msgid "ImplicitAnyClasses No" ++msgstr "ImplicitAnyClasses No" ++ ++# type: Plain text ++#: cupsd.conf.man.in:324 ++msgid "" ++"Specifies whether or not to create implicit classes for local and remote " ++"printers, e.g. \"AnyPrinter\" from \"Printer\", \"Printer@server1\", and " ++"\"Printer@server2\"." ++msgstr "" ++"Indiquer s'il faut créer des classes implicites pour les imprimantes locales " ++"et distantes (par exemple « UneImprimante » pour « Imprimante », " ++"« Imprimante@serveur1 » et « Imprimante@serveur2 »)." ++ ++# type: TP ++#: cupsd.conf.man.in:324 ++#, no-wrap ++msgid "ImplicitClasses Yes" ++msgstr "ImplicitClasses Yes" ++ ++# type: TP ++#: cupsd.conf.man.in:326 ++#, no-wrap ++msgid "ImplicitClasses No" ++msgstr "ImplicitClasses No" ++ ++# type: Plain text ++#: cupsd.conf.man.in:331 ++msgid "" ++"Specifies whether or not to create implicit classes from identical remote " ++"printers." ++msgstr "" ++"Indiquer s'il faut créer une classe implicite pour les imprimantes distantes " ++"identiques." ++ ++# type: TP ++#: cupsd.conf.man.in:331 ++#, no-wrap ++msgid "Include filename" ++msgstr "Include fichier" ++ ++# type: Plain text ++#: cupsd.conf.man.in:335 ++msgid "Includes the named file." ++msgstr "Inclure le fichier donné." ++ ++# type: TP ++#: cupsd.conf.man.in:335 ++#, no-wrap ++msgid "JobRetryInterval seconds" ++msgstr "JobRetryInterval secondes" ++ ++# type: Plain text ++#: cupsd.conf.man.in:339 ++msgid "Specifies the interval between retries of jobs in seconds." ++msgstr "" ++"Indiquer l'intervalle entre deux essais d'impression d'un travail, en " ++"secondes." ++ ++# type: TP ++#: cupsd.conf.man.in:339 ++#, no-wrap ++msgid "JobRetryLimit count" ++msgstr "JobRetryLimit nombre" ++ ++# type: Plain text ++#: cupsd.conf.man.in:343 ++msgid "Specifies the number of retries that are done for jobs." ++msgstr "Indiquer le nombre d'essais maximum pour les travaux." ++ ++# type: TP ++#: cupsd.conf.man.in:343 ++#, no-wrap ++msgid "KeepAlive Yes" ++msgstr "KeepAlive Yes" ++ ++# type: TP ++#: cupsd.conf.man.in:345 ++#, no-wrap ++msgid "KeepAlive No" ++msgstr "KeepAlive No" ++ ++# type: Plain text ++#: cupsd.conf.man.in:349 ++msgid "Specifies whether to support HTTP keep-alive connections." ++msgstr "Définir s'il faut utiliser HTTP-Keep-Alive." ++ ++# type: TP ++#: cupsd.conf.man.in:349 ++#, no-wrap ++msgid "KeepAliveTimeout seconds" ++msgstr "KeepAliveTimeout secondes" ++ ++# type: Plain text ++#: cupsd.conf.man.in:353 ++msgid "Specifies the amount of time that connections are kept alive." ++msgstr "Définir la durée pendant laquelle les connexion sont conservées." ++ ++# type: TP ++#: cupsd.conf.man.in:353 ++#, no-wrap ++msgid "Krb5Keytab filename" ++msgstr "Krb5Keytab fichier" ++ ++# type: Plain text ++#: cupsd.conf.man.in:357 ++msgid "Overrides the Kerberos key tab location." ++msgstr "Changer l'emplacement du fichier de clés (« key tab ») Kerberos." ++ ++# type: TP ++#: cupsd.conf.man.in:357 ++#, no-wrap ++msgid "ELimit operationsE ... E/LimitE" ++msgstr "ELimit operationsE ... E/LimitE" ++ ++# type: Plain text ++#: cupsd.conf.man.in:361 ++msgid "Specifies the IPP operations that are being limited inside a policy." ++msgstr "Indiquer les opérations IPP non autorisés dans une certaine politique." ++ ++# type: TP ++#: cupsd.conf.man.in:361 ++#, no-wrap ++msgid "ELimit methodsE ... E/LimitE" ++msgstr "ELimit methodesE ... E/LimitE" ++ ++# type: TP ++#: cupsd.conf.man.in:363 ++#, no-wrap ++msgid "ELimitExcept methodsE ... E/LimitExceptE" ++msgstr "ELimitExcept methodesE ... E/LimitExceptE" ++ ++# type: Plain text ++#: cupsd.conf.man.in:367 ++msgid "Specifies the HTTP methods that are being limited inside a location." ++msgstr "Définir les méthodes HTTP interdites pour un lieu donné." ++ ++# type: TP ++#: cupsd.conf.man.in:367 ++#, no-wrap ++msgid "LimitRequestBody" ++msgstr "LimitRequestBody" ++ ++# type: Plain text ++#: cupsd.conf.man.in:371 ++msgid "Specifies the maximum size of any print job request." ++msgstr "Définir la taille maximale des demandes de travaux d'impression." ++ ++# type: TP ++#: cupsd.conf.man.in:371 ++#, no-wrap ++msgid "Listen ip-address:port" ++msgstr "Listen adress_ip:port" ++ ++# type: TP ++#: cupsd.conf.man.in:373 ++#, no-wrap ++msgid "Listen *:port" ++msgstr "Listen *:port" ++ ++# type: TP ++#: cupsd.conf.man.in:375 ++#, no-wrap ++msgid "Listen /path/to/domain/socket" ++msgstr "Listen /chemin/socket/domaine" ++ ++# type: Plain text ++#: cupsd.conf.man.in:379 ++msgid "Listens to the specified address and port or domain socket path." ++msgstr "" ++"Écouter à l'adresse et au port indiqué ou sur la socket de domaine dont le " ++"chemin est indiqué." ++ ++# type: TP ++#: cupsd.conf.man.in:379 ++#, no-wrap ++msgid "ELocation /pathE ... E/LocationE" ++msgstr "ELocation /cheminE ... E/LocationE" ++ ++# type: Plain text ++#: cupsd.conf.man.in:383 ++msgid "Specifies access control for the named location." ++msgstr "Définir les contrôles d'accès pour un lieu donné." ++ ++# type: TP ++#: cupsd.conf.man.in:383 ++#, no-wrap ++msgid "LogFilePerm mode" ++msgstr "LogFilePerm mode" ++ ++# type: Plain text ++#: cupsd.conf.man.in:387 ++msgid "Specifies the permissions for all log files that the scheduler writes." ++msgstr "" ++"Définir les permissions des fichiers journaux écrits par l'ordonnanceur." ++ ++# type: TP ++#: cupsd.conf.man.in:387 ++#, no-wrap ++msgid "LogLevel alert" ++msgstr "LogLevel alert" ++ ++# type: TP ++#: cupsd.conf.man.in:389 ++#, no-wrap ++msgid "LogLevel crit" ++msgstr "LogLevel crit" ++ ++# type: TP ++#: cupsd.conf.man.in:391 ++#, no-wrap ++msgid "LogLevel debug2" ++msgstr "LogLevel debug2" ++ ++# type: TP ++#: cupsd.conf.man.in:393 ++#, no-wrap ++msgid "LogLevel debug" ++msgstr "LogLevel debug" ++ ++# type: TP ++#: cupsd.conf.man.in:395 ++#, no-wrap ++msgid "LogLevel emerg" ++msgstr "LogLevel emerg" ++ ++# type: TP ++#: cupsd.conf.man.in:397 ++#, no-wrap ++msgid "LogLevel error" ++msgstr "LogLevel error" ++ ++# type: TP ++#: cupsd.conf.man.in:399 ++#, no-wrap ++msgid "LogLevel info" ++msgstr "LogLevel info" ++ ++# type: TP ++#: cupsd.conf.man.in:401 ++#, no-wrap ++msgid "LogLevel none" ++msgstr "LogLevel none" ++ ++# type: TP ++#: cupsd.conf.man.in:403 ++#, no-wrap ++msgid "LogLevel notice" ++msgstr "LogLevel notice" ++ ++# type: TP ++#: cupsd.conf.man.in:405 ++#, no-wrap ++msgid "LogLevel warn" ++msgstr "LogLevel warn" ++ ++# type: Plain text ++#: cupsd.conf.man.in:409 ++msgid "Specifies the logging level for the ErrorLog file." ++msgstr "Définir le niveau de trace pour le journal des erreurs." ++ ++# type: TP ++#: cupsd.conf.man.in:409 ++#, no-wrap ++msgid "MaxClients number" ++msgstr "MaxClients nombre" ++ ++# type: Plain text ++#: cupsd.conf.man.in:413 ++msgid "Specifies the maximum number of simultaneous clients to support." ++msgstr "Définir le nombre maximum de clients simultanés." ++ ++# type: TP ++#: cupsd.conf.man.in:413 ++#, no-wrap ++msgid "MaxClientsPerHost number" ++msgstr "MaxClientsPerHost nombre" ++ ++# type: Plain text ++#: cupsd.conf.man.in:418 ++msgid "" ++"Specifies the maximum number of simultaneous clients to support from a " ++"single address." ++msgstr "" ++"Définir le nombre maximum de clients simultanés provenant de la même adresse." ++ ++# type: TP ++#: cupsd.conf.man.in:418 ++#, no-wrap ++msgid "MaxCopies number" ++msgstr "MaxCopies nombre" ++ ++# type: Plain text ++#: cupsd.conf.man.in:422 ++msgid "" ++"Specifies the maximum number of copies that a user can print of each job." ++msgstr "" ++"Définir le nombre maximum de copies qu'un utilisateur peut effectuer pour un " ++"travail d'impression." ++ ++# type: TP ++#: cupsd.conf.man.in:422 ++#, no-wrap ++msgid "MaxJobs number" ++msgstr "MaxJobs nombre" ++ ++# type: Plain text ++#: cupsd.conf.man.in:426 ++msgid "Specifies the maximum number of simultaneous jobs to support." ++msgstr "Définir le nombre maximum de travaux simultanés." ++ ++# type: TP ++#: cupsd.conf.man.in:426 ++#, no-wrap ++msgid "MaxJobsPerPrinter number" ++msgstr "MaxJobsPerPrinter nombre" ++ ++# type: Plain text ++#: cupsd.conf.man.in:430 ++msgid "" ++"Specifies the maximum number of simultaneous jobs per printer to support." ++msgstr "Définir le nombre maximum de travaux simultanés par imprimante." ++ ++# type: TP ++#: cupsd.conf.man.in:430 ++#, no-wrap ++msgid "MaxJobsPerUser number" ++msgstr "MaxJobsPerUser nombre" ++ ++# type: Plain text ++#: cupsd.conf.man.in:434 ++msgid "Specifies the maximum number of simultaneous jobs per user to support." ++msgstr "Définir le nombre maximum de travaux simultanés par utilisateur." ++ ++# type: TP ++#: cupsd.conf.man.in:434 ++#, no-wrap ++msgid "MaxLogSize number-bytes" ++msgstr "MaxLogSize nombre_octets" ++ ++# type: Plain text ++#: cupsd.conf.man.in:439 ++msgid "" ++"Specifies the maximum size of the log files before they are rotated (0 to " ++"disable rotation)" ++msgstr "" ++"Définir la taille maximale des fichiers de trace. Au-delà de cette taille, " ++"les fichiers sont recyclés (0 pour supprimer la rotation des fichiers." ++ ++# type: TP ++#: cupsd.conf.man.in:439 ++#, no-wrap ++msgid "MaxRequestSize number-bytes" ++msgstr "MaxRequestSize nombre_octets" ++ ++# type: Plain text ++#: cupsd.conf.man.in:443 ++msgid "Specifies the maximum request/file size in bytes (0 for no limit)" ++msgstr "" ++"Définir la taille maximale des fichiers et des requêtes à imprimer. La " ++"taille est exprimée en octets (0 indique qu'il n'y a pas de limite)." ++ ++# type: TP ++#: cupsd.conf.man.in:443 ++#, no-wrap ++msgid "Order allow,deny" ++msgstr "Order allow,deny" ++ ++# type: TP ++#: cupsd.conf.man.in:445 ++#, no-wrap ++msgid "Order deny,allow" ++msgstr "Order deny,allow" ++ ++# type: Plain text ++#: cupsd.conf.man.in:449 ++msgid "Specifies the order of HTTP access control (allow,deny or deny,allow)" ++msgstr "" ++"Définir l'ordre pour le contrôle d'accès HTTP (allow,deny ou deny,allow)." ++ ++# type: TP ++#: cupsd.conf.man.in:449 ++#, no-wrap ++msgid "PageLog filename" ++msgstr "PageLog fichier" ++ ++# type: TP ++#: cupsd.conf.man.in:451 ++#, no-wrap ++msgid "PageLog syslog" ++msgstr "PageLog syslog" ++ ++# type: Plain text ++#: cupsd.conf.man.in:455 ++msgid "Specifies the page log filename." ++msgstr "Définir le fichier de trace des pages web visitées." ++ ++# type: TP ++#: cupsd.conf.man.in:455 ++#, no-wrap ++msgid "PassEnv variable [... variable]" ++msgstr "PassEnv variable [... variable]" ++ ++# type: Plain text ++#: cupsd.conf.man.in:459 ++msgid "Passes the specified environment variable(s) to child processes." ++msgstr "Passer les variables d'environnement spécifiées aux processus fils." ++ ++# type: TP ++#: cupsd.conf.man.in:459 ++#, no-wrap ++msgid "EPolicy nameE ... E/PolicyE" ++msgstr "EPolicy nomE ... E/PolicyE" ++ ++# type: Plain text ++#: cupsd.conf.man.in:463 ++msgid "Specifies access control for the named policy." ++msgstr "Définir les contrôles d'accès pour la politique donnée." ++ ++# type: TP ++#: cupsd.conf.man.in:463 ++#, no-wrap ++msgid "Port number" ++msgstr "Port nombre" ++ ++# type: Plain text ++#: cupsd.conf.man.in:467 ++msgid "Specifies a port number to listen to for HTTP requests." ++msgstr "Définir le numéro du port où écouter les requêtes HTTP." ++ ++# type: TP ++#: cupsd.conf.man.in:467 ++#, no-wrap ++msgid "PreserveJobFiles Yes" ++msgstr "PreserveJobFiles Yes" ++ ++# type: TP ++#: cupsd.conf.man.in:469 ++#, no-wrap ++msgid "PreserveJobFiles No" ++msgstr "PreserveJobFiles No" ++ ++# type: Plain text ++#: cupsd.conf.man.in:473 ++msgid "Specifies whether or not to preserve job files after they are printed." ++msgstr "" ++"Définir s'il faut conserver ou non les fichiers de travail après impression." ++ ++# type: TP ++#: cupsd.conf.man.in:473 ++#, no-wrap ++msgid "PreserveJobHistory Yes" ++msgstr "PreserveJobHistory Yes" ++ ++# type: TP ++#: cupsd.conf.man.in:475 ++#, no-wrap ++msgid "PreserveJobHistory No" ++msgstr "PreserveJobHistory No" ++ ++# type: Plain text ++#: cupsd.conf.man.in:480 ++msgid "" ++"Specifies whether or not to preserve the job history after they are printed." ++msgstr "" ++"Définir s'il faut conserver ou non l'historique des demandes d'impression " ++"une fois qu'elles sont terminées." ++ ++# type: TP ++#: cupsd.conf.man.in:480 ++#, no-wrap ++msgid "Printcap" ++msgstr "Printcap" ++ ++# type: TP ++#: cupsd.conf.man.in:482 ++#, no-wrap ++msgid "Printcap filename" ++msgstr "Printcap fichier" ++ ++# type: Plain text ++#: cupsd.conf.man.in:489 ++msgid "" ++"Specifies the filename for a printcap file that is updated automatically " ++"with a list of available printers (needed for legacy applications); " ++"specifying Printcap with no filename disables printcap generation." ++msgstr "" ++"Définir l'emplacement du fichier printcap, contenant la liste des " ++"imprimantes disponibles, et qui est mis à jour automatiquement. Ce fichier " ++"est indispensable aux applications classiques. Si aucun fichier printcap " ++"n'est précisé, la génération du fichier printcap sera désactivée." ++ ++# type: TP ++#: cupsd.conf.man.in:489 ++#, no-wrap ++msgid "PrintcapFormat bsd" ++msgstr "PrintcapFormat bsd" ++ ++# type: TP ++#: cupsd.conf.man.in:491 ++#, no-wrap ++msgid "PrintcapFormat solaris" ++msgstr "PrintcapFormat solaris" ++ ++# type: Plain text ++#: cupsd.conf.man.in:495 ++msgid "Specifies the format of the printcap file." ++msgstr "Définir le format du fichier printcap." ++ ++# type: TP ++#: cupsd.conf.man.in:495 ++#, no-wrap ++msgid "PrintcapGUI" ++msgstr "PrintcapGUI" ++ ++# type: TP ++#: cupsd.conf.man.in:497 ++#, no-wrap ++msgid "PrintcapGUI gui-program-filename" ++msgstr "PrintcapGUI fichier_interface_graphique" ++ ++# type: Plain text ++#: cupsd.conf.man.in:503 ++msgid "" ++"Specifies whether to generate option panel definition files on some " ++"operating systems. When provided with no program filename, disables option " ++"panel definition files." ++msgstr "" ++"Définir s'il faut générer des fichiers de définition d'options pour des " ++"systèmes d'exploitation. Quand c'est fournit sans nom de fichier d'un " ++"programme, il n'y a pas de fichier de définition d'options." ++ ++# type: TP ++#: cupsd.conf.man.in:503 ++#, no-wrap ++msgid "ReloadTimeout seconds" ++msgstr "ReloadTimeout secondes" ++ ++# type: Plain text ++#: cupsd.conf.man.in:508 ++msgid "" ++"Specifies the amount of time to wait for job completion before restarting " ++"the scheduler." ++msgstr "" ++"Définir le temps maximum à attendre pour la fin d'un travail avant de " ++"redémarrer l'ordonnanceur." ++ ++# type: TP ++#: cupsd.conf.man.in:508 ++#, no-wrap ++msgid "RemoteRoot user-name" ++msgstr "RemoteRoot utilisateur" ++ ++# type: Plain text ++#: cupsd.conf.man.in:513 ++msgid "" ++"Specifies the username that is associated with unauthenticated root accesses." ++msgstr "Définir l'utilisateur associé aux accès root non identifié." ++ ++# type: TP ++#: cupsd.conf.man.in:513 ++#, no-wrap ++msgid "RequestRoot directory" ++msgstr "RequestRoot répertoire" ++ ++# type: Plain text ++#: cupsd.conf.man.in:518 ++msgid "" ++"Specifies the directory to store print jobs and other HTTP request data." ++msgstr "" ++"Définir le répertoire où sont stockés les travaux et les données des " ++"requêtes HTTP." ++ ++# type: TP ++#: cupsd.conf.man.in:518 ++#, no-wrap ++msgid "Require group group-name-list" ++msgstr "Require group liste_groupes" ++ ++# type: TP ++#: cupsd.conf.man.in:520 ++#, no-wrap ++msgid "Require user user-name-list" ++msgstr "Require user liste_utilisateurs" ++ ++# type: TP ++#: cupsd.conf.man.in:522 ++#, no-wrap ++msgid "Require valid-user" ++msgstr "Require valid-user" ++ ++# type: Plain text ++#: cupsd.conf.man.in:526 ++msgid "Specifies that user or group authentication is required." ++msgstr "" ++"Indiquer qu'une identification par utilisateur ou par groupe est nécessaire." ++ ++# type: TP ++#: cupsd.conf.man.in:526 ++#, no-wrap ++msgid "RIPCache bytes" ++msgstr "RIPCache octets" ++ ++# type: Plain text ++#: cupsd.conf.man.in:531 ++msgid "" ++"Specifies the maximum amount of memory to use when converting images and " ++"PostScript files to bitmaps for a printer." ++msgstr "" ++"Définir la taille maximale de mémoire à utiliser lors de la conversion " ++"d'images ou de fichiers PostScript en fichier bitmap pour une imprimante." ++ ++# type: TP ++#: cupsd.conf.man.in:531 ++#, no-wrap ++msgid "Satisfy all" ++msgstr "Satisfy all" ++ ++# type: TP ++#: cupsd.conf.man.in:533 ++#, no-wrap ++msgid "Satisfy any" ++msgstr "Satisfy any" ++ ++# type: Plain text ++#: cupsd.conf.man.in:538 ++msgid "" ++"Specifies whether all or any limits set for a Location must be satisfied to " ++"allow access." ++msgstr "" ++"Définir si toutes les limites (« all »), ou seulement une des limites " ++"(« any ») définies pour un lieu donné doivent être satisfaites pour permettre " ++"l'accès." ++ ++# type: TP ++#: cupsd.conf.man.in:538 ++#, no-wrap ++msgid "ServerAdmin user@domain.com" ++msgstr "ServerAdmin utilisateur@domaine.com" ++ ++# type: Plain text ++#: cupsd.conf.man.in:542 ++msgid "Specifies the email address of the server administrator." ++msgstr "Définir l'adresse électronique de l'administrateur du serveur." ++ ++# type: TP ++#: cupsd.conf.man.in:542 ++#, no-wrap ++msgid "ServerBin directory" ++msgstr "ServerBin répertoire" ++ ++# type: Plain text ++#: cupsd.conf.man.in:547 ++msgid "" ++"Specifies the directory where backends, CGIs, daemons, and filters may be " ++"found." ++msgstr "" ++"Définir le répertoire où les applications dorsales, les CGI, les démons et " ++"les filtres sont stockés." ++ ++# type: TP ++#: cupsd.conf.man.in:547 ++#, no-wrap ++msgid "ServerCertificate filename" ++msgstr "ServerCertificate fichier" ++ ++# type: Plain text ++#: cupsd.conf.man.in:551 ++msgid "Specifies the encryption certificate to use." ++msgstr "Définir le certificat à utiliser pour le chiffrement." ++ ++# type: TP ++#: cupsd.conf.man.in:551 ++#, no-wrap ++msgid "ServerKey filename" ++msgstr "ServerKey fichier" ++ ++# type: Plain text ++#: cupsd.conf.man.in:555 ++msgid "Specifies the encryption key to use." ++msgstr "Définir la clé de chiffrement à utiliser." ++ ++# type: TP ++#: cupsd.conf.man.in:555 ++#, no-wrap ++msgid "ServerName hostname-or-ip-address" ++msgstr "ServerName hôte-ou-adresse_ip" ++ ++# type: Plain text ++#: cupsd.conf.man.in:559 ++msgid "Specifies the fully-qualified hostname of the server." ++msgstr "Définir le nom complet du serveur." ++ ++# type: TP ++#: cupsd.conf.man.in:559 ++#, no-wrap ++msgid "ServerRoot directory" ++msgstr "ServerRoot répertoire" ++ ++# type: Plain text ++#: cupsd.conf.man.in:563 ++msgid "" ++"Specifies the directory where the server configuration files can be found." ++msgstr "" ++"Définir le répertoire où les fichiers de configuration du serveur sont " ++"stockés." ++ ++# type: TP ++#: cupsd.conf.man.in:563 ++#, no-wrap ++msgid "ServerTokens Full" ++msgstr "ServerTokens Full" ++ ++# type: TP ++#: cupsd.conf.man.in:565 ++#, no-wrap ++msgid "ServerTokens Major" ++msgstr "ServerTokens Major" ++ ++# type: TP ++#: cupsd.conf.man.in:567 ++#, no-wrap ++msgid "ServerTokens Minimal" ++msgstr "ServerTokens Minimal" ++ ++# type: TP ++#: cupsd.conf.man.in:569 ++#, no-wrap ++msgid "ServerTokens Minor" ++msgstr "ServerTokens Minor" ++ ++# type: TP ++#: cupsd.conf.man.in:571 ++#, no-wrap ++msgid "ServerTokens None" ++msgstr "ServerTokens None" ++ ++# type: TP ++#: cupsd.conf.man.in:573 ++#, no-wrap ++msgid "ServerTokens OS" ++msgstr "ServerTokens OS" ++ ++# type: TP ++#: cupsd.conf.man.in:575 ++#, no-wrap ++msgid "ServerTokens ProductOnly" ++msgstr "ServerTokens ProductOnly" ++ ++# type: Plain text ++#: cupsd.conf.man.in:580 ++msgid "" ++"Specifies what information is included in the Server header of HTTP " ++"responses." ++msgstr "" ++"Indiquer quelles informations sont disponibles dans l'entête des réponses du " ++"serveur HTTP." ++ ++# type: TP ++#: cupsd.conf.man.in:580 ++#, no-wrap ++msgid "SetEnv variable value" ++msgstr "SetEnv variable valeur" ++ ++# type: Plain text ++#: cupsd.conf.man.in:584 ++msgid "Set the specified environment variable to be passed to child processes." ++msgstr "Fixer les varaibles d'environnement à passer aux processus fils." ++ ++# type: TP ++#: cupsd.conf.man.in:584 ++#, no-wrap ++msgid "SSLListen" ++msgstr "SSLListen" ++ ++# type: Plain text ++#: cupsd.conf.man.in:588 ++msgid "Listens on the specified address and port for encrypted connections." ++msgstr "" ++"Écouter à l'adresse et au port indiqués pour les connexions sécurisées." ++ ++# type: TP ++#: cupsd.conf.man.in:588 ++#, no-wrap ++msgid "SSLPort" ++msgstr "SSLPort" ++ ++# type: Plain text ++#: cupsd.conf.man.in:592 ++msgid "Listens on the specified port for encrypted connections." ++msgstr "Écouter sur le port indiqué pour les connexions sécurisées." ++ ++# type: TP ++#: cupsd.conf.man.in:592 ++#, no-wrap ++msgid "SystemGroup group-name [group-name ...]" ++msgstr "SystemGroup groupe [groupe ...]" ++ ++# type: Plain text ++#: cupsd.conf.man.in:596 ++msgid "Specifies the group(s) to use for System class authentication." ++msgstr "Définir le(s) groupe(s) à utiliser pour les identifications système." ++ ++# type: TP ++#: cupsd.conf.man.in:596 ++#, no-wrap ++msgid "TempDir directory" ++msgstr "TempDir répertoire" ++ ++# type: Plain text ++#: cupsd.conf.man.in:600 ++msgid "Specifies the directory where temporary files are stored." ++msgstr "Définir le répertoire où les fichiers temporaires sont stockés." ++ ++# type: TP ++#: cupsd.conf.man.in:600 ++#, no-wrap ++msgid "Timeout seconds" ++msgstr "Timeout secondes" ++ ++# type: Plain text ++#: cupsd.conf.man.in:604 ++msgid "Specifies the HTTP request timeout in seconds." ++msgstr "Définir le timeout des requêtes HTTP (en secondes)." ++ ++# type: TP ++#: cupsd.conf.man.in:604 ++#, no-wrap ++msgid "User user-name" ++msgstr "User utilisateur" ++ ++# type: Plain text ++#: cupsd.conf.man.in:608 ++msgid "" ++"Specifies the user name or ID that is used when running external programs." ++msgstr "" ++"Définir le nom ou l'identifiant de l'utilisateur utilisé lors du lancement " ++"de programmes externes." ++ ++# type: Plain text ++#: cupsd.conf.man.in:612 ++msgid "" ++"I, I, I, I, " ++"I, I," ++msgstr "" ++"B(5), B(8), B(5), B(5), " ++"B(5), B(5)," ++ ++# type: TH ++#: cups-deviced.man.in:15 ++#, no-wrap ++msgid "cups-deviced" ++msgstr "cups-deviced" ++ ++# type: Plain text ++#: cups-deviced.man.in:18 ++msgid "cups-deviced - cups device daemon" ++msgstr "cups-deviced - Démon de périphériques CUPS." ++ ++# type: Plain text ++#: cups-deviced.man.in:21 ++msgid "B I" ++msgstr "B I" ++ ++# type: Plain text ++#: cups-deviced.man.in:36 ++msgid "" ++"I polls the backends in I<@CUPS_SERVERBIN@/backend> for a list " ++"of available devices. It is run by I in response to a I request. The output format is an IPP response message. The " ++"I argument is the request ID from the original IPP request, " ++"typically 1. The I argument is the limit value from the original IPP " ++"request - 0 means no limit. The I argument is the requesting-user-" ++"name value from the original IPP request. Finally, the I argument " ++"is a space-delimited list of attributes (\"name=value name=value ...\") that " ++"were passed in with the request. Currently I looks for the " ++"I attribute and tailors the output accordingly." ++msgstr "" ++"B interroge régulièrement les dorsaux de I<@CUPS_SERVERBIN@/" ++"backend> pour avoir la liste des périphériques disponibles. Il est exécuté " ++"par B(8) suite à une requête I. Le format de sortie " ++"est un message de réponse IPP. Le paramètre I correspond à " ++"l'identifiant de la requête IPP initiale, typiquement 1. Le paramètre " ++"I est la valeur limite de la requête initiale, 0 signifiant qu'il " ++"n'y a pas de limite. Le paramètre I est la valeur requesting-user-" ++"name (utilisateur demandeur) de la requête initiale. Enfin, le paramètre " ++"I est une liste d'attributs séparés par des espaces (« nom=valeur " ++"nom=valeur ») qui étaient passés à la requête. Actuellement, B " ++"utilise les attributs I pour construire la sortie en " ++"conséquence." ++ ++# type: Plain text ++#: cups-deviced.man.in:38 ++msgid "backend(7), cupsd(8), cupsd.conf(5)," ++msgstr "B(7), B(8), B(5)," ++ ++# type: TH ++#: cupsd.man.in:15 ++#, no-wrap ++msgid "cupsd" ++msgstr "cupsd" ++ ++# type: Plain text ++#: cupsd.man.in:18 ++msgid "cupsd - common unix printing system daemon" ++msgstr "cupsd - démon Common Unix Printing System." ++ ++# type: Plain text ++#: cupsd.man.in:23 ++msgid "B [ -c I ] [ -f ] [ -F ] [ -h ] [ -l ]" ++msgstr "B [ -c I ] [ -f ] [ -F ] [ -h ] [ -l ]" ++ ++# type: Plain text ++#: cupsd.man.in:29 ++msgid "" ++"I is the scheduler for the Common UNIX Printing System. It implements " ++"a printing system based upon the Internet Printing Protocol, version 1.1. " ++"If no options are specified on the command-line then the default " ++"configuration file I<@CUPS_SERVERROOT@/cupsd.conf> will be used." ++msgstr "" ++"B est un ordonanceur pour le système Common UNIX Printing System. Il " ++"fournit des outils pour un système d'impression de base sur le Internet " ++"Printing Protocol, version 1.1. Si aucune option n'est spécifiée sur la " ++"ligne de commande, alors le fichier de configuration par défaut " ++"I<@CUPS_SERVERROOT@/cupsd.conf> sera utilisé." ++ ++# type: TP ++#: cupsd.man.in:30 cupsfilter.man:38 ++#, no-wrap ++msgid "-c config-file" ++msgstr "B<-c> I" ++ ++# type: Plain text ++#: cupsd.man.in:34 ++msgid "Uses the named configuration file." ++msgstr "Utiliser le fichier de configuration donné." ++ ++# type: TP ++#: cupsd.man.in:34 ++#, no-wrap ++msgid "-f" ++msgstr "B<-f>" ++ ++# type: Plain text ++#: cupsd.man.in:39 ++msgid "" ++"Run I in the foreground; the default is to run in the background as a " ++"\"daemon\"." ++msgstr "" ++"Forcer B à tourner au premier plan ; par défaut, cupsd tourne en " ++"arrière-plan comme « démon »." ++ ++# type: TP ++#: cupsd.man.in:39 ++#, no-wrap ++msgid "-F" ++msgstr "B<-F>" ++ ++# type: Plain text ++#: cupsd.man.in:45 ++msgid "" ++"Run I in the foreground but detach the process from the controlling " ++"terminal and current directory. This is useful for running I from " ++"I." ++msgstr "" ++"Forcer B à tourner en avant-plan, mais détache le processus du " ++"terminal et du répertoire de travail. Cette option est utile pour lancer " ++"B depuis B(8)." ++ ++# type: TP ++#: cupsd.man.in:45 lpr.man:71 ++#, no-wrap ++msgid "-h" ++msgstr "B<-h>" ++ ++# type: Plain text ++#: cupsd.man.in:49 ++msgid "Shows the program usage." ++msgstr "Afficher un message d'aide." ++ ++# type: TP ++#: cupsd.man.in:49 lpinfo.man:51 lpoptions.man.in:84 lpq.man:59 lpr.man:76 ++#: lpstat.man:83 ++#, no-wrap ++msgid "-l" ++msgstr "B<-l>" ++ ++# type: Plain text ++#: cupsd.man.in:54 ++msgid "This option is passed to I when it is run from I." ++msgstr "" ++"Cette option est passée à B losqu'il est lancé par B(8)." ++ ++# type: Plain text ++#: cupsd.man.in:58 ++msgid "" ++"I implements all of the required IPP/1.1 attributes and operations. " ++"It also implements several CUPS-specific administration operations." ++msgstr "" ++"B fournit tous les attributs et opération de IPP/1.1. Il implémente " ++"aussi plusieurs opérations d'administration spécifiques à CUPS." ++ ++# type: Plain text ++#: cupsd.man.in:63 ++msgid "" ++"I, I, I, I, " ++"I, I, I, I, I, I, I, I," ++msgstr "" ++"B(7), B(5), B(8), B(8), " ++"B(8), B(8), B(5), B(7), B" ++"(8), B(5), B(5), B(5)," ++ ++# type: TH ++#: cups-driverd.man.in:15 ++#, no-wrap ++msgid "cups-driverd" ++msgstr "cups-driverd" ++ ++# type: Plain text ++#: cups-driverd.man.in:18 ++msgid "cups-driverd - cups driver daemon" ++msgstr "cups-driverd - Démon de pilotes CUPS." ++ ++# type: Plain text ++#: cups-driverd.man.in:22 ++msgid "B cat I" ++msgstr "B cat I" ++ ++# type: Plain text ++#: cups-driverd.man.in:26 ++msgid "B list I" ++msgstr "B list I" ++ ++# type: Plain text ++#: cups-driverd.man.in:31 ++msgid "" ++"I shows or lists PPD files. It is run in response to CUPS-Add-" ++"Modify-Printer or CUPS-Get-Devices requests. The first form (\"cups-driverd " ++"cat ppd-name\") writes the named PPD file to stdout. The output format is an " ++"uncompressed PPD file." ++msgstr "" ++"B affiche ou liste les fichiers PPD. Il est exécuté en réponse " ++"à des requêtes CUPS-Add-Modify-Printer ou CUPS-Get-Devices. La première " ++"forme (« cups-driverd cat nom_ppd ») écrit le fichier PPD sur la sortie " ++"standard. Le format de sortie est un fichier PPD non compressé." ++ ++# type: Plain text ++#: cups-driverd.man.in:43 ++msgid "" ++"The second form lists the available manufacturers or PPD files to stdout as " ++"indicated by the I argument. The output format is an IPP response " ++"message. The I argument is the request ID from the original IPP " ++"request, typically 1. The I argument is the limit value from the " ++"original IPP request - 0 means no limit. Finally, the I argument is " ++"a space-delimited list of attributes (\"name=value name=value \\&...\") that " ++"were passed in with the request. Currently I looks for the " ++"I and I attributes and tailors the output " ++"accordingly." ++msgstr "" ++"La seconde forme liste les fabricants ou les fichiers PPD disponibles sur la " ++"sortie standard, comme demandé par le paramètre I. Le format de " ++"sortie est un message de réponse IPP. Le paramètre I correspond " ++"à l'identifiant de la requête IPP initiale, typiquement 1. Le paramètre " ++"I est la valeur limite de la requête initiale, 0 signifiant qu'il " ++"n'y a pas de limite. Enfin, le paramètre I est une liste " ++"d'attributs séparés par des espaces (« nom=valeur nom=valeur \\&... ») qui " ++"étaient passés à la requête. Actuellement, B utilise les " ++"attributs I et I pour construire la sortie " ++"en conséquence." ++ ++# type: SH ++#: cups-driverd.man.in:43 ++#, no-wrap ++msgid "DRIVERS" ++msgstr "PILOTES" ++ ++# type: Plain text ++#: cups-driverd.man.in:51 ++msgid "" ++"Drivers can be static PPD files under the I<@CUPS_DATADIR@/model> directory " ++"or programs under the I<@CUPS_SERVERBIN@/driver> directory. Static PPD files " ++"must conform to the Adobe PPD File Format Specification version 4.3 and may " ++"be compressed using the I program. Driver programs must implement " ++"the command-line interface shown in the next section." ++msgstr "" ++"Les pilotes peuvent être des fichiers PPD dans le répertoire " ++"I<@CUPS_DATADIR@/model> ou des programmes dans le répertoire " ++"I<@CUPS_SERVERBIN@/driver>. Les fichiers PPD statiques doivent se conformer " ++"aux spécifications Adobe du format de fichier PPD, version 4.3, et peuvent " ++"être compressés avec le programme B(1). Les programmes de pilotes " ++"doivent gérer l'interface en ligne de commande définie dans la section " ++"suivante." ++ ++# type: SS ++#: cups-driverd.man.in:51 ++#, no-wrap ++msgid "DRIVER PROGRAMS" ++msgstr "PROGRAMMES DE PILOTES" ++ ++# type: Plain text ++#: cups-driverd.man.in:54 ++msgid "" ++"Driver programs provide an interface to dynamically-generated PPD files. The " ++"following arguments are currently defined:" ++msgstr "" ++"Les programmes de pilotes fournissent une interface pour générer " ++"dynamiquement des fichiers PPD. Pour l'instant, les paramètres suivants sont " ++"définis :" ++ ++# type: TP ++#: cups-driverd.man.in:54 ++#, no-wrap ++msgid "drivername list" ++msgstr "drivername list" ++ ++# type: Plain text ++#: cups-driverd.man.in:58 ++msgid "Lists the supported PPD files to stdout." ++msgstr "Liste, sur la sortie standard, les fichiers PPD gérés." ++ ++# type: TP ++#: cups-driverd.man.in:58 ++#, no-wrap ++msgid "drivername cat ppdname" ++msgstr "drivername cat nom_ppd" ++ ++# type: Plain text ++#: cups-driverd.man.in:62 ++msgid "Writes the named PPD file to stdout." ++msgstr "Écrire le fichier PPD indiqué sur la sortie standard." ++ ++# type: SS ++#: cups-driverd.man.in:62 ++#, no-wrap ++msgid "LISTING FILES (drivername list)" ++msgstr "LISTER LES FICHIER (nom_pilote list)" ++ ++# type: Plain text ++#: cups-driverd.man.in:66 ++msgid "" ++"When run with the single argument \"list\", the program must list the " ++"available PPD files it can generate to stdout using the following format:" ++msgstr "" ++"Lorsqu'il est lancé avec l'unique paramètre « list », le programme doit " ++"lister sur la sortie standard les fichiers PPD disponibles qu'il peut " ++"générer, en utilisant le format suivant :" ++ ++# type: Plain text ++#: cups-driverd.man.in:68 ++#, no-wrap ++msgid " \"drivername:ppdname\" language \"make\" \"make and model\" \"1284 device id\"\n" ++msgstr " \"nom_pilote:nom_ppd\" langue \"marque\" \"marque et modèle\" \"1284 id_périphérique\"\n" ++ ++# type: Plain text ++#: cups-driverd.man.in:77 ++msgid "" ++"I is the name of the driver program. I is the name used " ++"to select the given driver. I is the locale associated with the " ++"default language of the PPD file, typically \"en\". I is the " ++"Manufacturer name from the PPD file. I is the NickName name " ++"from the PPD file. I<1284 device id> is the 1284DeviceId from the PPD file, " ++"if any." ++msgstr "" ++"I est le nom du programme pilote. I est le nom utilisé " ++"pour sélectionner le pilote. I est la locale associée avec la langue " ++"par défaut du fichier PPD, généralement « en ». I est le nom du " ++"fabriquant dans le fichier PPD. I est le nom du fichier " ++"PPD. I est l'identifiant 1284DeviceID du fichier PPD, " ++"s'il y en a un." ++ ++# type: SS ++#: cups-driverd.man.in:77 ++#, no-wrap ++msgid "WRITING FILES (drivername cat ppdname)" ++msgstr "ÉCRIRE LES FICHIER (nom_pilote cat nom_ppd)" ++ ++# type: Plain text ++#: cups-driverd.man.in:82 ++msgid "" ++"When the driver program is run with the \"cat ppdname\" arguments, it must " ++"write the named PPD file to stdout, uncompressed. If the named PPD file does " ++"not exist, the driver program must not write any output to stdout and report " ++"the error to stderr instead." ++msgstr "" ++"QUand le programme pilote est lancé avec les paramètre « cat nom_ppd », il " ++"écrit le fichier PPD demandé, non compressé, sur la sortie standard. Si le " ++"fichier PPD demandé n'existe pas, le programme pilote ne doit rien écrire " ++"sur la sortie standard, mais doit utiliser la sortie d'erreur à la place." ++ ++# type: SS ++#: cups-driverd.man.in:82 ++#, no-wrap ++msgid "DRIVER ERROR MESSAGES" ++msgstr "MESSAGES D'ERREUR DES PILOTES" ++ ++# type: Plain text ++#: cups-driverd.man.in:85 ++msgid "" ++"Error messages can be relayed back to I by writing them to stderr. " ++"The following prefixes are recognized:" ++msgstr "" ++"Les messages d'erreur peuvent être renvoyés à I en les écrivant sur " ++"la sortie standard d'erreur. Les préfix suivants sont reconnus :" ++ ++# type: TP ++#: cups-driverd.man.in:85 ++#, no-wrap ++msgid "DEBUG: [drivername]" ++msgstr "DEBUG: [drivername]" ++ ++# type: Plain text ++#: cups-driverd.man.in:89 ++msgid "Debugging messages" ++msgstr "Mesages de débogage." ++ ++# type: TP ++#: cups-driverd.man.in:89 ++#, no-wrap ++msgid "ERROR: [drivername]" ++msgstr "ERROR: [nom_pilote]" ++ ++# type: Plain text ++#: cups-driverd.man.in:93 ++msgid "Error messages" ++msgstr "Messages d'erreur." ++ ++# type: TP ++#: cups-driverd.man.in:93 ++#, no-wrap ++msgid "INFO: [drivername]" ++msgstr "INFO: [nom_pilote]" ++ ++# type: Plain text ++#: cups-driverd.man.in:97 ++msgid "Informational messages" ++msgstr "Messages d'information." ++ ++# type: Plain text ++#: cups-driverd.man.in:99 ++msgid "cupsd(8), cupsd.conf(5), cupstestppd(1)," ++msgstr "B(8), B(5), B(1)," ++ ++# type: TH ++#: cupsenable.man:16 ++#, no-wrap ++msgid "cupsenable" ++msgstr "cupsenable" ++ ++# type: Plain text ++#: cupsenable.man:19 ++msgid "cupsdisable, cupsenable - stop/start printers and classes" ++msgstr "" ++"cupsdisable, cupsenable - Arrêter/démarrer des imprimantes ou classes " ++"d'imprimantes." ++ ++# type: Plain text ++#: cupsenable.man:28 ++msgid "" ++"B [ -E ] [-U I ] [ -c ] [ -h I ] [ -r " ++"I ] destination(s)" ++msgstr "" ++"B [ -E ] [-U I ] [ -c ] [ -h I ] " ++"[ -r I ] destination(s)" ++ ++# type: Plain text ++#: cupsenable.man:35 ++msgid "" ++"B [ -E ] [-U I ] [ -c ] [ -h I ] " ++"destination(s)" ++msgstr "" ++"B [ -E ] [-U I ] [ -c ] [ -h I ] " ++"destination(s)" ++ ++# type: Plain text ++#: cupsenable.man:37 ++msgid "I starts the named printers or classes." ++msgstr "B démarre l'imprimante ou la classe d'imprimante indiquée." ++ ++# type: Plain text ++#: cupsenable.man:40 ++msgid "" ++"I stops the named printers or classes. The following options " ++"may be used:" ++msgstr "" ++"B arrête l'imprimante ou la classe d'imprimante indiquée. Les " ++"options suivantes peuvent être utilisées :" ++ ++# type: Plain text ++#: cupsenable.man:44 ++msgid "Forces encryption of the connection to the server." ++msgstr "Forcer le chiffrement de la connexion au serveur." ++ ++# type: Plain text ++#: cupsenable.man:48 ++msgid "Uses the specified username when connecting to the server." ++msgstr "utiliser l'utilisateur indiqué pour les connexions au serveur." ++ ++# type: TP ++#: cupsenable.man:48 lp.man:80 ++#, no-wrap ++msgid "-c" ++msgstr "B<-c>" ++ ++# type: Plain text ++#: cupsenable.man:52 ++msgid "Cancels all jobs on the named destination." ++msgstr "Annuler tous les travaux sur la destination donnée." ++ ++# type: TP ++#: cupsenable.man:52 lpinfo.man:47 lpmove.man:54 lpoptions.man.in:80 ++#: lpq.man:55 lprm.man:49 lpstat.man:79 ++#, no-wrap ++msgid "-h server[:port]" ++msgstr "B<-h> I" ++ ++# type: Plain text ++#: cupsenable.man:56 ++msgid "Uses the specified server and port." ++msgstr "Utiliser le serveur et le port indiqués." ++ ++# type: Plain text ++#: cupsenable.man:61 ++msgid "" ++"Sets the message associated with the stopped state. If no reason is " ++"specified then the message is set to \"Reason Unknown\"." ++msgstr "" ++"Configurer le message associé avec l'état arrêté. Si aucune raison n'est " ++"spécifiée, alors le message sera « Reason Unknown » (« Raison Inconnue »)." ++ ++# type: Plain text ++#: cupsenable.man:69 ++msgid "" ++"The System V versions of these commands are I and I. They " ++"have been renamed to avoid conflicts with the I build-in command of " ++"the same name." ++msgstr "" ++"Les version System V de ces commandes sont B et B. Elles " ++"ont été renommées pour éviter les conflits avec les commandes internes de " ++"B(1) du même nom." ++ ++# type: Plain text ++#: cupsenable.man:74 ++msgid "" ++"The CUPS versions of I and I may ask the user for an access " ++"password depending on the printing system configuration. This differs from " ++"the System V versions which require the root user to execute these commands." ++msgstr "" ++"Les versions CUPS de B et B peuvent demander à " ++"l'utilisateur de s'identifier suivant la configuration du système " ++"d'impression, à la différence des versions System V, qui demandent le mot de " ++"passe root pour exécuter ces commande." ++ ++# type: Plain text ++#: cupsenable.man:77 ++msgid "I, I, I, I, I," ++msgstr "B(8), B(1), B(1), B(8), B(1)," ++ ++# type: TP ++#: cupsfilter.man:14 ++#, no-wrap ++msgid "cupsfilter" ++msgstr "cupsfilter" ++ ++# type: TH ++#: cupsfilter.man:14 ++#, no-wrap ++msgid "19 October 2007" ++msgstr "19 octobre 2007" ++ ++# type: Plain text ++#: cupsfilter.man:17 ++msgid "cupsfilter - convert a file to another format using cups filters" ++msgstr "" ++"cupsfilter - Convertir un fichier vers un autre format en utilisant les " ++"filtres CUPS" ++ ++# type: Plain text ++#: cupsfilter.man:33 ++msgid "" ++"B [ -c I ] [ -m I ] [ -n I ] [ -" ++"o I ] [ -p I ] [ -t I ] I<filename>" ++msgstr "" ++"B<cupsfilter> [ -c I<fichier_configuration> ] [ -m I<type/mime> ] [ -n " ++"I<copies> ] [ -o I<nom=valeur> ] [ -p I<fichier.ppd> ] [ -t I<titre> ] " ++"I<fichier>" ++ ++# type: Plain text ++#: cupsfilter.man:37 ++msgid "" ++"I<cupsfilter> is a front-end to the CUPS filter subsystem which allows you " ++"to convert a file to a specific format, just as if you had printed the file " ++"through CUPS. By default, I<cupsfilter> generates a PDF file." ++msgstr "" ++"B<cupsfilter> est une interface pour le système de filtres de CUPS qui vous " ++"permet de convertir un fichier dans un format spécific, comme si vous aviez " ++"imprimé le fichier avec CUPS. Par défaut, B<cupsfilter> génère un fichier " ++"PDF." ++ ++# type: Plain text ++#: cupsfilter.man:42 ++msgid "Uses the named cupsd.conf configuration file." ++msgstr "Utiliser le fichier de configuration cupsd.conf donné." ++ ++# type: TH ++#: cupsfilter.man:42 ++#, no-wrap ++msgid "-m mime/type" ++msgstr "B<-m> I<type/mime>" ++ ++# type: Plain text ++#: cupsfilter.man:46 ++msgid "" ++"Specifies the destination file type. The default file type is application/" ++"pdf." ++msgstr "" ++"Indiquer le type du fichier de destination. La valeur par défaut est " ++"application/pdf." ++ ++# type: TP ++#: cupsfilter.man:46 lp.man:104 ++#, no-wrap ++msgid "-n copies" ++msgstr "B<-n> I<copies>" ++ ++# type: Plain text ++#: cupsfilter.man:50 ++msgid "Specifies the number of copies to generate." ++msgstr "Indiquer le nombre de copies à créer." ++ ++# type: TP ++#: cupsfilter.man:50 cups-lpd.man.in:67 lpadmin.man:105 ++#, no-wrap ++msgid "-o name=value" ++msgstr "B<-o> I<nom=valeur>" ++ ++# type: Plain text ++#: cupsfilter.man:54 ++msgid "Specifies options to pass to the CUPS filters." ++msgstr "Indiquer les options à fournir aux filtres CUPS." ++ ++# type: TP ++#: cupsfilter.man:54 ++#, no-wrap ++msgid "-p filename.ppd" ++msgstr "B<-p> I<fichier.ppd>" ++ ++# type: Plain text ++#: cupsfilter.man:58 ++msgid "Specifies the PPD file to use." ++msgstr "Définir le fichier PPD à utiliser." ++ ++# type: TP ++#: cupsfilter.man:58 ++#, no-wrap ++msgid "-t title" ++msgstr "B<-t> I<titre>" ++ ++# type: Plain text ++#: cupsfilter.man:62 ++msgid "Specifies the document title." ++msgstr "Définir le titre du document." ++ ++# type: Plain text ++#: cupsfilter.man:65 ++msgid "" ++"I<cupsfilter> currently does not use the filters defined in the PPD file. " ++"This will be addressed in a future CUPS release." ++msgstr "" ++"B<cupsaddsmb> n'utilise pas pour l'instant les filtres définis dans le " ++"fichier PPD. Ces filtres eronts gérés dans une version future de CUPS." ++ ++# type: TH ++#: cupsfilter.man:67 ++msgid "I<cupsd.conf(5)>" ++msgstr "B<cupsd.conf>(5)" ++ ++# type: TH ++#: cups-lpd.man.in:15 ++#, no-wrap ++msgid "cups-lpd" ++msgstr "cups-lpd" ++ ++# type: TH ++#: cups-lpd.man.in:15 ++#, no-wrap ++msgid "24 April 2006" ++msgstr "24 avril 2006" ++ ++# type: Plain text ++#: cups-lpd.man.in:18 ++msgid "cups-lpd - receive print jobs and report printer status to lpd clients" ++msgstr "" ++"cups-lpd - Recevoir les travaux d'impression et renvoyer l'état des " ++"imprimantes aux clients lpd." ++ ++# type: Plain text ++#: cups-lpd.man.in:23 ++msgid "B<cups-lpd> [ -n ] [ -o I<option=value> ]" ++msgstr "B<cups-lpd> [ -n ] [ -o I<option=valeur> ]" ++ ++# type: Plain text ++#: cups-lpd.man.in:31 ++msgid "" ++"I<cups-lpd> is the CUPS Line Printer Daemon (\"LPD\") mini-server that " ++"supports legacy client systems that use the LPD protocol. I<cups-lpd> does " ++"not act as a standalone network daemon but instead operates using the " ++"Internet \"super-server\" I<inetd(8)> or I<xinetd(8)>. If you are using " ++"I<inetd>, add the following line to the I<inetd.conf> file to enable the " ++"I<cups-lpd> mini-server:" ++msgstr "" ++"B<cups-lpd> est le mini serveur Line Printer Daemon (« LPD ») de CUPS, qui " ++"gère les client classiques utilisant le protocole LPD. B<cups-lpd> ne " ++"fonctionne pas lui-même comme un démon réseau, mais utilise le super-serveur " ++"B<inetd>(8). Si vous utilisez B<inetd>, ajoutez la ligne suivante au fichier " ++"I<inetd.conf> pour activer le démon B<cups-lpd> :" ++ ++# type: Plain text ++#: cups-lpd.man.in:36 ++#, no-wrap ++msgid "" ++" printer stream tcp nowait lp @CUPS_SERVERBIN@/daemon/cups-lpd cups-lpd \\e\n" ++" -o document-format=application/octet-stream\n" ++msgstr "" ++" printer stream tcp nowait lp @CUPS_SERVERBIN@/daemon/cups-lpd cups-lpd \\e\n" ++" -o document-format=application/octet-stream\n" ++ ++# type: Plain text ++#: cups-lpd.man.in:42 ++msgid "" ++"B<Note:> If you are using Solaris 10 or higher, you must run the I<inetdconv" ++"(1m)> program to register the changes to the inetd.conf file." ++msgstr "" ++"B<Remarque :> si vous utilisez Solaris 10 ou une version ultérieure, vous " ++"devez exécuter B<inetdconv>(1m) pour enregistrer les changements apportés au " ++"fichier I<inetd.conf>." ++ ++# type: Plain text ++#: cups-lpd.man.in:45 ++msgid "" ++"If you are using the newer I<xinetd(8)> daemon, create a file named I</etc/" ++"xinetd.d/cups> containing the following lines:" ++msgstr "" ++"Si vous utilisez le démon plus récent I<xinetd>(8), créez le fichier I</etc/" ++"xinetd.d/cups> contenant les lignes suivantes :" ++ ++# type: Plain text ++#: cups-lpd.man.in:59 ++#, no-wrap ++msgid "" ++" service printer\n" ++" {\n" ++" socket_type = stream\n" ++" protocol = tcp\n" ++" wait = no\n" ++" user = lp\n" ++"\tgroup = sys\n" ++"\tpassenv =\n" ++" server = @CUPS_SERVERBIN@/daemon/cups-lpd\n" ++"\tserver_args = -o document-format=application/octet-stream\n" ++" }\n" ++msgstr "" ++" service printer\n" ++" {\n" ++" socket_type = stream\n" ++" protocol = tcp\n" ++" wait = no\n" ++" user = lp\n" ++"\tgroup = sys\n" ++"\tpassenv =\n" ++" server = @CUPS_SERVERBIN@/daemon/cups-lpd\n" ++"\tserver_args = -o document-format=application/octet-stream\n" ++" }\n" ++ ++# type: TP ++#: cups-lpd.man.in:61 ++#, no-wrap ++msgid "-n" ++msgstr "B<-n>" ++ ++# type: Plain text ++#: cups-lpd.man.in:67 ++msgid "" ++"Disables reverse address lookups; normally I<cups-lpd> will try to discover " ++"the hostname of the client via a reverse DNS lookup." ++msgstr "" ++"Désactiver la résolution inverse des noms d'hôte ; normalement, B<cups-lpd> " ++"essaie de récupérer le nom d'hôte à l'aide d'une requête DNS inverse." ++ ++# type: Plain text ++#: cups-lpd.man.in:75 ++msgid "" ++"Inserts options for all print queues. Most often this is used to disable the " ++"\"l\" filter so that remote print jobs are filtered as needed for printing; " ++"the examples in the previous section set the \"document-format\" option to " ++"\"application/octet-stream\" which forces autodetection of the print file " ++"format." ++msgstr "" ++"Insérer des options pour toutes les queues d'impression. Le plus souvent, " ++"c'est utilisé pour désactiver le filtre « l » pour que les travaux distants " ++"soient également filtrés correctement ; les exemples des sections " ++"précédentes fixent l'option « document-format » à « application/octet-" ++"stream », ce qui force l'autodétection du format des fichiers à imprimer." ++ ++# type: SH ++#: cups-lpd.man.in:75 ++#, no-wrap ++msgid "PERFORMANCE" ++msgstr "PERFORMANCE" ++ ++# type: Plain text ++#: cups-lpd.man.in:82 ++msgid "" ++"I<cups-lpd> performs well with small numbers of clients and printers. " ++"However, since a new process is created for each connection and since each " ++"process must query the printing system before each job submission, it does " ++"not scale to larger configurations. We highly recommend that large " ++"configurations use the native IPP support provided by CUPS instead." ++msgstr "" ++"Les performances de B<cups-lpd> sont correctes avec un petit nombre de " ++"clients et d'imprimantes. Cependant, comme un nouveau processus est créé " ++"pour chaque connexion et comme chaque processus doit interroger le système " ++"d'impression avant chaque soumission d'un travail d'impression, ça ne " ++"s'étend pas facilement à des configurations plus importantes. Nous " ++"recommandons d'utiliser la gestion du protocole IPP native dans CUPS pour " ++"les configurations importantes." ++ ++# type: SH ++#: cups-lpd.man.in:82 ++#, no-wrap ++msgid "SECURITY" ++msgstr "SÉCURITÉ" ++ ++# type: Plain text ++#: cups-lpd.man.in:89 ++msgid "" ++"I<cups-lpd> currently does not perform any access control based on the " ++"settings in I<cupsd.conf(5)> or in the I<hosts.allow(5)> or I<hosts.deny(5)> " ++"files used by TCP wrappers. Therefore, running I<cups-lpd> on your server " ++"will allow any computer on your network (and perhaps the entire Internet) to " ++"print to your server." ++msgstr "" ++"B<cups-lpd> n'applique pour le moment aucun des contrôles d'accès définis " ++"dans les fichiers B<cupsd.conf>(5), B<hosts.allow>(5) ou B<hosts.deny>(5) " ++"utilisés par les wrappers TCP. L'exécution de B<cups-lpd> sur un serveur " ++"permet donc le lancement d'impressions depuis n'importe quel ordinateur de " ++"votre réseau, voire même de n'importe quel ordinateur sur Internet." ++ ++# type: Plain text ++#: cups-lpd.man.in:94 ++msgid "" ++"While I<xinetd> has built-in access control support, you should use the TCP " ++"wrappers package with I<inetd> to limit access to only those computers that " ++"should be able to print through your server." ++msgstr "" ++"Bien que I<xinetd> possède un contrôle d'accès intégré, il est recommandé " ++"d'utiliser le wrapper TCP fourni avec I<inetd> pour limiter les accès aux " ++"seuls ordinateurs autorisés à lancer des impressions sur le serveur." ++ ++# type: Plain text ++#: cups-lpd.man.in:98 ++msgid "" ++"I<cups-lpd> is not enabled by the standard CUPS distribution. Please " ++"consult with your operating system vendor to determine whether it is enabled " ++"on your system." ++msgstr "" ++"B<cups-lpd> n'est pas activé dans la distribution standard de CUPS. Veuillez " ++"consulter votre distributeur de système d'exploitation pour savoir s'il est " ++"activé sur votre système." ++ ++# type: Plain text ++#: cups-lpd.man.in:104 ++msgid "" ++"I<cups-lpd> does not enforce the restricted source port number specified in " ++"RFC 1179, as using restricted ports does not prevent users from submitting " ++"print jobs. While this behavior is different than standard Berkeley LPD " ++"implementations, it should not affect normal client operations." ++msgstr "" ++"B<cups-lpd> ne se conforme pas à la RFC 1179 concernant l'utilisation des " ++"ports systèmes (1 à 1\\|024), car l'utilisation de ces ports n'empêche pas " ++"un utilisateur d'envoyer un travail d'impression. Bien que ce comportement " ++"soit différent de celui des implémentations LPD Berkeley, il ne devrait pas " ++"affecter le déroulement correct des impressions." ++ ++# type: Plain text ++#: cups-lpd.man.in:109 ++msgid "" ++"The output of the status requests follows RFC 2569, Mapping between LPD and " ++"IPP Protocols. Since many LPD implementations stray from this definition, " ++"remote status reporting to LPD clients may be unreliable." ++msgstr "" ++"Le format de sortie des demandes d'état se conforme à la RFC 2569, Mapping " ++"between LPD and IPP Protocols. Comme bon nombre d'implémentations LPD ne " ++"suivent pas cette définition, la récupération d'état par un client LPD peut " ++"être erronée." ++ ++# type: Plain text ++#: cups-lpd.man.in:112 ++msgid "I<cups(1)>, I<cupsd(8)>, I<inetconv(1m)>, I<inetd(8)>, I<xinetd(8)>," ++msgstr "B<cups>(1), B<cupsd>(8), B<inetconv>(1m), B<inetd>(8), B<xinetd>(8)," ++ ++# type: TH ++#: cups-polld.man:15 ++#, no-wrap ++msgid "cups-polld" ++msgstr "cups-polld" ++ ++# type: Plain text ++#: cups-polld.man:18 ++msgid "cups-polld - cups printer polling daemon" ++msgstr "cups-polld - Démon d'interrogation des imprimantes CUPS." ++ ++# type: Plain text ++#: cups-polld.man:21 ++msgid "B<cups-polld> I<address ipp-port interval browse-port>" ++msgstr "B<cups-polld> I<adresse port-ipp intervalle port-de-navigation>" ++ ++# type: Plain text ++#: cups-polld.man:27 ++msgid "" ++"I<cups-polld> polls remote servers for a list of available printers and " ++"printer classes every I<interval> seconds. Printer and class information is " ++"then broadcast to the localhost interface (127.0.0.1) on the specified " ++"browse port for reception by I<cupsd(8)>." ++msgstr "" ++"B<cups-polld> interroge des serveurs distants afin d'obtenir la liste des " ++"imprimantes et classes d'imprimantes disponibles toutes les I<intervalle> " ++"secondes. Les informations sont alors renvoyées vers l'interface locale " ++"(127.0.0.1) et le port de navigation spécifié pour être récupérées par " ++"B<cupsd>(8)." ++ ++# type: Plain text ++#: cups-polld.man:30 ++msgid "" ++"This program is started automatically by I<cupsd> for every I<BrowsePoll> " ++"directive found in the I<cupsd.conf(5)> file." ++msgstr "" ++"Ce programme est démarré automatiquement par B<cupsd> pour chaque directive " ++"« BrowsePoll » trouvée dans le fichier B<cupsd.conf>(5)." ++ ++# type: Plain text ++#: cups-polld.man:32 ++msgid "I<cupsd(8)>, I<cupsd.conf(5)>," ++msgstr "B<cupsd>(8), B<cupsd.conf>(5)," ++ ++# type: TH ++#: cups-snmp.conf.man:15 ++#, no-wrap ++msgid "snmp.conf" ++msgstr "snmp.conf" ++ ++# type: TH ++#: cups-snmp.conf.man:15 ++#, no-wrap ++msgid "31 July 2006" ++msgstr "31 juillet 2006" ++ ++# type: Plain text ++#: cups-snmp.conf.man:18 ++msgid "snmp.conf - snmp configuration file for cups" ++msgstr "snmp.conf - Fichier de configuration SNMP pour CUPS" ++ ++# type: Plain text ++#: cups-snmp.conf.man:24 ++msgid "" ++"The I<snmp.conf> file configures the CUPS SNMP printer discovery backend and " ++"is normally located in the I</etc/cups> directory. Each line in the file can " ++"be a configuration directive, a blank line, or a comment. Comment lines " ++"start with the # character." ++msgstr "" ++"Le fichier I<snmp.conf> configure le service SNMP de découverte des " ++"imprimantes de CUPS et se trouve normalement dans le répertoire I</etc/" ++"cups>. Chaque ligne du fichier est une directive de configuration, une ligne " ++"vide ou un commentaire. Les commentaires commencent par le symbole #." ++ ++# type: Plain text ++#: cups-snmp.conf.man:30 ++msgid "" ++"The SNMP backend uses the SNMPv1 protocol to discover network printers, " ++"collecting information from the Host MIB along with intelligent port probes " ++"to determine the correct device URI and make and model for each printer. " ++"Future versions of CUPS will likely support the new Port Monitor MIB as well." ++msgstr "" ++"La gestion du SNMP utilise le protocol SNMPv1 pour découvrir les imprimantes " ++"réseau, récupérer les information à partir de la MIB de l'hôte en plus de " ++"sondes de ports pour déterminer l'URI correcte du périphérique, la marque et " ++"le modèle pour chacune des imprimantes. Les versions futures de CUPS " ++"géreront probablement également la nouvelle MIB « Port Monitor »." ++ ++# type: Plain text ++#: cups-snmp.conf.man:33 ++msgid "" ++"The following directives are understood by the SNMP backend. Consult the on-" ++"line help for detailed descriptions:" ++msgstr "" ++"Les directives suivantes sont comprises par le service SNMP. Veuillez vous " ++"reporter à l'aide en ligne pour une description plus détaillée." ++ ++# type: TP ++#: cups-snmp.conf.man:33 ++#, no-wrap ++msgid "Address @IF(I<name>)" ++msgstr "Address @IF(I<nom>)" ++ ++# type: TP ++#: cups-snmp.conf.man:35 ++#, no-wrap ++msgid "Address @LOCAL" ++msgstr "Address @LOCAL" ++ ++# type: TP ++#: cups-snmp.conf.man:37 ++#, no-wrap ++msgid "Address I<address>" ++msgstr "Address I<adresse>" ++ ++# type: Plain text ++#: cups-snmp.conf.man:43 ++msgid "" ++"Sends SNMP broadcast queries to the specified address(es). The default " ++"address is \"@LOCAL\" which broadcasts to all LAN interfaces." ++msgstr "" ++"Envoyer les reqête SNMP de broadcast à (aux) adresse(s) indiquée(s). Par " ++"défaut, l'adresse est « @LOCAL », ce qui signifie que les requêtes sont " ++"envoyées sur les interfaces LAN." ++ ++# type: TP ++#: cups-snmp.conf.man:43 ++#, no-wrap ++msgid "Community I<name>" ++msgstr "Community I<nom>" ++ ++# type: Plain text ++#: cups-snmp.conf.man:48 ++msgid "" ++"Specifies a SNMP community to query. The default community is \"public\"." ++msgstr "" ++"Spécifier la communauté SNMP à interroger. La communauté par défaut est " ++"« public »." ++ ++# type: TP ++#: cups-snmp.conf.man:48 ++#, no-wrap ++msgid "DebugLevel I<N>" ++msgstr "DebugLevel I<N>" ++ ++# type: Plain text ++#: cups-snmp.conf.man:54 ++msgid "" ++"Sets the debug logging level to I<N>; 0 disables debug logging, 1 enables " ++"basic logging, 2 displays SNMP values, and 3 displays raw hex data." ++msgstr "" ++"Fixer le niveau de débogage enregistré dans les journaux à I<N> ; 0 désative " ++"l'enregistrement des informations pour le débogage, 1 active un " ++"enregistrement basique, 2 affiche les valeurs SNMP et 3 affiche les données " ++"brutes hexadécimales." ++ ++# type: TP ++#: cups-snmp.conf.man:54 ++#, no-wrap ++msgid "HostNameLookups on" ++msgstr "HostNameLookups on" ++ ++# type: TP ++#: cups-snmp.conf.man:56 ++#, no-wrap ++msgid "HostNameLookups off" ++msgstr "HostNameLookups off" ++ ++# type: Plain text ++#: cups-snmp.conf.man:62 ++msgid "" ++"Specifies whether the addresses of printers should be converted to hostnames " ++"or left as numeric IP addresses. The default is \"off\"." ++msgstr "" ++"Définir si les adresses des imprimantes doivent être convertie en nom " ++"d'hôtes ou doivent être laissées en adresses IP numérique. La valeur par " ++"défaut est « off »." ++ ++# type: TP ++#: cups-snmp.conf.man:62 ++#, no-wrap ++msgid "MaxRunTime I<seconds>" ++msgstr "MaxRunTime I<secondes>" ++ ++# type: Plain text ++#: cups-snmp.conf.man:67 ++msgid "" ++"Specifies the maximum number of seconds that the SNMP backend will scan the " ++"network for printers." ++msgstr "" ++"Spécifier le nombre maximal de secondes entre les requêtes du dorsal SNMP " ++"pour la découverte des imprimantes réseau." ++ ++# type: TH ++#: cupstestdsc.man:15 ++#, no-wrap ++msgid "cupstestdsc" ++msgstr "cupstestdsc" ++ ++# type: Plain text ++#: cupstestdsc.man:18 ++msgid "cupstestdsc - test conformance of postscript files" ++msgstr "cupstestppd - Tester la conformité des fichiers postscript." ++ ++# type: Plain text ++#: cupstestdsc.man:23 ++msgid "B<cupstestdsc> [ -h ] filename.ps [ ... I<filenameN.ps> ]" ++msgstr "B<cupstestdsc> [ -h ] I<fichier.ps> [ ... I<fichierN.ps> ]" ++ ++# type: Plain text ++#: cupstestdsc.man:26 ++msgid "B<cupstestdsc> [ -h ] -" ++msgstr "B<cupstestdsc> [ -h ] -" ++ ++# type: Plain text ++#: cupstestdsc.man:32 ++msgid "" ++"I<cupstestdsc> tests the conformance of PostScript files to the Adobe " ++"PostScript Language Document Structuring Conventions Specification version " ++"3.0. The results of testing and any other output are sent to the standard " ++"output. The second form of the command reads PostScript from the standard " ++"input." ++msgstr "" ++"B<cupstestdsc> teste la conformité de fichiers PostScript envers la " ++"spécification de format de fichier édictée par Adobe, « Adobe PostScript " ++"Language Document Structuring Conventions Specification » dans sa version " ++"3.0. Les résultats des tests et autres sorties sont envoyés sur la sortie " ++"standard. La seconde forme de la commande lit l'entrée PostScript depuis " ++"l'entrée standard." ++ ++# type: SH ++#: cupstestdsc.man:32 lpadmin.man:195 lpc.man:53 ++#, no-wrap ++msgid "LIMITATIONS" ++msgstr "LIMITATIONS" ++ ++# type: Plain text ++#: cupstestdsc.man:41 ++msgid "" ++"I<cupstestdsc> only validates the DSC comments in a PostScript file and does " ++"not attempt to validate the PostScript code itself. Developers must ensure " ++"that the PostScript they generate follows the rules defined by Adobe. " ++"Specifically, all pages must be independent of each other, code outside page " ++"descriptions may not affect the graphics state (current font, color, " ++"transform matrix, etc.), and device-specific commands such as setpagedevice " ++"should not be used." ++msgstr "" ++"B<cupstestdsc> ne valide que les commentaires DSC du fichier PostScript et " ++"ne cherche pas à valider le code PostScript lui-même. Les développeurs " ++"doivent s'assurer que le PostScript qu'ils génèrent est conforme aux règles " ++"définies par Adobe. En particulier, toutes les pages doivent être " ++"indépendantes les unes des autres, le code en dehors des descriptions des " ++"pages ne doit pas affecter l'état des graphiques (police, couleur, matrices " ++"de transformations en cours, etc.) et les commandes spécifiques à certains " ++"périphériques ne doivent pas être utilisées." ++ ++# type: Plain text ++#: cupstestdsc.man:46 ++msgid "" ++"Adobe PostScript Language Document Structuring Conventions Specification, " ++"Version 3.0." ++msgstr "" ++"Adobe PostScript Language Document Structuring Conventions Specification, " ++"Version 3.0." ++ ++# type: TH ++#: cupstestppd.man:15 ++#, no-wrap ++msgid "cupstestppd" ++msgstr "cupstestppd" ++ ++# type: TH ++#: cupstestppd.man:15 ++#, no-wrap ++msgid "3 May 2007" ++msgstr "3 mai 2007" ++ ++# type: Plain text ++#: cupstestppd.man:18 ++msgid "cupstestppd - test conformance of ppd files" ++msgstr "cupstestppd - Tester la conformité des fichiers PPD." ++ ++# type: Plain text ++#: cupstestppd.man:25 ++msgid "" ++"B<cupstestppd> [ -R I<rootdir> ] [ -W I<category> ] [ -q ] [-r] [ -v[v] ] " ++"filename.ppd[.gz] [ ... filenameN.ppd[.gz] ]" ++msgstr "" ++"B<cupstestppd> [ -R I<rép_racine> ] [ -W I<catégorie> ] [ -q ] [-r] [ -v" ++"[v] ] fichier.ppd[.gz] [ ... fichierN.ppd[.gz] ]" ++ ++# type: Plain text ++#: cupstestppd.man:32 ++msgid "" ++"B<cupstestppd> [ -R I<rootdir> ] [ -W I<category> ] [ -q ] [-r] [ -v[v] ] -" ++msgstr "" ++"B<cupstestppd> [ -R I<rép_racine> ] [ -W I<catégorie> ] [ -q ] [-r] [ -v" ++"[v] ] -" ++ ++# type: Plain text ++#: cupstestppd.man:38 ++msgid "" ++"I<cupstestppd> tests the conformance of PPD files to the Adobe PostScript " ++"Printer Description file format specification version 4.3. It can also be " ++"used to list the supported options and available fonts in a PPD file. The " ++"results of testing and any other output are sent to the standard output." ++msgstr "" ++"B<cupstestppd> teste la conformité des fichiers PPD envers la spécification " ++"de format de fichier édictée par Adobe, « Adobe PostScript Printer " ++"Description » dans sa version 4.3. Cette commande peut également être " ++"utilisée pour voir la liste des options reconnues et des polices disponibles " ++"d'un fichier PPD. Toutes les sorties sont effectuées sur la sortie standard." ++ ++# type: Plain text ++#: cupstestppd.man:42 ++msgid "" ++"The first form of I<cupstestppd> tests one or more PPD files on the command-" ++"line. The second form tests the PPD file provided on the standard input." ++msgstr "" ++"Le premier mode d'appel de B<cupstestppd> teste un ou plusieurs fichiers PPD " ++"fournis sur la ligne de ommande Le second mode d'appel teste le fichier PPD " ++"fourni sur l'entrée standard." ++ ++# type: Plain text ++#: cupstestppd.man:44 ++msgid "I<cupstestppd> supports the following options:" ++msgstr "B<cupstestppd> gère les options suivantes :" ++ ++# type: TP ++#: cupstestppd.man:44 ++#, no-wrap ++msgid "-R rootdir" ++msgstr "B<-R> I<rép_racine>" ++ ++# NOTE: support file checks? ++# type: Plain text ++#: cupstestppd.man:49 ++msgid "" ++"Specifies an alternate root directory for the filter, pre-filter, and other " ++"support file checks." ++msgstr "" ++"Définir un autre répertoire racine pour les filtres, pré-filtres et autres " ++"fichiers de vérification." ++ ++# type: TP ++#: cupstestppd.man:49 ++#, no-wrap ++msgid "-W constraints" ++msgstr "B<-W> I<constraints>" ++ ++# type: Plain text ++#: cupstestppd.man:53 ++msgid "Report all UIConstraint errors as warnings." ++msgstr "Remonter toutes les erreurs UIConstraint comme des avertissements." ++ ++# type: TP ++#: cupstestppd.man:53 ++#, no-wrap ++msgid "-W defaults" ++msgstr "B<-W> I<defaults>" ++ ++# type: Plain text ++#: cupstestppd.man:57 ++msgid "" ++"Except for size-related options, report all default option errors as " ++"warnings." ++msgstr "" ++"À l'exception des options liées à la taille, remonter toutes les erreurs sur " ++"les valeurs par défaut comme des avertissements." ++ ++# type: TP ++#: cupstestppd.man:57 ++#, no-wrap ++msgid "-W filters" ++msgstr "B<-W> I<filters>" ++ ++# type: Plain text ++#: cupstestppd.man:61 ++msgid "Report all filter errors as warnings." ++msgstr "Remonter toutes les erreurs sur les filtres comme des avertissements." ++ ++# type: TP ++#: cupstestppd.man:61 ++#, no-wrap ++msgid "-W translations" ++msgstr "B<-W> I<translations>" ++ ++# type: Plain text ++#: cupstestppd.man:65 ++msgid "Report all translation errors as warnings." ++msgstr "Remonter toutes les erreurs de conversion comme des avertissements." ++ ++# type: TP ++#: cupstestppd.man:65 ++#, no-wrap ++msgid "-W all" ++msgstr "B<-W> I<all>" ++ ++# type: Plain text ++#: cupstestppd.man:69 ++msgid "Report all of the previous errors as warnings." ++msgstr "Remonter toutes les erreurs précédentes comme des avertissements." ++ ++# type: TP ++#: cupstestppd.man:69 ++#, no-wrap ++msgid "-W none" ++msgstr "B<-W> I<none>" ++ ++# type: Plain text ++#: cupstestppd.man:73 ++msgid "Report all of the previous errors as errors." ++msgstr "Remonter toutes les erreurs précédentes comme des erreurs." ++ ++# type: TP ++#: cupstestppd.man:73 lpr.man:97 ++#, no-wrap ++msgid "-q" ++msgstr "B<-q>" ++ ++# type: Plain text ++#: cupstestppd.man:77 ++msgid "Specifies that no information should be displayed." ++msgstr "N'afficher aucune information." ++ ++# type: TP ++#: cupstestppd.man:77 lpr.man:101 lpstat.man:97 ++#, no-wrap ++msgid "-r" ++msgstr "B<-r>" ++ ++# type: Plain text ++#: cupstestppd.man:83 ++msgid "" ++"Relaxes the PPD conformance requirements so that common whitespace, control " ++"character, and formatting problems are not treated as hard errors." ++msgstr "" ++"Réduire les exigences de conformité des PPD de telle sorte que les espaces " ++"communes, les caractères de contrôle et les problèmes de format ne soient " ++"pas traités comme des erreurs fatales." ++ ++# type: Plain text ++#: cupstestppd.man:88 ++msgid "" ++"Specifies that detailed conformance testing results should be displayed " ++"rather than the concise PASS/FAIL/ERROR status." ++msgstr "" ++"Demander l'affichage des résultats détaillés des tests de conformité au lieu " ++"des états concis PASS/FAIL/ERROR." ++ ++# type: TP ++#: cupstestppd.man:88 ++#, no-wrap ++msgid "-vv" ++msgstr "B<-vv>" ++ ++# type: Plain text ++#: cupstestppd.man:94 ++msgid "" ++"Specifies that all information in the PPD file should be displayed in " ++"addition to the detailed conformance testing results." ++msgstr "" ++"Afficher toutes les informations d'un fichier PPD en plus des résultats " ++"détaillés des tests de conformité." ++ ++# type: Plain text ++#: cupstestppd.man:96 ++msgid "The I<-q>, I<-v>, and I<-vv> options are mutually exclusive." ++msgstr "Les options B<-q>, B<-v> et B<-vv> sont mutuellement exclusives." ++ ++# type: SH ++#: cupstestppd.man:96 ++#, no-wrap ++msgid "EXIT STATUS" ++msgstr "CODE DE RETOUR" ++ ++# type: Plain text ++#: cupstestppd.man:99 ++msgid "" ++"I<cupstestppd> returns zero on success and non-zero on error. The error " ++"codes are as follows:" ++msgstr "" ++"B<cupstestppd> renvoie 0 en cas de réussite aux tests et une valeur " ++"différente de 0 en cas d'échec. Les codes d'erreur sont les suivants :" ++ ++# type: TP ++#: cupstestppd.man:99 ++#, no-wrap ++msgid "1" ++msgstr "1" ++ ++# type: Plain text ++#: cupstestppd.man:103 ++msgid "Bad command-line arguments or missing PPD filename." ++msgstr "" ++"Paramètres de la ligne de commandes incorrects ou fichier PPD non trouvé." ++ ++# type: TP ++#: cupstestppd.man:103 ++#, no-wrap ++msgid "2" ++msgstr "2" ++ ++# type: Plain text ++#: cupstestppd.man:107 ++msgid "Unable to open or read PPD file." ++msgstr "Impossible d'ouvrir ou de lire le fichier PPD." ++ ++# type: TP ++#: cupstestppd.man:107 ++#, no-wrap ++msgid "3" ++msgstr "3" ++ ++# type: Plain text ++#: cupstestppd.man:111 ++msgid "The PPD file contains format errors that cannot be skipped." ++msgstr "" ++"Le fichier PPD contient des erreurs de format ne pouvant être ignorées." ++ ++# type: TP ++#: cupstestppd.man:111 ++#, no-wrap ++msgid "4" ++msgstr "4" ++ ++# type: Plain text ++#: cupstestppd.man:115 ++msgid "The PPD file does not conform to the Adobe PPD specification." ++msgstr "Le fichier PPD n'est pas conforme à la spécification Adobe." ++ ++# type: Plain text ++#: cupstestppd.man:119 ++msgid "" ++"The following command will test all PPD files under the current directory " ++"and print the names of each file that does not conform:" ++msgstr "" ++"La commande suivante teste tous les fichiers PPD du répertoire courant et " ++"affiche le nom de ceux qui ne sont pas conformes :" ++ ++# type: Plain text ++#: cupstestppd.man:122 ++#, no-wrap ++msgid " find . -name \\e*.ppd \\e! -exec cupstestppd -q '{}' \\e; -print\n" ++msgstr " find . -name \\e*.ppd \\e! -exec cupstestppd -q '{}' \\e; -print\n" ++ ++# type: Plain text ++#: cupstestppd.man:127 ++msgid "" ++"The next command tests all PPD files under the current directory and print " ++"detailed conformance testing results for the files that do not conform:" ++msgstr "" ++"La commande suivante teste tous les fichiers PPD du répertoire courant et " ++"affiche les résultats détaillés des tests de conformité pour les fichiers " ++"qui ne sont pas conformes :" ++ ++# type: Plain text ++#: cupstestppd.man:131 ++#, no-wrap ++msgid "" ++" find . -name \\e*.ppd \\e! -exec cupstestppd -q '{}' \\e; \\e\n" ++" -exec cupstestppd -v '{}' \\e;\n" ++msgstr "" ++" find . -name \\e*.ppd \\e! -exec cupstestppd -q '{}' \\e; \\e\n" ++" -exec cupstestppd -v '{}' \\e;\n" ++ ++# type: Plain text ++#: cupstestppd.man:135 lpinfo.man:59 ++msgid "I<lpadmin(8)>," ++msgstr "B<lpadmin>(8)," ++ ++# type: Plain text ++#: cupstestppd.man:139 ++msgid "" ++"Adobe PostScript Printer Description File Format Specification, Version 4.3." ++msgstr "" ++"Adobe PostScript Printer Description File Format Specification, Version 4.3." ++ ++# type: TP ++#: filter.man:15 ++#, no-wrap ++msgid "filter" ++msgstr "filter" ++ ++# type: TH ++#: filter.man:15 ++#, no-wrap ++msgid "6 July 2007" ++msgstr "6 juillet 2007" ++ ++# type: Plain text ++#: filter.man:18 ++msgid "filter - cups file conversion filter interface" ++msgstr "" ++"filter - Interface pour des filtres de conversion de fichiers pour CUPS." ++ ++# type: Plain text ++#: filter.man:23 ++msgid "B<filter> job user title num-copies options [ I<filename> ]" ++msgstr "B<filter> travail utilisateur titre copies options [ I<fichier> ]" ++ ++# type: Plain text ++#: filter.man:28 ++msgid "" ++"The CUPS filter interface provides a standard method for adding support for " ++"new document types to CUPS. Each filter is capable of converting from one or " ++"more input formats to another format that can either be printed directly or " ++"piped into another filter to get it to a printable format." ++msgstr "" ++"Les filtres CUPS offrent la possibilité de gérer avec CUPS des nouveaux " ++"types de documents. Chaque filtre est capable de convertir des fichiers de " ++"différents formats dans un format qui est soit géré directement par CUPS ou " ++"qui peut être envoyé à un autre filtre afin d'être imprimable." ++ ++# type: Plain text ++#: filter.man:33 ++msgid "" ++"Filters B<must> be capable of reading from a filename on the command-line or " ++"from the standard input, copying the standard input to a temporary file as " ++"required by the file format. All output B<must> be sent to the standard " ++"output." ++msgstr "" ++"Les filtres B<doivent> être capables de lire depuis un fichier fournit sur " ++"la ligne de commande ou depuis l'entrée standard, en copiant l'entrée " ++"standard vers un fichier temporaire si nécessaire pour ce format de fichier. " ++"Toutes les sorties B<doivent> être envoyées sur la sortie standard." ++ ++# type: Plain text ++#: filter.man:35 ++msgid "" ++"The command name (argv[0]) is set to the name of the destination printer." ++msgstr "" ++"Le nom de la commande (argv[0]) vaut le nom de l'imprimante de destination." ++ ++# type: SH ++#: filter.man:35 ++#, no-wrap ++msgid "LOG MESSAGES" ++msgstr "MESSAGES JOURNALISÉS" ++ ++# type: Plain text ++#: filter.man:39 ++msgid "" ++"Messages sent to stderr are generally logged to printer-state-message " ++"attribute and the current I<ErrorLog>. Each line begins with a standard " ++"prefix:" ++msgstr "" ++"Les messages envoyés à la sortie d'erreur sont généralement enregistrés dans " ++"l'attribut printer-state-message et dans le journal I<ErrorLog> actuel. " ++"Chaque ligne commence par un préfixe standard :" ++ ++# type: TP ++#: filter.man:40 ++#, no-wrap ++msgid "ALERT: message" ++msgstr "ALERT: message" ++ ++# type: Plain text ++#: filter.man:45 ++msgid "" ++"Sets the printer-state-message attribute and adds the specified message to " ++"the current I<ErrorLog> using the \"alert\" log level." ++msgstr "" ++"Définir l'attribut printer-state-message et ajouter le message donné au " ++"journal I<ErrorLog> actuel en utilisant le niveau de journalisation « alert »." ++ ++# type: TP ++#: filter.man:46 ++#, no-wrap ++msgid "ATTR: attribute=value [attribute=value]" ++msgstr "ATTR: attribut=valeur [attribut=valeur]" ++ ++# type: Plain text ++#: filter.man:51 ++msgid "" ++"Sets the named job attribute(s). Typically this will be used to set the job-" ++"remote-id attribute." ++msgstr "" ++"Définir l'attribut (les attributs) donné(s) du travail d'impression. " ++"Typiquement, c'est utilisé pour fixer l'attribut job-remote-id." ++ ++# type: TP ++#: filter.man:52 ++#, no-wrap ++msgid "CRIT: message" ++msgstr "CRIT: message" ++ ++# type: Plain text ++#: filter.man:57 ++msgid "" ++"Sets the printer-state-message attribute and adds the specified message to " ++"the current I<ErrorLog> using the \"critical\" log level." ++msgstr "" ++"Définir l'attribut printer-state-message et ajouter le message donné au " ++"journal I<ErrorLog> actuel en utilisant le niveau de journalisation " ++"« critical »." ++ ++# type: TP ++#: filter.man:58 ++#, no-wrap ++msgid "DEBUG: message" ++msgstr "DEBUG: message" ++ ++# type: Plain text ++#: filter.man:63 ++msgid "" ++"Sets the printer-state-message attribute and adds the specified message to " ++"the current I<ErrorLog> using the \"debug\" log level." ++msgstr "" ++"Définir l'attribut printer-state-message et ajouter le message donné au " ++"journal I<ErrorLog> actuel en utilisant le niveau de journalisation « debug »." ++ ++# type: TP ++#: filter.man:64 ++#, no-wrap ++msgid "DEBUG2: message" ++msgstr "DEBUG2: message" ++ ++# type: Plain text ++#: filter.man:69 ++msgid "" ++"Sets the printer-state-message attribute and adds the specified message to " ++"the current I<ErrorLog> using the \"debug2\" log level." ++msgstr "" ++"Définir l'attribut printer-state-message et ajouter le message donné au " ++"journal I<ErrorLog> actuel en utilisant le niveau de journalisation " ++"« debug2 »." ++ ++# type: TP ++#: filter.man:70 ++#, no-wrap ++msgid "EMERG: message" ++msgstr "EMERG: message" ++ ++# type: Plain text ++#: filter.man:75 ++msgid "" ++"Sets the printer-state-message attribute and adds the specified message to " ++"the current I<ErrorLog> using the \"emergency\" log level." ++msgstr "" ++"Définir l'attribut printer-state-message et ajouter le message donné au " ++"journal I<ErrorLog> actuel en utilisant le niveau de journalisation " ++"« emergency »." ++ ++# type: TP ++#: filter.man:76 ++#, no-wrap ++msgid "ERROR: message" ++msgstr "ERROR: message" ++ ++# type: Plain text ++#: filter.man:81 ++msgid "" ++"Sets the printer-state-message attribute and adds the specified message to " ++"the current I<ErrorLog> using the \"error\" log level." ++msgstr "" ++"Définir l'attribut printer-state-message et ajouter le message donné au " ++"journal I<ErrorLog> actuel en utilisant le niveau de journalisation « error »." ++ ++# type: TP ++#: filter.man:82 ++#, no-wrap ++msgid "INFO: message" ++msgstr "INFO: message" ++ ++# type: Plain text ++#: filter.man:88 ++msgid "" ++"Sets the printer-state-message attribute. If the current I<LogLevel> is set " ++"to \"debug2\", also adds the specified message to the current I<ErrorLog> " ++"using the \"info\" log level." ++msgstr "" ++"Fixer l'attribut printer-state-message. Si I<LogLevel> vaut « debug2 », le " ++"message est également ajouté au journal I<ErrorLog> en utilisant le niveau " ++"« info »." ++ ++# type: TP ++#: filter.man:89 ++#, no-wrap ++msgid "NOTICE: message" ++msgstr "NOTICE: message" ++ ++# type: Plain text ++#: filter.man:94 ++msgid "" ++"Sets the printer-state-message attribute and adds the specified message to " ++"the current I<ErrorLog> using the \"notice\" log level." ++msgstr "" ++"Définir l'attribut printer-state-message et ajouter le message donné au " ++"journal I<ErrorLog> actuel en utilisant le niveau de journalisation " ++"« notice »." ++ ++# type: TP ++#: filter.man:95 ++#, no-wrap ++msgid "PAGE: page-number #-copies" ++msgstr "PAGE: numéro_page #-copies" ++ ++# type: TP ++#: filter.man:97 ++#, no-wrap ++msgid "PAGE: total #-pages" ++msgstr "PAGE: total #-pages" ++ ++# type: Plain text ++#: filter.man:103 ++msgid "" ++"Adds an entry to the current I<PageLog>. The first form adds #-copies to the " ++"job-media-sheets-completed attribute. The second form sets the job-media-" ++"sheets-completed attribute to #-pages." ++msgstr "" ++"Ajouter une entrée au fichier I<PageLog> actuel. La première forme ajoute le " ++"nombre de copies à l'attribut job-media-sheets-completed. La seconde forme " ++"définie l'attribut job-media-sheets-completed au nombre de pages." ++ ++# type: TP ++#: filter.man:104 ++#, no-wrap ++msgid "STATE: printer-state-reason [printer-state-reason ...]" ++msgstr "STATE: raison-état-impimante [raison-état-impimante ...]" ++ ++# type: TP ++#: filter.man:106 ++#, no-wrap ++msgid "STATE: + printer-state-reason [printer-state-reason ...]" ++msgstr "STATE: + raison-état-impimante [raison-état-impimante ...]" ++ ++# type: TP ++#: filter.man:108 ++#, no-wrap ++msgid "STATE: - printer-state-reason [printer-state-reason ...]" ++msgstr "STATE: - raison-état-impimante [raison-état-impimante ...]" ++ ++# type: Plain text ++#: filter.man:114 ++msgid "" ++"Sets, adds, or removes printer-state-reason keywords to the current queue. " ++"Typically this is used to indicate media, ink, and toner conditions on a " ++"printer." ++msgstr "" ++"Définir, ajouter ou retirer des mots clé raison-état-impimante de la file " ++"d'attente en cours. Typiquement c'est utilisé pour indiquer l'état du média, " ++"de l'encre et du toner d'une imprimante." ++ ++# type: TP ++#: filter.man:115 ++#, no-wrap ++msgid "WARNING: message" ++msgstr "WARNING: message" ++ ++# type: Plain text ++#: filter.man:120 ++msgid "" ++"Sets the printer-state-message attribute and adds the specified message to " ++"the current I<ErrorLog> using the \"warning\" log level." ++msgstr "" ++"Définir l'attribut printer-state-message et ajouter le message donné au " ++"journal I<ErrorLog> actuel en utilisant le niveau de journalisation " ++"« warning »." ++ ++# type: SH ++#: filter.man:121 ++#, no-wrap ++msgid "ENVIRONMENT VARIABLES" ++msgstr "VARIABLES D'ENVIRONNEMENT" ++ ++# type: Plain text ++#: filter.man:124 ++msgid "" ++"The following environment variables are defined by the CUPS server when " ++"executing the filter:" ++msgstr "" ++"Les variables d'environnement suivantes sont définies par le serveur CUPS " ++"pour l'exécution des filtres :" ++ ++# type: TP ++#: filter.man:125 ++#, no-wrap ++msgid "CHARSET" ++msgstr "CHARSET" ++ ++# type: Plain text ++#: filter.man:129 ++msgid "The default text character set, typically utf-8." ++msgstr "" ++"Définir le jeu de caractères par défaut à utiliser pour les textes, " ++"typiquement utf-8." ++ ++# type: TP ++#: filter.man:130 ++#, no-wrap ++msgid "CLASS" ++msgstr "CLASS" ++ ++# type: Plain text ++#: filter.man:136 ++msgid "" ++"When a job is submitted to a printer class, contains the name of the " ++"destination printer class. Otherwise this environment variable will not be " ++"set." ++msgstr "" ++"Quand un travail est soumis à une classe d'imprimantes, elle contient le nom " ++"de la classe d'imprimante. Sinon, cette variable d'environnement n'est pas " ++"définie." ++ ++# type: TP ++#: filter.man:137 ++#, no-wrap ++msgid "CONTENT_TYPE" ++msgstr "CONTENT_TYPE" ++ ++# type: Plain text ++#: filter.man:142 ++msgid "The MIME type associated with the file (e.g. application/postscript)." ++msgstr "Le type MIME associé au fichier (par exemple application/postscript)." ++ ++# type: TP ++#: filter.man:143 ++#, no-wrap ++msgid "CUPS_DATADIR" ++msgstr "CUPS_DATADIR" ++ ++# type: Plain text ++#: filter.man:147 ++msgid "The directory where data files can be found." ++msgstr "Le répertoire où se trouvent les fichiers de données." ++ ++# type: TP ++#: filter.man:148 ++#, no-wrap ++msgid "CUPS_SERVERROOT" ++msgstr "CUPS_SERVERROOT" ++ ++# type: Plain text ++#: filter.man:152 ++msgid "The root directory of the server." ++msgstr "Le répertoire racine du serveur." ++ ++# type: TP ++#: filter.man:153 ++#, no-wrap ++msgid "DEVICE_URI" ++msgstr "DEVICE_URI" ++ ++# type: Plain text ++#: filter.man:157 ++msgid "The device-uri associated with the printer." ++msgstr "L'uri du périphérique associé à l'imprimante." ++ ++# type: TP ++#: filter.man:158 ++#, no-wrap ++msgid "FINAL_CONTENT_TYPE" ++msgstr "FINAL_CONTENT_TYPE" ++ ++# type: Plain text ++#: filter.man:163 ++msgid "" ++"The MIME type associated with the printer (e.g. application/vnd.cups-" ++"postscript)." ++msgstr "" ++"Le type MIME associé à l'imprimante (par exemple application/vnd.cups-" ++"postscript)." ++ ++# type: TP ++#: filter.man:164 ++#, no-wrap ++msgid "LANG" ++msgstr "LANG" ++ ++# type: Plain text ++#: filter.man:168 ++msgid "The default language locale (typically C or en)." ++msgstr "La locale de la langue par défaut (généralement C ou en)." ++ ++# type: TP ++#: filter.man:169 ++#, no-wrap ++msgid "PATH" ++msgstr "PATH" ++ ++# type: Plain text ++#: filter.man:174 ++msgid "" ++"The standard execution path for external programs that may be run by the " ++"filter." ++msgstr "" ++"Le chemin d'exécution par défaut pour les programmes externes qui peuvent " ++"être exécutés par le filtre." ++ ++# type: TP ++#: filter.man:175 ++#, no-wrap ++msgid "PPD" ++msgstr "PPD" ++ ++# type: Plain text ++#: filter.man:180 ++msgid "" ++"The full pathname of the PostScript Printer Description (PPD) file for this " ++"printer." ++msgstr "" ++"Le chemin complet vers le fichier PPD (PostScript Printer Description) de " ++"cette imprimante." ++ ++# type: TP ++#: filter.man:181 ++#, no-wrap ++msgid "PRINTER" ++msgstr "PRINTER" ++ ++# type: Plain text ++#: filter.man:185 ++msgid "The name of the printer." ++msgstr "Le nom de l'imprimante." ++ ++# type: TP ++#: filter.man:186 ++#, no-wrap ++msgid "RIP_CACHE" ++msgstr "RIP_CACHE" ++ ++# type: Plain text ++#: filter.man:191 ++msgid "" ++"The recommended amount of memory to use for Raster Image Processors (RIPs)." ++msgstr "" ++"La quantité de mémoire recommandée pour les RIP (Raster Image Processors)." ++ ++# type: TP ++#: filter.man:192 ++#, no-wrap ++msgid "SOFTWARE" ++msgstr "SOFTWARE" ++ ++# type: Plain text ++#: filter.man:196 ++msgid "The name and version number of the server (typically CUPS/1.2)." ++msgstr "Le nom et la version du serveur (par exemple CUPS/1.2)." ++ ++# type: TP ++#: filter.man:197 ++#, no-wrap ++msgid "TZ" ++msgstr "TZ" ++ ++# type: Plain text ++#: filter.man:201 ++msgid "The timezone of the server." ++msgstr "Le fuseau horaire du serveur" ++ ++# type: TP ++#: filter.man:202 ++#, no-wrap ++msgid "USER" ++msgstr "USER" ++ ++# type: Plain text ++#: filter.man:207 ++msgid "" ++"The user executing the filter, typically \"lp\" or \"root\"; consult the " ++"I<cupsd.conf(5)> file for the current setting." ++msgstr "" ++"L'utilisateur qui exécute le filtre, typiquement « lp » ou « root » ; " ++"consultez le fichier B<cupsd.conf>(5) pour le paramétrage courant." ++ ++# type: Plain text ++#: filter.man:213 ++msgid "" ++"While the filter interface is compatible with System V interface scripts, it " ++"will only work with the System V interface script as the only filter. " ++"Typically the interface script will be provided via the I<lpadmin(8)> " ++"command using the I<-i> option." ++msgstr "" ++"Alors que l'interface des filtres est compatible avec l'interface des " ++"scripts Système V, elle ne fonctionnera avec le script d'interface " ++"Système V que comme unique filtre. Typiquement le script d'interface sera " ++"fournit par la commande B<lpadmin>(8) en utilisant l'option B<-i>." ++ ++# type: Plain text ++#: filter.man:215 ++msgid "I<backend(1)>, I<cupsd(8)>," ++msgstr "B<backend>(1), B<cupsd>(8)," ++ ++# type: TH ++#: lpadmin.man:15 ++#, no-wrap ++msgid "lpadmin" ++msgstr "lpadmin" ++ ++# type: TH ++#: lpadmin.man:15 ++#, no-wrap ++msgid "2 January 2008" ++msgstr "2 janvier 2008" ++ ++# type: Plain text ++#: lpadmin.man:18 ++msgid "lpadmin - configure cups printers and classes" ++msgstr "lpadmin - Configurer les imprimantes et classes d'imprimantes CUPS." ++ ++# type: Plain text ++#: lpadmin.man:26 ++msgid "" ++"B<lpadmin> [ -E ] [-U I<username> ] [ -h I<server[:port]> ] -d I<destination>" ++msgstr "" ++"B<lpadmin> [ -E ] [-U I<utilisateur> ] [ -h I<serveur[:port]> ] -d " ++"I<destination>" ++ ++# type: Plain text ++#: lpadmin.man:34 ++msgid "" ++"B<lpadmin> [ -E ] [-U I<username> ] [ -h I<server[:port]> ] -p I<printer " ++"option(s)>" ++msgstr "" ++"B<lpadmin> [ -E ] [-U I<utilisateur> ] [ -h I<serveur[:port]> ] -p " ++"I<imprimante option(s)>" ++ ++# type: Plain text ++#: lpadmin.man:42 ++msgid "" ++"B<lpadmin> [ -E ] [-U I<username> ] [ -h I<server[:port]> ] -x I<destination>" ++msgstr "" ++"B<lpadmin> [ -E ] [-U I<utilisateur> ] [ -h I<serveur[:port]> ] -x " ++"I<destination>" ++ ++# type: Plain text ++#: lpadmin.man:46 ++msgid "" ++"I<lpadmin> configures printer and class queues provided by CUPS. It can also " ++"be used to set the server default printer or class." ++msgstr "" ++"B<lpadmin> configure les imprimantes et classes d'imprimantes CUPS. Il est " ++"également utilisé pour définir l'imprimante ou classe d'imprimante par " ++"défaut." ++ ++# type: Plain text ++#: lpadmin.man:50 ++msgid "" ++"When specified before the I<-d>, I<-p>, or I<-x> options, the I<-E> option " ++"forces encryption when connecting to the server." ++msgstr "" ++"Lorsque l'option B<-E> est spécifiée avant les options B<-d>, B<-p> ou B<-" ++"x>, la communication avec le serveur est chiffrée." ++ ++# type: Plain text ++#: lpadmin.man:56 ++msgid "" ++"The first form of the command (I<-d>) sets the default printer or class to " ++"I<destination>. Subsequent print jobs submitted via the I<lp(1)> or I<lpr(1)" ++"> commands will use this destination unless the user specifies otherwise " ++"with the I<lpoptions(1)> command." ++msgstr "" ++"La première méthode d'utilisation de la commande (avec B<-d>) définit " ++"l'imprimante ou la classe par défaut. Les impressions futures demandées par " ++"les commandes B<lp>(1) ou B<lpr>(1) utiliseront cette destination sauf avis " ++"contraire de l'utilisateur par l'utilisation de la commande B<lpoptions>(1)." ++ ++# type: Plain text ++#: lpadmin.man:59 ++msgid "" ++"The second form of the command (I<-p>) configures the named printer. The " ++"additional options are described below." ++msgstr "" ++"La seconde forme de la commande (avec B<-p>) configure l'imprimante " ++"spécifiée. Les options supplémentaires sont décrites plus loin." ++ ++# type: Plain text ++#: lpadmin.man:64 ++msgid "" ++"The third form of the command (I<-x>) deletes the printer or class " ++"I<destination>. Any jobs that are pending for the destination will be " ++"removed and any job that is currently printed will be aborted." ++msgstr "" ++"La troisième forme de la commande (avec B<-x>) supprime l'imprimante ou " ++"classe I<destination>. Tous les travaux d'impression en attente sur cette " ++"destination sont supprimés, et les travaux en cours d'impression sont " ++"arrêtés." ++ ++# type: SH ++#: lpadmin.man:64 ++#, no-wrap ++msgid "CONFIGURATION OPTIONS" ++msgstr "OPTIONS DE CONFIGURATION" ++ ++# type: Plain text ++#: lpadmin.man:67 ++msgid "The following options are recognized when configuring a printer queue:" ++msgstr "" ++"Les options suivantes sont reconnues pour la configuration d'une liste " ++"d'attente :" ++ ++# type: TP ++#: lpadmin.man:67 ++#, no-wrap ++msgid "-c class" ++msgstr "B<-c> I<classe>" ++ ++# type: Plain text ++#: lpadmin.man:72 ++msgid "" ++"Adds the named I<printer> to I<class>. If I<class> does not exist it is " ++"created automatically." ++msgstr "" ++"Ajouter l'imprimante I<imprimante> à la classe I<classe>. Si la I<classe> " ++"n'existe pas encore, elle est créée automatiquement." ++ ++# type: TP ++#: lpadmin.man:72 ++#, no-wrap ++msgid "-i interface" ++msgstr "B<-i> I<interface>" ++ ++# type: Plain text ++#: lpadmin.man:78 ++msgid "" ++"Sets a System V style interface script for the printer. This option cannot " ++"be specified with the I<-P> option (PPD file) and is intended for providing " ++"support for legacy printer drivers." ++msgstr "" ++"Créer un script d'interface System V pour l'imprimante. Cette option ne peut " ++"être utilisée en même temps que l'option B<-P> (fichier PPD) et est destinée " ++"au support des imprimantes de base." ++ ++# type: TP ++#: lpadmin.man:78 ++#, no-wrap ++msgid "-m model" ++msgstr "B<-m> I<modèle>" ++ ++# type: Plain text ++#: lpadmin.man:83 ++msgid "" ++"Sets a standard System V interface script or PPD file from the I<model> " ++"directory." ++msgstr "" ++"Définir un script d'interface System V ou un fichier PPD du répertoire " ++"I<modèle>." ++ ++# type: TP ++#: lpadmin.man:83 ++#, no-wrap ++msgid "-o job-k-limit=value" ++msgstr "B<-o> B<job-k-limit>=I<valeur>" ++ ++# type: Plain text ++#: lpadmin.man:88 ++msgid "" ++"Sets the kilobyte limit for per-user quotas. The value is an integer number " ++"of kilobytes; one kilobyte is 1024 bytes." ++msgstr "" ++"Définir les quotas par utilisateur en kilo-octets. La valeur est un nombre " ++"entier de kilo-octets (valant 1 024 octets)." ++ ++# type: TP ++#: lpadmin.man:88 ++#, no-wrap ++msgid "-o job-page-limit=value" ++msgstr "B<-o> B<job-page-limit>=I<valeur>" ++ ++# type: Plain text ++#: lpadmin.man:94 ++msgid "" ++"Sets the page limit for per-user quotas. The value is the integer number of " ++"pages that can be printed; double-sided pages are counted as two pages." ++msgstr "" ++"Définir les quotas par utilisateur en nombre de pages. La valeur est un " ++"nombre entier de pages pouvant être imprimées. Les recto-verso comptent pour " ++"deux pages." ++ ++# type: TP ++#: lpadmin.man:94 ++#, no-wrap ++msgid "-o job-quota-period=value" ++msgstr "B<-o> B<job-quota-period>=I<valeur>" ++ ++# type: Plain text ++#: lpadmin.man:99 ++msgid "" ++"Sets the accounting period for per-user quotas. The value is an integer " ++"number of seconds; 86,400 seconds are in one day." ++msgstr "" ++"Définir les quotas par utilisateur en impressions par intervalle de temps. " ++"La valeur est un nombre entier définissant le nombre de secondes entre " ++"chaque impression. Une journée contient 86 400 secondes." ++ ++# type: TP ++#: lpadmin.man:99 ++#, no-wrap ++msgid "-o job-sheets-default=banner" ++msgstr "B<-o> B<job-sheets-default>=I<bannière>" ++ ++# type: TP ++#: lpadmin.man:101 ++#, no-wrap ++msgid "-o job-sheets-default=banner,banner" ++msgstr "B<-o> B<job-sheets-default>=I<bannière,bannière>" ++ ++# type: Plain text ++#: lpadmin.man:105 ++msgid "Sets the default banner page(s) to use for print jobs." ++msgstr "" ++"Fixer la (les) pages de bannière par défaut pour les travaux d'impression." ++ ++# type: Plain text ++#: lpadmin.man:111 ++msgid "" ++"Sets a PPD option for the printer. PPD options can be listed using the I<-l> " ++"option with the I<lpoptions(1)> command." ++msgstr "" ++"Définir une option PPD pour l'imprimante. La liste des options PPD peut être " ++"obtenue en utilisant l'option B<-l> de la commande B<lpoptions>(1)." ++ ++# type: TP ++#: lpadmin.man:111 ++#, no-wrap ++msgid "-o name-default=value" ++msgstr "B<-o> B<name-default>=I<valeur>" ++ ++# type: Plain text ++#: lpadmin.man:117 ++msgid "" ++"Sets a default server-side option for the printer. Any print-time option can " ++"be defaulted, e.g. \"-o cpi-default=17\" to set the default \"cpi\" option " ++"value to 17." ++msgstr "" ++"Définir au niveau du serveur une option par défaut pour l'imprimante. Toute " ++"option pouvant être définie au moment de l'impression peut avoir une valeur " ++"par défaut, par exemple \"-o cpi-default=17\" pour définir l'option \"cpi\" " ++"par défaut à la valeur 17." ++ ++# type: TP ++#: lpadmin.man:117 ++#, no-wrap ++msgid "-o port-monitor=name" ++msgstr "B<-o> B<port-monitor>=I<nom>" ++ ++# type: Plain text ++#: lpadmin.man:123 ++msgid "" ++"Sets the binary communications program to use when printing, \"none\", \"bcp" ++"\", or \"tbcp\". The default program is \"none\". The specified port monitor " ++"must be listed in the printer's PPD file." ++msgstr "" ++"Fixer le programme à utiliser pour les communications binaires lors de " ++"l'impression : « none », « bcp » ou « tbcp ». Le programme par défaut est " ++"« none ». Le moniteur de port indiqué doit être listé dans le fichier PPD de " ++"l'imprimante." ++ ++# type: TP ++#: lpadmin.man:123 ++#, no-wrap ++msgid "-o printer-error-policy=name" ++msgstr "B<-o> B<printer-error-policy>=I<nom>" ++ ++# type: Plain text ++#: lpadmin.man:130 ++msgid "" ++"Sets the error policy to be used when the printer backend is unable to send " ++"the job to the printer. The name must be one of \"abort-job\", \"retry-job\" " ++"or \"stop-printer\". The default error policy is \"stop-printer\"." ++msgstr "" ++"Fixer la politique à utiliser en cas d'erreur quand le dorsal responsable de " ++"l'impression n'arrive pas à envoyer le travail à l'imprimante. Le nom doit " ++"être soit « abort-job » (annuler l'impression), « retry-job » (réessayer) ou " ++"« stop-printer » (arrêter l'imprimante). La politique par défaut en cas " ++"d'erreur est « stop-printer »." ++ ++# type: TP ++#: lpadmin.man:130 ++#, no-wrap ++msgid "-o printer-is-shared=true/false" ++msgstr "B<-o> B<printer-is-shared>=I<true/false>" ++ ++# type: Plain text ++#: lpadmin.man:138 ++msgid "" ++"Sets the printer to shared/published or unshared/unpublished. Shared/" ++"published printers are publically announced by the server on the LAN based " ++"on the browsing configuration in B<cupsd.conf>, while unshared/unpublished " ++"printers are not announced. The default value is \"true\"." ++msgstr "" ++"Placer l'imprimante dans l'état partagée/publiée ou non partagée/non " ++"publiée. Les imprimantes partagées/publiées sont annoncées publiquement par " ++"le serveur sur le réseau local, en fonction de la configuration pour les " ++"recherches de I<cupsd.conf>, tandis que les imprimantes non partagées/non " ++"publiées ne sont pas annoncées. La valeur par défaut est « true »." ++ ++# type: TP ++#: lpadmin.man:138 ++#, no-wrap ++msgid "-o printer-op-policy=name" ++msgstr "B<-o> B<printer-op-policy>=I<nom>" ++ ++# type: Plain text ++#: lpadmin.man:144 ++msgid "" ++"Sets the IPP operation policy associated with the printer. The name must be " ++"defined in the B<cupsd.conf> in a Policy section. The default operation " ++"policy is \"default\"." ++msgstr "" ++"Fixer la politique des opérations IPP associée à l'imprimante. Le nom doit " ++"être définit dans I<cupsd.conf>, dans une section de type Policy. La " ++"politique des opérations est par défaut « default »." ++ ++# type: TP ++#: lpadmin.man:144 ++#, no-wrap ++msgid "-r class" ++msgstr "B<-r> I<classe>" ++ ++# type: Plain text ++#: lpadmin.man:149 ++msgid "" ++"Removes the named I<printer> from I<class>. If the resulting class becomes " ++"empty it is removed." ++msgstr "" ++"Supprimer l'I<imprimante> de la I<classe>. Si la classe d'imprimante devient " ++"vide, celle-ci est supprimée." ++ ++# type: TP ++#: lpadmin.man:149 ++#, no-wrap ++msgid "-u allow:user,user,@group" ++msgstr "B<-u> B<allow>:I<utilisateur,utilisateur,@groupe>" ++ ++# type: TP ++#: lpadmin.man:151 ++#, no-wrap ++msgid "-u deny:user,user,@group" ++msgstr "B<-u> B<deny>:I<utilisateur,utilisateur,@groupe>" ++ ++# type: TP ++#: lpadmin.man:153 ++#, no-wrap ++msgid "-u allow:all" ++msgstr "B<-u> B<allow>:B<all>" ++ ++# type: TP ++#: lpadmin.man:155 ++#, no-wrap ++msgid "-u deny:none" ++msgstr "B<-u> B<deny>:B<none>" ++ ++# type: Plain text ++#: lpadmin.man:161 ++msgid "" ++"Sets user-level access control on a printer. Names starting with \"@\" are " ++"interpreted as UNIX groups. The latter two forms turn user-level access " ++"control off." ++msgstr "" ++"Définir les accès par utilisateur sur une imprimante. Les noms commençant " ++"par un « @ » sont interprétés comme des groupes UNIX. Les deux dernières " ++"expressions suppriment les contrôles d'accès par utilisateur." ++ ++# type: TP ++#: lpadmin.man:161 ++#, no-wrap ++msgid "-v \"device-uri\"" ++msgstr "B<-v> I<uri_périphérique>" ++ ++# type: Plain text ++#: lpadmin.man:168 ++msgid "" ++"Sets the I<device-uri> attribute of the printer queue. If I<device-uri> is " ++"a filename it is automatically converted to the form I<file:///file/name>. " ++"Use the I<lpinfo(8)> command to get a list of supported device URIs and " ++"schemes." ++msgstr "" ++"Définir l'attribut B<device-uri> de la file d'attente de l'imprimante. Si " ++"I<uri_périphérique> est un nom de fichier, il est converti automatiquement " ++"en la forme B<file:/fichier/nom>. Utilisez la commande B<lpinfo>(8) pour " ++"avoir la liste des URI de périphériques gérés et leurs schémas." ++ ++# type: TP ++#: lpadmin.man:168 ++#, no-wrap ++msgid "-D \"info\"" ++msgstr "B<-D> I<info>" ++ ++# type: Plain text ++#: lpadmin.man:172 ++msgid "Provides a textual description of the printer." ++msgstr "Définir une description textuelle de l'imprimante." ++ ++# type: Plain text ++#: lpadmin.man:177 ++msgid "" ++"Enables the printer and accepts jobs; this is the same as running the " ++"I<accept(8)> and I<cupsenable(8)> programs on the printer." ++msgstr "" ++"Activer l'imprimante et lui fait accepter les travaux d'impression. Ceci " ++"peut également être effectué en lançant les commandes B<accept>(8) et " ++"B<cupsenable>(8) avec cette imprimante." ++ ++# type: TP ++#: lpadmin.man:177 ++#, no-wrap ++msgid "-L \"location\"" ++msgstr "B<-L> I<emplacement>" ++ ++# type: Plain text ++#: lpadmin.man:181 ++msgid "Provides a textual location of the printer." ++msgstr "Définir l'emplacement de l'imprimante." ++ ++# type: TP ++#: lpadmin.man:181 ++#, no-wrap ++msgid "-P ppd-file" ++msgstr "B<-P> I<fichier-ppd>" ++ ++# type: Plain text ++#: lpadmin.man:187 ++msgid "" ++"Specifies a PostScript Printer Description file to use with the printer. If " ++"specified, this option overrides the I<-i> option (interface script)." ++msgstr "" ++"Définir le fichier PPD (Postscript Printer Description) à utiliser avec " ++"cette imprimante. Si cette option est spécifiée, elle annule l'option B<-i> " ++"(script d'interface)." ++ ++# type: Plain text ++#: lpadmin.man:195 ++msgid "" ++"Unlike the System V printing system, CUPS allows printer names to contain " ++"any printable character except SPACE, TAB, \"/\", or \"#\". Also, printer " ++"and class names are I<not> case-sensitive. Finally, the CUPS version of " ++"I<lpadmin> may ask the user for an access password depending on the printing " ++"system configuration. This differs from the System V version which requires " ++"the root user to execute this command." ++msgstr "" ++"Contrairement au système d'impression System V, CUPS permet des noms " ++"d'imprimantes contenant tout caractère imprimable sauf ESPACE, TABULATION, " ++"w / » ou « # ». De plus, les noms d'imprimante et de classe ne sont I<pas> " ++"sensibles à la casse. Enfin, la version CUPS de B<lpadmin> peut demander un " ++"mot de passe, suivant la configuration du système, à la différence de la " ++"version System V qui demande le mot de passe root lors de l'exécution de " ++"cette commande." ++ ++# type: Plain text ++#: lpadmin.man:198 ++msgid "" ++"The CUPS version of I<lpadmin> does not support all of the System V or " ++"Solaris printing system configuration options." ++msgstr "" ++"La version CUPS de B<lpadmin> ne reconnaît pas toutes les options de " ++"configuration disponibles dans les versions System V ou Solaris." ++ ++# type: Plain text ++#: lpadmin.man:201 ++msgid "I<accept(8)>, I<cupsenable(8)>, I<lpinfo(8)>, I<lpoptions(1)>," ++msgstr "B<accept>(8), B<cupsenable>(8), B<lpinfo>(8), B<lpoptions>(1)," ++ ++# type: TH ++#: lpc.man:15 ++#, no-wrap ++msgid "lpc" ++msgstr "lpc" ++ ++# type: Plain text ++#: lpc.man:18 ++msgid "lpc - line printer control program" ++msgstr "lpc - Programme de contrôle d'imprimantes par ligne." ++ ++# type: Plain text ++#: lpc.man:25 ++msgid "B<lpc> [ I<command> [ I<parameter(s)> ] ]" ++msgstr "B<lpc> [ I<commande> [ I<paramètre(s)> ] ]" ++ ++# type: Plain text ++#: lpc.man:29 ++msgid "" ++"I<lpc> provides limited control over printer and class queues provided by " ++"CUPS. It can also be used to query the state of queues." ++msgstr "" ++"B<lpc> permet de contrôler partiellement des imprimantes et classes " ++"d'imprimantes de CUPS. Il est également utilisé pour récupérer l'état des " ++"files d'attente." ++ ++# type: Plain text ++#: lpc.man:32 ++msgid "" ++"If no command is specified on the command-line, lpc will display a prompt " ++"and accept commands from the standard input." ++msgstr "" ++"Si aucune commande n'est donnée dans la ligne de commande, lpc affichera une " ++"invite et prendra ses commandes depuis l'entrée standard." ++ ++# type: SH ++#: lpc.man:32 ++#, no-wrap ++msgid "COMMANDS" ++msgstr "COMMANDES" ++ ++# type: Plain text ++#: lpc.man:35 ++msgid "" ++"The I<lpc> program accepts a subset of commands accepted by the Berkeley " ++"I<lpc> program of the same name:" ++msgstr "" ++"B<lpc> reconnaît un sous-ensemble des commandes reconnues le programme " ++"B<lpc> de Berkeley :" ++ ++# type: TP ++#: lpc.man:35 ++#, no-wrap ++msgid "exit" ++msgstr "B<exit>" ++ ++# type: Plain text ++#: lpc.man:39 lpc.man:49 ++msgid "Exits the command interpreter." ++msgstr "Quitte l'interpréteur de commandes." ++ ++# type: TP ++#: lpc.man:39 ++#, no-wrap ++msgid "help [command]" ++msgstr "B<help> I<[commande]>" ++ ++# type: TP ++#: lpc.man:41 ++#, no-wrap ++msgid "? [command]" ++msgstr "B<?> I<[commande]>" ++ ++# type: Plain text ++#: lpc.man:45 ++msgid "Displays a short help message." ++msgstr "Afficher un message d'aide." ++ ++# type: TP ++#: lpc.man:45 ++#, no-wrap ++msgid "quit" ++msgstr "B<quit>" ++ ++# type: TP ++#: lpc.man:49 ++#, no-wrap ++msgid "status [queue]" ++msgstr "B<status> [I<file-attente>]" ++ ++# type: Plain text ++#: lpc.man:53 ++msgid "Displays the status of one or more printer or class queues." ++msgstr "" ++"Afficher l'état des files d'attente d'une ou plusieurs imprimantes ou " ++"classes d'imprimantes." ++ ++# type: Plain text ++#: lpc.man:59 ++msgid "" ++"Since I<lpc> is geared towards the Berkeley printing system, it is " ++"impossible to use I<lpc> to configure printer or class queues provided by " ++"CUPS. To configure printer or class queues you must use the I<lpadmin(8)> " ++"command or another CUPS-compatible client with that functionality." ++msgstr "" ++"Étant donné que B<lpc> est spécifique au système d'impression de Berkeley, " ++"il est impossible de l'utiliser pour configurer les files d'attente de CUPS. " ++"Pour cela, vous devez utiliser le programme B<lpadmin>(8) ou tout autre " ++"client compatible avec CUPS remplissant ces fonctions." ++ ++# type: Plain text ++#: lpc.man:62 ++msgid "" ++"The CUPS version of I<lpc> does not implement all of the standard Berkeley " ++"or LPRng commands." ++msgstr "" ++"La version CUPS de B<lpc> n'implémente pas toutes les commandes des versions " ++"Berkeley ou LPRng." ++ ++# type: Plain text ++#: lpc.man:65 ++msgid "" ++"I<accept(8)>, I<cancel(1)>, I<cupsenable(8)>, I<lp(1)>, I<lpr(1)>, I<lprm(1)" ++">, I<lpstat(1)>," ++msgstr "" ++"B<accept>(8), B<cancel>(1), B<cupsenable>(8), B<lp>(1), B<lpr>(1), B<lprm>" ++"(1), B<lpstat>(1)," ++ ++# type: TH ++#: lpinfo.man:15 ++#, no-wrap ++msgid "lpinfo" ++msgstr "lpinfo" ++ ++# type: Plain text ++#: lpinfo.man:18 ++msgid "lpinfo - show available devices or drivers" ++msgstr "lpinfo - Afficher les périphériques et pilotes disponibles." ++ ++# type: Plain text ++#: lpinfo.man:25 ++msgid "B<lpinfo> [ -E ] [ -U I<username> ] [ -h I<server[:port]> ] [ -l ] -m" ++msgstr "" ++"B<lpinfo> [ -E ] [ -U I<utilisateur> ] [ -h I<serveur[:port]> ] [ -l ] -m" ++ ++# type: Plain text ++#: lpinfo.man:32 ++msgid "B<lpinfo> [ -E ] [ -U I<username> ] [ -h I<server[:port]> ] [ -l ] -v" ++msgstr "" ++"B<lpinfo> [ -E ] [ -U I<utilisateur> ] [ -h I<serveur[:port]> ] [ -l ] -v" ++ ++# type: Plain text ++#: lpinfo.man:37 ++msgid "" ++"I<lpinfo> lists the available devices or drivers known to the CUPS server. " ++"The first form (I<-m>) lists the available drivers, while the second form " ++"(I<-v>) lists the available devices." ++msgstr "" ++"B<lpinfo> affiche la liste des périphériques ou pilotes connus par le " ++"serveur CUPS. La première forme (avec B<-m>) liste les pilotes disponibles, " ++"et la seconde forme (avec B<-v>) liste les périphériques disponibles." ++ ++# type: Plain text ++#: lpinfo.man:39 ++msgid "I<lpinfo> accepts the following options:" ++msgstr "B<lpinfo> gère les options suivantes :" ++ ++# type: Plain text ++#: lpinfo.man:47 ++msgid "Sets the username to use when connecting to the server." ++msgstr "Indiquer l'utilisateur utilisé pour se connecter au serveur." ++ ++# type: Plain text ++#: lpinfo.man:51 ++msgid "Selects an alternate server." ++msgstr "Sélectionner un autre serveur." ++ ++# type: Plain text ++#: lpinfo.man:55 ++msgid "Shows a \"long\" listing of devices or drivers." ++msgstr "Afficher une liste « longue » des périphériques ou pilotes." ++ ++# type: Plain text ++#: lpinfo.man:57 ++msgid "The I<lpinfo> command is unique to CUPS." ++msgstr "La commande B<lpinfo> est spécifique à CUPS." ++ ++# type: TH ++#: lp.man:15 ++#, no-wrap ++msgid "lp" ++msgstr "lp" ++ ++# type: TH ++#: lp.man:15 lpstat.man:15 ++#, no-wrap ++msgid "23 March 2006" ++msgstr "23 mars 2006" ++ ++# type: Plain text ++#: lp.man:18 ++msgid "lp - print files" ++msgstr "lp - Imprimer des fichiers." ++ ++# type: Plain text ++#: lp.man:41 ++msgid "" ++"B<lp> [ -E ] [ -U I<username> ] [ -c ] [ -d I<destination[/instance]> ] [ -h " ++"I<hostname[:port]> ] [ -m ] [ -n I<num-copies> ] [ -o I<option[=value]> ] [ -" ++"q I<priority> ] [ -s ] [ -t I<title> ] [ -H I<handling> ] [ -P I<page-" ++"list> ] [ -- ] [ I<file(s)> ]" ++msgstr "" ++"B<lp> [ -E ] [ -U I<utilisateur> ] [ -c ] [ -d I<destination[/instance]> ] " ++"[ -h I<hostname[:port]> ] [ -m ] [ -n I<copies> ] [ -o I<option[=valeur]> ] " ++"[ -q I<priorité> ] [ -s ] [ -t I<titre> ] [ -H I<méthode> ] [ -P " ++"I<liste_de_pages> ] [ -- ] [ I<fichier(s)> ]" ++ ++# type: Plain text ++#: lp.man:62 ++msgid "" ++"B<lp> [ -E ] [ -U I<username> ] [ -c ] [ -h I<hostname[:port]> ] [ -i I<job-" ++"id> ] [ -n I<num-copies> ] [ -o I<option[=value]> ] [ -q I<priority> ] [ -t " ++"I<title> ] [ -H I<handling> ] [ -P I<page-list> ]" ++msgstr "" ++"B<lp> [ -E ] [ -U I<utilisateur> ] [ -c ] [ -h I<serveur[:port]> ] [ -i " ++"I<id_travail> ] [ -n I<copies> ] [ -o I<option[=valeur]> ] [ -q " ++"I<priorité> ] [ -t I<titre> ] [ -H I<méthode> ] [ -P I<liste_de_pages> ]" ++ ++# type: Plain text ++#: lp.man:65 ++msgid "" ++"I<lp> submits files for printing or alters a pending job. Use a filename of " ++"\"-\" to force printing from the standard input." ++msgstr "" ++"B<lp> demande l'impression d'un fichier ou modifie un travail d'impression " ++"en attente. Utiliser « - » comme fichier pour forcer l'impression à partir de " ++"l'entrée standard." ++ ++# type: Plain text ++#: lp.man:67 ++msgid "The following options are recognized by I<lp>:" ++msgstr "Les options suivantes sont reconnues par B<lp> :" ++ ++# type: TP ++#: lp.man:67 ++#, no-wrap ++msgid "--" ++msgstr "B<-->" ++ ++# type: Plain text ++#: lp.man:72 ++msgid "" ++"Marks the end of options; use this to print a file whose name begins with a " ++"dash (-)." ++msgstr "" ++"Marquer la fin des options ; utilisez ceci pour imprimer un fichier dont le " ++"nom commence par un tiret (« - »)." ++ ++# type: Plain text ++#: lp.man:88 ++msgid "" ++"This option is provided for backwards-compatibility only. On systems that " ++"support it, this option forces the print file to be copied to the spool " ++"directory before printing. In CUPS, print files are always sent to the " ++"scheduler via IPP which has the same effect." ++msgstr "" ++"Cette option n'est fournie que pour des raisons de compatibilité avec les " ++"précédentes versions. Sur les systèmes le permettant, elle force la copie du " ++"fichier d'impression dans le répertoire spool avant impression. Avec CUPS, " ++"les fichiers d'impression sont envoyés à l'ordonnanceur via IPP. Le résultat " ++"est le même dans les deux cas." ++ ++# type: TP ++#: lp.man:88 ++#, no-wrap ++msgid "-d destination" ++msgstr "B<-d> I<destination>" ++ ++# type: Plain text ++#: lp.man:92 lpr.man:63 ++msgid "Prints files to the named printer." ++msgstr "Imprimer les fichiers sur l'imprimante donnée." ++ ++# type: TP ++#: lp.man:96 ++#, no-wrap ++msgid "-i job-id" ++msgstr "B<-i> I<id_travail>" ++ ++# type: Plain text ++#: lp.man:100 ++msgid "Specifies an existing job to modify." ++msgstr "Indiquer l'identifiant du travail d'impression à modifier." ++ ++# type: TP ++#: lp.man:100 lpr.man:82 ++#, no-wrap ++msgid "-m" ++msgstr "B<-m>" ++ ++# type: Plain text ++#: lp.man:104 ++msgid "Sends an email when the job is completed." ++msgstr "Envoyer un courrier électronique lorsque l'impression est terminée." ++ ++# type: Plain text ++#: lp.man:108 lpr.man:71 ++msgid "Sets the number of copies to print from 1 to 100." ++msgstr "Nombre de copies à effectuer (de 1 à 100)." ++ ++# type: TP ++#: lp.man:108 ++#, no-wrap ++msgid "-o \"name=value [name=value ...]\"" ++msgstr "B<-o> I<nom=valeur [nom=valeur ...]>" ++ ++# type: Plain text ++#: lp.man:112 ++msgid "Sets one or more job options." ++msgstr "Définir une ou plusieurs options pour le travail d'impression." ++ ++# type: TP ++#: lp.man:112 ++#, no-wrap ++msgid "-q priority" ++msgstr "B<-q> I<priorité>" ++ ++# type: Plain text ++#: lp.man:117 ++msgid "" ++"Sets the job priority from 1 (lowest) to 100 (highest). The default priority " ++"is 50." ++msgstr "" ++"Définir la priorité du travail d'impression, de 1 (minimale) à 100 " ++"(maximale). La priorité par défaut est 50." ++ ++# type: TP ++#: lp.man:117 lpstat.man:101 ++#, no-wrap ++msgid "-s" ++msgstr "B<-s>" ++ ++# type: Plain text ++#: lp.man:121 ++msgid "Do not report the resulting job IDs (silent mode.)" ++msgstr "Ne pas afficher le numéro du travail (mode silencieux)." ++ ++# type: TP ++#: lp.man:121 ++#, no-wrap ++msgid "-t \"name\"" ++msgstr "B<-t> I<nom>" ++ ++# type: Plain text ++#: lp.man:125 lpr.man:59 ++msgid "Sets the job name." ++msgstr "Définir le I<nom> du travail." ++ ++# type: Plain text ++#: lp.man:129 ++msgid "Submits jobs as I<username>." ++msgstr "Envoyer les travaux d'impression en tant que I<utilisateur>." ++ ++# type: TP ++#: lp.man:129 ++#, no-wrap ++msgid "-H hh:mm" ++msgstr "B<-H> I<hh:mm>" ++ ++# type: TP ++#: lp.man:131 ++#, no-wrap ++msgid "-H hold" ++msgstr "B<-H hold>" ++ ++# type: TP ++#: lp.man:133 ++#, no-wrap ++msgid "-H immediate" ++msgstr "B<-H immediate>" ++ ++# type: TP ++#: lp.man:135 ++#, no-wrap ++msgid "-H restart" ++msgstr "B<-H restart>" ++ ++# type: TP ++#: lp.man:137 ++#, no-wrap ++msgid "-H resume" ++msgstr "B<-H resume>" ++ ++# type: Plain text ++#: lp.man:147 ++msgid "" ++"Specifies when the job should be printed. A value of I<immediate> will print " ++"the file immediately, a value of I<hold> will hold the job indefinitely, and " ++"a time value (HH:MM) will hold the job until the specified time. Use a value " ++"of I<resume> with the I<-i> option to resume a held job. Use a value of " ++"I<restart> with the I<-i> option to restart a completed job." ++msgstr "" ++"Définir quand l'impression doit être effectuée. La valeur B<immediate> " ++"effectue l'impression immédiatement, la valeur B<hold> suspend l'impression " ++"indéfiniment, une heure suspend l'impression jusqu'à l'heure donnée. " ++"Utilisez la valeur B<resume> avec l'option B<-i> pour reprendre un travail " ++"suspendu. Utilisez la valeur B<restart> avec l'option B<-i> pour relancer un " ++"travail terminé." ++ ++# type: TP ++#: lp.man:147 ++#, no-wrap ++msgid "-P page-list" ++msgstr "B<-P> I<liste-de-pages>" ++ ++# type: Plain text ++#: lp.man:153 ++msgid "" ++"Specifies which pages to print in the document. The list can contain a list " ++"of numbers and ranges (#-#) separated by commas (e.g. 1,3-5,16)." ++msgstr "" ++"Définir quelles sont les pages à imprimer. Cette liste ne peut contenir que " ++"des numéros ou des portions (#-#), séparés par des virgules (par exemple : " ++"1,3-5,16)." ++ ++# type: SH ++#: lp.man:153 ++#, no-wrap ++msgid "COMMON JOB OPTIONS" ++msgstr "OPTIONS COMMUNES DES TRAVAUX" ++ ++# type: Plain text ++#: lp.man:157 ++msgid "" ++"Aside from the printer-specific options reported by the I<lpoptions(1)> " ++"command, the following generic options are available:" ++msgstr "" ++"En plus des options spécifiques des imprimantes, indiquées par B<lpoptions>" ++"(1), les options génériques suivantes sont disponibles :" ++ ++# type: TP ++#: lp.man:157 ++#, no-wrap ++msgid "-o media=size" ++msgstr "B<-o> B<media>=I<taille>" ++ ++# type: Plain text ++#: lp.man:162 ++msgid "" ++"Sets the page size to I<size>. Most printers support at least the size names " ++"\"a4\", \"letter\", and \"legal\"." ++msgstr "" ++"Fixer la taille du papier à I<taille>. La plupart des imprimantes gèrent au " ++"moins les tailles appelées « a4 », « letter » et « legal »." ++ ++# type: TP ++#: lp.man:162 ++#, no-wrap ++msgid "-o landscape" ++msgstr "B<-o landscape>" ++ ++# type: TP ++#: lp.man:164 ++#, no-wrap ++msgid "-o orientation-requested=4" ++msgstr "B<-o orientation-requested>=I<4>" ++ ++# type: Plain text ++#: lp.man:168 ++msgid "Prints the job in landscape (rotated 90 degrees)." ++msgstr "Imprimer en mode paysage (rotation de 90 degrés)." ++ ++# type: TP ++#: lp.man:168 ++#, no-wrap ++msgid "-o sides=one-sided" ++msgstr "B<-o sides>=B<one-sided>" ++ ++# type: TP ++#: lp.man:170 ++#, no-wrap ++msgid "-o sides=two-sided-long-edge" ++msgstr "B<-o sides>=B<two-sided-long-edge>" ++ ++# type: TP ++#: lp.man:172 ++#, no-wrap ++msgid "-o sides=two-sided-short-edge" ++msgstr "B<-o sides>=B<two-sided-short-edge>" ++ ++# type: Plain text ++#: lp.man:179 ++msgid "" ++"Prints on one or two sides of the paper. The value \"two-sided-long-edge\" " ++"is normally used when printing portrait (unrotated) pages, while \"two-sided-" ++"short-edge\" is used for landscape pages." ++msgstr "" ++"Imprimer sur une face ou en recto-verso. La valeur « B<two-sided-long-" ++"edge> » (double faces, côté long) est normalement utilisée pour l'impression " ++"en mode portrait (pas de rotation), et « B<two-sided-short-edge> » (double " ++"faces, petit côté) pour l'impression de pages en mode paysage." ++ ++# type: TP ++#: lp.man:179 ++#, no-wrap ++msgid "-o fitplot" ++msgstr "B<-o fitplot>" ++ ++# type: Plain text ++#: lp.man:183 ++msgid "Scales the print file to fit on the page." ++msgstr "Mettre le fichier à l'échelle pour qu'il prenne la taille de la page." ++ ++# type: TP ++#: lp.man:183 ++#, no-wrap ++msgid "-o scaling=number" ++msgstr "B<-o scaling>=I<nombre>" ++ ++# type: Plain text ++#: lp.man:189 ++msgid "" ++"Scales image files to use up to I<number> percent of the page. Values " ++"greater than 100 cause the image file to be printed across multiple pages." ++msgstr "" ++"Mettre les fichiers image à l'échelle de telle sorte qu'il utilise jusqu'à " ++"I<nombre> pourcents de la page. Les valeurs supérieures à 100 forceront " ++"l'impression des images sur plusieurs pages." ++ ++# type: TP ++#: lp.man:189 ++#, no-wrap ++msgid "-o cpi=N" ++msgstr "B<-o cpi>=I<N>" ++ ++# type: Plain text ++#: lp.man:194 ++msgid "" ++"Sets the number of characters per inch to use when printing a text file. The " ++"default is 10." ++msgstr "" ++"Fixer le nombre de caractères par pouces à utiliser pour l'impression de " ++"fichiers texte. La valeur par défaut est 10." ++ ++# type: TP ++#: lp.man:194 ++#, no-wrap ++msgid "-o lpi=N" ++msgstr "B<-o lpi>=I<N>" ++ ++# type: Plain text ++#: lp.man:199 ++msgid "" ++"Sets the number of lines per inch to use when printing a text file. The " ++"default is 6." ++msgstr "" ++"Fixer le nombre de lignes par pouces à utiliser pour l'impression de " ++"fichiers texte. La valeur par défaut est 6." ++ ++# type: TP ++#: lp.man:199 ++#, no-wrap ++msgid "-o page-bottom=N" ++msgstr "B<-o page-bottom>=I<N>" ++ ++# type: TP ++#: lp.man:201 ++#, no-wrap ++msgid "-o page-left=N" ++msgstr "B<-o page-left>=I<N>" ++ ++# type: TP ++#: lp.man:203 ++#, no-wrap ++msgid "-o page-right=N" ++msgstr "B<-o page-right>=I<N>" ++ ++# type: TP ++#: lp.man:205 ++#, no-wrap ++msgid "-o page-top=N" ++msgstr "B<-o page-top>=I<N>" ++ ++# type: Plain text ++#: lp.man:210 ++msgid "" ++"Sets the page margins when printing text files. The values are in points - " ++"there are 72 points to the inch." ++msgstr "" ++"Fixer les marges des pages pour l'impression de fichiers texte. Les valeurs " ++"sont exprimées en points ; il y a 72 points par pouces." ++ ++# type: Plain text ++#: lp.man:212 ++msgid "Print a double-sided legal document to a printer called \"foo\":" ++msgstr "Imprimer en recto-verso sur du papier a4 avec l'imprimante « toto »." ++ ++# type: Plain text ++#: lp.man:214 ++#, no-wrap ++msgid " lp -d foo -o media=legal -o sides=two-sided-long-edge filename\n" ++msgstr " lp -d toto -o media=a4 -o sides=two-sided-long-edge fichier\n" ++ ++# type: Plain text ++#: lp.man:217 ++msgid "Print an image across 4 pages:" ++msgstr "Imprimer une image sur 4 pages :" ++ ++# type: Plain text ++#: lp.man:219 ++#, no-wrap ++msgid " lp -d bar -o scaling=200 filename\n" ++msgstr " lp -d titi -o scaling=200 fichier\n" ++ ++# type: Plain text ++#: lp.man:223 ++msgid "" ++"Print a text file with 12 characters per inch, 8 lines per inch, and a 1 " ++"inch left margin:" ++msgstr "" ++"Imprimer un fichier texte avec 12 caractères par pouces, 8 lignes par pouces " ++"et une marge de gauche de 1 pouce :" ++ ++# type: Plain text ++#: lp.man:225 ++#, no-wrap ++msgid " lp -d bar -o cpi=12 -o lpi=8 -o page-left=72 filename\n" ++msgstr " lp -d titi -o cpi=12 -o lpi=8 -o page-left=72 fichier\n" ++ ++# type: Plain text ++#: lp.man:235 ++msgid "" ++"The \"q\" option accepts a different range of values than the Solaris lp " ++"command, matching the IPP job priority values (1-100, 100 is highest " ++"priority) instead of the Solaris values (0-39, 0 is highest priority)." ++msgstr "" ++"L'option « B<-q> » accepte des valeurs différentes de celles utilisées par la " ++"commande lp de Solaris (qui utilise les valeurs de 0 à 39, 0 étant la " ++"priorité la plus élevée), correspondant aux priorités des travaux IPP (de 1 " ++"à 100, 100 étant la priorité la plus élevée)." ++ ++# type: Plain text ++#: lp.man:237 ++msgid "I<cancel(1)>, I<lpmove(8)>, I<lpoptions(1)>, I<lpstat(1)>," ++msgstr "B<cancel>(1), B<lpmove>(8), B<lpoptions>(1), B<lpstat>(1)," ++ ++# type: TH ++#: lpmove.man:15 ++#, no-wrap ++msgid "lpmove" ++msgstr "lpmove" ++ ++# type: Plain text ++#: lpmove.man:18 ++msgid "lpmove - move a job or all jobs to a new destination" ++msgstr "" ++"lpmove - Déplacer un travail d'impression (ou tous) vers une nouvelle " ++"destination." ++ ++# type: Plain text ++#: lpmove.man:26 ++msgid "" ++"B<lpmove> [ -E ] [ -h I<server[:port]> ] [ -U I<username> ] I<job " ++"destination>" ++msgstr "" ++"B<lpmove> [ -E ] [ -h I<serveur[:port]> ] [ -U I<utilisateur> ] I<travail " ++"destination>" ++ ++# type: Plain text ++#: lpmove.man:34 ++msgid "" ++"B<lpmove> [ -E ] [ -h I<server[:port]> ] [ -U I<username> ] I<source " ++"destination>" ++msgstr "" ++"B<lpmove> [ -E ] [ -h I<serveur[:port]> ] [ -U I<utilisateur> ] I<source " ++"destination>" ++ ++# type: Plain text ++#: lpmove.man:38 ++msgid "" ++"B<lpmove> moves the specified I<job> or all jobs from I<source> to " ++"I<destination>. I<job> can be the job ID number or the old destination and " ++"job ID:" ++msgstr "" ++"B<lpmove> déplace le I<travail d'impression> ou tous les travaux de " ++"I<source> vers I<destination>. On peut spécifier le I<travail> sous deux " ++"formes : soit l'identifiant du travail d'impression, soit l'ancienne " ++"destination et l'identifiant du travail. Par exemple :" ++ ++# type: Plain text ++#: lpmove.man:43 ++#, no-wrap ++msgid "" ++" lpmove 123 newprinter\n" ++" lpmove oldprinter-123 newprinter\n" ++msgstr "" ++" lpmove 123 NouvelleImprimante\n" ++" lpmove AncienneImprimante-123 NouvelleImprimante\n" ++ ++# type: Plain text ++#: lpmove.man:46 ++msgid "The I<lpmove> command supports the following options:" ++msgstr "B<lpmove> gère les options suivantes :" ++ ++# type: Plain text ++#: lpmove.man:54 lpq.man:51 lpr.man:67 lprm.man:49 lpstat.man:57 ++msgid "Specifies an alternate username." ++msgstr "Utiliser l'I<utilisateur> donné." ++ ++# type: Plain text ++#: lpmove.man:58 lpq.man:59 lpr.man:51 lpstat.man:83 ++msgid "Specifies an alternate server." ++msgstr "Utiliser le serveur donné." ++ ++# type: Plain text ++#: lpmove.man:60 lpstat.man:133 ++msgid "I<cancel(1)>, I<lp(1)>," ++msgstr "B<cancel>(1), B<lp>(1)," ++ ++# type: TH ++#: lpoptions.man.in:15 ++#, no-wrap ++msgid "lpoptions" ++msgstr "lpoptions" ++ ++# type: Plain text ++#: lpoptions.man.in:18 ++msgid "lpoptions - display or set printer options and defaults" ++msgstr "" ++"lpoptions - Afficher et définir les options et paramètres par défaut d'une " ++"imprimante." ++ ++# type: Plain text ++#: lpoptions.man.in:31 ++msgid "" ++"B<lpoptions> [ -E ] [ -U I<username> ] [ -h I<server[:port]> ] -d " ++"I<destination[/instance]> [ -o I<option[=value]> ] ... [ -o I<option[=value]" ++"> ]" ++msgstr "" ++"B<lpoptions> [ -E ] [ -U I<utilisateur> ] [ -h I<serveur[:port]> ] -d " ++"I<destination[/instance]> [ -o I<option[=valeur]> ] ... [ -o I<option" ++"[=valeur]> ]" ++ ++# type: Plain text ++#: lpoptions.man.in:40 ++msgid "" ++"B<lpoptions> [ -E ] [ -U I<username> ] [ -h I<server[:port]> ] [ -p " ++"I<destination[/instance]> ] -l" ++msgstr "" ++"B<lpoptions> [ -E ] [ -U I<utilisateur> ] [ -h I<serveur[:port]> ] [ -p " ++"I<destination[/instance]> ] -l" ++ ++# type: Plain text ++#: lpoptions.man.in:54 ++msgid "" ++"B<lpoptions> [ -E ] [ -U I<username> ] [ -h I<server[:port]> ] [ -o I<option" ++"[=value]> ] ... [ -o I<option[=value]> ] [ -p I<destination[/instance]> ] -r " ++"I<option>" ++msgstr "" ++"B<lpoptions> [ -E ] [ -U I<utilisateur> ] [ -h I<serveur[:port]> ] [ -o " ++"I<option[=value]> ] ... [ -o I<option[=valeur]> ] [ -p I<destination[/" ++"instance]> ] -r I<option>" ++ ++# type: Plain text ++#: lpoptions.man.in:62 ++msgid "" ++"B<lpoptions> [ -E ] [ -U I<username> ] [ -h I<server[:port]> ] -x " ++"I<destination[/instance]>" ++msgstr "" ++"B<lpoptions> [ -E ] [ -U I<utilisateur> ] [ -h I<serveur[:port]> ] -x " ++"I<destination[/instance]>" ++ ++# type: Plain text ++#: lpoptions.man.in:66 ++msgid "" ++"I<lpoptions> displays or sets printer options and defaults. I<lpoptions> " ++"shows the default printer options when run with no arguments. Other options " ++"include:" ++msgstr "" ++"B<lpoptions> affiche et définit les options et valeurs par défaut d'une " ++"imprimante. Lorsqu'il est lancé sans arguments, B<lpoptions> affiche les " ++"options. Les otpions pouvant être fournis sont :" ++ ++# type: Plain text ++#: lpoptions.man.in:70 ++msgid "Enables encryption when communicating with the CUPS server." ++msgstr "Activer le chiffrement pour la communication avec le serveur CUPS." ++ ++# type: Plain text ++#: lpoptions.man.in:74 ++msgid "Uses an alternate username." ++msgstr "Utilise un autre utilisateur." ++ ++# type: TP ++#: lpoptions.man.in:74 ++#, no-wrap ++msgid "-d destination[/instance]" ++msgstr "B<-d> I<destination[/instance]>" ++ ++# type: Plain text ++#: lpoptions.man.in:80 ++msgid "" ++"Sets the default printer to I<destination>. If I<instance> is supplied then " ++"that particular instance is used. This option overrides the system default " ++"printer for the current user." ++msgstr "" ++"Définir I<destination> comme imprimante par défaut. Il est également " ++"possible de fournir une I<instance>. Cette option redéfinit l'imprimante par " ++"défaut de l'utilisateur en cours." ++ ++# type: Plain text ++#: lpoptions.man.in:84 ++msgid "Uses an alternate server." ++msgstr "Utiliser un autre serveur." ++ ++# type: Plain text ++#: lpoptions.man.in:88 ++msgid "Lists the printer specific options and their current settings." ++msgstr "Affiche les options spécifiques d'une imprimante et leur valeur." ++ ++# type: TP ++#: lpoptions.man.in:88 lpr.man:86 ++#, no-wrap ++msgid "-o option[=value]" ++msgstr "B<-o> I<option[=valeur]>" ++ ++# type: Plain text ++#: lpoptions.man.in:92 ++msgid "Specifies a new option for the named destination." ++msgstr "Définir une nouvelle option pour la destination donnée." ++ ++# type: TP ++#: lpoptions.man.in:92 ++#, no-wrap ++msgid "-p destination[/instance]" ++msgstr "B<-p> I<destination[/instance]>" ++ ++# type: Plain text ++#: lpoptions.man.in:98 ++msgid "" ++"Sets the destination and instance, if specified, for any options that " ++"follow. If the named instance does not exist then it is created." ++msgstr "" ++"Définir la destination et l'instance, si elle est indiquée. Si l'instance " ++"n'existe pas, celle-ci est créée." ++ ++# type: TP ++#: lpoptions.man.in:98 ++#, no-wrap ++msgid "-r option" ++msgstr "B<-r> I<option>" ++ ++# type: Plain text ++#: lpoptions.man.in:102 ++msgid "Removes the specified option for the named destination." ++msgstr "Supprimer une option de la destination fournie en paramètre." ++ ++# type: TP ++#: lpoptions.man.in:102 ++#, no-wrap ++msgid "-x destination[/instance]" ++msgstr "B<-x> I<destination[/instance]>" ++ ++# type: Plain text ++#: lpoptions.man.in:108 ++msgid "" ++"Removes the options for the named destination and instance, if specified. If " ++"the named instance does not exist then this does nothing." ++msgstr "" ++"Supprimer toutes les options de la destination, et de l'instance si elle est " ++"indiquée, fournie en paramètre. Si l'instance n'existe pas, la commande n'a " ++"pas d'effet." ++ ++# type: Plain text ++#: lpoptions.man.in:112 ++msgid "" ++"If no options are specified using the I<-o> option, then the current options " ++"for the named printer are reported on the standard output." ++msgstr "" ++"Si aucune option n'est fournie avec l'option B<-o>, les options actuelles de " ++"l'imprimante fournie en paramètre sont affichées sur la sortie standard." ++ ++# type: Plain text ++#: lpoptions.man.in:115 ++msgid "" ++"Options set with the I<lpoptions> command are used by the I<lp(1)> and I<lpr" ++"(1)> commands when submitting jobs." ++msgstr "" ++"Les options définies par la commande B<lpoptions> sont utilisées par les " ++"commandes B<lp>(1) et B<lpr>(1) lors de l'envoi de travaux d'impression." ++ ++# type: SH ++#: lpoptions.man.in:115 ++#, no-wrap ++msgid "ROOT ACCOUNT OPTIONS" ++msgstr "OPTION DU COMPTE ROOT" ++ ++# type: Plain text ++#: lpoptions.man.in:119 ++msgid "" ++"When run by the root user, I<lpoptions> gets and sets default options and " ++"instances for I<all users> in the @CUPS_SERVERROOT@/lpoptions file." ++msgstr "" ++"Lorsque la commande B<lpoptions> est lancée par l'utilisateur root, les " ++"options sont lues et sauvegardées pour I<tous les utilisateurs> dans le " ++"fichier @CUPS_SERVERROOT@/lpoptions." ++ ++# type: Plain text ++#: lpoptions.man.in:121 ++msgid "The I<lpoptions> command is unique to CUPS." ++msgstr "La commande B<lpoptions> est spécifique à CUPS." ++ ++# type: SH ++#: lpoptions.man.in:121 ++#, no-wrap ++msgid "FILES" ++msgstr "FICHIERS" ++ ++# type: Plain text ++#: lpoptions.man.in:124 ++msgid "" ++"~/.cups/lpoptions - user defaults and instances created by non-root users." ++msgstr "" ++"~/.cups/lpoptions - Fichier des valeurs par défaut et instance de " ++"l'utilisateur." ++ ++# type: Plain text ++#: lpoptions.man.in:127 ++msgid "" ++"@CUPS_SERVERROOT@/lpoptions - system-wide defaults and instances created by " ++"the root user." ++msgstr "" ++"@CUPS_SERVERROOT@/lpoptions - Fichier global des instance et valeurs par " ++"défaut, créé par l'utilisateur root." ++ ++# type: Plain text ++#: lpoptions.man.in:129 ++msgid "I<cancel(1)>, I<lp(1)>, I<lpr(1)>," ++msgstr "B<cancel>(1), B<lp>(1), B<lpr>(1)," ++ ++# type: TH ++#: lppasswd.man:15 ++#, no-wrap ++msgid "lppasswd" ++msgstr "lppasswd" ++ ++# type: Plain text ++#: lppasswd.man:18 ++msgid "lppasswd - add, change, or delete digest passwords." ++msgstr "lppasswd - Ajouter, modifier ou supprimer des mots de passe." ++ ++# type: Plain text ++#: lppasswd.man:23 ++msgid "B<lppasswd> [ I<username> ]" ++msgstr "B<lppasswd> [ I<utilisateur> ]" ++ ++# type: Plain text ++#: lppasswd.man:29 ++msgid "B<lppasswd> -a [ -g I<groupname> ] I<username>" ++msgstr "B<lppasswd> -a [ -g I<groupe> ] I<utilisateur>" ++ ++# type: Plain text ++#: lppasswd.man:33 ++msgid "B<lppasswd> -x I<username>" ++msgstr "B<lppasswd> -x I<utilisateur>" ++ ++# type: Plain text ++#: lppasswd.man:41 ++msgid "" ++"I<lppasswd> adds, changes, or deletes passwords in the CUPS digest password " ++"file, I<passwd.md5>. When run by a normal user, I<lppasswd> will prompt for " ++"the old and new passwords. When run by the super-user, I<lppasswd> can add " ++"new accounts (I<-a username>), change existing accounts (I<username>), or " ++"delete accounts (I<-x username>) in the digest password file. Digest " ++"usernames do not have to match local UNIX usernames." ++msgstr "" ++"B<lppasswd> ajoute, modifie ou supprime des mots de passe du fichier CUPS de " ++"hachés de mots de passe, I<passwd.md5>. Lorsque ce programme est lancé par " ++"un utlisateur non privilégié, B<lppasswd> demande l'ancien et le nouveau mot " ++"de passe. Lorsque ce programme est lancé par un superutilisateur, il peut " ++"créer de nouveaux comptes utilisateurs (B<-a> I<utilisateur>), modifier des " ++"comptes existants (I<utilisateur>) ou supprimer des comptes (B<-x> " ++"I<utilisateur>). Les noms d'utilisateurs ne doivent pas forcément " ++"correspondre à des noms d'utilisateurs UNIX." ++ ++# type: Plain text ++#: lppasswd.man:43 ++msgid "I<lppasswd> supports the following options:" ++msgstr "B<lppasswd> gère les options suivantes :" ++ ++# type: TP ++#: lppasswd.man:43 ++#, no-wrap ++msgid "-g groupname" ++msgstr "B<-g> I<groupe>" ++ ++# type: Plain text ++#: lppasswd.man:47 ++msgid "Specifies a group other than the default system group." ++msgstr "Définir un groupe autre que le groupe système par défaut." ++ ++# type: SH ++#: lppasswd.man:47 ++#, no-wrap ++msgid "SECURITY ISSUES" ++msgstr "PROBLÈMES DE SÉCURITÉ" ++ ++# type: Plain text ++#: lppasswd.man:53 ++#, fuzzy ++#| msgid "" ++#| "The I<lppasswd> command is installed setuid to root. While every attempt " ++#| "has been made to make it secure against exploits that could grant super-" ++#| "user privileges to unprivileged users, paranoid system administrators may " ++#| "wish to disable or change the ownership of the program to an unprivileged " ++#| "account. " ++msgid "" ++"The I<lppasswd> command is installed setuid to root. While every attempt has " ++"been made to make it secure against exploits that could grant super-user " ++"privileges to unprivileged users, paranoid system administrators may wish to " ++"disable or change the ownership of the program to an unprivileged account." ++msgstr "" ++"La commande B<lppasswd> est installée avec le bit setuid activé. Toutes les " ++"précautions ont été prises pour empêcher les failles permettant l'accès aux " ++"privilèges du super-utilisateur par un utilisateur non privilégié. " ++"Cependant, certains administrateurs systèmes paranoïaques peuvent vouloir " ++"désactiver ce programme ou en modifier le propriétaire en un utilisateur non " ++"privilégié." ++ ++# type: Plain text ++#: lppasswd.man:55 ++msgid "I<lp(1)>, I<lpr(1)>," ++msgstr "B<lp>(1), B<lpr>(1)," ++ ++# type: TH ++#: lpq.man:15 ++#, no-wrap ++msgid "lpq" ++msgstr "lpq" ++ ++# type: Plain text ++#: lpq.man:18 ++msgid "lpq - show printer queue status" ++msgstr "lpq - Afficher l'état d'une file d'attente d'impression." ++ ++# type: Plain text ++#: lpq.man:29 ++msgid "" ++"B<lpq> [ -E ] [ -U I<username> ] [ -h I<server[:port]> ] [ -P I<destination[/" ++"instance]> ] [ -a ] [ -l ] [ I<+interval> ]" ++msgstr "" ++"B<lpq> [ -E ] [ -U I<utilisateur> ] [ -h I<serveur[:port]> ] [ -P " ++"I<destination[/instance]> ] [ -a ] [ -l ] [ I<+intervalle> ]" ++ ++# type: Plain text ++#: lpq.man:33 ++msgid "" ++"I<lpq> shows the current print queue status on the named printer. Jobs " ++"queued on the default destination will be shown if no printer or class is " ++"specified on the command-line." ++msgstr "" ++"B<lpq> affiche l'état actuel de la file d'attente d'une imprimante donnée. " ++"Si aucune imprimante ou classe d'imprimante n'est donnée dans la ligne de " ++"commande, les travaux en attente sur la destination par défaut seront " ++"affichés." ++ ++# type: Plain text ++#: lpq.man:37 ++msgid "" ++"The I<+interval> option allows you to continuously report the jobs in the " ++"queue until the queue is empty; the list of jobs is shown once every " ++"I<interval> seconds." ++msgstr "" ++"L'option I<+intervalle> permet d'afficher les travaux en attente en continu " ++"jusqu'à ce qu'il n'y en ait plus. La liste est réaffichée toutes les " ++"I<intervalle> secondes." ++ ++# type: Plain text ++#: lpq.man:39 ++msgid "I<lpq> supports the following options:" ++msgstr "B<lpq> gère les options suivantes :" ++ ++# type: TP ++#: lpq.man:43 lpr.man:59 lprm.man:41 ++#, no-wrap ++msgid "-P destination[/instance]" ++msgstr "B<-P> I<destination[/instance]>" ++ ++# type: Plain text ++#: lpq.man:47 ++msgid "Specifies an alternate printer or class name." ++msgstr "Utiliser l'imprimante ou classe d'imprimante donnée." ++ ++# type: Plain text ++#: lpq.man:55 ++msgid "Reports jobs on all printers." ++msgstr "Afficher les travaux de toutes les imprimantes." ++ ++# type: Plain text ++#: lpq.man:63 ++msgid "Requests a more verbose (long) reporting format." ++msgstr "Demander un format de rapport plus bavard." ++ ++# type: Plain text ++#: lpq.man:66 ++msgid "I<cancel(1)>, I<lp(1)>, I<lpr(1)>, I<lprm(1)>, I<lpstat(1)>," ++msgstr "B<cancel>(1), B<lp>(1), B<lpr>(1), B<lprm>(1), B<lpstat>(1)," ++ ++# type: TH ++#: lpr.man:15 ++#, no-wrap ++msgid "lpr" ++msgstr "lpr" ++ ++# type: Plain text ++#: lpr.man:18 ++msgid "lpr - print files" ++msgstr "lpr - Imprimer des fichiers." ++ ++# type: Plain text ++#: lpr.man:35 ++msgid "" ++"B<lpr> [ -E ] [ -H I<server[:port]> ] [ -U I<username> ] [ -P I<destination[/" ++"instance]> ] [ -# I<num-copies> [ -h ] [ -l ] [ -m ] [ -o I<option[=value]" ++"> ] [ -p] [ -q ] [ -r ] [ -C/J/T I<title> ] [ I<file(s)> ]" ++msgstr "" ++"B<lpr> [ -E ] [ -H I<serveur[:port]> ] [ -U I<utilisateur> ] [ -P " ++"I<destination[/instance]> ] [ -# I<copies> [ -h ] [ -l ] [ -m ] [ -o I<option" ++"[=valeur]> ] [ -p] [ -q ] [ -r ] [ -C/J/T I<titre> ] [ I<fichier(s)> ]" ++ ++# type: Plain text ++#: lpr.man:41 ++msgid "" ++"I<lpr> submits files for printing. Files named on the command line are sent " ++"to the named printer (or the system default destination if no destination is " ++"specified). If no files are listed on the command-line, I<lpr> reads the " ++"print file from the standard input." ++msgstr "" ++"B<lpr> demande l'impression de fichiers. Si des fichiers sont donnés dans la " ++"ligne de commande, ceux-ci sont envoyés à la destination donnée (ou la " ++"destination par défaut si aucune n'est fournie). Si aucun fichier n'est " ++"donné dans la ligne de commande, B<lpr> lit le fichier sur l'entrée standard." ++ ++# type: Plain text ++#: lpr.man:43 ++msgid "The following options are recognized by I<lpr>:" ++msgstr "Les options suivantes sont gérées par B<lpr>\\ :" ++ ++# type: TP ++#: lpr.man:47 ++#, no-wrap ++msgid "-H server[:port]" ++msgstr "B<-H> I<serveur[:port]>" ++ ++# type: TP ++#: lpr.man:51 ++#, no-wrap ++msgid "-C \"name\"" ++msgstr "B<-C> I<nom>" ++ ++# type: TP ++#: lpr.man:53 ++#, no-wrap ++msgid "-J \"name\"" ++msgstr "B<-J> I<nom>" ++ ++# type: TP ++#: lpr.man:55 ++#, no-wrap ++msgid "-T \"name\"" ++msgstr "B<-T> I<nom>" ++ ++# type: TP ++#: lpr.man:67 ++#, no-wrap ++msgid "-# I<copies>" ++msgstr "B<-#> I<copies>" ++ ++# type: Plain text ++#: lpr.man:76 ++msgid "" ++"Disables banner printing. This option is equivalent to \"-o job-sheets=none" ++"\"." ++msgstr "" ++"Désasctiver l'impression de la bannière. Cette option est équivalente à « B<-" ++"o job-sheets=none> »." ++ ++# type: Plain text ++#: lpr.man:82 ++msgid "" ++"Specifies that the print file is already formatted for the destination and " ++"should be sent without filtering. This option is equivalent to \"-o raw\"." ++msgstr "" ++"Indiquer que le fichier est déjà formaté pour la destination et qu'aucun " ++"filtre n'a besoin d'être appliqué. Cette option est équivalente à « B<-o " ++"raw> »." ++ ++# type: Plain text ++#: lpr.man:86 ++msgid "Send an email on job completion." ++msgstr "Envoyer un courier électronique à la fin du travail d'impression." ++ ++# type: Plain text ++#: lpr.man:90 ++msgid "Sets a job option." ++msgstr "Définir une option pour le travail d'impression." ++ ++# type: TP ++#: lpr.man:90 ++#, no-wrap ++msgid "-p" ++msgstr "B<-p>" ++ ++# type: Plain text ++#: lpr.man:97 ++msgid "" ++"Specifies that the print file should be formatted with a shaded header with " ++"the date, time, job name, and page number. This option is equivalent to \"-o " ++"prettyprint\" and is only useful when printing text files." ++msgstr "" ++"Spécifier que chaque page du fichier à imprimer doit avoir un en-tête ombré " ++"contenant la date, l'heure, le nom du travail d'impression et le numéro de " ++"page. Cette option est équivalente à « -oprettyprint » et n'est utile que " ++"dans le cas de fichiers texte." ++ ++# type: Plain text ++#: lpr.man:101 ++msgid "Hold job for printing." ++msgstr "Suspendre l'impression d'un travail." ++ ++# type: Plain text ++#: lpr.man:106 ++msgid "" ++"Specifies that the named print files should be deleted after printing them." ++msgstr "" ++"Spécifier que les fichiers indiqués doivent être effacés après impression." ++ ++# type: Plain text ++#: lpr.man:109 ++msgid "" ++"The \"c\", \"d\", \"f\", \"g\", \"i\", \"n\", \"t\", \"v\", and \"w\" " ++"options are not supported by CUPS and produce a warning message if used." ++msgstr "" ++"Les options « B<-c> », « B<-d> », « B<-f> », « B<-g> », « B<-i> », « B<-n> », « B<-" ++"t> », « B<-v> » et « B<-w> » ne sont pas gérées par CUPS et donnent un message " ++"d'avertissement lorsqu'elles sont utilisées." ++ ++# type: Plain text ++#: lpr.man:112 ++msgid "I<cancel(1)>, I<lp(1)>, I<lpq(1)>, I<lprm(1)>, I<lpstat(1)>," ++msgstr "B<cancel>(1), B<lp>(1), B<lpq>(1), B<lprm>(1), B<lpstat>(1)," ++ ++# type: TH ++#: lprm.man:15 ++#, no-wrap ++msgid "lprm" ++msgstr "lprm" ++ ++# type: Plain text ++#: lprm.man:18 ++msgid "lprm - cancel print jobs" ++msgstr "lprm - Annuler des travaux d'impression." ++ ++# type: Plain text ++#: lprm.man:29 ++msgid "" ++"B<lprm> [ -E ] [ -U I<username> ] [ -h I<server[:port]> ] [ -P I<destination" ++"[/instance]> ] [ - ] [ I<job ID(s)> ]" ++msgstr "" ++"B<lprm> [ -E ] [ -U I<utilisateur> ] [ -h I<serveur[:port]> ] [ -P " ++"I<destination[/instance]> ] [ - ] [ I<identifiant(s) des travaux " ++"d'impression> ]" ++ ++# type: Plain text ++#: lprm.man:35 ++msgid "" ++"I<lprm> cancels print jobs that have been queued for printing. If no " ++"arguments are supplied, the current job on the default destination is " ++"cancelled. You can specify one or more job ID numbers to cancel those jobs " ++"or use the I<-> option to cancel all jobs." ++msgstr "" ++"B<lprm> annule des travaux d'impression en attente. Si aucun paramètre n'est " ++"fourni, c'est le travail en cours sur la destination par défaut qui est " ++"annulé. Il est possible de fournir un ou plusieurs identifiants de travaux " ++"d'impression à annuler ou d'utiliser l'option B<-> pour annuler tous les " ++"travaux." ++ ++# type: Plain text ++#: lprm.man:37 ++msgid "The I<lprm> command supports the following options:" ++msgstr "B<lprm> gère les options suivantes :" ++ ++# type: Plain text ++#: lprm.man:45 ++msgid "Specifies the destination printer or class." ++msgstr "Spécifier l'imprimante, ou la classe d'imprimante, de destination." ++ ++# type: Plain text ++#: lprm.man:53 ++msgid "Specifies and alternate server." ++msgstr "Définir un autre serveur." ++ ++# type: Plain text ++#: lprm.man:56 ++msgid "" ++"The CUPS version of I<lprm> is compatible with the standard Berkeley I<lprm> " ++"command." ++msgstr "" ++"La version CUPS de B<lprm> est compatible avec la version standard Berkeley." ++ ++# type: Plain text ++#: lprm.man:59 ++msgid "I<cancel(1)>, I<lp(1)>, I<lpq(1)>, I<lpr(1)>, I<lpstat(1)>," ++msgstr "B<cancel>(1), B<lp>(1), B<lpq>(1), B<lpr>(1), B<lpstat>(1)," ++ ++# type: TH ++#: lpstat.man:15 ++#, no-wrap ++msgid "lpstat" ++msgstr "lpstat" ++ ++# type: Plain text ++#: lpstat.man:18 ++msgid "lpstat - print cups status information" ++msgstr "lpstat - Afficher l'état de CUPS." ++ ++# type: Plain text ++#: lpstat.man:39 ++msgid "" ++"B<lpstat> [ -E ] [ -U I<username> ] [ -h I<hostname[:port]> ] [ -l ] [ -W " ++"I<which-jobs> ] [ -a [ I<destination(s)> ] ] [ -c [ I<class(es)> ] ] [ -d ] " ++"[ -o [ I<destination(s)> ] ] [ -p [ I<printer(s)> ] ] [ -r ] [ -R ] [ -s ] " ++"[ -t ] [ -u [ I<user(s)> ] ] [ -v [ I<printer(s)> ] ]" ++msgstr "" ++"B<lpstat> [ -E ] [ -U I<utilisateur> ] [ -h I<serveur[:port]> ] [ -l ] [ -W " ++"I<travaux> ] [ -a [ I<destination(s)> ] ] [ -c [ I<class(es)> ] ] [ -d ] [ -" ++"o [ I<destination(s)> ] ] [ -p [ I<imprimante(s)> ] ] [ -r ] [ -R ] [ -s ] " ++"[ -t ] [ -u [ I<utilisateur(s)> ] ] [ -v [ I<imprimante(s)> ] ]" ++ ++# type: Plain text ++#: lpstat.man:43 ++msgid "" ++"I<lpstat> displays status information about the current classes, jobs, and " ++"printers. When run with no arguments, I<lpstat> will list jobs queued by the " ++"current user." ++msgstr "" ++"B<lpstat> affiche l'état des classes, travaux et imprimantes. Quand " ++"B<lpstat> est lancé sans arguments, la liste des travaux en attente de " ++"l'utilisateur est affichée." ++ ++# type: Plain text ++#: lpstat.man:45 ++msgid "The I<lpstat> command supports the following options:" ++msgstr "B<lpstat> gère les options suivantes :" ++ ++# type: TP ++#: lpstat.man:49 ++#, no-wrap ++msgid "-R" ++msgstr "B<-R>" ++ ++# type: Plain text ++#: lpstat.man:53 ++msgid "Shows the ranking of print jobs." ++msgstr "Afficher le rang des travaux d'impression." ++ ++# type: TP ++#: lpstat.man:57 ++#, no-wrap ++msgid "-W which-jobs" ++msgstr "B<-W> I<travaux>" ++ ++# type: Plain text ++#: lpstat.man:65 ++msgid "" ++"Specifies which jobs to show, I<completed> or I<not-completed> (the " ++"default). This option I<must> appear before the I<-o> option and/or any " ++"printer names, otherwise the default (not-completed) value will be used in " ++"the request to the scheduler." ++msgstr "" ++"Indiquer quels travaux afficher : B<completed> (les travaux terminés) ou " ++"B<not-completed> (les travaux non terminés, par défaut). Cette option " ++"I<doit> être précisée avant l'option B<-o> et/ou des noms d'imprimantes, " ++"sinon la valeur par défaut (« B<not-completed> ») sera utilisée pour la " ++"requête à l'ordonnanceur." ++ ++# type: TP ++#: lpstat.man:65 ++#, no-wrap ++msgid "-a [printer(s)]" ++msgstr "B<-a> [I<imprimante(s)>]" ++ ++# type: Plain text ++#: lpstat.man:70 ++msgid "" ++"Shows the accepting state of printer queues. If no printers are specified " ++"then all printers are listed." ++msgstr "" ++"Afficher si les files d'attente des imprimantes acceptent les travaux " ++"d'impression. Si aucune imprimante n'est fournie dans la ligne de commande, " ++"toutes les imprimantes sont affichées." ++ ++# type: TP ++#: lpstat.man:70 ++#, no-wrap ++msgid "-c [class(es)]" ++msgstr "B<-c> [I<classe(s)>]" ++ ++# type: Plain text ++#: lpstat.man:75 ++msgid "" ++"Shows the printer classes and the printers that belong to them. If no " ++"classes are specified then all classes are listed." ++msgstr "" ++"Afficher la classe d'imprimantes et ses imprimantes associées. Si aucune " ++"classe n'est fournie dans la ligne de commande, toutes les classes sont " ++"affichées." ++ ++# type: TP ++#: lpstat.man:75 ++#, no-wrap ++msgid "-d" ++msgstr "B<-d>" ++ ++# type: Plain text ++#: lpstat.man:79 ++msgid "Shows the current default destination." ++msgstr "Affiche la destination par défaut." ++ ++# type: Plain text ++#: lpstat.man:87 ++msgid "Shows a long listing of printers, classes, or jobs." ++msgstr "" ++"Afficher une liste détaillée des imprimantes, classes et travaux " ++"d'impression." ++ ++# type: TP ++#: lpstat.man:87 ++#, no-wrap ++msgid "-o [destination(s)]" ++msgstr "B<-o> [I<destination(s)>]" ++ ++# type: Plain text ++#: lpstat.man:92 ++msgid "" ++"Shows the jobs queue on the specified destinations. If no destinations are " ++"specified all jobs are shown." ++msgstr "" ++"Afficher la file d'attente des travaux des destinations spécifiées. Si " ++"aucune destination n'est fournie dans la ligne de commande, tous les travaux " ++"sont affichés." ++ ++# type: TP ++#: lpstat.man:92 ++#, no-wrap ++msgid "-p [printer(s)]" ++msgstr "B<-p> [I<imprimante(s)>]" ++ ++# type: Plain text ++#: lpstat.man:97 ++msgid "" ++"Shows the printers and whether or not they are enabled for printing. If no " ++"printers are specified then all printers are listed." ++msgstr "" ++"Afficher les imprimantes et indiquer si elles sont prêtes ou non à " ++"l'impression. Si aucune imprimante n'est fournie dans la ligne de commande, " ++"toutes les imprimantes sont listées." ++ ++# type: Plain text ++#: lpstat.man:101 ++msgid "Shows whether the CUPS server is running." ++msgstr "Afficher si le serveur CUPS est actif." ++ ++# type: Plain text ++#: lpstat.man:108 ++msgid "" ++"Shows a status summary, including the default destination, a list of classes " ++"and their member printers, and a list of printers and their associated " ++"devices. This is equivalent to using the \"-d\", \"-c\", and \"-v\" options." ++msgstr "" ++"Afficher un résumé de l'état, comprenant la destination par défaut, la liste " ++"des classes et leurs imprimantes associées, la liste des imprimantes et leur " ++"périphérique. Ceci est équivalent à utiliser les options « B<-d> », « B<-c> » " ++"et « B<-p> »." ++ ++# type: TP ++#: lpstat.man:108 ++#, no-wrap ++msgid "-t" ++msgstr "B<-t>" ++ ++# type: Plain text ++#: lpstat.man:113 ++msgid "" ++"Shows all status information. This is equivalent to using the \"-r\", \"-d" ++"\", \"-c\", \"-v\", \"-a\", \"-p\", and \"-o\" options." ++msgstr "" ++"Affiche toutes les informations. Ceci peut être effectué en utilisant les " ++"options « B<-r> », « B<-d> », « B<-c> », « B<-d> », « B<-v> », « B<-a> », « B<-p> » " ++"et « B<-o> »." ++ ++# type: TP ++#: lpstat.man:113 ++#, no-wrap ++msgid "-u [user(s)]" ++msgstr "B<-u> [I<utilisateur(s)>]" ++ ++# type: Plain text ++#: lpstat.man:118 ++msgid "" ++"Shows a list of print jobs queued by the specified users. If no users are " ++"specified, lists the jobs queued by the current user." ++msgstr "" ++"Afficher les travaux d'impression en attente pour un utilisateur. Si aucun " ++"utilisateur n'est fourni dans la ligne de commande, afficher les travaux de " ++"l'utilisateur qui lance la commande." ++ ++# type: TP ++#: lpstat.man:118 ++#, no-wrap ++msgid "-v [printer(s)]" ++msgstr "B<-v> [I<imprimante(s)>]" ++ ++# type: Plain text ++#: lpstat.man:123 ++msgid "" ++"Shows the printers and what device they are attached to. If no printers are " ++"specified then all printers are listed." ++msgstr "" ++"Afficher les imprimantes et à quel matériel elles sont rattachées. Si aucune " ++"imprimante n'est fournie sur la ligne de commande, toutes les imprimantes " ++"sont affichées." ++ ++# type: Plain text ++#: lpstat.man:127 ++msgid "" ++"Unlike the System V printing system, CUPS allows printer names to contain " ++"any printable character except SPACE, TAB, \"/\", and \"#\". Also, printer " ++"and class names are I<not> case-sensitive." ++msgstr "" ++"Contrairement au système d'impression System V, CUPS permet des noms " ++"d'imprimantes contenant tout caractère imprimable sauf ESPACE, TABULATION, " ++"« / » et « # ». De plus, les noms d'imprimante et de classe d'imprimante ne " ++"sont pas sensibles à la casse." ++ ++# type: Plain text ++#: lpstat.man:129 ++msgid "The \"-h\", \"-E\", \"-U\", and \"-W\" options are unique to CUPS." ++msgstr "" ++"Les options « B<-h> », « B<-E> », « B<-U> » et « B<-W> » sont spécifiques à CUPS." ++ ++# type: Plain text ++#: lpstat.man:131 ++msgid "The Solaris \"-f\", \"-P\", and \"-S\" options are silently ignored." ++msgstr "Les options « B<-f> », « B<-P> » et « B<-S> » de Solaris sont ignorées." ++ ++# type: TH ++#: mailto.conf.man:15 ++#, no-wrap ++msgid "mailto.conf" ++msgstr "mailto.conf" ++ ++# type: TH ++#: mailto.conf.man:15 ++#, no-wrap ++msgid "12 July 2006" ++msgstr "12 juillet 2006" ++ ++# type: Plain text ++#: mailto.conf.man:18 ++msgid "mailto.conf - configuration file for cups email notifier" ++msgstr "" ++"mailto.conf - Fichier de configuration pour les notifications par courier " ++"électronique de CUPS" ++ ++# type: Plain text ++#: mailto.conf.man:21 ++msgid "" ++"The I<mailto.conf> file defines the local mail server and email notification " ++"preferences for CUPS." ++msgstr "" ++"Le fichier I<mailto.conf> configure le serveur de courriers et les " ++"notifications par courrier électronique pour CUPS." ++ ++# type: TP ++#: mailto.conf.man:25 ++#, no-wrap ++msgid "Cc I<cc-address@domain.com>" ++msgstr "Cc I<adresse_copie@domaine.com>" ++ ++# type: Plain text ++#: mailto.conf.man:29 ++msgid "Specifies an additional recipient for all email notifications." ++msgstr "" ++"Spécifier une adresse supplémentaire à laquelle les notifications par " ++"courier électronique seront envoyées." ++ ++# type: TP ++#: mailto.conf.man:29 ++#, no-wrap ++msgid "From I<from-address@domain.com>" ++msgstr "From I<adresse_émetteur@domaine.com>" ++ ++# type: Plain text ++#: mailto.conf.man:33 ++msgid "Specifies the sender of email notifications." ++msgstr "Spécifier l'émetteur des notifications par courier électronique." ++ ++# type: Plain text ++#: mailto.conf.man:33 ++#, no-wrap ++msgid "Sendmail I<sendmail command and options>" ++msgstr "Sendmail I<commande sendmail et options>" ++ ++# type: Plain text ++#: mailto.conf.man:40 ++msgid "" ++"Specifies the sendmail command to use when sending email notifications. Only " ++"one I<Sendmail> or I<SMTPServer> line may be present in the I<mailto.conf> " ++"file. If multiple lines are present, only the last one is used." ++msgstr "" ++"Spécifier la commande sendmail à utiliser pour l'envoie des courriers de " ++"notifications. Seule une ligne B<Sendmail> ou B<SMTPServer> peut être " ++"présente dans le fichier I<mailto.conf>. Si plusieurs lignes sont présentes, " ++"seule la dernière est prise en compte." ++ ++# type: TP ++#: mailto.conf.man:40 ++#, no-wrap ++msgid "SMTPServer I<servername>" ++msgstr "SMTPServer I<nom_serveur>" ++ ++# type: Plain text ++#: mailto.conf.man:47 ++msgid "" ++"Specifies a SMTP server to send email notifications to. Only one I<Sendmail> " ++"or I<SMTPServer> line may be present in the I<mailto.conf> file. If multiple " ++"lines are present, only the last one is used." ++msgstr "" ++"Spécifier le serveur SMTP à utiliser pour l'envoie des courriers de " ++"notifications. Seule une ligne B<Sendmail> ou B<SMTPServer> peut être " ++"présente dans le fichier I<mailto.conf>. Si plusieurs lignes sont présentes, " ++"seule la dernière est prise en compte." ++ ++# type: TP ++#: mailto.conf.man:47 ++#, no-wrap ++msgid "Subject I<subject-prefix>" ++msgstr "Subject I<préfix_sujet>" ++ ++# type: Plain text ++#: mailto.conf.man:51 ++msgid "" ++"Specifies a prefix string for the subject line of an email notification." ++msgstr "Utiliser un préfixe dans les sujets des courriers de notification." ++ ++# type: Plain text ++#: mailto.conf.man:54 ++msgid "" ++"I<classes.conf(5)>, I<cupsd(8)>, I<cupsd.conf(5)>, I<mime.convs(5)>, I<mime." ++"types(5)>, I<printers.conf(5)>," ++msgstr "" ++"B<classes.conf>(5), B<cupsd>(8), B<cupsd.conf>(5), B<mime.convs>(5), B<mime." ++"types>(5), B<printers.conf>(5)," ++ ++# type: TH ++#: mime.convs.man:15 ++#, no-wrap ++msgid "mime.convs" ++msgstr "mime.convs" ++ ++# type: Plain text ++#: mime.convs.man:18 ++msgid "mime.convs - mime type conversion file for cups" ++msgstr "mime.convs - Fichier de conversion des types MIME pour CUPS." ++ ++# type: Plain text ++#: mime.convs.man:23 ++msgid "" ++"The I<mime.convs> file defines the filters that are available for converting " ++"files from one format to another. The standard filters support text, PDF, " ++"PostScript, HP-GL/2, and many types of image files." ++msgstr "" ++"Le fichier I<mime.convs> définit les filtres disponibles pour convertir des " ++"fichiers d'un format vers un autre. Les filtres standards concernent les " ++"fichiers textes, PDF, PostScript, HP-GL/2 ainsi que de nombreux formats " ++"graphiques." ++ ++# type: Plain text ++#: mime.convs.man:26 ++msgid "" ++"Additional filters can be added to the I<mime.convs> file or (preferably) to " ++"other files in the CUPS configuration directory." ++msgstr "" ++"Des filtres supplémentaires peuvent être ajoutés dans le fichier I<mime." ++"convs> ou (de préférence) dans d'autres fichiers du répertoire de " ++"configuration de CUPS." ++ ++# type: Plain text ++#: mime.convs.man:31 ++msgid "" ++"Each line in the I<mime.convs> file is a comment, blank, or filter line. " ++"Comment lines start with the # character. Filter lines specify the source " ++"and destination MIME types along with a relative cost associated with the " ++"filter and the filter to run:" ++msgstr "" ++"Chaque ligne du fichier I<mime.convs> est un commentaire, une ligne vide ou " ++"une définition de filtre. Les commentaires commencent par le caractère #. " ++"Les lignes contenant un filtre spécifient les types MIME source et cible, le " ++"coût du filtre, puis le filtre lui-même :" ++ ++# type: Plain text ++#: mime.convs.man:36 ++#, no-wrap ++msgid "" ++"super/type super/type cost filter\n" ++"application/postscript application/vnd.cups-raster 50 pstoraster\n" ++msgstr "" ++"super/type super/type coût filtre\n" ++"application/postscript application/vnd.cups-raster 50 pstoraster\n" ++ ++# type: Plain text ++#: mime.convs.man:40 ++msgid "" ++"I<classes.conf(5)>, I<cupsd(8)>, I<cupsd.conf(5)>, I<mime.types(5)>, " ++"I<printers.conf(5)>," ++msgstr "" ++"B<classes.conf>(5), B<cupsd>(8), B<cupsd.conf>(5), B<mime.types>(5), " ++"B<printers.conf>(5)," ++ ++# type: TH ++#: mime.types.man:15 ++#, no-wrap ++msgid "mime.types" ++msgstr "mime.types" ++ ++# type: Plain text ++#: mime.types.man:18 ++msgid "mime.types - mime type description file for cups" ++msgstr "mime.types - Fichier de description des types MIME de CUPS." ++ ++# type: Plain text ++#: mime.types.man:20 ++msgid "The I<mime.types> file defines the recognized file types." ++msgstr "" ++"Le fichier I<mime.types> définit les types de fichier reconnus par CUPS." ++ ++# type: Plain text ++#: mime.types.man:24 ++msgid "" ++"Additional file types can be added to I<mime.types> or (preferably) in " ++"additional files in the CUPS configuration directory with the extension \"." ++"types\"." ++msgstr "" ++"D'autres types de fichiers peuvent être ajoutés au fichier I<mime.types> ou " ++"(de préférence) à d'autres fichier dans le répertoire de configuration de " ++"CUPS, avec l'extension « .types »." ++ ++# type: Plain text ++#: mime.types.man:30 ++msgid "" ++"Each line in the I<mime.types> file is a comment, blank, or rule line. " ++"Comment lines start with the # character. Rule lines start with the MIME " ++"type name and are optionally followed by a series of file recognition rules " ++"that are used to automatically identify print and web files:" ++msgstr "" ++"Chaque ligne du fichier I<mime.types> est soit un commentaire, soit une " ++"ligne vide, soit une règle. Les lignes définissant une règle commencent par " ++"le nom du type MIME et peuvent être suivies par une liste de règles de " ++"reconnaissance utilisées pour déterminer automatiquement le type du fichier :" ++ ++# type: Plain text ++#: mime.types.man:34 ++#, no-wrap ++msgid " super/type rule [ ... ruleN]\n" ++msgstr " super/type règle [ ... règleN]\n" ++ ++# type: Plain text ++#: mime.types.man:38 ++msgid "" ++"The rules may be grouped using parenthesis, joined using \"+\" for a logical " ++"AND and \",\" or whitespace for a logical OR, and negated using \"!\"." ++msgstr "" ++"Ces règles doivent être mises entre parenthèses, liées par un « + » pour " ++"exprimer un ET logique, « , » ou une espace pour exprimer un OU logique. " ++"Elles sont précédées de « ! » pour exprimer un NON logique." ++ ++# type: SH ++#: mime.types.man:38 ++#, no-wrap ++msgid "RULES" ++msgstr "RÈGLES" ++ ++# type: Plain text ++#: mime.types.man:41 ++msgid "" ++"Rules take two forms - a filename extension by itself and functions with " ++"test values inside parenthesis. The following functions are available:" ++msgstr "" ++"Les règles sont composées de deux parties : une extension de fichier et des " ++"fonctions de test entre parenthèses. Les fonctions suivantes peuvent être " ++"utilisées :" ++ ++# type: TP ++#: mime.types.man:41 ++#, no-wrap ++msgid "match(\"pattern\")" ++msgstr "match(\"motif\")" ++ ++# type: Plain text ++#: mime.types.man:45 ++msgid "Pattern match on filename" ++msgstr "Reconnaissance d'un motif sur le nom du fichier" ++ ++# type: TP ++#: mime.types.man:45 ++#, no-wrap ++msgid "ascii(offset,length)" ++msgstr "ascii(début, longueur)" ++ ++# type: Plain text ++#: mime.types.man:49 ++msgid "True if bytes are valid printable ASCII (CR, NL, TAB, BS, 32-126)" ++msgstr "" ++"Vrai si tous les octets sont des caractères ASCII valables (CR, NL, TAB, BS, " ++"32-126)." ++ ++# type: TP ++#: mime.types.man:49 ++#, no-wrap ++msgid "printable(offset,length)" ++msgstr "printable(début, longueur)" ++ ++# type: Plain text ++#: mime.types.man:53 ++msgid "" ++"True if bytes are printable 8-bit chars (CR, NL, TAB, BS, 32-126, 128-254)" ++msgstr "" ++"Vrai si tous les octets sont des caractères 8 bits imprimables (CR, NL, TAB, " ++"BS, 32-126, 128-254)." ++ ++# type: TP ++#: mime.types.man:53 ++#, no-wrap ++msgid "string(offset,\"string\")" ++msgstr "string(début, \"chaîne\")" ++ ++# type: Plain text ++#: mime.types.man:57 ++msgid "True if bytes are identical to string" ++msgstr "Vrai si les octets sont identiques à « chaîne »" ++ ++# type: TP ++#: mime.types.man:57 ++#, no-wrap ++msgid "istring(offset,\"string\")" ++msgstr "istring(début, \"chaîne\")" ++ ++# type: Plain text ++#: mime.types.man:61 ++msgid "True if a case-insensitive comparison of the bytes is identical" ++msgstr "Vrai si les octets sont identiques, sans prendre en compte la casse." ++ ++# type: TP ++#: mime.types.man:61 ++#, no-wrap ++msgid "char(offset,value)" ++msgstr "char(début, valeur)" ++ ++# type: Plain text ++#: mime.types.man:65 ++msgid "True if byte is identical" ++msgstr "Vrai si les octets sont identiques." ++ ++# type: TP ++#: mime.types.man:65 ++#, no-wrap ++msgid "short(offset,value)" ++msgstr "short(début, valeur)" ++ ++# type: Plain text ++#: mime.types.man:69 ++msgid "True if 16-bit integer is identical" ++msgstr "Vrai si les nombres entiers (16 bits) sont identiques." ++ ++# type: TP ++#: mime.types.man:69 ++#, no-wrap ++msgid "int(offset,value)" ++msgstr "int(début, valeur)" ++ ++# type: Plain text ++#: mime.types.man:73 ++msgid "True if 32-bit integer is identical" ++msgstr "Vrai si les nombres entiers (32 bits) sont identiques." ++ ++# type: TP ++#: mime.types.man:73 ++#, no-wrap ++msgid "locale(\"string\")" ++msgstr "locale(\"chaîne\")" ++ ++# type: Plain text ++#: mime.types.man:77 ++msgid "True if current locale matches string" ++msgstr "Vrai si les définitions de langage sont identiques." ++ ++# type: TP ++#: mime.types.man:77 ++#, no-wrap ++msgid "contains(offset,range,\"string\")" ++msgstr "contains(début, portée, \"chaîne\")" ++ ++# type: Plain text ++#: mime.types.man:81 ++msgid "True if the range contains the string" ++msgstr "Vrai si la chaîne est trouvée dans la portion précisée." ++ ++# type: SH ++#: mime.types.man:81 ++#, no-wrap ++msgid "STRING CONSTANTS" ++msgstr "CHAÎNES DE CARACTÈRES" ++ ++# type: Plain text ++#: mime.types.man:85 ++msgid "" ++"String constants can be specified inside quotes (\"\") for strings " ++"containing whitespace and angle brackets (E<lt>E<gt>) for hexadecimal " ++"strings." ++msgstr "" ++"Les chaînes de caractères peuvent être définies entre guillemets (\"\") pour " ++"des chaînes contenant des espaces ou entre crochets (E<lt>E<gt>) pour des " ++"chaînes en hexadécimal." ++ ++# type: Plain text ++#: mime.types.man:88 ++msgid "" ++"I<classes.conf(5)>, I<cupsd(8)>, I<cupsd.conf(5)>, I<mime.convs(5)>, " ++"I<printers.conf(5)>," ++msgstr "" ++"B<classes.conf>(5), B<cupsd>(8), B<cupsd.conf>(5), B<mime.convs>(5), " ++"B<printers.conf>(5)," ++ ++# type: TH ++#: printers.conf.man:15 ++#, no-wrap ++msgid "printers.conf" ++msgstr "printers.conf" ++ ++# type: Plain text ++#: printers.conf.man:18 ++msgid "printers.conf - printer configuration file for cups" ++msgstr "printers.conf - Fichier de configuration des imprimantes CUPS." ++ ++# type: Plain text ++#: printers.conf.man:23 ++msgid "" ++"The I<printers.conf> file defines the local printers that are available. It " ++"is normally located in the I</etc/cups> directory and is generated " ++"automatically by the I<cupsd(8)> program when printers are added or deleted." ++msgstr "" ++"Le fichier I<printers.conf> définit les imprimantes locales disponibles. Il " ++"est habituellement situé dans le répertoire I</etc/cups> et est généré " ++"automatiquement par le programme B<cupsd>(8) lors de l'ajout ou de la " ++"suppression d'imprimantes." ++ ++# type: TP ++#: printers.conf.man:27 ++#, no-wrap ++msgid "E<lt>Printer nameE<gt> ... E<lt>/PrinterE<gt>" ++msgstr "E<lt>Printer nomE<gt> ... E<lt>/PrinterE<gt>" ++ ++# type: Plain text ++#: printers.conf.man:31 ++msgid "Defines a specific printer." ++msgstr "Définir une certaine imprimante." ++ ++# type: TP ++#: printers.conf.man:31 ++#, no-wrap ++msgid "E<lt>DefaultPrinter nameE<gt> ... E<lt>/PrinterE<gt>" ++msgstr "E<lt>DefaultPrinter nomE<gt> ... E<lt>/PrinterE<gt>" ++ ++# type: Plain text ++#: printers.conf.man:35 ++msgid "Defines a default printer." ++msgstr "Définir une imprimante par défaut." ++ ++# type: TP ++#: printers.conf.man:49 ++#, no-wrap ++msgid "DeviceURI uri" ++msgstr "DeviceURI uri" ++ ++# type: Plain text ++#: printers.conf.man:53 ++msgid "Specifies the device URI for a printer." ++msgstr "Spécifier l'URI de périphérique d'une imprimante." ++ ++# type: TP ++#: printers.conf.man:85 ++#, no-wrap ++msgid "PortMonitor monitor" ++msgstr "PortMonitor moniteur" ++ ++# type: Plain text ++#: printers.conf.man:89 ++msgid "Specifies the port monitor for a printer." ++msgstr "Spécifier le moniteur de port pour l'imprimante." ++ ++# type: Plain text ++#: printers.conf.man:116 ++msgid "" ++"I<classes.conf(5)>, I<cupsd(8)>, I<cupsd.conf(5)>, I<mime.convs(5)>, I<mime." ++"types(5)>," ++msgstr "" ++"B<classes.conf>(5), B<cupsd>(8), B<cupsd.conf>(5), B<mime.convs>(5), B<mime." ++"types>(5)," ++ ++# type: TH ++#: subscriptions.conf.man:15 ++#, no-wrap ++msgid "subscriptions.conf" ++msgstr "subscriptions.conf" ++ ++# type: TH ++#: subscriptions.conf.man:15 ++#, no-wrap ++msgid "30 April 2006" ++msgstr "30 avril 2006" ++ ++# type: Plain text ++#: subscriptions.conf.man:18 ++msgid "subscriptions.conf - subscriptions file for cups" ++msgstr "subscriptions.conf - Fichier des abonnements pour CUPS" ++ ++# type: Plain text ++#: subscriptions.conf.man:23 ++msgid "" ++"The I<subscriptions.conf> file defines the local subscriptions that are " ++"active. It is normally located in the I</etc/cups> directory and is " ++"generated automatically by the I<cupsd(8)> program when subscriptions are " ++"created, renewed, or cancelled." ++msgstr "" ++"Le fichier I<subscriptions.conf> définit les abonnements locaux actifs. Il " ++"est habituellement situé dans le répertoire I</etc/cups> et est généré " ++"automatiquement par le programme B<cupsd>(8) lors de l'ajout, le " ++"renouvellement ou l'annulation d'abonnements." ++ ++# type: TP ++#: subscriptions.conf.man:27 ++#, no-wrap ++msgid "E<lt>Subscription NNNE<gt> ... E<lt>/SubscriptionE<gt>" ++msgstr "E<lt>Subscription NNNE<gt> ... E<lt>/SubscriptionE<gt>" ++ ++# type: Plain text ++#: subscriptions.conf.man:31 ++msgid "Defines a subscription." ++msgstr "Définir un abonnement." ++ ++# type: TP ++#: subscriptions.conf.man:31 ++#, no-wrap ++msgid "Events name [ ... name ]" ++msgstr "Events nom [ ... nom ]" ++ ++# type: Plain text ++#: subscriptions.conf.man:35 ++msgid "Specifies the events that are subscribed." ++msgstr "Définir les événements auquels on s'abonne." ++ ++# type: TP ++#: subscriptions.conf.man:35 ++#, no-wrap ++msgid "ExpirationTime unix-time" ++msgstr "ExpirationTime temps_UNIX" ++ ++# type: Plain text ++#: subscriptions.conf.man:40 ++msgid "" ++"Specifies the expiration time of a subscription as a UNIX time value in " ++"seconds since January 1st, 1970." ++msgstr "" ++"Définir la date d'expiration d'un abonnement. La date est indiquée en " ++"utilisant le temps UNIX, c'est-à-dire en exprimée en secondes depuis le 1er " ++"janvier 1970." ++ ++# type: TP ++#: subscriptions.conf.man:40 ++#, no-wrap ++msgid "Interval seconds" ++msgstr "Interval secondes" ++ ++# type: Plain text ++#: subscriptions.conf.man:45 ++msgid "" ++"Specifies the preferred time interval for event notifications in seconds." ++msgstr "Définir l'intervalle voulu entre les notifications, en secondes." ++ ++# type: TP ++#: subscriptions.conf.man:45 ++#, no-wrap ++msgid "JobId job-id" ++msgstr "JobId id_travail" ++ ++# type: Plain text ++#: subscriptions.conf.man:49 ++msgid "Specifies the job ID associated with the subscription." ++msgstr "Indiquer l'identifiant de travail associé avec l'abonnement." ++ ++# type: TP ++#: subscriptions.conf.man:49 ++#, no-wrap ++msgid "LeaseDuration seconds" ++msgstr "LeaseDuration secondes" ++ ++# type: Plain text ++#: subscriptions.conf.man:54 ++msgid "" ++"Specifies the number of seconds that the subscription is valid for. If 0, " ++"the subscription does not expire." ++msgstr "" ++"Indiquer le nombre de secondes pendants lesquelles l'abonnement sera " ++"valable. 0 permet aux abonnement de ne pas expirer." ++ ++# type: TP ++#: subscriptions.conf.man:54 ++#, no-wrap ++msgid "NextEventId number" ++msgstr "NextEventId numéro" ++ ++# type: Plain text ++#: subscriptions.conf.man:59 ++msgid "Specifies the next notify-sequence-number to use for the subscription." ++msgstr "Spécifier le prochain numéro de séquence à utiliser pour l'abonnement." ++ ++# type: TP ++#: subscriptions.conf.man:59 ++#, no-wrap ++msgid "NextSubscriptionId number" ++msgstr "NextSubscriptionId nombre" ++ ++# type: Plain text ++#: subscriptions.conf.man:63 ++msgid "Specifies the next subscription-id to use." ++msgstr "Indiquer le prochain identifiant d'abonnement à utiliser." ++ ++# type: TP ++#: subscriptions.conf.man:63 ++#, no-wrap ++msgid "Owner username" ++msgstr "Owner utilisateur" ++ ++# type: Plain text ++#: subscriptions.conf.man:67 ++msgid "Specifies the user that owns the subscription." ++msgstr "Indiquer le propriétaire de l'abonnement." ++ ++# type: TP ++#: subscriptions.conf.man:67 ++#, no-wrap ++msgid "PrinterName printername" ++msgstr "PrinterName imprimante" ++ ++# type: Plain text ++#: subscriptions.conf.man:71 ++msgid "Specifies the printer or class associated with the subscription." ++msgstr "Indiquer l'imprimante ou la classe associée à l'abonnement." ++ ++# type: TP ++#: subscriptions.conf.man:71 ++#, no-wrap ++msgid "Recipient uri" ++msgstr "Recipient uri" ++ ++# type: Plain text ++#: subscriptions.conf.man:75 ++msgid "Specifies the notify-recipient-uri value for push-type notifications." ++msgstr "" ++"Spécifier l'uri recevant les notifications pour les notifications de type " ++"push (envoi)." ++ ++# type: TP ++#: subscriptions.conf.man:75 ++#, no-wrap ++msgid "UserData hex-escaped-data" ++msgstr "UserData donnée_hexa_protégées" ++ ++# type: Plain text ++#: subscriptions.conf.man:80 ++msgid "" ++"Specifies user data to be included in event notifications. This is typically " ++"the \"from\" address in mailto: notifications." ++msgstr "" ++"Spécifier des données utilisateur à inclure dans les notifications " ++"d'événement. C'est typiquement l'adresse émettrice des mails de " ++"notifications." ++ ++# type: Plain text ++#: subscriptions.conf.man:83 ++msgid "" ++"I<classes.conf(5)>, I<cupsd(8)>, I<cupsd.conf(5)>, I<mime.convs(5)>, I<mime." ++"types(5)>, printers.conf(5)" ++msgstr "" ++"B<classes.conf>(5), B<cupsd>(8), B<cupsd.conf>(5), B<mime.convs>(5), B<mime." ++"types>(5), B<printers.conf>(5)" ++ ++# type: TH ++#~ msgid "11 February 2006" ++#~ msgstr "11 février 2006" ++ ++# type: TP ++#~ msgid "HostNameLookups Yes" ++#~ msgstr "HostNameLookups Yes" ++ ++# type: TP ++#~ msgid "HostNameLookups No" ++#~ msgstr "HostNameLookups No" ++ ++# type: TH ++#~ msgid "Easy Software Products" ++#~ msgstr "Easy Software Products" ++ ++# type: Plain text ++#~ msgid "Copyright 1997-2006 by Easy Software Products, All Rights Reserved." ++#~ msgstr "Copyright 1997-2006 Easy Software Products, Tous droits réservés." ++ ++# type: Plain text ++#~ msgid "Copyright 2006 by Easy Software Products, All Rights Reserved." ++#~ msgstr "Copyright 2006 Easy Software Products, Tous droits réservés." ++ ++# type: TH ++#~ msgid "13 July 2006" ++#~ msgstr "13 juillet 2006" ++ ++# #-#-#-#-# cupsd.conf.5.po (PACKAGE VERSION) #-#-#-#-# ++# type: TP ++# #-#-#-#-# cups-lpd.8.po (PACKAGE VERSION) #-#-#-#-# ++# type: Plain text ++# #-#-#-#-# lpstat.1.po (PACKAGE VERSION) #-#-#-#-# ++# type: TP ++#, fuzzy ++#~ msgid "TBD1" ++#~ msgstr "" ++#~ "#-#-#-#-# cupsd.conf.5.po (PACKAGE VERSION) #-#-#-#-#\n" ++#~ "RunAsUser\n" ++#~ "#-#-#-#-# cups-lpd.8.po (PACKAGE VERSION) #-#-#-#-#\n" ++#~ "/path/to/cups/daemon est habituellement /usr/lib/cups/daemon ou /usr/" ++#~ "libexec/cups/daemon, suivant votre système d'exploitation. Vous pouvez " ++#~ "trouver cette information dans le fichier cupsd.conf.\n" ++#~ "#-#-#-#-# lpstat.1.po (PACKAGE VERSION) #-#-#-#-#\n" ++#~ "-W [I<quels-travaux>]" ++ ++# type: Plain text ++#, fuzzy ++#~ msgid "TBD2" ++#~ msgstr "" ++#~ "#-#-#-#-# cupsd.conf.5.po (PACKAGE VERSION) #-#-#-#-#\n" ++#~ "Définit si l'ordonnanceur doit être lancé en tant qu'utilisateur, dont le " ++#~ "nom doit être défini par la directive «\\ User\\ ».\n" ++#~ "#-#-#-#-# lpstat.1.po (PACKAGE VERSION) #-#-#-#-#\n" ++#~ "Définit quels sont les travaux à afficher, terminés («\\ I<completed>\\ ») " ++#~ "ou en cours («\\ I<not-completed>\\ »), qui est l'option par défaut. Cette " ++#~ "option B<doit> doit se trouver dans la ligne de commandes avant l'option " ++#~ "I<-o> et tout nom d'imprimante. Dans le cas contraire, la valeur par " ++#~ "défaut («\\ I<not-completed>\\ ») sera envoyée à l'ordonnanceur." ++ ++# type: Plain text ++#, fuzzy ++#~ msgid "TBD10" ++#~ msgstr "" ++#~ "#-#-#-#-# cups-lpd.8.po (PACKAGE VERSION) #-#-#-#-#\n" ++#~ "Dans cet exemple, le format du document est réinitialisé à la valeur " ++#~ "I<application/octet-stream>, ce qui force l'auto-détection du type de " ++#~ "fichier.\n" ++#~ "#-#-#-#-# lpq.1.po (PACKAGE VERSION) #-#-#-#-#\n" ++#~ "Pour chaque job soumis (à la suite d'un appel à lpr(1)) B<lpq> affiche le " ++#~ "nom de l'utilisateur, le rang actuel dans la file d'attente, le nom des " ++#~ "fichiers constituant le job, l'identificateur du job (un nombre qui doit " ++#~ "être fourni à lprm(1) pour annuler le job), et la taille totale en " ++#~ "octets. L'ordre de classement des jobs dépend de l'algorithme utilisé " ++#~ "pour consulter le répertoire de spool, il est supposé que c'est un ordre " ++#~ "FIFO (First In First Out). Les noms des fichiers constituant un job " ++#~ "peuvent être indisponibles (quand lpr(1) est utilisé comme puits dans un " ++#~ "pipeline) auquel cas le fichier est désigné par ``(standard input)''." ++ ++# type: Plain text ++#, fuzzy ++#~ msgid "TBD11" ++#~ msgstr "" ++#~ "Si B<lpq> prévient s'il n'y a pas de démon présent (ceci indique un " ++#~ "défaut de fonctionnement de la chaîne d'impression), la commande lpc(8) " ++#~ "permet de relancer le démon d'impression." --- cups-1.3.8.orig/debian/patches/rootbackends-worldreadable.dpatch +++ cups-1.3.8/debian/patches/rootbackends-worldreadable.dpatch @@ -0,0 +1,33 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## rootbackends-worldreadable.dpatch by <mpitt@debian.org> +## +## DP: Install root backends world-readable, to comply to Debian Policy and +## DP: because it is both nonsensical to to not do so, and also breaks system +## DP: checkers, bug reporting, etc. +## DP: (http://bugs.debian.org/410171, http://www.cups.org/str.php?L2935) + +@DPATCH@ +diff -urNad trunk~/backend/Makefile trunk/backend/Makefile +--- trunk~/backend/Makefile 2007-08-08 21:27:51.000000000 +0200 ++++ trunk/backend/Makefile 2008-09-06 18:17:10.000000000 +0200 +@@ -55,7 +55,7 @@ + install: all + $(INSTALL_DIR) -m 755 $(SERVERBIN)/backend + for file in $(RBACKENDS); do \ +- $(LIBTOOL) $(INSTALL) -m 700 $$file $(SERVERBIN)/backend; \ ++ $(LIBTOOL) $(INSTALL) -m 744 $$file $(SERVERBIN)/backend; \ + done + for file in $(UBACKENDS); do \ + $(INSTALL_BIN) $$file $(SERVERBIN)/backend; \ +diff -urNad trunk~/scheduler/job.c trunk/scheduler/job.c +--- trunk~/scheduler/job.c 2008-07-21 21:57:20.000000000 +0200 ++++ trunk/scheduler/job.c 2008-09-06 18:17:48.000000000 +0200 +@@ -3406,7 +3406,7 @@ + else if (stat(command, &backinfo)) + backroot = 0; + else +- backroot = !(backinfo.st_mode & (S_IRWXG | S_IRWXO)); ++ backroot = !(backinfo.st_mode & (S_IWGRP | S_IXGRP | S_IWOTH | S_IXOTH)); + + argv[0] = sani_uri; + --- cups-1.3.8.orig/debian/patches/00list +++ cups-1.3.8/debian/patches/00list @@ -0,0 +1,32 @@ +# patches backported from upstream SVN trunk for 1.4: +freebsd.dpatch +manpage-typos.dpatch +search_mime_files_in_usr_share.dpatch +pdftops-cups-1.4.dpatch +pdftops-dont_fail_on_cancel.dpatch +cupsaccept.dpatch + +# patches accepted and committed upstream for next 1.3: +cupsfilter-path-typo.dpatch +pjl-display-ready-message.dpatch +dont-chown-symlinked-ssl.dpatch + +# patches sent upstream +removecvstag.dpatch +pidfile.dpatch +ppd-poll-with-client-conf.dpatch +# no answer yet, po4a might not be appropriate +manpage-translations.dpatch +quiesce-bonjour-warning.dpatch +rootbackends-worldreadable.dpatch + +# patches which should go upstream +reactivate_recommended_driver.dpatch + +# Debian patches +default_log_warn.dpatch +confdirperms.dpatch + +# Ubuntu patches +ubuntu-disable-browsing.dpatch +ubuntu-default-error-policy-retry-job.dpatch --- cups-1.3.8.orig/debian/patches/manpage-typos.dpatch +++ cups-1.3.8/debian/patches/manpage-typos.dpatch @@ -0,0 +1,55 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## manpage-typos.dpatch by Nicolas François <nicolas.francois@centraliens.net> +## +## DP: Fix various manpage typos. (Debian #478597, STR #2862); Fixed in 1.4 +## DP: trunk. + +@DPATCH@ +diff -urNad trunk~/man/cups-driverd.man.in trunk/man/cups-driverd.man.in +--- trunk~/man/cups-driverd.man.in 2008-06-16 19:41:11.000000000 +0200 ++++ trunk/man/cups-driverd.man.in 2008-07-23 08:07:52.000000000 +0200 +@@ -48,7 +48,7 @@ + and may be compressed using the \fIgzip(1)\fR program. Driver + programs must implement the command-line interface shown in the + next section. +-.Sh DRIVER PROGRAMS ++.SS DRIVER PROGRAMS + Driver programs provide an interface to dynamically-generated PPD + files. The following arguments are currently defined: + .TP 5 +@@ -59,7 +59,7 @@ + drivername cat ppdname + .br + Writes the named PPD file to stdout. +-.Sh LISTING FILES (drivername list) ++.SS LISTING FILES (drivername list) + When run with the single argument "list", the program must list + the available PPD files it can generate to stdout using the + following format: +@@ -74,12 +74,12 @@ + file. \fIMake and model\fR is the NickName name from the PPD + file. \fI1284 device id\fR is the 1284DeviceId from the PPD file, + if any. +-.Sh WRITING FILES (drivername cat ppdname) ++.SS WRITING FILES (drivername cat ppdname) + When the driver program is run with the "cat ppdname" arguments, + it must write the named PPD file to stdout, uncompressed. If the + named PPD file does not exist, the driver program must not write + any output to stdout and report the error to stderr instead. +-.Sh DRIVER ERROR MESSAGES ++.SS DRIVER ERROR MESSAGES + Error messages can be relayed back to \fIcupsd\fR by writing them + to stderr. The following prefixes are recognized: + .TP 5 +diff -urNad trunk~/man/mantohtml.c trunk/man/mantohtml.c +--- trunk~/man/mantohtml.c 2008-07-12 00:48:49.000000000 +0200 ++++ trunk/man/mantohtml.c 2008-07-23 08:08:01.000000000 +0200 +@@ -158,7 +158,7 @@ + } + else if (section < 0) + continue; +- else if (!strncmp(line, ".SH ", 4) || !strncmp(line, ".Sh ", 4)) ++ else if (!strncmp(line, ".SH ", 4) || !strncmp(line, ".SS ", 4)) + { + /* + * Grab heading... --- cups-1.3.8.orig/debian/patches/ppd-poll-with-client-conf.dpatch +++ cups-1.3.8/debian/patches/ppd-poll-with-client-conf.dpatch @@ -0,0 +1,31 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## ppd-poll-with-client-conf.dpatch by <till.kamppeter@gmail.com> +## +## DP: If an external server is used via client.conf and the DNS is +## DP: inconsistent (ex: DNS gives "noname" for many IPs, reverse DNS +## DP: gives one of these IPs for "noname") local PPDs can get polled +## DP: for print queues instead of the PPDs of the external server +## DP: (http://www.cups.org/str.php?L2763) + +@DPATCH@ +diff -urNad cups-1.3.6~/cups/util.c cups-1.3.6/cups/util.c +--- cups-1.3.6~/cups/util.c 2008-01-17 00:42:35.000000000 +0100 ++++ cups-1.3.6/cups/util.c 2008-03-20 17:44:46.000000000 +0100 +@@ -812,11 +812,13 @@ + http2 = http; + else if ((http2 = httpConnectEncrypt(hostname, port, + cupsEncryption())) == NULL) +- { +- DEBUG_puts("Unable to connect to server!"); ++ if ((http2 = httpConnectEncrypt(http_hostname, http_port, ++ cupsEncryption())) == NULL) ++ { ++ DEBUG_puts("Unable to connect to server!"); + +- return (NULL); +- } ++ return (NULL); ++ } + + /* + * Get a temp file... --- cups-1.3.8.orig/debian/patches/pjl-display-ready-message.dpatch +++ cups-1.3.8/debian/patches/pjl-display-ready-message.dpatch @@ -0,0 +1,20 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## pjl-display-ready-message.dpatch by Johan Kiviniemi <debian@johan.kiviniemi.name> +## +## DP: According to the PJL spec, one should use RDYMSG DISPLAY = "" to return +## DP: the display to the normal ready message. +## DP: (http://www.cups.org/str.php?L2909, svn trunk r7863) + +@DPATCH@ +diff -urNad cups~/cups/emit.c cups/cups/emit.c +--- cups~/cups/emit.c 2008-07-12 01:48:49.000000000 +0300 ++++ cups/cups/emit.c 2008-08-15 15:05:01.699303148 +0300 +@@ -475,7 +475,7 @@ + */ + + fputs("\033%-12345X@PJL\n", fp); +- fputs("@PJL RDYMSG DISPLAY = \"READY\"\n", fp); ++ fputs("@PJL RDYMSG DISPLAY = \"\"\n", fp); + fputs(ppd->jcl_end + 9, fp); + } + else --- cups-1.3.8.orig/debian/patches/default_log_warn.dpatch +++ cups-1.3.8/debian/patches/default_log_warn.dpatch @@ -0,0 +1,18 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 13_default_log_warn.dpatch by <mpitt@debian.org> +## +## DP: Set default loglevel to 'warning'. + +@DPATCH@ +diff -urNad cups~/conf/cupsd.conf.in cups/conf/cupsd.conf.in +--- cups~/conf/cupsd.conf.in 2006-04-12 16:32:11.000000000 +0200 ++++ cups/conf/cupsd.conf.in 2006-04-12 17:04:58.000000000 +0200 +@@ -8,7 +8,7 @@ + + # Log general information in error_log - change "info" to "debug" for + # troubleshooting... +-LogLevel info ++LogLevel warning + + # Administrator user group... + SystemGroup @CUPS_SYSTEM_GROUPS@ --- cups-1.3.8.orig/debian/patches/cupsfilter-path-typo.dpatch +++ cups-1.3.8/debian/patches/cupsfilter-path-typo.dpatch @@ -0,0 +1,19 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## cupsfilter-path-typo.dpatch by Johan Kiviniemi <debian@johan.kiviniemi.name> +## +## DP: Fix a typo in cupsfilter, causing filters not to have /bin in their +## DP: PATH. (http://www.cups.org/str.php?L2908, trunk svn r7862) + +@DPATCH@ +diff -urNad cups-1.3.8~/scheduler/cupsfilter.c cups-1.3.8/scheduler/cupsfilter.c +--- cups-1.3.8~/scheduler/cupsfilter.c 2008-08-13 12:14:17.803302953 +0300 ++++ cups-1.3.8/scheduler/cupsfilter.c 2008-08-13 12:14:36.815297551 +0300 +@@ -928,7 +928,7 @@ + } + + snprintf(line, sizeof(line), +- "%s/filter:" CUPS_BINDIR ":" CUPS_SBINDIR ":/bin/usr/bin", ++ "%s/filter:" CUPS_BINDIR ":" CUPS_SBINDIR ":/bin:/usr/bin", + ServerBin); + set_string(&Path, line); + --- cups-1.3.8.orig/debian/patches/confdirperms.dpatch +++ cups-1.3.8/debian/patches/confdirperms.dpatch @@ -0,0 +1,20 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## confdirperms.dpatch by Martin Pitt <mpitt@debian.org> +## +## DP: Do not mess with the permissions of cupsd.conf. + +@DPATCH@ +diff -urNad cups-1.3.0~rc2~/scheduler/conf.c cups-1.3.0~rc2/scheduler/conf.c +--- cups-1.3.0~rc2~/scheduler/conf.c 2007-07-30 17:47:10.000000000 +0100 ++++ cups-1.3.0~rc2/scheduler/conf.c 2007-08-02 16:30:54.000000000 +0100 +@@ -789,8 +766,10 @@ + Group, 1, 1) < 0 || + cupsdCheckPermissions(ServerRoot, "ssl", 0700, RunUser, + Group, 1, 0) < 0 || ++ /* Never alter permissions of central conffile + cupsdCheckPermissions(ServerRoot, "cupsd.conf", ConfigFilePerm, RunUser, + Group, 0, 0) < 0 || ++ */ + cupsdCheckPermissions(ServerRoot, "classes.conf", 0600, RunUser, + Group, 0, 0) < 0 || + cupsdCheckPermissions(ServerRoot, "printers.conf", 0600, RunUser, --- cups-1.3.8.orig/debian/patches/reactivate_recommended_driver.dpatch +++ cups-1.3.8/debian/patches/reactivate_recommended_driver.dpatch @@ -0,0 +1,34 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 70_reactivate_recommended_driver.dpatch by <till.kamppeter@gmail.com> +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad cups-1.3.0~rc2~/scheduler/cups-driverd.c cups-1.3.0~rc2/scheduler/cups-driverd.c +--- cups-1.3.0~rc2~/scheduler/cups-driverd.c 2007-07-11 22:46:42.000000000 +0100 ++++ cups-1.3.0~rc2/scheduler/cups-driverd.c 2007-08-01 15:23:01.000000000 +0100 +@@ -180,7 +180,6 @@ + int type) /* I - Driver type */ + { + ppd_info_t *ppd; /* PPD */ +- char *recommended; /* Foomatic driver string */ + + + /* +@@ -238,15 +237,6 @@ + strlcpy(ppd->record.device_id, device_id, sizeof(ppd->record.device_id)); + + /* +- * Strip confusing (and often wrong) "recommended" suffix added by +- * Foomatic drivers... +- */ +- +- if ((recommended = strstr(ppd->record.make_and_model, +- " (recommended)")) != NULL) +- *recommended = '\0'; +- +- /* + * Return the new PPD pointer... + */ + --- cups-1.3.8.orig/debian/patches/removecvstag.dpatch +++ cups-1.3.8/debian/patches/removecvstag.dpatch @@ -0,0 +1,28 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 07_removecvstag.dpatch by Kenshi Muto <kmuto@debian.org> +## +## DP: Do not write VCS tags into installed conffiles +## DP: (http://www.cups.org/str.php?L2369) + +@DPATCH@ +diff -urNad cups-1.2~/conf/Makefile cups-1.2/conf/Makefile +--- cups-1.2~/conf/Makefile 2006-04-25 12:16:07.000000000 +0200 ++++ cups-1.2/conf/Makefile 2006-04-25 12:17:11.000000000 +0200 +@@ -65,6 +65,8 @@ + chgrp $(CUPS_GROUP) $(SERVERROOT)/$$file.N || true; \ + else \ + $(INSTALL_CONFIG) $$file $(SERVERROOT) ; \ ++ grep -v "\$$Id:" $(SERVERROOT)/$$file > $(SERVERROOT)/$$file.n ; \ ++ mv $(SERVERROOT)/$$file.n $(SERVERROOT)/$$file ; \ + chgrp $(CUPS_GROUP) $(SERVERROOT)/$$file || true; \ + fi ; \ + done +@@ -75,6 +77,8 @@ + $(MV) $(SERVERROOT)/$$file $(SERVERROOT)/$$file.O ; \ + fi ; \ + $(INSTALL_DATA) $$file $(SERVERROOT) ; \ ++ grep -v "\$$Id:" $(SERVERROOT)/$$file > $(SERVERROOT)/$$file.n ; \ ++ mv $(SERVERROOT)/$$file.n $(SERVERROOT)/$$file ; \ + done + -if test x$(PAMDIR) != x; then \ + $(INSTALL_DIR) -m 755 $(BUILDROOT)$(PAMDIR); \ --- cups-1.3.8.orig/debian/patches/freebsd.dpatch +++ cups-1.3.8/debian/patches/freebsd.dpatch @@ -0,0 +1,92 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 04_freebsd.dpatch by Kenshi Muto <kmuto@debian.org> +## +## DP: (http://www.cups.org/str.php?L2367, svn trunk r6876) + +@DPATCH@ +diff -urNad cups-1.2~/backend/parallel.c cups-1.2/backend/parallel.c +--- cups-1.2~/backend/parallel.c 2006-04-25 12:14:36.000000000 +0200 ++++ cups-1.2/backend/parallel.c 2006-04-25 12:14:51.000000000 +0200 +@@ -693,7 +693,7 @@ + printf("direct parallel:%s \"Unknown\" \"Parallel Port #%d\"\n", device, i + 1); + } + } +-#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) ++#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) + int i; /* Looping var */ + int fd; /* File descriptor */ + char device[255]; /* Device filename */ +diff -urNad cups-1.2~/backend/serial.c cups-1.2/backend/serial.c +--- cups-1.2~/backend/serial.c 2006-04-25 12:14:36.000000000 +0200 ++++ cups-1.2/backend/serial.c 2006-04-25 12:15:44.000000000 +0200 +@@ -666,11 +666,11 @@ + void + list_devices(void) + { +-#if defined(__hpux) || defined(__sgi) || defined(__sun) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) ++#if defined(__hpux) || defined(__sgi) || defined(__sun) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) + static char *funky_hex = "0123456789abcdefghijklmnopqrstuvwxyz"; + /* Funky hex numbering used for some * + * devices */ +-#endif /* __hpux || __sgi || __sun || __FreeBSD__ || __OpenBSD__ */ ++#endif /* __hpux || __sgi || __sun || __FreeBSD__ || __OpenBSD__ || __FreeBSD_kernel__ */ + + #ifdef __linux + int i, j; /* Looping vars */ +@@ -958,7 +958,7 @@ + printf("serial serial:%s?baud=38400 \"Unknown\" \"Serial Port #%d\"\n", + device, i + 1); + } +-#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) ++#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) + int i, j; /* Looping vars */ + int fd; /* File descriptor */ + char device[255]; /* Device filename */ +diff -urNad cups-1.2~/backend/usb-unix.c cups-1.2/backend/usb-unix.c +--- cups-1.2~/backend/usb-unix.c 2006-04-25 12:14:36.000000000 +0200 ++++ cups-1.2/backend/usb-unix.c 2006-04-25 12:14:51.000000000 +0200 +@@ -401,7 +401,7 @@ + } + #elif defined(__hpux) + #elif defined(__osf) +-#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) ++#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) + int i; /* Looping var */ + char device[255]; /* Device filename */ + +diff -urNad cups-1.2~/backend/usb.c cups-1.2/backend/usb.c +--- cups-1.2~/backend/usb.c 2006-04-25 12:14:36.000000000 +0200 ++++ cups-1.2/backend/usb.c 2006-04-25 12:14:51.000000000 +0200 +@@ -72,7 +72,7 @@ + + #ifdef __APPLE__ + # include "usb-darwin.c" +-#elif defined(__linux) || defined(__sun) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) ++#elif defined(__linux) || defined(__sun) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) + # include "usb-unix.c" + #else + /* +diff -urNad cups-1.2~/config-scripts/cups-directories.m4 cups-1.2/config-scripts/cups-directories.m4 +--- cups-1.2~/config-scripts/cups-directories.m4 2006-04-25 12:14:36.000000000 +0200 ++++ cups-1.2/config-scripts/cups-directories.m4 2006-04-25 12:14:51.000000000 +0200 +@@ -135,7 +135,7 @@ + "/System/Library/StartupItems/PrintingServices") + ;; + +- Linux | GNU) ++ Linux | GNU | GNU/k*BSD*) + # Linux/HURD seems to choose an init.d directory at random... + if test -d /sbin/init.d; then + # SuSE +diff -urNad cups-1.2~/configure cups-1.2/configure +--- cups-1.2~/configure 2006-04-25 12:14:50.000000000 +0200 ++++ cups-1.2/configure 2006-04-25 12:14:51.000000000 +0200 +@@ -7445,7 +7445,7 @@ + + ;; + +- Linux | GNU) ++ Linux | GNU | GNU/k*BSD*) + # Linux/HURD seems to choose an init.d directory at random... + if test -d /sbin/init.d; then + # SuSE --- cups-1.3.8.orig/debian/patches/ubuntu-default-error-policy-retry-job.dpatch +++ cups-1.3.8/debian/patches/ubuntu-default-error-policy-retry-job.dpatch @@ -0,0 +1,24 @@ +#! /bin/sh -e +## ubuntu-default-error-policy-retry-job.dpatch by <martin.pitt@ubuntu.com> +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Set default job error policy to "Retry", since it is less confusing and +## DP: a better default on desktop machines. This patch is only applied when +## DP: building on Ubuntu. + +[ "`lsb_release -is 2>/dev/null`" = "Ubuntu" ] || { echo -n '(ignored)' >&2; exit 0; } +. /usr/share/dpatch/dpatch-run + +@DPATCH@ +diff -urNad cups-1.3.0~rc2~/scheduler/conf.c cups-1.3.0~rc2/scheduler/conf.c +--- cups-1.3.0~rc2~/scheduler/conf.c 2007-07-30 17:47:10.000000000 +0100 ++++ cups-1.3.0~rc2/scheduler/conf.c 2007-08-01 15:33:55.000000000 +0100 +@@ -548,7 +548,7 @@ + cupsdClearString(&BrowseLocalOptions); + cupsdClearString(&BrowseRemoteOptions); + +- cupsdSetString(&ErrorPolicy, "stop-printer"); ++ cupsdSetString(&ErrorPolicy, "retry-job"); + + #ifdef HAVE_LDAP + cupsdClearString(&BrowseLDAPBindDN); --- cups-1.3.8.orig/debian/patches/search_mime_files_in_usr_share.dpatch +++ cups-1.3.8/debian/patches/search_mime_files_in_usr_share.dpatch @@ -0,0 +1,577 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## search_mime_files_in_usr_share.dpatch by <till.kamppeter@gmail.com> +## +## DP: http://www.cups.org/str.php?L2719, svn trunk r7670 + +@DPATCH@ +diff -urNad cups-1.3.8~/scheduler/conf.c cups-1.3.8/scheduler/conf.c +--- cups-1.3.8~/scheduler/conf.c 2008-08-06 22:31:38.000000000 +0200 ++++ cups-1.3.8/scheduler/conf.c 2008-08-06 22:32:28.000000000 +0200 +@@ -342,6 +342,7 @@ + cups_file_t *fp; /* Configuration file */ + int status; /* Return status */ + char temp[1024], /* Temporary buffer */ ++ mimedir[1024], /* MIME directory */ + *slash; /* Directory separator */ + cups_lang_t *language; /* Language */ + struct passwd *user; /* Default user */ +@@ -1100,20 +1101,25 @@ + */ + + snprintf(temp, sizeof(temp), "%s/filter", ServerBin); ++ snprintf(mimedir, sizeof(mimedir), "%s/mime", DataDir); + +- MimeDatabase = mimeLoad(ServerRoot, temp); ++ MimeDatabase = mimeLoadTypes(NULL, mimedir); ++ MimeDatabase = mimeLoadTypes(MimeDatabase, ServerRoot); ++ MimeDatabase = mimeLoadFilters(MimeDatabase, mimedir, temp); ++ MimeDatabase = mimeLoadFilters(MimeDatabase, ServerRoot, temp); + + if (!MimeDatabase) + { + cupsdLogMessage(CUPSD_LOG_EMERG, +- "Unable to load MIME database from \'%s\'!", ServerRoot); ++ "Unable to load MIME database from \"%s\" or \"%s\"!", ++ mimedir, ServerRoot); + exit(errno); + } + + cupsdLogMessage(CUPSD_LOG_INFO, +- "Loaded MIME database from \'%s\': %d types, %d filters...", +- ServerRoot, mimeNumTypes(MimeDatabase), +- mimeNumFilters(MimeDatabase)); ++ "Loaded MIME database from \"%s\" and \"%s\": %d types, " ++ "%d filters...", mimedir, ServerRoot, ++ mimeNumTypes(MimeDatabase), mimeNumFilters(MimeDatabase)); + + /* + * Create a list of MIME types for the document-format-supported +--- cups-1.3.8~/scheduler/cupsfilter.c 2008-01-16 23:20:33.000000000 +0100 ++++ cups-1.3.8/scheduler/cupsfilter.c 2008-08-06 22:32:38.000000000 +0200 +@@ -103,6 +103,7 @@ + int compression; /* Compression of file */ + int cost; /* Cost of filters */ + mime_t *mime; /* MIME database */ ++ char mimedir[1024]; /* MIME directory */ + char *infile, /* File to filter */ + *outfile; /* File to create */ + char cupsdconf[1024]; /* cupsd.conf file */ +@@ -331,11 +332,19 @@ + if (read_cupsd_conf(cupsdconf)) + return (1); + +- if ((mime = mimeLoad(ServerRoot, Path)) == NULL) ++ snprintf(mimedir, sizeof(mimedir), "%s/mime", DataDir); ++ ++ mime = mimeLoadTypes(NULL, mimedir); ++ mime = mimeLoadTypes(mime, ServerRoot); ++ mime = mimeLoadFilters(mime, mimedir, Path); ++ mime = mimeLoadFilters(mime, ServerRoot, Path); ++ ++ if (!mime) + { + _cupsLangPrintf(stderr, +- _("%s: Unable to read MIME database from \"%s\"!\n"), +- command, ServerRoot); ++ _("%s: Unable to read MIME database from \"%s\" or " ++ "\"%s\"!\n"), ++ command, mimedir, ServerRoot); + return (1); + } + +--- cups-1.3.8~/scheduler/mime.c 2008-01-17 00:42:35.000000000 +0100 ++++ cups-1.3.8/scheduler/mime.c 2008-08-06 22:32:48.000000000 +0200 +@@ -72,6 +72,7 @@ + const char *filterpath, + cups_array_t *filtercache); + static void load_types(mime_t *mime, const char *filename); ++static mime_t *mime_new(void); + + + /* +@@ -192,73 +193,50 @@ + + /* + * 'mimeLoad()' - Create a new MIME database from disk. ++ * ++ * This function uses @link mimeLoadFilters@ and @link mimeLoadTypes@ to ++ * create a MIME database from a single directory. + */ + + mime_t * /* O - New MIME database */ + mimeLoad(const char *pathname, /* I - Directory to load */ + const char *filterpath) /* I - Directory to load */ + { +- return (mimeMerge(NULL, pathname, filterpath)); ++ return (mimeLoadFilters(mimeLoadTypes(NULL, pathname), pathname, filterpath)); + } + + + /* +- * 'mimeMerge()' - Merge a MIME database from disk with the current one. ++ * 'mimeLoadFilters()' - Load filter definitions from disk. ++ * ++ * This function loads all of the .convs files from the specified directory. ++ * Use @link mimeLoadTypes@ to load all types before you load the filters. + */ + +-mime_t * /* O - Updated MIME database */ +-mimeMerge(mime_t *mime, /* I - MIME database to add to */ +- const char *pathname, /* I - Directory to load */ +- const char *filterpath) /* I - Directory to load */ ++mime_t * /* O - MIME database */ ++mimeLoadFilters(mime_t *mime, /* I - MIME database */ ++ const char *pathname, /* I - Directory to load from */ ++ const char *filterpath) /* I - Default filter program directory */ + { + cups_dir_t *dir; /* Directory */ + cups_dentry_t *dent; /* Directory entry */ +- char filename[1024]; /* Full filename of types/converts file */ ++ char filename[1024]; /* Full filename of .convs file */ + cups_array_t *filtercache; /* Filter cache */ + + + /* +- * First open the directory specified by pathname... Return NULL if nothing +- * was read or if the pathname is NULL... +- */ +- +- if (!pathname) +- return (NULL); +- +- if ((dir = cupsDirOpen(pathname)) == NULL) +- return (NULL); +- +- /* +- * If "mime" is NULL, make a new, blank database... ++ * Range check input... + */ + +- if (!mime) +- mime = mimeNew(); +- if (!mime) +- { +- cupsDirClose(dir); +- return (NULL); +- } ++ if (!mime || !pathname || !filterpath) ++ return (mime); + + /* +- * Read all the .types files... ++ * Then open the directory specified by pathname... + */ + +- while ((dent = cupsDirRead(dir)) != NULL) +- { +- if (strlen(dent->filename) > 6 && +- !strcmp(dent->filename + strlen(dent->filename) - 6, ".types")) +- { +- /* +- * Load a mime.types file... +- */ +- +- snprintf(filename, sizeof(filename), "%s/%s", pathname, dent->filename); +- load_types(mime, filename); +- } +- } +- +- cupsDirRewind(dir); ++ if ((dir = cupsDirOpen(pathname)) == NULL) ++ return (mime); + + /* + * Read all the .convs files... +@@ -289,13 +267,62 @@ + + + /* +- * 'mimeNew()' - Create a new, empty MIME database. ++ * 'mimeLoadTypes()' - Load type definitions from disk. ++ * ++ * This function loads all of the .types files from the specified directory. ++ * Use @link mimeLoadFilters@ to load all filters after you load the types. + */ + + mime_t * /* O - MIME database */ +-mimeNew(void) ++mimeLoadTypes(mime_t *mime, /* I - MIME database or @code NULL@ to create a new one */ ++ const char *pathname) /* I - Directory to load from */ + { +- return ((mime_t *)calloc(1, sizeof(mime_t))); ++ cups_dir_t *dir; /* Directory */ ++ cups_dentry_t *dent; /* Directory entry */ ++ char filename[1024]; /* Full filename of .types file */ ++ ++ ++ /* ++ * First open the directory specified by pathname... ++ */ ++ ++ if ((dir = cupsDirOpen(pathname)) == NULL) ++ return (mime); ++ ++ /* ++ * If "mime" is NULL, make a new, empty database... ++ */ ++ ++ if (!mime) ++ mime = mime_new(); ++ ++ if (!mime) ++ { ++ cupsDirClose(dir); ++ return (NULL); ++ } ++ ++ /* ++ * Read all the .types files... ++ */ ++ ++ while ((dent = cupsDirRead(dir)) != NULL) ++ { ++ if (strlen(dent->filename) > 6 && ++ !strcmp(dent->filename + strlen(dent->filename) - 6, ".types")) ++ { ++ /* ++ * Load a mime.types file... ++ */ ++ ++ snprintf(filename, sizeof(filename), "%s/%s", pathname, dent->filename); ++ load_types(mime, filename); ++ } ++ } ++ ++ cupsDirClose(dir); ++ ++ return (mime); + } + + +@@ -474,6 +501,10 @@ + int cost; /* Cost of filter */ + + ++ DEBUG_printf(("load_convs(mime=%p, filename=\"%s\", filterpath=\"%s\", " ++ "filtercache=%p)\n", mime, filename, filterpath, filtercache)); ++ ++ + /* + * First try to open the file... + */ +@@ -481,8 +512,6 @@ + if ((fp = cupsFileOpen(filename, "r")) == NULL) + return; + +- DEBUG_printf(("\"%s\":\n", filename)); +- + /* + * Then read each line from the file, skipping any comments in the file... + */ +@@ -493,8 +522,6 @@ + * Skip blank lines and lines starting with a #... + */ + +- DEBUG_puts(line); +- + if (!line[0] || line[0] == '#') + continue; + +@@ -544,7 +571,8 @@ + + if ((dsttype = mimeType(mime, super, type)) == NULL) + { +- DEBUG_printf((" Destination type %s/%s not found!\n", super, type)); ++ DEBUG_printf(("load_convs: Destination type %s/%s not found!\n", ++ super, type)); + continue; + } + +@@ -578,7 +606,8 @@ + + if (!add_fcache(filtercache, filter, filterpath)) + { +- DEBUG_printf((" Filter %s not found in %s!\n", filter, filterpath)); ++ DEBUG_printf(("load_convs: Filter %s not found in %s!\n", filter, ++ filterpath)); + continue; + } + } +@@ -653,6 +682,8 @@ + mime_type_t *typeptr; /* New MIME type */ + + ++ DEBUG_printf(("load_types(mime=%p, filename=\"%s\")\n", mime, filename)); ++ + /* + * First try to open the file... + */ +@@ -660,8 +691,6 @@ + if ((fp = cupsFileOpen(filename, "r")) == NULL) + return; + +- DEBUG_printf(("\"%s\":\n", filename)); +- + /* + * Then read each line from the file, skipping any comments in the file... + */ +@@ -672,8 +701,6 @@ + * Skip blank lines and lines starting with a #... + */ + +- DEBUG_puts(line); +- + if (!line[0] || line[0] == '#') + continue; + +@@ -732,5 +759,16 @@ + + + /* ++ * 'mime_new()' - Create a new, empty MIME database. ++ */ ++ ++static mime_t * /* O - MIME database */ ++mime_new(void) ++{ ++ return ((mime_t *)calloc(1, sizeof(mime_t))); ++} ++ ++ ++/* + * End of "$Id: mime.c 7224 2008-01-16 23:42:35Z mike $". + */ +--- cups-1.3.8~/scheduler/mime.h 2007-07-11 23:46:42.000000000 +0200 ++++ cups-1.3.8/scheduler/mime.h 2008-08-06 22:32:51.000000000 +0200 +@@ -3,7 +3,7 @@ + * + * MIME type/conversion database definitions for the Common UNIX Printing System (CUPS). + * +- * Copyright 2007 by Apple Inc. ++ * Copyright 2007-2008 by Apple Inc. + * Copyright 1997-2007 by Easy Software Products, all rights reserved. + * + * These coded instructions, statements, and computer programs are the +@@ -86,6 +86,7 @@ + typedef struct _mime_type_s /**** MIME Type Data ****/ + { + mime_magic_t *rules; /* Rules used to detect this type */ ++ int priority; /* Priority of this type */ + char super[MIME_MAX_SUPER], /* Super-type name ("image", "application", etc.) */ + type[MIME_MAX_TYPE]; /* Type name ("png", "postscript", etc.) */ + } mime_type_t; +@@ -112,9 +113,9 @@ + + extern void mimeDelete(mime_t *mime); + extern mime_t *mimeLoad(const char *pathname, const char *filterpath); +-extern mime_t *mimeMerge(mime_t *mime, const char *pathname, +- const char *filterpath); +-extern mime_t *mimeNew(void); ++extern mime_t *mimeLoadFilters(mime_t *mime, const char *pathname, ++ const char *filterpath); ++extern mime_t *mimeLoadTypes(mime_t *mime, const char *pathname); + + extern mime_type_t *mimeAddType(mime_t *mime, const char *super, + const char *type); +--- cups-1.3.8~/scheduler/type.c 2008-07-12 00:48:49.000000000 +0200 ++++ cups-1.3.8/scheduler/type.c 2008-08-06 22:33:06.000000000 +0200 +@@ -3,7 +3,7 @@ + * + * MIME typing routines for the Common UNIX Printing System (CUPS). + * +- * Copyright 2007 by Apple Inc. ++ * Copyright 2007-2008 by Apple Inc. + * Copyright 1997-2006 by Easy Software Products, all rights reserved. + * + * These coded instructions, statements, and computer programs are the +@@ -102,6 +102,7 @@ + + strlcpy(temp->super, super, sizeof(temp->super)); + strcpy(temp->type, type); /* Safe: temp->type is allocated */ ++ temp->priority = 100; + + cupsArrayAdd(mime->types, temp); + +@@ -156,7 +157,7 @@ + logic = MIME_MAGIC_NOP; + invert = 0; + +- DEBUG_printf(("%s/%s: %s\n", mt->super, mt->type, rule)); ++ DEBUG_printf(("mimeAddTypeRule: %s/%s: %s\n", mt->super, mt->type, rule)); + + while (*rule != '\0') + { +@@ -165,13 +166,13 @@ + + if (*rule == '(') + { +- DEBUG_puts("new parenthesis group"); ++ DEBUG_puts("mimeAddTypeRule: New parenthesis group"); + logic = MIME_MAGIC_NOP; + rule ++; + } + else if (*rule == ')') + { +- DEBUG_puts("close paren..."); ++ DEBUG_puts("mimeAddTypeRule: Close paren..."); + if (current == NULL || current->parent == NULL) + return (-1); + +@@ -207,11 +208,12 @@ + current->prev = NULL; + current->parent = temp; + +- DEBUG_printf(("creating new AND group %p...\n", temp)); ++ DEBUG_printf(("mimeAddTypeRule: Creating new AND group %p...\n", temp)); + } + else + { +- DEBUG_printf(("setting group %p op to AND...\n", current->parent)); ++ DEBUG_printf(("mimeAddTypeRule: Setting group %p op to AND...\n", ++ current->parent)); + current->parent->op = MIME_MAGIC_AND; + } + +@@ -237,7 +239,8 @@ + if ((temp = calloc(1, sizeof(mime_magic_t))) == NULL) + return (-1); + +- DEBUG_printf(("creating new AND group %p inside OR group\n", temp)); ++ DEBUG_printf(("mimeAddTypeRule: Creating new AND group %p inside OR " ++ "group\n", temp)); + + while (current->prev != NULL) + { +@@ -257,7 +260,7 @@ + * This isn't the top rule, so go up one level... + */ + +- DEBUG_puts("going up one level"); ++ DEBUG_puts("mimeAddTypeRule: Going up one level"); + current = current->parent; + } + } +@@ -267,7 +270,7 @@ + } + else if (*rule == '!') + { +- DEBUG_puts("NOT"); ++ DEBUG_puts("mimeAddTypeRule: NOT"); + invert = 1; + rule ++; + } +@@ -395,6 +398,11 @@ + op = MIME_MAGIC_LOCALE; + else if (!strcmp(name, "contains")) + op = MIME_MAGIC_CONTAINS; ++ else if (!strcmp(name, "priority") && num_values == 1) ++ { ++ mt->priority = atoi(value[0]); ++ continue; ++ } + else + return (-1); + } +@@ -433,7 +441,8 @@ + * Add parenthetical grouping... + */ + +- DEBUG_printf(("making new OR group %p for parenthesis...\n", temp)); ++ DEBUG_printf(("mimeAddTypeRule: Making new OR group %p for " ++ "parenthesis...\n", temp)); + + temp->op = MIME_MAGIC_OR; + +@@ -446,8 +455,8 @@ + logic = MIME_MAGIC_OR; + } + +- DEBUG_printf(("adding %p: %s, op = %d, logic = %d, invert = %d\n", +- temp, name, op, logic, invert)); ++ DEBUG_printf(("mimeAddTypeRule: adding %p: %s, op=%d, logic=%d, " ++ "invert=%d\n", temp, name, op, logic, invert)); + + /* + * Fill in data for the rule... +@@ -530,14 +539,12 @@ + { + _mime_filebuf_t fb; /* File buffer */ + const char *base; /* Base filename of file */ +- mime_type_t *type; /* File type */ ++ mime_type_t *type, /* File type */ ++ *best; /* Best match */ + + + DEBUG_printf(("mimeFileType(mime=%p, pathname=\"%s\", filename=\"%s\", " +- "compression=%p)\n", +- mime, pathname ? pathname : "(nil)", +- filename ? filename : "(nil)", +- compression)); ++ "compression=%p)\n", mime, pathname, filename, compression)); + + /* + * Range check input parameters... +@@ -576,11 +583,14 @@ + * Then check it against all known types... + */ + +- for (type = (mime_type_t *)cupsArrayFirst(mime->types); ++ for (type = (mime_type_t *)cupsArrayFirst(mime->types), best = NULL; + type; + type = (mime_type_t *)cupsArrayNext(mime->types)) + if (checkrules(base, &fb, type->rules)) +- break; ++ { ++ if (!best || type->priority > best->priority) ++ best = type; ++ } + + /* + * Finally, close the file and return a match (if any)... +@@ -591,7 +601,7 @@ + + cupsFileClose(fb.fp); + +- return (type); ++ return (best); + } + + +@@ -791,7 +801,7 @@ + break; + + case MIME_MAGIC_STRING : +- DEBUG_printf((" string(%d, \"%s\")\n", rules->offset, ++ DEBUG_printf(("checkrules: string(%d, \"%s\")\n", rules->offset, + rules->value.stringv)); + + /* +@@ -810,7 +820,7 @@ + sizeof(fb->buffer)); + fb->offset = rules->offset; + +- DEBUG_printf((" loaded %d byte fb->buffer at %d, starts " ++ DEBUG_printf(("checkrules: loaded %d byte fb->buffer at %d, starts " + "with \"%c%c%c%c\"...\n", + fb->length, fb->offset, fb->buffer[0], fb->buffer[1], + fb->buffer[2], fb->buffer[3])); +@@ -826,7 +836,7 @@ + else + result = (memcmp(fb->buffer + rules->offset - fb->offset, + rules->value.stringv, rules->length) == 0); +- DEBUG_printf((" result=%d\n", result)); ++ DEBUG_printf(("checkrules: result=%d\n", result)); + break; + + case MIME_MAGIC_ISTRING : +@@ -1027,8 +1037,8 @@ + * the the rule set is false... + */ + +- DEBUG_printf((" result of test %p (MIME_MAGIC_%s) is %d\n", rules, +- debug_tests[rules->op], result)); ++ DEBUG_printf(("checkrules: result of test %p (MIME_MAGIC_%s) is %d\n", ++ rules, debug_tests[rules->op], result)); + + if ((result && logic == MIME_MAGIC_OR) || + (!result && logic == MIME_MAGIC_AND)) --- cups-1.3.8.orig/debian/patches/pdftops-dont_fail_on_cancel.dpatch +++ cups-1.3.8/debian/patches/pdftops-dont_fail_on_cancel.dpatch @@ -0,0 +1,34 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## pdftops-fixes.dpatch by <mpitt@debian.org> +## +## DP: Fix behavioural change in patch from STR #2780 which broke the test +## DP: suite: When a job is cancelled, do not report a failure in the exit code +## DP: of pdftops. (http://www.cups.org/str.php?L2808, upstream svn trunk r7479) + +@DPATCH@ +diff -urNad trunk~/filter/pdftops.c trunk/filter/pdftops.c +--- trunk~/filter/pdftops.c 2008-04-21 19:33:00.000000000 +0200 ++++ trunk/filter/pdftops.c 2008-04-21 19:34:57.000000000 +0200 +@@ -270,20 +270,18 @@ + * Parent comes here... + */ + +- while ((pdfwaitpid = wait(&pdfstatus)) < 0 && errno == EINTR) ++ while ((pdfwaitpid = wait(&pdfstatus)) < 0 && errno == EINTR); + { + /* + * Wait until we get a valid process ID or the job is canceled... + */ + +- if (job_canceled) +- break; + } + + if (pdfwaitpid != pdfpid) + { + kill(pdfpid, SIGTERM); +- pdfstatus = 1; ++ pdfstatus = job_canceled ? 0 : 1; + } + else if (pdfstatus) + { --- cups-1.3.8.orig/debian/local/pstopdf.convs +++ cups-1.3.8/debian/local/pstopdf.convs @@ -0,0 +1 @@ +application/postscript application/pdf 22 pstopdf --- cups-1.3.8.orig/debian/local/textonly.ppd +++ cups-1.3.8/debian/local/textonly.ppd @@ -0,0 +1,47 @@ +*PPD-Adobe: "4.3" +*% +*% Text-only printer definition +*% +*FormatVersion: "4.3" +*FileVersion: "1.1" +*LanguageVersion: English +*LanguageEncoding: ISOLatin1 +*PCFileName: "TEXTONLY.PPD" +*Manufacturer: "Generic" +*Product: "(Generic)" +*cupsVersion: 1.0 +*cupsManualCopies: True +*cupsModelNumber: 2 +*cupsFilter: "text/plain 0 textonly" +*ModelName: "Generic text-only printer" +*ShortNickName: "Generic text-only printer" +*NickName: "Generic text-only printer" +*PSVersion: "(2017.000) 0" +*LanguageLevel: "2" +*ColorDevice: False +*DefaultColorSpace: Gray +*FileSystem: False +*Throughput: "8" +*LandscapeOrientation: Plus90 +*VariablePaperSize: False +*TTRasterizer: Type42 +*DefaultImageableArea: Letter +*ImageableArea Letter/US Letter: "18 36 594 756" +*DefaultPaperDimension: Letter +*PaperDimension Letter/Letter: "612 792" +*OpenUI *PageSize/Media Size: PickOne +*OrderDependency: 10 AnySetup *PageSize +*DefaultPageSize: Letter +*PageSize Letter/Letter: "<</PageSize[612 792]/ImagingBBox null>>setpagedevice" +*CloseUI: *PageSize +*OpenUI *PageRegion: PickOne +*OrderDependency: 10 AnySetup *PageRegion +*DefaultPageRegion: Letter +*PageRegion Letter/Letter: "<</PageSize[612 792]/ImagingBBox null>>setpagedevice" +*CloseUI: *PageRegion + +*OpenUI *SendFF: Boolean +*DefaultSendFF: False +*SendFF True/True: "" +*SendFF False/False: "" +*CloseUI: *SendFF --- cups-1.3.8.orig/debian/local/postscript.ppd +++ cups-1.3.8/debian/local/postscript.ppd @@ -0,0 +1,540 @@ +*PPD-Adobe: "4.3" +*% +*% "$Id: postscript.ppd,v 1.1.1.1 2000/08/24 19:23:13 goffioul Exp $" +*% +*% Sample Postscript driver PPD file for the Common UNIX Printing +*% System (CUPS). +*% +*% Michael Goffioul <goffioul@emic.ucl.ac.be> +*% +*% Changes to the original file by Volker Behr, Martin-Eric Racine, +*% Nickolay Kondrashov and other contributors: +*% added custom page size - 2006-05-18 +*% replaced page descriptions - 2006-05-18 +*% InputSlot constraints removed - 2006-05-11 +*% maxed out imageable regions - 2006-05-11 +*% added pstitleiconv filter - 2006-05-11 +*% added ledger paper size - 2006-01-29 +*% match Adobe specifications - 2005-12-23 +*% additional paper formats - 2005-02-03 and 2005-02-07 +*% made A4 default paper size - 2005-02-03 +*% Color enabled - 2003-12-02 +*% +*FormatVersion: "4.3" +*FileVersion: "1.1" +*LanguageVersion: English +*LanguageEncoding: ISOLatin1 +*PCFileName: "GENPS.PPD" +*Manufacturer: "Generic" +*Product: "(CUPS v1.1)" +*ModelName: "Generic PostScript Printer" +*ShortNickName: "Generic PostScript Printer" +*NickName: "Generic PostScript Printer" +*1284DeviceID: "MFG:Generic;MDL:PostScript Printer;DES:Generic PostScript Printer;CLS:PRINTER;CMD:POSTSCRIPT;" +*% cupsFilter: "application/vnd.cups-postscript 0 pstitleiconv" +*PSVersion: "(2017.000) 0" +*LanguageLevel: "2" +*ColorDevice: True +*DefaultColorSpace: RGB +*FileSystem: False +*Throughput: "8" +*LandscapeOrientation: Plus90 +*TTRasterizer: Type42 + +*HWMargins: 0 0 0 0 +*VariablePaperSize: True +*MaxMediaWidth: 100000 +*MaxMediaHeight: 100000 +*NonUIOrderDependency: 100 AnySetup *CustomPageSize +*CustomPageSize True: "pop pop pop +<</PageSize [ 5 -2 roll ] /ImagingBBox null>>setpagedevice" +*End +*ParamCustomPageSize Width: 1 points 36 100000 +*ParamCustomPageSize Height: 2 points 36 100000 +*ParamCustomPageSize Orientation: 3 int 0 3 +*ParamCustomPageSize WidthOffset: 4 points 0 0 +*ParamCustomPageSize HeightOffset: 5 points 0 0 + +*OpenGroup: General/General + +*OpenUI *PageSize/Page Size: PickOne +*OrderDependency: 100 AnySetup *PageSize +*DefaultPageSize: A4 +*PageSize 11x14/11x14: "<</PageSize[792 1008]/ImagingBBox null>>setpagedevice" +*PageSize 11x17/11x17: "<</PageSize[792 1224]/ImagingBBox null>>setpagedevice" +*PageSize 13x19/13x19: "<</PageSize[936 1368]/ImagingBBox null>>setpagedevice" +*PageSize 16x20/16x20: "<</PageSize[1152 1440]/ImagingBBox null>>setpagedevice" +*PageSize 16x24/16x24: "<</PageSize[1152 1728]/ImagingBBox null>>setpagedevice" +*PageSize 2A/2A: "<</PageSize[3370 4768]/ImagingBBox null>>setpagedevice" +*PageSize 4A/4A: "<</PageSize[4768 6749]/ImagingBBox null>>setpagedevice" +*PageSize 8x10/8x10: "<</PageSize[576 720]/ImagingBBox null>>setpagedevice" +*PageSize 8x12/8x12: "<</PageSize[576 864]/ImagingBBox null>>setpagedevice" +*PageSize A0/A0: "<</PageSize[2384 3370]/ImagingBBox null>>setpagedevice" +*PageSize A1/A1: "<</PageSize[1684 2384]/ImagingBBox null>>setpagedevice" +*PageSize A2/A2: "<</PageSize[1191 1684]/ImagingBBox null>>setpagedevice" +*PageSize A3/A3: "<</PageSize[842 1191]/ImagingBBox null>>setpagedevice" +*PageSize A4/A4: "<</PageSize[595 842]/ImagingBBox null>>setpagedevice" +*PageSize A5/A5: "<</PageSize[421 595]/ImagingBBox null>>setpagedevice" +*PageSize AnsiA/ANSI A: "<</PageSize[612 792]/ImagingBBox null>>setpagedevice" +*PageSize AnsiB/ANSI B: "<</PageSize[792 1224]/ImagingBBox null>>setpagedevice" +*PageSize AnsiC/ANSI C: "<</PageSize[1224 1584]/ImagingBBox null>>setpagedevice" +*PageSize AnsiD/ANSI D: "<</PageSize[1584 2448]/ImagingBBox null>>setpagedevice" +*PageSize AnsiE/ANSI E: "<</PageSize[2448 3168]/ImagingBBox null>>setpagedevice" +*PageSize ArchA/Arch A: "<</PageSize[648 864]/ImagingBBox null>>setpagedevice" +*PageSize ArchB/Arch B: "<</PageSize[864 1296]/ImagingBBox null>>setpagedevice" +*PageSize ArchC/Arch C: "<</PageSize[1296 1728]/ImagingBBox null>>setpagedevice" +*PageSize ArchD/Arch D: "<</PageSize[1728 2592]/ImagingBBox null>>setpagedevice" +*PageSize ArchE/Arch E: "<</PageSize[2592 3456]/ImagingBBox null>>setpagedevice" +*PageSize C0/C0: "<</PageSize[2599 3676]/ImagingBBox null>>setpagedevice" +*PageSize C1/C1: "<</PageSize[1836 2599]/ImagingBBox null>>setpagedevice" +*PageSize C2/C2: "<</PageSize[1298 1836]/ImagingBBox null>>setpagedevice" +*PageSize C3/C3: "<</PageSize[918 1298]/ImagingBBox null>>setpagedevice" +*PageSize C4/C4: "<</PageSize[649 918]/ImagingBBox null>>setpagedevice" +*PageSize C5/C5: "<</PageSize[459 649]/ImagingBBox null>>setpagedevice" +*PageSize Env10/Envelope #10: "<</PageSize[297 684]/ImagingBBox null>>setpagedevice" +*PageSize EnvC5/Envelope C5: "<</PageSize[459 649]/ImagingBBox null>>setpagedevice" +*PageSize EnvDL/Envelope DL: "<</PageSize[312 624]/ImagingBBox null>>setpagedevice" +*PageSize EnvMonarch/Envelope Monarch: "<</PageSize[279 540]/ImagingBBox null>>setpagedevice" +*PageSize Executive/Executive: "<</PageSize[522 756]/ImagingBBox null>>setpagedevice" +*PageSize ISOB0/B0 (ISO): "<</PageSize[2834 4008]/ImagingBBox null>>setpagedevice" +*PageSize ISOB1/B1 (ISO): "<</PageSize[2004 2834]/ImagingBBox null>>setpagedevice" +*PageSize ISOB2/B2 (ISO): "<</PageSize[1417 2004]/ImagingBBox null>>setpagedevice" +*PageSize ISOB3/B3 (ISO): "<</PageSize[1000 1417]/ImagingBBox null>>setpagedevice" +*PageSize ISOB4/B4 (ISO): "<</PageSize[708 1000]/ImagingBBox null>>setpagedevice" +*PageSize ISOB5/B5 (ISO): "<</PageSize[498 708]/ImagingBBox null>>setpagedevice" +*PageSize JISB0/B0 (JIS): "<</PageSize[2919 4127]/ImagingBBox null>>setpagedevice" +*PageSize JISB1/B1 (JIS): "<</PageSize[2063 2919]/ImagingBBox null>>setpagedevice" +*PageSize JISB2/B2 (JIS): "<</PageSize[1459 2063]/ImagingBBox null>>setpagedevice" +*PageSize JISB3/B3 (JIS): "<</PageSize[1029 1459]/ImagingBBox null>>setpagedevice" +*PageSize JISB4/B4 (JIS): "<</PageSize[727 1029]/ImagingBBox null>>setpagedevice" +*PageSize JISB5/B5 (JIS): "<</PageSize[518 727]/ImagingBBox null>>setpagedevice" +*PageSize Ledger/Ledger: "<</PageSize[1224 792]/ImagingBBox null>>setpagedevice" +*PageSize Legal/US Legal: "<</PageSize[612 1008]/ImagingBBox null>>setpagedevice" +*PageSize Letter/US Letter: "<</PageSize[612 792]/ImagingBBox null>>setpagedevice" +*PageSize RA0/RA0: "<</PageSize[2437 3458]/ImagingBBox null>>setpagedevice" +*PageSize RA1/RA1: "<</PageSize[1729 2437]/ImagingBBox null>>setpagedevice" +*PageSize RA2/RA2: "<</PageSize[1218 1729]/ImagingBBox null>>setpagedevice" +*PageSize RA3/RA3: "<</PageSize[864 1218]/ImagingBBox null>>setpagedevice" +*PageSize RA4/RA4: "<</PageSize[609 864]/ImagingBBox null>>setpagedevice" +*PageSize SRA0/SRA0: "<</PageSize[2551 3628]/ImagingBBox null>>setpagedevice" +*PageSize SRA1/SRA1: "<</PageSize[1814 2551]/ImagingBBox null>>setpagedevice" +*PageSize SRA2/SRA2: "<</PageSize[1275 1814]/ImagingBBox null>>setpagedevice" +*PageSize SRA3/SRA3: "<</PageSize[907 1275]/ImagingBBox null>>setpagedevice" +*PageSize SRA4/SRA4: "<</PageSize[637 907]/ImagingBBox null>>setpagedevice" +*PageSize SuperA/Super A: "<</PageSize[644 1008]/ImagingBBox null>>setpagedevice" +*PageSize SuperB/Super B: "<</PageSize[936 1368]/ImagingBBox null>>setpagedevice" +*PageSize TabloidExtra/Tabloid Extra: "<</PageSize[864 1296]/ImagingBBox null>>setpagedevice" +*PageSize Tabloid/Tabloid: "<</PageSize[792 1224]/ImagingBBox null>>setpagedevice" +*CloseUI: *PageSize + +*OpenUI *PageRegion: PickOne +*OrderDependency: 100 AnySetup *PageRegion +*DefaultPageRegion: A4 +*PageRegion 11x14/11x14: "<</PageSize[792 1008]/ImagingBBox null>>setpagedevice" +*PageRegion 11x17/11x17: "<</PageSize[792 1224]/ImagingBBox null>>setpagedevice" +*PageRegion 13x19/13x19: "<</PageSize[936 1368]/ImagingBBox null>>setpagedevice" +*PageRegion 16x20/16x20: "<</PageSize[1152 1440]/ImagingBBox null>>setpagedevice" +*PageRegion 16x24/16x24: "<</PageSize[1152 1728]/ImagingBBox null>>setpagedevice" +*PageRegion 2A/2A: "<</PageSize[3370 4768]/ImagingBBox null>>setpagedevice" +*PageRegion 4A/4A: "<</PageSize[4768 6749]/ImagingBBox null>>setpagedevice" +*PageRegion 8x10/8x10: "<</PageSize[576 720]/ImagingBBox null>>setpagedevice" +*PageRegion 8x12/8x12: "<</PageSize[576 864]/ImagingBBox null>>setpagedevice" +*PageRegion A0/A0: "<</PageSize[2384 3370]/ImagingBBox null>>setpagedevice" +*PageRegion A1/A1: "<</PageSize[1684 2384]/ImagingBBox null>>setpagedevice" +*PageRegion A2/A2: "<</PageSize[1191 1684]/ImagingBBox null>>setpagedevice" +*PageRegion A3/A3: "<</PageSize[842 1191]/ImagingBBox null>>setpagedevice" +*PageRegion A4/A4: "<</PageSize[595 842]/ImagingBBox null>>setpagedevice" +*PageRegion A5/A5: "<</PageSize[421 595]/ImagingBBox null>>setpagedevice" +*PageRegion AnsiA/ANSI A: "<</PageSize[612 792]/ImagingBBox null>>setpagedevice" +*PageRegion AnsiB/ANSI B: "<</PageSize[792 1224]/ImagingBBox null>>setpagedevice" +*PageRegion AnsiC/ANSI C: "<</PageSize[1224 1584]/ImagingBBox null>>setpagedevice" +*PageRegion AnsiD/ANSI D: "<</PageSize[1584 2448]/ImagingBBox null>>setpagedevice" +*PageRegion AnsiE/ANSI E: "<</PageSize[2448 3168]/ImagingBBox null>>setpagedevice" +*PageRegion ArchA/Arch A: "<</PageSize[648 864]/ImagingBBox null>>setpagedevice" +*PageRegion ArchB/Arch B: "<</PageSize[864 1296]/ImagingBBox null>>setpagedevice" +*PageRegion ArchC/Arch C: "<</PageSize[1296 1728]/ImagingBBox null>>setpagedevice" +*PageRegion ArchD/Arch D: "<</PageSize[1728 2592]/ImagingBBox null>>setpagedevice" +*PageRegion ArchE/Arch E: "<</PageSize[2592 3456]/ImagingBBox null>>setpagedevice" +*PageRegion C0/C0: "<</PageSize[2599 3676]/ImagingBBox null>>setpagedevice" +*PageRegion C1/C1: "<</PageSize[1836 2599]/ImagingBBox null>>setpagedevice" +*PageRegion C2/C2: "<</PageSize[1298 1836]/ImagingBBox null>>setpagedevice" +*PageRegion C3/C3: "<</PageSize[918 1298]/ImagingBBox null>>setpagedevice" +*PageRegion C4/C4: "<</PageSize[649 918]/ImagingBBox null>>setpagedevice" +*PageRegion C5/C5: "<</PageSize[459 649]/ImagingBBox null>>setpagedevice" +*PageRegion Env10/Envelope #10: "<</PageSize[297 684]/ImagingBBox null>>setpagedevice" +*PageRegion EnvC5/Envelope C5: "<</PageSize[459 649]/ImagingBBox null>>setpagedevice" +*PageRegion EnvDL/Envelope DL: "<</PageSize[312 624]/ImagingBBox null>>setpagedevice" +*PageRegion EnvMonarch/Envelope Monarch: "<</PageSize[279 540]/ImagingBBox null>>setpagedevice" +*PageRegion Executive/Executive: "<</PageSize[522 756]/ImagingBBox null>>setpagedevice" +*PageRegion ISOB0/B0 (ISO): "<</PageSize[2834 4008]/ImagingBBox null>>setpagedevice" +*PageRegion ISOB1/B1 (ISO): "<</PageSize[2004 2834]/ImagingBBox null>>setpagedevice" +*PageRegion ISOB2/B2 (ISO): "<</PageSize[1417 2004]/ImagingBBox null>>setpagedevice" +*PageRegion ISOB3/B3 (ISO): "<</PageSize[1000 1417]/ImagingBBox null>>setpagedevice" +*PageRegion ISOB4/B4 (ISO): "<</PageSize[708 1000]/ImagingBBox null>>setpagedevice" +*PageRegion ISOB5/B5 (ISO): "<</PageSize[498 708]/ImagingBBox null>>setpagedevice" +*PageRegion JISB0/B0 (JIS): "<</PageSize[2919 4127]/ImagingBBox null>>setpagedevice" +*PageRegion JISB1/B1 (JIS): "<</PageSize[2063 2919]/ImagingBBox null>>setpagedevice" +*PageRegion JISB2/B2 (JIS): "<</PageSize[1459 2063]/ImagingBBox null>>setpagedevice" +*PageRegion JISB3/B3 (JIS): "<</PageSize[1029 1459]/ImagingBBox null>>setpagedevice" +*PageRegion JISB4/B4 (JIS): "<</PageSize[727 1029]/ImagingBBox null>>setpagedevice" +*PageRegion JISB5/B5 (JIS): "<</PageSize[518 727]/ImagingBBox null>>setpagedevice" +*PageRegion Ledger/Ledger: "<</PageSize[1224 792]/ImagingBBox null>>setpagedevice" +*PageRegion Legal/US Legal: "<</PageSize[612 1008]/ImagingBBox null>>setpagedevice" +*PageRegion Letter/US Letter: "<</PageSize[612 792]/ImagingBBox null>>setpagedevice" +*PageRegion RA0/RA0: "<</PageSize[2437 3458]/ImagingBBox null>>setpagedevice" +*PageRegion RA1/RA1: "<</PageSize[1729 2437]/ImagingBBox null>>setpagedevice" +*PageRegion RA2/RA2: "<</PageSize[1218 1729]/ImagingBBox null>>setpagedevice" +*PageRegion RA3/RA3: "<</PageSize[864 1218]/ImagingBBox null>>setpagedevice" +*PageRegion RA4/RA4: "<</PageSize[609 864]/ImagingBBox null>>setpagedevice" +*PageRegion SRA0/SRA0: "<</PageSize[2551 3628]/ImagingBBox null>>setpagedevice" +*PageRegion SRA1/SRA1: "<</PageSize[1814 2551]/ImagingBBox null>>setpagedevice" +*PageRegion SRA2/SRA2: "<</PageSize[1275 1814]/ImagingBBox null>>setpagedevice" +*PageRegion SRA3/SRA3: "<</PageSize[907 1275]/ImagingBBox null>>setpagedevice" +*PageRegion SRA4/SRA4: "<</PageSize[637 907]/ImagingBBox null>>setpagedevice" +*PageRegion SuperA/Super A: "<</PageSize[644 1008]/ImagingBBox null>>setpagedevice" +*PageRegion SuperB/Super B: "<</PageSize[936 1368]/ImagingBBox null>>setpagedevice" +*PageRegion TabloidExtra/Tabloid Extra: "<</PageSize[864 1296]/ImagingBBox null>>setpagedevice" +*PageRegion Tabloid/Tabloid: "<</PageSize[792 1224]/ImagingBBox null>>setpagedevice" +*CloseUI: *PageRegion + +*DefaultImageableArea: A4 +*ImageableArea 11x14/11x14: "0 0 792 1008" +*ImageableArea 11x17/11x17: "0 0 792 1224" +*ImageableArea 13x19/13x19: "0 0 936 1368" +*ImageableArea 16x20/16x20: "0 0 1152 1440" +*ImageableArea 16x24/16x24: "0 0 1152 1728" +*ImageableArea 2A/2A: "0 0 3370 4768" +*ImageableArea 4A/4A: "0 0 4768 6749" +*ImageableArea 8x10/8x10: "0 0 576 720" +*ImageableArea 8x12/8x12: "0 0 576 864" +*ImageableArea A0/A0: "0 0 2384 3370" +*ImageableArea A1/A1: "0 0 1684 2384" +*ImageableArea A2/A2: "0 0 1191 1684" +*ImageableArea A3/A3: "0 0 842 1191" +*ImageableArea A4/A4: "0 0 595 842" +*ImageableArea A5/A5: "0 0 421 595" +*ImageableArea AnsiA/ANSI A: "0 0 612 792" +*ImageableArea AnsiB/ANSI B: "0 0 792 1224" +*ImageableArea AnsiC/ANSI C: "0 0 1224 1584" +*ImageableArea AnsiD/ANSI D: "0 0 1584 2448" +*ImageableArea AnsiE/ANSI E: "0 0 2448 3168" +*ImageableArea ArchA/Arch A: "0 0 648 864" +*ImageableArea ArchB/Arch B: "0 0 864 1296" +*ImageableArea ArchC/Arch C: "0 0 1296 1728" +*ImageableArea ArchD/Arch D: "0 0 1728 2592" +*ImageableArea ArchE/Arch E: "0 0 2592 3456" +*ImageableArea C0/C0: "0 0 2599 3676" +*ImageableArea C1/C1: "0 0 1836 2599" +*ImageableArea C2/C2: "0 0 1298 1836" +*ImageableArea C3/C3: "0 0 918 1298" +*ImageableArea C4/C4: "0 0 649 918" +*ImageableArea C5/C5: "0 0 459 649" +*ImageableArea Env10/Envelope #10: "0 0 297 684" +*ImageableArea EnvC5/Envelope C5: "0 0 459 649" +*ImageableArea EnvDL/Envelope DL: "0 0 312 624" +*ImageableArea EnvMonarch/Envelope Monarch: "0 0 279 540" +*ImageableArea Executive/Executive: "0 0 522 756" +*ImageableArea ISOB0/B0 (ISO): "0 0 2834 4008" +*ImageableArea ISOB1/B1 (ISO): "0 0 2004 2834" +*ImageableArea ISOB2/B2 (ISO): "0 0 1417 2004" +*ImageableArea ISOB3/B3 (ISO): "0 0 1000 1417" +*ImageableArea ISOB4/B4 (ISO): "0 0 708 1000" +*ImageableArea ISOB5/B5 (ISO): "0 0 498 708" +*ImageableArea JISB0/B0 (JIS): "0 0 2919 4127" +*ImageableArea JISB1/B1 (JIS): "0 0 2063 2919" +*ImageableArea JISB2/B2 (JIS): "0 0 1459 2063" +*ImageableArea JISB3/B3 (JIS): "0 0 1029 1459" +*ImageableArea JISB4/B4 (JIS): "0 0 727 1029" +*ImageableArea JISB5/B5 (JIS): "0 0 518 727" +*ImageableArea Ledger/Ledger: "0 0 1224 792" +*ImageableArea Legal/US Legal: "0 0 612 1008" +*ImageableArea Letter/US Letter: "0 0 612 792" +*ImageableArea RA0/RA0: "0 0 2437 3458" +*ImageableArea RA1/RA1: "0 0 1729 2437" +*ImageableArea RA2/RA2: "0 0 1218 1729" +*ImageableArea RA3/RA3: "0 0 864 1218" +*ImageableArea RA4/RA4: "0 0 609 864" +*ImageableArea SRA0/SRA0: "0 0 2551 3628" +*ImageableArea SRA1/SRA1: "0 0 1814 2551" +*ImageableArea SRA2/SRA2: "0 0 1275 1814" +*ImageableArea SRA3/SRA3: "0 0 907 1275" +*ImageableArea SRA4/SRA4: "0 0 637 907" +*ImageableArea SuperA/Super A: "0 0 644 1008" +*ImageableArea SuperB/Super B: "0 0 936 1368" +*ImageableArea TabloidExtra/Tabloid Extra: "0 0 864 1296" +*ImageableArea Tabloid/Tabloid: "0 0 792 1224" + +*DefaultPaperDimension: A4 +*PaperDimension 11x14/11x14: "792 1008" +*PaperDimension 11x17/11x17: "792 1224" +*PaperDimension 13x19/13x19: "936 1368" +*PaperDimension 16x20/16x20: "1152 1440" +*PaperDimension 16x24/16x24: "1152 1728" +*PaperDimension 2A/2A: "3370 4768" +*PaperDimension 4A/4A: "4768 6749" +*PaperDimension 8x10/8x10: "576 720" +*PaperDimension 8x12/8x12: "576 864" +*PaperDimension A0/A0: "2384 3370" +*PaperDimension A1/A1: "1684 2384" +*PaperDimension A2/A2: "1191 1684" +*PaperDimension A3/A3: "842 1191" +*PaperDimension A4/A4: "595 842" +*PaperDimension A5/A5: "421 595" +*PaperDimension AnsiA/ANSI A: "612 792" +*PaperDimension AnsiB/ANSI B: "792 1224" +*PaperDimension AnsiC/ANSI C: "1224 1584" +*PaperDimension AnsiD/ANSI D: "1584 2448" +*PaperDimension AnsiE/ANSI E: "2448 3168" +*PaperDimension ArchA/Arch A: "648 864" +*PaperDimension ArchB/Arch B: "864 1296" +*PaperDimension ArchC/Arch C: "1296 1728" +*PaperDimension ArchD/Arch D: "1728 2592" +*PaperDimension ArchE/Arch E: "2592 3456" +*PaperDimension C0/C0: "2599 3676" +*PaperDimension C1/C1: "1836 2599" +*PaperDimension C2/C2: "1298 1836" +*PaperDimension C3/C3: "918 1298" +*PaperDimension C4/C4: "649 918" +*PaperDimension C5/C5: "459 649" +*PaperDimension Env10/Envelope #10: "297 684" +*PaperDimension EnvC5/Envelope C5: "459 649" +*PaperDimension EnvDL/Envelope DL: "312 624" +*PaperDimension EnvMonarch/Envelope Monarch: "279 540" +*PaperDimension Executive/Executive: "522 756" +*PaperDimension ISOB0/B0 (ISO): "2834 4008" +*PaperDimension ISOB1/B1 (ISO): "2004 2834" +*PaperDimension ISOB2/B2 (ISO): "1417 2004" +*PaperDimension ISOB3/B3 (ISO): "1000 1417" +*PaperDimension ISOB4/B4 (ISO): "708 1000" +*PaperDimension ISOB5/B5 (ISO): "498 708" +*PaperDimension JISB0/B0 (JIS): "2919 4127" +*PaperDimension JISB1/B1 (JIS): "2063 2919" +*PaperDimension JISB2/B2 (JIS): "1459 2063" +*PaperDimension JISB3/B3 (JIS): "1029 1459" +*PaperDimension JISB4/B4 (JIS): "727 1029" +*PaperDimension JISB5/B5 (JIS): "518 727" +*PaperDimension Ledger/Ledger: "1224 792" +*PaperDimension Legal/US Legal: "612 1008" +*PaperDimension Letter/US Letter: "612 792" +*PaperDimension RA0/RA0: "2437 3458" +*PaperDimension RA1/RA1: "1729 2437" +*PaperDimension RA2/RA2: "1218 1729" +*PaperDimension RA3/RA3: "864 1218" +*PaperDimension RA4/RA4: "609 864" +*PaperDimension SRA0/SRA0: "2551 3628" +*PaperDimension SRA1/SRA1: "1814 2551" +*PaperDimension SRA2/SRA2: "1275 1814" +*PaperDimension SRA3/SRA3: "907 1275" +*PaperDimension SRA4/SRA4: "637 907" +*PaperDimension SuperA/Super A: "644 1008" +*PaperDimension SuperB/Super B: "936 1368" +*PaperDimension TabloidExtra/Tabloid Extra: "864 1296" +*PaperDimension Tabloid/Tabloid: "792 1224" + +*OpenUI *Resolution/Output Resolution: PickOne +*OrderDependency: 100 AnySetup *Resolution +*DefaultResolution: 300dpi +*Resolution 150dpi/150 DPI: "<</HWResolution[150 150]>>setpagedevice" +*Resolution 300dpi/300 DPI: "<</HWResolution[300 300]>>setpagedevice" +*Resolution 600dpi/600 DPI: "<</HWResolution[600 600]>>setpagedevice" +*Resolution 1200dpi/1200 DPI: "<</HWResolution[1200 1200]>>setpagedevice" +*Resolution 2400dpi/2400 DPI: "<</HWResolution[2400 2400]>>setpagedevice" +*CloseUI: *Resolution + +*CloseGroup: General + +*DefaultFont: Courier +*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM +*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM +*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM +*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM +*Font Bookman-Demi: Standard "(001.004S)" Standard ROM +*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM +*Font Bookman-Light: Standard "(001.004S)" Standard ROM +*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM +*Font Courier: Standard "(002.004S)" Standard ROM +*Font Courier-Bold: Standard "(002.004S)" Standard ROM +*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM +*Font Courier-Oblique: Standard "(002.004S)" Standard ROM +*Font Helvetica: Standard "(001.006S)" Standard ROM +*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM +*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM +*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM +*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM +*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM +*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM +*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM +*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM +*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM +*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM +*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM +*Font Palatino-Bold: Standard "(001.005S)" Standard ROM +*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM +*Font Palatino-Italic: Standard "(001.005S)" Standard ROM +*Font Palatino-Roman: Standard "(001.005S)" Standard ROM +*Font Symbol: Special "(001.007S)" Special ROM +*Font Times-Bold: Standard "(001.007S)" Standard ROM +*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM +*Font Times-Italic: Standard "(001.007S)" Standard ROM +*Font Times-Roman: Standard "(001.007S)" Standard ROM +*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM +*Font ZapfDingbats: Special "(001.004S)" Standard ROM +*% +*% End of "$Id: postscript.ppd,v 1.1.1.1 2000/08/24 19:23:13 goffioul Exp $". +*% + + +*PPD-Adobe: "4.3" +*% +*% "$Id: postscript.ppd,v 1.1.1.1 2000/08/24 19:23:13 goffioul Exp $" +*% +*% Sample Postscript driver PPD file for the Common UNIX Printing +*% System (CUPS). +*% +*% Michael Goffioul <goffioul@emic.ucl.ac.be> +*% +*FormatVersion: "4.3" +*FileVersion: "1.1" +*LanguageVersion: English +*LanguageEncoding: ISOLatin1 +*PCFileName: "POSTSCRI.PPD" +*Manufacturer: "Generic" +*Product: "(CUPS v1.1)" +*ModelName: "Generic PostScript Printer" +*ShortNickName: "Generic PostScript Printer" +*NickName: "Generic PostScript Printer" +*PSVersion: "(2017.000) 0" +*LanguageLevel: "2" +*ColorDevice: False +*DefaultColorSpace: Gray +*FileSystem: False +*Throughput: "8" +*LandscapeOrientation: Plus90 +*VariablePaperSize: False +*TTRasterizer: Type42 + +*OpenUI *PageSize/Media Size: PickOne +*OrderDependency: 10 AnySetup *PageSize +*DefaultPageSize: Letter +*PageSize Letter/Letter: "<</PageSize[612 792]/ImagingBBox null>>setpagedevice" +*PageSize Legal/Legal: "<</PageSize[612 1008]/ImagingBBox null>>setpagedevice" +*PageSize Executive/Executive: "<</PageSize[522 756]/ImagingBBox null>>setpagedevice" +*PageSize A4/A4: "<</PageSize[595 842]/ImagingBBox null>>setpagedevice" +*PageSize A5/A5: "<</PageSize[420 595]/ImagingBBox null>>setpagedevice" +*PageSize B5/B5 (JIS): "<</PageSize[516 729]/ImagingBBox null>>setpagedevice" +*PageSize EnvISOB5/Envelope B5: "<</PageSize[499 709]/ImagingBBox null>>setpagedevice" +*PageSize Env10/Envelope #10: "<</PageSize[297 684]/ImagingBBox null>>setpagedevice" +*PageSize EnvC5/Envelope C5: "<</PageSize[459 649]/ImagingBBox null>>setpagedevice" +*PageSize EnvDL/Envelope DL: "<</PageSize[312 624]/ImagingBBox null>>setpagedevice" +*PageSize EnvMonarch/Envelope Monarch: "<</PageSize[279 540]/ImagingBBox null>>setpagedevice" +*CloseUI: *PageSize + +*OpenUI *PageRegion: PickOne +*OrderDependency: 10 AnySetup *PageRegion +*DefaultPageRegion: Letter +*PageRegion Letter/Letter: "<</PageSize[612 792]/ImagingBBox null>>setpagedevice" +*PageRegion Legal/Legal: "<</PageSize[612 1008]/ImagingBBox null>>setpagedevice" +*PageRegion Executive/Executive: "<</PageSize[522 756]/ImagingBBox null>>setpagedevice" +*PageRegion A4/A4: "<</PageSize[595 842]/ImagingBBox null>>setpagedevice" +*PageRegion A5/A5: "<</PageSize[421 595]/ImagingBBox null>>setpagedevice" +*PageRegion B5/B5 (JIS): "<</PageSize[516 729]/ImagingBBox null>>setpagedevice" +*PageRegion EnvISOB5/Envelope B5: "<</PageSize[499 709]/ImagingBBox null>>setpagedevice" +*PageRegion Env10/Envelope #10: "<</PageSize[297 684]/ImagingBBox null>>setpagedevice" +*PageRegion EnvC5/Envelope C5: "<</PageSize[459 649]/ImagingBBox null>>setpagedevice" +*PageRegion EnvDL/Envelope DL: "<</PageSize[312 624]/ImagingBBox null>>setpagedevice" +*PageRegion EnvMonarch/Envelope Monarch: "<</PageSize[279 540]/ImagingBBox null>>setpagedevice" +*CloseUI: *PageRegion + +*DefaultImageableArea: Letter +*ImageableArea Letter/US Letter: "18 36 594 756" +*ImageableArea Legal/US Legal: "18 36 594 972" +*ImageableArea Executive/Executive: "18 36 504 684" +*ImageableArea A4/A4: "18 36 577 806" +*ImageableArea A5/A5: "18 36 403 559" +*ImageableArea B5/JIS B5: "18 36 498 693" +*ImageableArea EnvISOB5/B5 (ISO): "18 36 463 673" +*ImageableArea Env10/Com-10: "18 36 279 648" +*ImageableArea EnvC5/EnvC5: "18 36 441 613" +*ImageableArea EnvDL/EnvDL: "18 36 294 588" +*ImageableArea EnvMonarch/Envelope Monarch: "18 36 261 504" + +*DefaultPaperDimension: Letter +*PaperDimension Letter/Letter: "612 792" +*PaperDimension Legal/Legal: "612 1008" +*PaperDimension Executive/Executive: "522 756" +*PaperDimension A4/A4: "595 842" +*PaperDimension A5/A5: "421 595" +*PaperDimension B5/B5 (JIS): "516 729" +*PaperDimension EnvISOB5/Envelope B5: "499 709" +*PaperDimension Env10/Envelope #10: "297 684" +*PaperDimension EnvC5/Envelope C5: "459 649" +*PaperDimension EnvDL/Envelope DL: "312 624" +*PaperDimension EnvMonarch/Envelope Monarch: "279 540" + +*OpenUI *InputSlot/Media Source: PickOne +*OrderDependency: 10 AnySetup *InputSlot +*DefaultInputSlot: Default +*InputSlot Default/Default: "" +*InputSlot Tray1/Tray 1: "<</ManualFeed false /MediaPosition 3>>setpagedevice" +*InputSlot Tray2/Tray 2: "<</ManualFeed false /MediaPosition 0>>setpagedevice" +*InputSlot Tray3/Tray 3: "<</ManualFeed false /MediaPosition 1>>setpagedevice" +*InputSlot Manual/Manual Feed: "<</ManualFeed true /MediaPosition 3>>setpagedevice" +*CloseUI: *InputSlot + +*OpenUI *Resolution/Output Resolution: PickOne +*OrderDependency: 20 AnySetup *Resolution +*DefaultResolution: 300dpi +*Resolution 150dpi/150 DPI: "<</HWResolution[150 150]>>setpagedevice" +*Resolution 300dpi/300 DPI: "<</HWResolution[300 300]>>setpagedevice" +*Resolution 600dpi/600 DPI: "<</HWResolution[600 600]>>setpagedevice" +*Resolution 1200dpi/1200 DPI: "<</HWResolution[1200 1200]>>setpagedevice" +*Resolution 2400dpi/2400 DPI: "<</HWResolution[2400 2400]>>setpagedevice" +*CloseUI: *Resolution + +*OpenUI *Duplex/Double-Sided Printing: PickOne +*OrderDependency: 20 AnySetup *Duplex +*DefaultDuplex: None +*Duplex None/Off: "<</Duplex false>>setpagedevice" +*Duplex DuplexNoTumble/Long Edge (Standard): "<</Duplex true/Tumble false>>setpagedevice" +*Duplex DuplexTumble/Short Edge (Flip): "<</Duplex true/Tumble true>>setpagedevice" +*CloseUI: *Duplex + +*DefaultFont: Courier +*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM +*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM +*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM +*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM +*Font Bookman-Demi: Standard "(001.004S)" Standard ROM +*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM +*Font Bookman-Light: Standard "(001.004S)" Standard ROM +*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM +*Font Courier: Standard "(002.004S)" Standard ROM +*Font Courier-Bold: Standard "(002.004S)" Standard ROM +*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM +*Font Courier-Oblique: Standard "(002.004S)" Standard ROM +*Font Helvetica: Standard "(001.006S)" Standard ROM +*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM +*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM +*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM +*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM +*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM +*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM +*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM +*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM +*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM +*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM +*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM +*Font Palatino-Bold: Standard "(001.005S)" Standard ROM +*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM +*Font Palatino-Italic: Standard "(001.005S)" Standard ROM +*Font Palatino-Roman: Standard "(001.005S)" Standard ROM +*Font Symbol: Special "(001.007S)" Special ROM +*Font Times-Bold: Standard "(001.007S)" Standard ROM +*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM +*Font Times-Italic: Standard "(001.007S)" Standard ROM +*Font Times-Roman: Standard "(001.007S)" Standard ROM +*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM +*Font ZapfDingbats: Special "(001.004S)" Standard ROM +*% +*% End of "$Id: postscript.ppd,v 1.1.1.1 2000/08/24 19:23:13 goffioul Exp $". +*% --- cups-1.3.8.orig/debian/local/cups.ufw.profile +++ cups-1.3.8/debian/local/cups.ufw.profile @@ -0,0 +1,5 @@ +[CUPS] +title=Common UNIX Printing System server +description=CUPS is a printing system with support for IPP, samba, lpd, and other protocols. +ports=631 + --- cups-1.3.8.orig/debian/local/apparmor-profile +++ cups-1.3.8/debian/local/apparmor-profile @@ -0,0 +1,136 @@ +# vim:syntax=apparmor +# Last Modified: Thu Aug 2 12:54:46 2007 +# Author: Martin Pitt <martin.pitt@ubuntu.com> + +#include <tunables/global> + +/usr/sbin/cupsd { + #include <abstractions/base> + #include <abstractions/bash> + #include <abstractions/authentication> + #include <abstractions/dbus> + #include <abstractions/fonts> + #include <abstractions/nameservice> + #include <abstractions/perl> + #include <abstractions/user-tmp> + + capability chown, + capability fowner, + capability fsetid, + capability kill, + capability net_bind_service, + capability setgid, + capability setuid, + + # nasty, but we limit file access pretty tightly, and cups chowns a + # lot of files to 'lp' which it cannot read/write afterwards any + # more + capability dac_override, + + # the bluetooth backend needs this + network bluetooth, + + /bin/bash ixr, + /bin/dash ixr, + /bin/hostname ixr, + /dev/lp* rw, + /dev/ttyS* rw, + /dev/usb/lp* rw, + /dev/parport* rw, + /etc/cups/ rw, + /etc/cups/** rw, + /etc/foomatic/* r, + /etc/gai.conf r, + /etc/shadow m, + /etc/passwd m, + /etc/group m, + /etc/papersize r, + /etc/pnm2ppa.conf r, + /etc/printcap rwl, + /etc/ssl/** r, + @{PROC}/net/ r, + @{PROC}/net/* r, + @{PROC}/sys/dev/parport/** r, + /sys/** r, + /usr/bin/* ixr, + /usr/sbin/* ixr, + /bin/* ixr, + /sbin/* ixr, + /usr/lib/** rm, + + # backends which come with CUPS can be confined + /usr/lib/cups/backend/bluetooth ixr, + /usr/lib/cups/backend/dnssd ixr, + /usr/lib/cups/backend/http ixr, + /usr/lib/cups/backend/ipp ixr, + /usr/lib/cups/backend/lpd ixr, + /usr/lib/cups/backend/parallel ixr, + /usr/lib/cups/backend/scsi ixr, + /usr/lib/cups/backend/serial ixr, + /usr/lib/cups/backend/snmp ixr, + /usr/lib/cups/backend/socket ixr, + /usr/lib/cups/backend/usb ixr, + # we treat cups-pdf specially, since it needs to write into /home + # and thus needs extra paranoia + /usr/lib/cups/backend/cups-pdf Px, + # third party backends get no restrictions as they often need high + # privileges and this is beyond our control + /usr/lib/cups/backend/* Ux, + + /usr/lib/cups/cgi-bin/* ixr, + /usr/lib/cups/daemon/* ixr, + /usr/lib/cups/monitor/* ixr, + /usr/lib/cups/notifier/* ixr, + # filters and drivers (PPD generators) are always run as non-root, + # and there are a lot of third-party drivers which we cannot predict + /usr/lib/cups/filter/* Uxr, + /usr/lib/cups/driver/* Uxr, + /usr/local/share/** r, + /usr/share/** r, + /var/cache/cups/ rw, + /var/cache/cups/** rw, + /var/log/cups/ rw, + /var/log/cups/* rw, + /var/run/avahi-daemon/socket rw, + /var/run/cups/ rw, + /var/run/cups/** rw, + /var/spool/cups/ rw, + /var/spool/cups/** rw, + + # third-party printer drivers; no known structure here + /opt/** rix, + + # FIXME: no policy ATM for hplip + /usr/bin/hpijs Ux, + + # Kerberos authentication + /etc/krb5.conf r, + /etc/cups/krb5.keytab rw, +} + +# separate profile since this needs to write into /home +/usr/lib/cups/backend/cups-pdf { + #include <abstractions/base> + #include <abstractions/fonts> + #include <abstractions/nameservice> + #include <abstractions/user-tmp> + + capability chown, + capability fowner, + capability fsetid, + capability setgid, + capability setuid, + + /bin/dash ixr, + /bin/bash ixr, + /etc/papersize r, + /etc/cups/cups-pdf.conf r, + @{HOME}/PDF/ rw, + @{HOME}/PDF/* rw, + /usr/bin/gs ixr, + /usr/lib/cups/backend/cups-pdf mr, + /usr/lib/ghostscript/** mr, + /usr/share/** r, + /var/log/cups/cups-pdf_log w, + /var/spool/cups-pdf/** rw, +} --- cups-1.3.8.orig/debian/local/oopstops.types +++ cups-1.3.8/debian/local/oopstops.types @@ -0,0 +1 @@ +application/openofficeps string(0,%!) + contains(0,1024,"%%Creator: OpenOffice.org 2.") --- cups-1.3.8.orig/debian/local/pdftops.conf +++ cups-1.3.8/debian/local/pdftops.conf @@ -0,0 +1,61 @@ +# +# Configuration file for the alternate pdftops filter +# +# 2004-10-05/Bl +# initial +# +# This configuration file defaults the configuration settings for xpdf's pdftops +# utility for use as a CUPS filter (under the pdftops wrapper). Short of +# unicode handling, those options are listed which are (or seem to me) relevant +# to convert PDFs to PostScript suitable for production printers. +# +# Most of these options may be overridden by osing the commandline options +# pr pdftops prefixed with 'pdf'. Example: to enable OPI handling, add +# pdf-opi +# to the command line options. For the details see the pdftops wrapper. + +# +# Where to search for fonts not embedded in the PDF (currently, Type1 fonts only) +# +fontDir /PostScript/pfa + +# +# Paper size handling +# We default to the media size specified in the PDF file. +# If a crop box is specified, it wil be used, otherwise the media box instead. +# By default, we use this size as imageable area. +# +psPaperSize match +psCrop yes +psExpandSmaller no +psShrinkLarger no +psCenter yes + +# +# As we have (level 2) printers which don't understand CID fonts, we produce level 2 +# output. +# +psLevel level2 + +# +# Font handling. +# We embed all fonts embedded in the PDF in the generated PS (level2 compatible composite +# fonts in case of CID fonts. +# +psEmbedType1Fonts yes +psEmbedTrueTypeFonts yes +psEmbedCIDTrueTypeFonts yes +psEmbedCIDPostScriptFonts yes + +# +# OPI. +# As OPI handling is rather uncommon to printers, disable it by default. But it may be +# enabled by print command attribute. +# +psOPI no + +# +# Use ASCII85 encoding. +# +psASCIIHex no + --- cups-1.3.8.orig/debian/local/cpdftocps.convs +++ cups-1.3.8/debian/local/cpdftocps.convs @@ -0,0 +1 @@ +application/vnd.cups-pdf application/vnd.cups-postscript 22 cpdftocps --- cups-1.3.8.orig/debian/local/acroread.conf +++ cups-1.3.8/debian/local/acroread.conf @@ -0,0 +1,43 @@ +# +# Configuration file for acroread as alternate pdftops filter +# +# 2006-09-26/Bl +# initial +# +# This configuration file sets some useful default options for use of +# the Adobe readder (acroread) as an alternate pdftops filter. +# +# Most of these options may be overridden by using the commandline options +# of pdftops prefixed with 'pdf'. Example: to expand the PDF pages to match +# the specified media size, add +# pdf-expand +# to the command line options. +# We use the option names of xpdf's pdftops utility for compatibility reasons; +# for use with acroread they are translated by the pdftops wrapper. For +# details see the script itself. + +# +# Paper size handling +# We default to the media size in the PDF file. If acroread uses +# the media box or the crop box is unknown to me and cannot be modified +# by command line options, but we use the shrink to fit option by default. +# +shrink + +# +# By default, we use level2 output, as most printers only support level2. +# Note that acroread does no longer support level1, thus level1 will be +# silently ignored. +# +level2 + +# +# As we convert to PostScript for printing only, we do not output comments +# or annotations and emit all used fonts once at the beginning of the document. +# +optimizeForSpeed +commentsOff +annotsOff +transQuality 3 + + --- cups-1.3.8.orig/debian/local/oopstops.convs +++ cups-1.3.8/debian/local/oopstops.convs @@ -0,0 +1 @@ +application/openofficeps application/postscript 33 oopstops --- cups-1.3.8.orig/debian/local/backends/dnssd +++ cups-1.3.8/debian/local/backends/dnssd @@ -0,0 +1,275 @@ +#!/usr/bin/perl +# The above Perl path may vary on your system; fix it!!! -*- perl -*- + +# dnssd - Search for network printers with the avahi-browse command +# (Zeroconf, DNS-SD) + +# Printer discovery CUPS backend (like the SNMP backend) +# See also http://qa.mandriva.com/show_bug.cgi?id=21812 + +# Copyright 2007 Till Kamppeter <till.kamppeter@gmail.com> +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +# USA. + +# Usage: +# +# cp dnssd /usr/lib/cups/backend/ +# chmod 755 /usr/lib/cups/backend/dnssd +# killall -HUP cupsd (or "/etc/init.d/cups restart", CUPS 1.1.x only) +# lpinfo -v (or use any printer setup tool) +# +# /usr/lib/cups/backend/dnssd <IP address> +# Shows only info for printer with given IP + +use strict; + +$0 =~ m!^(.*)/([^/]+)\s*$!; +my $progname = ($2 || $0 || "dnssd"); +my $progpath = ($1 || "/usr/lib/cups/backend"); + +if (@ARGV > 1) { + die "This backend is only for printer discovery, not for actual printing.\n"; +} + +my $ipfilter = $ARGV[0] if $ARGV[0]; + +my $avahicmd = "avahi-browse -k -t -v -r -a 2> /dev/null"; + +# IPs which are for computers, consider their printer entries as queues +# set up with the local printing system (CUPS, LPD, Windows/Samba SMB, ...) +my @computerips = (); +my $output; +my $hosts; +my ($interface, $nettype, $ip, $host, $make, $model, $description, $cmd, $makemodel, $deviceid, $protocol, $port, $uriext, $uri); + +open (AVAHI, "$avahicmd |") or exit 0; +while (my $line = <AVAHI>) { + chomp ($line); + if ($line =~ /^\s*=\s+(\S+)\s+(\S+)\s+(.*?)\s+(\S+)\s+(\S+)\s*$/) { + # New item + $interface = $1; + $nettype = $2; + my $itemname = $3; + my $protocolinfo = $4; + next if $nettype !~ /^IPv4$/i; + if ($protocolinfo =~ /_workstation/) { + $protocol = "computer"; + } elsif ($protocolinfo =~ /_pdl-datastream/) { + $protocol = "socket"; + } elsif ($protocolinfo =~ /_printer/) { + $protocol = "lpd"; + } elsif ($protocolinfo =~ /_ipp/) { + $protocol = "ipp"; + } + } elsif ($line =~ /^\s*hostname\s*=\s*\[([^\]]+)\]\s*$/) { + $host = $1; + $host =~ s/\.local\.?$//; + } elsif ($line =~ /^\s*address\s*=\s*\[([^\]]+)\]\s*$/) { + $ip = $1; + if ($protocol eq "computer") { + push (@computerips, $ip); + $protocol = ""; + } + } elsif ($line =~ /^\s*port\s*=\s*\[([^\]]+)\]\s*$/) { + $port = $1; + } elsif ($line =~ /^\s*txt\s*=\s*\[(.+)\]\s*$/) { + my $info = $1; + if ($protocol && (!defined($ipfilter) || ($ipfilter eq $ip))) { + my ($ty, $product, $pdls, $usb_MFG, $usb_MDL, $usb_DES, $usb_CMD) = + ("", "", "", "", "", "", ""); + while ($info =~ s/^\s*\"([^\"]+)\"\s*//) { + my $infoitem = $1; + if ($infoitem =~ /^([^=]*)=(.*)$/) { + my $field = $1; + my $content = $2; + if ($field eq "ty") { + $ty = $content; + } elsif ($field eq "product") { + $product = $content; + $product =~ s/^\((.*)\)$/$1/; + } elsif ($field eq "usb_MFG") { + $usb_MFG = $content; + } elsif ($field eq "usb_MDL") { + $usb_MDL = $content; + } elsif ($field eq "usb_DES") { + $usb_DES = $content; + } elsif ($field eq "usb_CMD") { + $usb_CMD = $content; + } elsif ($field eq "rp") { + $uriext = $content; + } elsif ($field eq "pdl") { + while ($content =~ s/^\s*([^\,]+?)\s*\,\s*//) { + my $i = $1; + if ($i =~ m!\b(postscript|ps)\b!i) { + $pdls .= "POSTSCRIPT,"; + } elsif ($i =~ m!\b(pdf)\b!i) { + $pdls .= "PDF,"; + } elsif ($i =~ m!\b(pcl6|pclxl|pxl)\b!i) { + $pdls .= "PCLXL,"; + } elsif ($i =~ m!\b(pcl[345][ce]?|pcl)\b!i) { + $pdls .= "PCL,"; + } + } + $pdls =~ s/\,$//; + } + } + } + $usb_MDL ||= $ty; + $usb_DES ||= $product; + if ($usb_MFG) { + $make = $usb_MFG; + } elsif ($usb_DES =~ /^KONICA\s*MINOLTA\b/i) { + $make = "KONICA MINOLTA"; + } elsif ($usb_DES) { + $usb_DES =~ /^\s*(\S*)\b/; + $make = $1; + } + $model = $usb_MDL; + if (!$model) { + $usb_DES =~ /^\s*\S*\s*(.*)$/; + $model = $1; + } + $usb_CMD ||= $pdls; + my $extra; + if ($protocol eq "socket") { + if ($port eq "9100") { + $uri = "socket://$ip"; + } else { + $uri = "socket://$ip:$port"; + } + $extra = "Port $port"; + } elsif ($protocol eq "lpd") { + $uri = "lpd://$ip" . ($uriext ? "/$uriext" : ""); + $extra = ($uriext ? "Queue: $uriext" : "Default queue"); + } elsif ($protocol eq "ipp") { + $uri = "ipp://$ip:$port" . ($uriext ? "/$uriext" : ""); + $extra = ($uriext ? "Queue: $uriext" : "Default queue"); + } + if ($make && $model) { + $make =~ s/Hewlett.?Packard/HP/i; + $make =~ s/Lexmark.?International/Lexmark/i; + $model =~ s/Hewlett.?Packard/HP/i; + $model =~ s/Lexmark.?International/Lexmark/i; + while ($model =~ s/^\s*$make\s*//i) {}; + $makemodel = "$make $model"; + } elsif ($usb_DES) { + $makemodel = $usb_DES; + } else { + $makemodel = "Unknown"; + } + $deviceid = ($usb_MFG ? "MFG:$usb_MFG;" : "") . + ($usb_MDL ? "MDL:$usb_MDL;" : "") . + ($usb_DES ? "DES:$usb_DES;" : "") . + ($usb_CMD ? "CMD:$usb_CMD;" : ""); + $deviceid .= "CLS:PRINTER;" if $deviceid; + $hosts->{$ip} = $host if $host; + $output->{$ip}{$protocol}{$uriext} = + "network $uri \"$makemodel\" \"$makemodel $ip ($extra)\" \"$deviceid\"\n"; + ($interface, $nettype, $ip, $host, $make, $model, $description, $cmd, $makemodel, $deviceid, $protocol, $port, $uriext, $uri) = + ("", "", "", "", "", "", "", "", "", "", "", "", "", ""); + } + } +} + +my $localqueues = {}; +my $queue = undef; +if (open LPSTAT, "LC_ALL=C lpstat -l -p -v |") { + while (my $line = <LPSTAT>) { + chomp $line; + if ($line =~ /^printer\s+(\S+)/i) { + $queue = $1; + $localqueues->{$queue} = {}; + } elsif ($queue) { + if ($line =~ /^\s+Connection:\s+remote/i) { + $localqueues->{$queue}{remote} = 1; + } elsif ($line =~ /^\s+Interface:\s+(\S+)/i) { + $localqueues->{$queue}{interface} = $1; + } elsif ($line =~ /^device\s+for\s+(\S+)\s*:\s*(\S+)/i) { + $localqueues->{$1}{uri} = $2; + } + } + } + close LPSTAT +} + +my @localips = (); +if (open IFCONFIG, "LC_ALL=C /sbin/ifconfig |") { + while (my $line = <IFCONFIG>) { + chomp $line; + if ($line =~ /^\s*inet\s+addr:\s*(\S+)/i) { + push (@localips, $1); + } + } + close IFCONFIG; +} + +foreach my $ip (keys(%{$output})) { + # Do not list print queues of the local machine + next if member($ip, @localips); + if ($output->{$ip}{"socket"}) { + foreach my $uriext (keys(%{$output->{$ip}{"socket"}})) { + if (keys(%{$output->{$ip}{"socket"}}) == 1) { + $output->{$ip}{"socket"}{$uriext} =~ + s/^(\s*\S*\s*\S*\s*\"[^\"]*\"\s*\"[^\"\(]*?)\s*\([^\)]*\)\s*(\"\s*.*)$/$1$2/; + } + print $output->{$ip}{"socket"}{$uriext}; + } + } elsif ($output->{$ip}{"lpd"}) { + foreach my $uriext (keys(%{$output->{$ip}{"lpd"}})) { + if (keys(%{$output->{$ip}{"lpd"}}) == 1) { + $output->{$ip}{"lpd"}{$uriext} =~ + s/^(\s*\S*\s*\S*\s*\"[^\"]*\"\s*\"[^\"\(]*?)\s*\([^\)]*\)\s*(\"\s*.*)$/$1$2/; + } + print $output->{$ip}{"lpd"}{$uriext}; + } + } elsif ($output->{$ip}{"ipp"}) { + foreach my $uriext (keys(%{$output->{$ip}{"ipp"}})) { + if ($uriext =~ /^(printers|classes)\/(\S+)$/) { + # Queue from a CUPS server. We should suppress it if it + # is a queue received via CUPS broadcast + $queue=$2; + if (defined($localqueues->{"$queue\@$ip"})) { + $queue = "$queue\@$ip"; + } elsif (defined($localqueues->{"$queue\@$hosts->{$ip}"})) { + $queue = "$queue\@$hosts->{$ip}"; + } + if (defined($localqueues->{$queue})) { + if ($localqueues->{$queue}{remote} && + ($localqueues->{$queue}{uri} =~ + /^ipp:\/\/([^\/:]+)(:\d+|)\/(\S+)/)) { + my $host = $1; + my $ue = $3; + if ($host !~ /\d+\.\d+\.\d+\.\d+/) { + $host = + join(".", unpack("C4", gethostbyname($host))); + } + next if ($host eq $ip) && ($ue eq $uriext); + } + } + } + if (keys(%{$output->{$ip}{"ipp"}}) == 1) { + $output->{$ip}{"ipp"}{$uriext} =~ + s/^(\s*\S*\s*\S*\s*\"[^\"]*\"\s*\"[^\"]*?)\s*\([^\)]*\)\s*(\"\s*.*)$/$1$2/; + } + print $output->{$ip}{"ipp"}{$uriext}; + } + } +} + +exit 0; + +# member( $a, @b ) returns 1 if $a is in @b, 0 otherwise. +sub member { my $e = shift; foreach (@_) { $e eq $_ and return 1 } 0 }; --- cups-1.3.8.orig/debian/local/filters/oopstops +++ cups-1.3.8/debian/local/filters/oopstops @@ -0,0 +1,184 @@ +#!/usr/bin/perl -w +# =============================================================================== +# oopstops prefilter to sanitize PostScript jobs generated by OpenOffice 2.x +# ------------------------------------------------------------------------------- +# 1.00 - 2007-03-17/Bl +# First implementation +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# Description: +# ------------ +# OpenOffice as of version 2.x has built-in CUPS support, parses +# the user selectable options in the printer's PPD and inserts the respecitve +# PostScript code into the PostScript job. However, it does not insert all +# defined defaults nor the JCL settings, but it does honour the JobPatchFile +# keyword. In addition, if a default setting in the PPD does not correspond +# to one of the choices listed in the respective UI block, OpenOffice silently +# selects the first choice (NOTE: this cannot be corrected by this filter). +# Moreover, the page related features are inserted into the page setup section +# of the first page. This violates the page independence and prohibits successful +# working of job attivutes like number-up or same-up. +# +# We therefore modify the PostScript job as follows: +# - any JobPatchFile features are discaarded, as they are re-inserted by the +# pstops filter. +# - the first page's page setup is moved to the end of the general setup section +# (in fact, the respective comments are moved instead). + + + +use IO::Handle; + +# +# Check the arguments +# +die ("ERROR: wrong number of arguments\n") if (scalar @ARGV < 5); + +$jobid = $username = $title = $copies = $options = undef; +$jobid = shift; # Job ID +$username = shift; # Job requesting user name +$title = shift; # Job title +$copies = shift; # Number of requested copies +$options = shift; # Textual representation of job attributes +$psfile = shift; # read from file ? + + +# +# Normalize options string +# +$options =~ s/^\s+//; +$options =~ s/\s+$//; +$options = ' ' . $options . ' '; + +# +# Check from where to read +# +if (defined $psfile) +{ + open (FILI, "<$psfile") || die ("ERROR: $psfile: $!\n"); +} +else +{ + open (FILI, "<&STDIN") || die ("ERROR: STDIN: $!\n"); +} + +# STDOUT->autoflush (1); + +# +# Parse the input until and including the page setup of the first page +# and relocate the setup features to the end of the setup section. +# +@feature = (); +$within_feature = 0; +$feature_name = ''; +$saw_page = 0; +@pagehead = (); + +while (<FILI>) +{ + if (/^\[\{/) + { + push (@feature, $_); + $_ = <FILI>; + if (/^%%BeginFeature:\s+\*(\S+)\s+/) + { + $feature_name = $1; + push (@feature, $_); + $within_feature = 1; + next; + } + else + { + print STDOUT shift @feature; + print STDOUT; + } + next; + } + if (/^%%EndFeature/) + { + if ($within_feature) + { + push (@feature, $_); + $_ = <FILI>; + if (/^\}\s+stopped\s+cleartomark/) + { + push (@feature, $_); + } + else + { + $next_line = $_; + } + if ($feature_name eq 'JobPatchFile') + { + @feature = (); # discard the job patch file(s) + } + $within_feature = 0; + print STDOUT $next_line if (defined $next_line && $next_line); + } + else + { + print STDOUT; + } + next; + } + next if (/^%%EndSetup/); + if (/^%%Page:/) + { + $saw_page = 1; + push (@pagehead, $_); + next; + } + if (/^%%EndPageSetup/) + { + push (@pagehead, $_); + if (scalar @feature > 0) + { + while (my $line = shift @feature) + { + print STDOUT $line; + } + $feature_name = ''; + } + print STDOUT "%%EndSetup\n"; + while (my $line = shift @pagehead) + { + print STDOUT $line; + } + $saw_page = 0; + last; + } + next if (/^<< \/NumCopies null /); # skip the copies hack because of Ghostscript quirks + if ($within_feature) + { + push (@feature, $_); + } + elsif ($saw_page) + { + push (@pagehead, $_); + } + else + { + print STDOUT; + } +} + +# +# Now copy the rest without further interpretation +# +while (<FILI>) +{ + print STDOUT; +} + +close (FILI) if (defined $psfile); + + --- cups-1.3.8.orig/debian/local/filters/textonly +++ cups-1.3.8/debian/local/filters/textonly @@ -0,0 +1,124 @@ +#!/bin/bash +## Copyright (C) 2003-2006 Red Hat, Inc. +## Copyright (C) 2003-2006 Tim Waugh <twaugh@redhat.com> +## Changed on 2007/05/17, Opher Shachar, LADPC Ltd. +## Added support for page-ranges option. +## Added page accounting. + +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. + +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. + +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +if [ $# == 0 ]; then + echo >&2 "ERROR: $0 job-id user title copies options [file]" + exit 1 +fi + +# Extract the papersize +SENDFF=`grep '^\*DefaultSendFF' "$PPD" | cut -d\ -f2` +COPIES=1 +if [ $# -ge 4 ]; then + COPIES="$4" +fi + +if [ "$COPIES" -gt 1 ] && [ $# -lt 6 ]; then + unset TMPFILE + trap -- 'rm -f "$TMPFILE"' EXIT + TMPFILE=$(mktemp ${TMPDIR:-/tmp}/textonly.XXXXXX) + cat > "$TMPFILE" +else + TMPFILE="$6" +fi + +PR=${5#*page-ranges=} +# Do options specify page-ranges? +if [[ "$PR" != "$5" ]]; then + PR=${PR%% *} +else + #unset PR + PR=1-999999 +fi + +if [[ "$PR" ]]; then + TMPFILE2=$(mktemp ${TMPDIR:-/tmp}/textonly2.XXXXXX) + pagenum=0 + EOF= + { + while [[ "$PR" ]]; do + pl=${PR%%,*} ;# take first subrange + PR=${PR#$pl};PR=${PR#,} ;# remove from range list + pu=${pl#*-} ;# extract upper and lower + pl=${pl%-*} ;# pages of subrange + # Allows interpreting 0-5,3-10 as 1-5,6-10 rejects 5-1 or 1- + (( pagenum >= pl )) && pl=$(( pagenum + 1 )) + (( pl > pu )) && continue + + # Loop reading pages until at or over lower page of subrange. + while read -d `echo -ne '\f'` -r; do + (( pagenum++ )) + (( pagenum == pl )) && break + done + # Did we reach lower page of subrange or EOF? + if (( pagenum < pl )); then + [[ ! "$REPLY" ]] && break ;# empty last page - we're done. + (( pagenum++ )) + EOF=y + fi + # Output page and report to page log + if (( pagenum == pl )); then + echo -n "${REPLY}" >>"$TMPFILE2" + # If EOF then page has no final FF + [[ ! "$EOF" ]] && echo -ne '\f' >>"$TMPFILE2" + echo "PAGE: $pagenum $COPIES" >&2 + fi + [[ "$EOF" ]] && break + # Is the current subrange a single page? + (( pagenum == pu )) && continue + while read -d `echo -ne '\f'` -r; do + (( pagenum++ )) + echo -ne "${REPLY}\f" >>"$TMPFILE2" + echo "PAGE: $pagenum $COPIES" >&2 + (( pagenum == pu )) && break + done + # Could be that we reached EOF before page boundry + if (( pagenum < pu )); then + if [[ "$REPLY" ]]; then + (( pagenum++ )) + echo -n "${REPLY}" >>"$TMPFILE2" + echo "PAGE: $pagenum $COPIES" >&2 + fi + break + fi + done + } <"$TMPFILE" +else + TMPFILE2="$TMPFILE" + pc=$(grep -co `echo -ne '\f'` "$TMPFILE2") + pc=$(( pc * $COPIES )) + echo "PAGE: $pc" >&2 +fi + +while [ "$COPIES" -gt 0 ]; do + # Just translate LF->CRLF at the moment, until the PPD has options added. + sed -e 's/$/'`echo -ne '\r'`'/g' "$TMPFILE2" + + if [ "$SENDFF" == "True" ] + then + echo -ne \\14 + fi + + COPIES=$(($COPIES - 1)) +done +# Cleanup +[[ "$TMPFILE" != "$TMPFILE2" ]] && rm -f "$TMPFILE2" +exit 0 --- cups-1.3.8.orig/debian/local/filters/cpdftocps +++ cups-1.3.8/debian/local/filters/cpdftocps @@ -0,0 +1,69 @@ +#!/bin/sh + +# application/vnd.cups-pdf -> application/vnd.cups-postscript filter + +# Contributed by Johan Kiviniemi. Licensed under the terms of the CUPS Debian +# packaging. +# The typical filter chain using this filter: +# (something that outputs pdf) +# -> pdftopdf +# -> cpdftocps (runs pdftops -> pstops) +# -> (postscript printer) + +# The emit-jcl option can be safely passed through to pstops, since pdftops +# strips any JCL output by pdftopdf before processing the PDF. pstops then +# simply does the right thing regarding JCL for pdftops’ output. + +set -e + +# These options are *not* passed through to pstops, since pdftopdf or +# equivalent has already processed them. +MASK=' + brightness + Collate + cupsEvenDuplex + fitplot + gamma + hue + landscape + mirror + multiple-document-handling + natural-scaling + number-up + number-up-layout + orientation-requested + OutputOrder + page-border + page-bottom + page-label + page-left + page-ranges + page-right + page-set + page-top + position + saturation + scaling + sides +' + +# Convert MASK to a regexp. +MASK_RE=$( + set -- $MASK + IFS='|' + printf "%s" "$*" +) + +# Annihilate all forms of the masked options from $5: +# - <option>=parameter +# - <option> (boolean) +# - no<option> (boolean) +MASKED_OPTS=$( + printf "%s" "$5" | \ + sed -r -e 's/(^|\s+)(no)?('"$MASK_RE"')(=\S*)?//g' -e 's/^\s+//' +) + +/usr/lib/cups/filter/pdftops "$@" | \ + /usr/lib/cups/filter/pstops "$1" "$2" "$3" "$4" "$MASKED_OPTS" + +# vim:set et sw=2 sts=2: --- cups-1.3.8.orig/debian/local/filters/pdf-filters/README +++ cups-1.3.8/debian/local/filters/pdf-filters/README @@ -0,0 +1,831 @@ + +CUPS filters for PDF as standard print job format +------------------------------------------------- + +This tarball contains the three CUPS filters imagetopdf, texttopdf, +pdftopdf, pdftoraster, and pdftoijs, prepared for being compiled +together with CUPS. + +The original filters are from http://sourceforge.jp/projects/opfc/ + +In addition to what CUPS itself needs you will also need the Poppler +and the IJS libraries (on distributions install also the appropriate +"-dev" or "-devel" packages). + +There are two scripts in the root directory of the tarball: + +addtocups <CUPS source dir> + +adds the files of the filters to the CUPS source tree in <CUPS source +dir> and also modifies configure script and Makefiles +accordingly. After that you can compile and install CUPS and you will +have the extra filters and file detection and conversion rules in your +new CUPS installation. + +removefromcups <CUPS source dir> + +removes these extra files and changes on configure script and +Makefiles. Make sure you do "make distclean" before and that you do +not delete backup files with the extension ".pdf-filters". + +Below you find the original documentation of the three filters, from +the original README files. + +The COPYING and AUTHORS files are merged from the original packages + + +=========================================================================== + +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. KOWN 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. LICENSE + +Almost 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. + +3. 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>. + +4. 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". + +5. INFORMATION FOR DEVELOPERS + +Following information is for developers, not for driver users. + +5.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; + +5.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, "pdftopdf" handles this case as follows; +(In following pseudo program, JCL option is a 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 + +5.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 + +5.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". + +=========================================================================== + +PDFTORASTER + +1. INTRODUCTION + +There are two executable programs, "pdftoraster" and "rasterdsp", in this +package. "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. + +"rasterdsp" is a test program and not installed. It reads CUPS raster file +and display header contents. If you specify <filename> as its command +argument, this program creates image files that the names are <filename> +with sequential page number, and each image file contains each page content. +Image format is PPM for color, and BMP for monochrome page. + +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". + +=========================================================================== + +TEXTTOPDF + +This implements a texttopdf filter, and is derived from cups' texttops. + +To configure: +------------- + +- texttopdf uses a CUPS_DATADIR/charset/pdf.* (e.g. pdf.utf-8) for + font configuration. All the fonts named here MUST also be present + under CUPS_DATADIR/fonts/ as TrueType fonts for texttopdf to work. + For TrueType Collections (.TTC) you'll have to append '/' and the + number of the font in the collection to the filename charsets/pdf.utf-8 + (resp. charsets/pdf.* ), for example to use the second font of uming.ttc + use the filename uming.ttc/1 + +- There are examples of pdf.utf-8 in the cups/data directory, + you may use one of these (don't forget to copy / symlink the fonts). + +To use: +------- + +The filter is called just like any other cups filter. Have a +look at test.sh for example. + +Known Issues +------------ +(Release 0.0.1) + + - text extraction does not work (at least for pdftotext from xpdf) + for the resulting pdfs. + + - 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. + +=========================================================================== + +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". --- cups-1.3.8.orig/debian/local/filters/pdf-filters/removefromcups +++ cups-1.3.8/debian/local/filters/pdf-filters/removefromcups @@ -0,0 +1,41 @@ +#!/bin/bash + +# Silently exit if the changes are already removed +[ ! -f $1/filter/imagetopdf.c ] && exit 0 + +# Remove files +rm -f $1/filter/imagetopdf.c +rm -f $1/filter/pdftoraster.cxx +rm -f $1/filter/pdftoijs.cxx +rm -f $1/filter/texttopdf.c +rm -f $1/filter/pdfutils.h +rm -f $1/filter/pdfutils.c +rm -rf $1/filter/fontembed +rm -f $1/filter/test_pdf1.c +rm -f $1/filter/test_pdf2.c +rm -f $1/conf/imagetopdf.convs +rm -f $1/conf/imagetopdf.types +rm -f $1/conf/pdftopdf.convs +rm -f $1/conf/pdftoraster.convs +rm -f $1/conf/pdf.types +rm -f $1/conf/texttopdf.convs +rm -f $1/data/pdf.utf-8.heavy +rm -f $1/data/pdf.utf-8.simple +rm -f $1/config-scripts/cups-pdf-filters.m4 + +# Remove directories +rm -rf $1/pdftopdf + +cd $1 + +# Restore configure script +mv -f configure.in.pdf-filters configure.in +mv -f configure.pdf-filters configure +mv -f config.h.in.pdf-filters config.h.in + +# Restore Makefiles +mv -f conf/Makefile.pdf-filters conf/Makefile +mv -f filter/Makefile.pdf-filters filter/Makefile +mv -f data/Makefile.pdf-filters data/Makefile +mv -f Makefile.pdf-filters Makefile +mv -f Makedefs.in.pdf-filters Makedefs.in --- cups-1.3.8.orig/debian/local/filters/pdf-filters/addtocups +++ cups-1.3.8/debian/local/filters/pdf-filters/addtocups @@ -0,0 +1,140 @@ +#!/bin/bash + +# Silently exit if the changes are already applied +[ -f $1/filter/imagetopdf.c ] && exit 0 + +# Copy files +cp filter/imagetopdf.c $1/filter/ +cp filter/pdftoraster.cxx $1/filter/ +cp filter/pdftoijs.cxx $1/filter/ +cp filter/texttopdf.c $1/filter/ +cp filter/pdfutils.h $1/filter/ +cp filter/pdfutils.c $1/filter/ +cp -r filter/fontembed $1/filter/ +cp filter/test_pdf1.c $1/filter/ +cp filter/test_pdf2.c $1/filter/ +cp conf/imagetopdf.convs $1/conf/ +cp conf/imagetopdf.types $1/conf/ +cp conf/pdftopdf.convs $1/conf/ +cp conf/pdftoraster.convs $1/conf/ +cp conf/pdf.types $1/conf/ +cp conf/texttopdf.convs $1/conf/ +cp data/pdf.utf-8.heavy $1/data/ +cp data/pdf.utf-8.simple $1/data/ +cp config-scripts/cups-pdf-filters.m4 $1/config-scripts/ + +# Copy directories +cp -r pdftopdf $1 + +cd $1 + +# Edit configure script +cp configure.in configure.in.pdf-filters +cp configure configure.pdf-filters +cp config.h.in config.h.in.pdf-filters +perl -p -i -e 's/(sinclude\(config-scripts\/cups-defaults\.m4\))/$1\nsinclude(config-scripts\/cups-pdf-filters.m4)/' configure.in +autoconf +perl -p -i -e 's:(\#endif\s*\/\*\s*\!_CUPS_CONFIG_H_\s*\*\/): + +/* Define to 1 if you have the <dirent.h> header file, and it defines "DIR". + */ +\#undef HAVE_DIRENT_H + +/* Define to 1 if you have the <ndir.h> header file, and it defines "DIR". */ +\#undef HAVE_NDIR_H + +/* Define to 1 if you have the <sys/dir.h> header file, and it defines "DIR". + */ +\#undef HAVE_SYS_DIR_H + +/* Define to 1 if you have the <sys/ndir.h> header file, and it defines "DIR". + */ +\#undef HAVE_SYS_NDIR_H + +/* Define to 1 if you have the <zlib.h> header file. */ +\#undef HAVE_ZLIB_H + +/* Parser\:\:Parser has two arguments. */ +\#undef PARSER_HAS_2_ARGS + +/* Define to 1 if you have the "poppler" library (-lpoppler). */ +\#undef HAVE_LIBPOPPLER + +/* New font type enumeration */ +\#undef FONTTYPE_ENUM2 + +/* GlobalParams\:\:GlobalParams has a argument. */ +\#undef GLOBALPARAMS_HAS_A_ARG + +/* Have Stream\:\:getUndecodedStream */ +\#undef HAVE_GETUNDECODEDSTREAM + +/* Have UGooString.h */ +\#undef HAVE_UGOOSTRING_H + +/* Old CharCodeToUnicode\:\:mapToUnicode */ +\#undef OLD_MAPTOUNICODE + +\n$1:' config.h.in + +# Edit Makefiles +cp conf/Makefile conf/Makefile.pdf-filters +cp filter/Makefile filter/Makefile.pdf-filters +cp data/Makefile data/Makefile.pdf-filters +cp Makefile Makefile.pdf-filters +cp Makedefs.in Makedefs.in.pdf-filters +perl -p -i -e 's/^(\s*REPLACE\s*=.*)$/$1 imagetopdf.convs imagetopdf.types pdftopdf.convs pdftoraster.convs pdf.types texttopdf.convs/' conf/Makefile +perl -p -i -e 's/^(\s*FILTERS\s*=\s+)/$1imagetopdf pdftoraster pdftoijs texttopdf /' filter/Makefile +perl -p -i -e 's/^(\s*OBJS\s*=\s+)/$1imagetopdf.o pdftoraster.o pdftoijs.o texttopdf.o pdfutils.o /' filter/Makefile +perl -p -i -e 's/^(\s*CHARSETS\s*=\s+)/$1pdf.utf-8.heavy pdf.utf-8.simple /' data/Makefile +cat >> filter/Makefile <<EOF + +# +# imagetops +# + +imagetopdf: imagetopdf.o common.o \$(LIBCUPSIMAGE) \\ + ../cups/\$(LIBCUPS) + echo Linking \$@... + \$(CC) \$(LDFLAGS) -o \$@ imagetopdf.o common.o \$(LINKCUPSIMAGE) \\ + \$(IMGLIBS) \$(LIBS) + + +# +# pdftoraster +# + +pdftoraster: pdftoraster.o common.o \$(LIBCUPSIMAGE) \\ + ../cups/\$(LIBCUPS) + echo Linking \$@... + \$(CC) \$(LDFLAGS) -o \$@ pdftoraster.o common.o \$(LINKCUPSIMAGE) \\ + \$(POPPLER_LIBS) + + +# +# pdftoijs +# + +pdftoijs: pdftoijs.o ../cups/\$(LIBCUPS) + echo Linking \$@... + \$(CC) \$(LDFLAGS) -o \$@ pdftoijs.o \\ + \$(POPPLER_LIBS) \$(IJS_LIBS) + + +# +# texttopdf +# + +fontembed/libfontembed.a: + \$(MAKE) -C fontembed + +texttopdf: texttopdf.o textcommon.o common.o pdfutils.o fontembed/libfontembed.a \\ + ../cups/\$(LIBCUPS) + echo Linking \$@... + \$(CC) \$(LDFLAGS) -o \$@ texttopdf.o textcommon.o common.o pdfutils.o -Lfontembed -lfontembed \$(LIBS) + +EOF +perl -p -i -e 's/^(\s*DIRS\s*=.*\s+filter\s+)/$1pdftopdf /' Makefile +perl -p -i -e 's/^(\s*LIBS\s*=.*$)/$1\nPOPPLER_LIBS\t=\t\@POPPLER_LIBS\@ \$(LIBS)/' Makedefs.in +perl -p -i -e 's/^(\s*LIBS\s*=.*$)/$1\nIJS_LIBS\t=\t\@IJS_LIBS\@ \$(LIBS)/' Makedefs.in +perl -p -i -e 's/^(\s*ALL_CFLAGS\s*=\s*)/$1-Ifontembed /' Makedefs.in --- cups-1.3.8.orig/debian/local/filters/pdf-filters/AUTHORS +++ cups-1.3.8/debian/local/filters/pdf-filters/AUTHORS @@ -0,0 +1,2 @@ +Koji Otani +Tobias Hoffmann --- cups-1.3.8.orig/debian/local/filters/pdf-filters/COPYING +++ cups-1.3.8/debian/local/filters/pdf-filters/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. --- cups-1.3.8.orig/debian/local/filters/pdf-filters/man/pdf2pdf.1 +++ cups-1.3.8/debian/local/filters/pdf-filters/man/pdf2pdf.1 @@ -0,0 +1,234 @@ +.TH pdf2pdf 1 +.SH NAME +pdf2pdf \- Portable Document Format (PDF) converter +.SH SYNOPSIS +.B pdf2pdf +[<options>] [ +.I <Input-PDF-file> +[ +.I <Output-PDF-file> +]] +.SH DESCRIPTION +\fIpdf2pdf\fR converts a Portable Document Format (PDF) file to a new PDF file. +pdf2pdf reads a PDF file, \fIInput-PDF-File\fR, changes layouts of pages, +and writes as a new PDF file, \fIOutput-PDF-File\fR. If \fIOutput-PDF-Files\fR +is not specified, the new PDF file is sent to stdout. If \flInput-PDF-Files\fR +is not specified, pdf2pdf reads the PDF data from stdin. + +pdf2pdf can embed fonts in the new PDF file if you set its option. +"pdf2pdf" finds fonts to embed by fontconfig library. +"pdf2pdf" now embed only TrueType format fonts. +PDF Standard fonts are not embedded . + +\fBNote:\fR You should not embed fonts that's licenses inhibit embedding. + +"pdf2pdf" 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. + +.SH OPTIONS +.TP 5 +-c <copies> +.RS 0 +-copies <copies> +.RE +.RS 5 +.br +Sets the number of copies to <copies>. +.RE +.TP 5 +-collate +.br +Gets collated copies. +.TP 5 +-scaling <scale> +.br +Specifies scaling factor <scale> in percentage of the paper size. +.TP 5 +-natural-scaling <scale> +.br +Specifies scaling factor <scale> in percentage of the original size. +.TP 5 +-landscape +.br +Rotates 90 degrees. +.TP 5 +-orientation <num> +.br +Rotates the page. <num> is one of the followings. +.RS 10 +0 : 0 degrees +.br +1 : 90 degrees +.br +2 : 180 degrees +.br +3 : 270 degrees +.RE +.TP 5 +-fitplot +.br +Fits the page on the paper's imageable area. pdf2pdf may scale +and rotate the page. +.TP 5 +-mirror +.br +Outputs the mirror image of the page. +.TP 5 +-paper <paper size> +.br +Specifies the paper size. <paper size> is one of the followings. +.RS 10 +letter, legal, A0, A1, A2, A3, A4, A5, B0, B1, B2, B3, B4, B5 +.RE +.TP 5 +-paperw <paper width> +.br +Specifies width of the paper in points. +.TP 5 +-paperh <paper height> +.br +Specifies height of the paper in points. +.TP 5 +-page-left <margin> +.RS 0 +-page-right <margin> +.RE +.RS 0 +-page-bottom <margin> +.RE +.RS 0 +-page-top <margin> +.RE +.RS 5 +.br +Specifies margins of each paper edge (left, right, bottom, top) in points. +<margin> should be greater than or equal 0, and less than or +equal paper dimension. +.RE +.TP 5 +-position <pos> +.br +Specifies page position in imageable area. <pos> is one of the followings. +.RS 10 +center, top, left, right, top-left, top-right, bottom, bottom-left, +bottom-right +.RE +.TP 5 +-number-up <number> +.br +Selects N-up. N-up layouts multiple pages on a single paper. <number> is +one of the followings. +.RS 10 +1, 2, 4, 6, 8, 9, 16 +.RE +.RS 5 +The page may be rotated 90 degrees. +.RE +.TP 5 +-number-up-layout <layout> +.br +Specifies layout order when -number-up is specified. <layout> is one +of the followings. +.RS 10 +lrtb : left to right, top to bottom (default) +.br +lrbt : left to right, bottom to top +.br +rltb : right to left, top to bottom +.br +rlbt : right to left, bottom to top +.br +tblr : top to bottom, left to right +.br +tbrl : top to bottom, right to left +.br +btlr : bottom to top, left to right +.br +btrl : bottom to top, right to left +.RE +.TP 5 +-page-border <border> +.br +Specifies border line of the page when -number-up is specified. <border> +is one of the followings. +.RS 10 +none : no line +.br +single : single thin line +.br +single-thick : single thick line +.br +double : double thin lines +.br +double-thick : double thick lines +.RE +.TP 5 +-reverse +.br +Reverses page output order. +.TP 5 +-page-set <set> +.br +Selects output page set. <set> is one of followings. +.RS 10 +even : even page set +.br +odd : odd page set +.RE +.TP 5 +-page-ranges <ranges> +.br +Selects output pages. <ranges> is a list of ranges. Each range is +separated by comma. Each range is <begin>-<end> or <page>. +.RS 10 +Ex. +.br +2,4,5 : 2, 4, 5 page +.br +1-4 : 1, 2, 3, 4, page +.br +1-4,7,9-12 : 1, 2, 3, 4, 7, 9, 10, 11, 12 page +.RE +.TP 5 +-font-embedding +.br +Embeds fonts into output PDF file. +.TP 5 +-no-compressing-font +.br +Not compresses embedded fonts. By default, embedded fonts are compressed. +.TP 5 +no-compressing-contents +.br +Not compresses page content. By default, page content is compressed. +.TP 5 +-opw <owner password> +.br +Specifies owner password if a PDF file is encrypted. +.TP 5 +-upw <user password> +.br +Specifies user password if a PDF file is encrypted. +.TP 5 +-v +.br +Displays version number. +.TP 5 +-h +.RS 0 +-help +.br +--help +.br +--? +.RE +.RS 5 +Displays simple help message. +.RE + +.SH AUTHOR + Koji Otani +.SH COPYRIGHT +Copyright 2007-2008, BBR Inc. --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/P2PPageTree.cxx +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/P2PPageTree.cxx @@ -0,0 +1,290 @@ +/* + +Copyright (c) 2006-2007, BBR Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +/* + P2PPageTree.cc + pdftopdf page tree +*/ + +#include <config.h> +#include "goo/gmem.h" +#include "P2PPageTree.h" +#include <ctype.h> +#include <stdlib.h> + +GBool P2PPageTree::checkPageRange(int no, const char *pageSet, + const char *pageRanges) +{ + const char *range; + int lower, upper; + + if (pageSet != 0) { + if (!strcasecmp(pageSet,"even") && (no % 2) == 1) { + return gFalse; + } else if (!strcasecmp(pageSet, "odd") && (no % 2) == 0) { + return gFalse; + } + } + + if (pageRanges == 0) { + return gTrue; + } + + for (range = pageRanges; *range != '\0';) { + if (*range == '-') { + lower = 1; + range ++; + upper = strtol(range, (char **)&range, 10); + } else { + lower = strtol(range, (char **)&range, 10); + if (*range == '-') { + range ++; + if (!isdigit(*range)) { + upper = 65535; + } else { + upper = strtol(range, (char **)&range, 10); + } + } else { + upper = lower; + } + } + if (no >= lower && no <= upper) { + return gTrue; + } + + if (*range == ',') { + range++; + } else { + break; + } + } + return gFalse; +} + +/* Constructor */ +P2PPageTree::P2PPageTree(Catalog *orgCatalogA, XRef *xrefA) +{ + int i; + int n; + + xref = xrefA; + numPages = orgCatalogA->getNumPages(); + pages = new P2PPage *[numPages]; + for (n = 0, i = 0;i < numPages;i++) { + if (checkPageRange(i+1,P2PDoc::options.pageSet, + P2PDoc::options.pageRanges)) { + pages[n++] = new P2PPage(orgCatalogA->getPage(i+1),xref); + } + } + numPages = n; +} + +void P2PPageTree::cleanPages(P2PPage **pagesA, int size) +{ + int i; + + for (i = 0;i < size;i++) { + if (pagesA[i] != 0) { + delete pagesA[i]; + } + } + delete[] pagesA; +} + +P2PPageTree::~P2PPageTree() +{ + cleanPages(pages,numPages); +} + +void P2PPageTree::outputSelf(P2POutputStream *str, P2PObject **pageObjects, + int len) +{ + int i; + + outputBegin(str); + str->puts("<< /Type /Pages " + "/Kids [ "); + for (i = 0;i < len;i++) { + P2PXRef::put(pageObjects[i]); + pageObjects[i]->outputRef(str); + str->putchar('\n'); + } + str->printf(" ] /Count %d >>\n",len); + outputEnd(str); +} + +void P2PPageTree::output(P2POutputStream *str, int copies, GBool collate) +{ + int i,j,k; + int n = numPages; + int len; + P2PObject **pageObjects; + P2PPage **outPages; + + if (P2PDoc::options.even && (numPages % 2) != 0) { + /* make number of pages even. + append empty page to the last */ + /* only increment allocate size here */ + n++; + } + outPages = new P2PPage *[n]; + for (i = 0;i < numPages;i++) { + outPages[i] = pages[i]; + } + if (P2PDoc::options.even && (numPages % 2) != 0) { + /* make number of pages even. + append a empty page to the last. */ + /* assumed n >= 2 */ + /* empty page's mediaSize is same as a preceding page's media Size */ + outPages[n-1] = new P2PPage(outPages[n-2]->getMediaBox(),xref); + } + if (P2PDoc::options.reverse) { + /* reverse output pages */ + for (i = 0;i < (n+1)/2;i++) { + P2PPage *t; + + t = outPages[i]; + outPages[i] = outPages[n-i-1]; + outPages[n-i-1] = t; + } + } + + len = n*copies; + pageObjects = new P2PObject * [len]; + + if (collate) { + for (i = 0;i < n;i++) { + pageObjects[i] = static_cast<P2PObject *>(outPages[i]); + } + for (i = n;i < len;i++) { + pageObjects[i] = new P2PObject(); + } + outputSelf(str,pageObjects,len); + for (i = 0;i < n;i++) { + outPages[i]->output(str,this); + } + for (i = 1;i < copies;i++) { + k = i*n; + for (j = 0;j < n;j++) { + outPages[j]->output(str,this,pageObjects[k+j]); + } + } + } else { + for (i = 0;i < n;i++) { + k = i*copies; + pageObjects[k] = static_cast<P2PObject *>(outPages[i]); + for (j = 1;j < copies;j++) { + pageObjects[k+j] = new P2PObject(); + } + } + outputSelf(str,pageObjects,len); + for (i = 0;i < n;i++) { + k = i*copies; + outPages[i]->output(str,this); + for (j = 1;j < copies;j++) { + outPages[i]->output(str,this,pageObjects[k+j]); + } + } + } + delete[] pageObjects; + delete[] outPages; +} + +int P2PPageTree::nup(int n, PDFRectangle *box, + unsigned int borderFlag, unsigned int layout, + int xpos, int ypos) +{ + P2PPage **newPages; + int size; + int i,j; + + size = (numPages+(n-1))/n; + newPages = new P2PPage *[size]; + for (i = 0,j = 0;i < numPages;j++, i += n) { + int len = numPages - i; + int k; + + if (len > n) { + len = n; + } + /* check original pages */ + for (k = 0;k < len;k++) { + if (pages[i+k]->getNumOrgPages() != 1) { + /* nup twice error */ + return -1; + } + } + newPages[j] = new P2PPage(n,pages+i,len,box,borderFlag,layout, + xref,xpos,ypos); + } + cleanPages(pages,numPages); + pages = newPages; + numPages = size; + return 0; +} + +void P2PPageTree::fit(PDFRectangle *box, double zoom) +{ + int i; + + for (i = 0;i < numPages;i++) { + pages[i]->fit(box,zoom); + } +} + +void P2PPageTree::mirror() +{ + int i; + + for (i = 0;i < numPages;i++) { + pages[i]->mirror(); + } +} + +void P2PPageTree::rotate(int orientation) +{ + int i; + + for (i = 0;i < numPages;i++) { + pages[i]->rotate(orientation); + } +} + +void P2PPageTree::position(PDFRectangle *box, int xpos, int ypos) +{ + int i; + + for (i = 0;i < numPages;i++) { + pages[i]->position(box,xpos,ypos); + } +} + +void P2PPageTree::scale(double zoom) +{ + int i; + + for (i = 0;i < numPages;i++) { + pages[i]->scale(zoom); + } +} --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/pdf2pdf.cxx +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/pdf2pdf.cxx @@ -0,0 +1,620 @@ +/* +Copyright (c) 2007, BBR Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +/* + pdf2pdf.cc + pdf to pdf filter, utilty version +*/ + +#include <config.h> +#include <stdio.h> +#include <stdlib.h> +#include "goo/GooString.h" +#include "goo/gmem.h" +#include "Object.h" +#include "Stream.h" +#include "PDFDoc.h" +#include "P2PDoc.h" +#include "P2POutputStream.h" +#include <stdarg.h> +#include "Error.h" +#include "GlobalParams.h" +#include "parseargs.h" +#include "PDFFTrueTypeFont.h" + +namespace { + int exitCode = 0; + GBool fitplot = gFalse; + GBool mirror = gFalse; + int numberUp = 1; + char numberUpLayoutStr[5] = ""; + unsigned int numberUpLayout = PDFTOPDF_LAYOUT_LRTB; + char pageBorderStr[15] = ""; + char pageSetStr[5] = ""; + char pageRangesStr[255] = ""; + unsigned int pageBorder = PDFTOPDF_BORDERNONE; + int margin = 0; + int aMargin = -1; + double pageLeft = 0; + double pageRight = 612.0; + double pageBottom = 0; + double pageTop = 792.0; + double pageWidth = 612.0; + double pageLength = 792.0; + int paperWidth = 0; + int paperHeight = 0; + int xposition = 0; + int yposition = 0; + GBool position = gFalse; + char positionStr[15] = ""; + int orientation = 0; + double scaling = 1.0; + int aScaling = -1; + double naturalScaling = 1.0; + int aNaturalScaling = -1; + GBool printHelp = gFalse; + GBool printVersion = gFalse; + GBool copies = 1; + GBool landscape = gFalse; + char paperSize[15] = ""; + int leftMargin = -1; + int rightMargin = -1; + int bottomMargin = -1; + int topMargin = -1; + char ownerPassword[33] = "\001"; + char userPassword[33] = "\001"; + GBool reverseOrder = gFalse; + GBool collate = gFalse; + GBool fontEmbedding = gFalse; + GBool fontNoCompress = gFalse; + GBool contentNoCompress = gFalse; + GooString *ownerPW = NULL; + GooString *userPW = NULL; +}; + +struct Paper { + const char *name; + double width; + double height; +} papers[] = { + {"Letter", 612, 792}, + {"Legal", 612, 1008}, + {"Executive", 522, 757}, + {"A5", 421, 595}, + {"A4", 595, 842}, + {"A3", 842, 1191}, + {"A2", 1191, 1684}, + {"A1", 1684, 2384}, + {"A0", 2384, 3370}, + {"B5", 516, 729}, + {"B4", 729, 1032}, + {"B3", 1032, 1460}, + {"B2", 1460, 2064}, + {"B1", 2064, 2920}, + {"B0", 2920, 4127}, + {"Postcard", 283, 421}, + {NULL} +}; + + +static ArgDesc argDesc[] = { + {const_cast<char *>("-c"), argInt, &copies, 0, + const_cast<char *>("number of copies")}, + {const_cast<char *>("-copies"), argInt, &copies, 0, + const_cast<char *>("number of copies")}, + {const_cast<char *>("-fitplot"),argFlag, &fitplot, 0, + const_cast<char *>("fit original page to new page region")}, + {const_cast<char *>("-number-up"),argInt, &numberUp, 0, + const_cast<char *>("number up (1,2,4,6,8,9,16)")}, + {const_cast<char *>("-number-up-layout"), argString,numberUpLayoutStr,sizeof(numberUpLayoutStr), + const_cast<char *>("number up layout (lrtb,lrbt,rltb,rlbt,tblr,tbrl,btlr,btrl)")}, + {const_cast<char *>("-reverse"), argFlag, &reverseOrder, 0, + const_cast<char *>("reverse output order")}, + {const_cast<char *>("-mirror"), argFlag, &mirror, 0, + const_cast<char *>("mirror image")}, + {const_cast<char *>("-collate"), argFlag, &collate, 0, + const_cast<char *>("collate")}, + {const_cast<char *>("-scaling"),argInt, &aScaling, 0, + const_cast<char *>("scaling, in %")}, + {const_cast<char *>("-natural-scaling"),argInt, &aNaturalScaling, 0, + const_cast<char *>("natural scaling, in %")}, + {const_cast<char *>("-page-border"),argString, pageBorderStr, sizeof(pageBorderStr), + const_cast<char *>("page border (none,single,single-thick,double,double-thick)")}, + {const_cast<char *>("-landscape"),argFlag, &landscape, 0, + const_cast<char *>("landscape")}, + {const_cast<char *>("-orientation"),argInt, &orientation, 0, + const_cast<char *>("orientation (0,1,2,3)")}, + {const_cast<char *>("-paper"), argString, paperSize, sizeof(paperSize), + const_cast<char *>("paper size (letter, legal, A0 ... A5, B0 ... B5)")}, + {const_cast<char *>("-paperw"), argInt, &paperWidth, 0, + const_cast<char *>("paper width, in points")}, + {const_cast<char *>("-paperh"), argInt, &paperHeight, 0, + const_cast<char *>("paper height, in points")}, + {const_cast<char *>("-margin"), argInt, &aMargin, 0, + const_cast<char *>("paper margin, in points")}, + {const_cast<char *>("-page-left"),argInt, &leftMargin, 0, + const_cast<char *>("left margin, in points")}, + {const_cast<char *>("-page-right"),argInt, &rightMargin, 0, + const_cast<char *>("right margin, in points")}, + {const_cast<char *>("-page-bottom"),argInt, &bottomMargin, 0, + const_cast<char *>("bottom margin, in points")}, + {const_cast<char *>("-page-top"), argInt, &topMargin, 0, + const_cast<char *>("top margin, in points")}, + {const_cast<char *>("-page-set"), argString, pageSetStr, sizeof(pageSetStr), + const_cast<char *>("page set (odd or even)")}, + {const_cast<char *>("-page-ranges"),argString, pageRangesStr, sizeof(pageRangesStr), + const_cast<char *>("page ranges (Ex. 2-4,8)")}, + {const_cast<char *>("-font-embedding"),argFlag, &fontEmbedding, 0, + const_cast<char *>("embedding fonts")}, + {const_cast<char *>("-no-compressing-font"),argFlag,&fontNoCompress,0, + const_cast<char *>("not compressing embedding fonts")}, + {const_cast<char *>("-no-compressing-contents"),argFlag,&contentNoCompress,0, + const_cast<char *>("not compressing page contents")}, + {const_cast<char *>("-position"),argString, positionStr, sizeof(positionStr), + const_cast<char *>("page position (center,top,left,right,top-left,top-right,bottom,bottom-left,bottom-right)\n")}, + {const_cast<char *>("-opw"), argString, ownerPassword, sizeof(ownerPassword), + const_cast<char *>("owner password (for encrypted files)")}, + {const_cast<char *>("-upw"), argString, userPassword, sizeof(userPassword), + const_cast<char *>("user password (for encrypted files)")}, + {const_cast<char *>("-v"), argFlag, &printVersion, 0, + const_cast<char *>("print version info")}, + {const_cast<char *>("-h"), argFlag, &printHelp, 0, + const_cast<char *>("print usage information")}, + {const_cast<char *>("-help"), argFlag, &printHelp, 0, + const_cast<char *>("print usage information")}, + {const_cast<char *>("--help"), argFlag, &printHelp, 0, + const_cast<char *>("print usage information")}, + {const_cast<char *>("--?"), argFlag, &printHelp, 0, + const_cast<char *>("print usage information")}, + {NULL} +}; + +void CDECL myErrorFun(int pos, char *msg, va_list args) +{ + if (pos >= 0) { + fprintf(stderr, "ERROR (%d): ", pos); + } else { + fprintf(stderr, "ERROR: "); + } + vfprintf(stderr, msg, args); + fprintf(stderr, "\n"); + fflush(stderr); +} + +Paper *getPaper(char *name) +{ + for (Paper *p = papers;p->name != NULL;p++) { + if (strcasecmp(name,p->name) == 0) { + return p; + } + } + return NULL; +} + +void parseOpts(int *argc, char **argv) +{ + GBool ok; + Paper *ppaper; + + ok = parseArgs(argDesc,argc,argv); + if (!ok || *argc < 1 || *argc > 3 || printVersion || printHelp) { + fprintf(stderr, "pdf2pdf version %s\n", VERSION); + if (!printVersion) { + printUsage(argv[0], + const_cast<char *>("[<input PDF-file> [<output PDF-file>]]"), argDesc); + } + exit(1); + } + + if (copies <= 0) { + fprintf(stderr,"number of copies should be plus number\n"); + exit(1); + } + P2PDoc::options.copies = copies; + + /* paper size */ + if (paperSize[0] != '\0') { + if ((ppaper = getPaper(paperSize)) == NULL) { + fprintf(stderr,"Unknown paper\n"); + exit(1); + } + pageWidth = ppaper->width; + pageLength = ppaper->height; + position = gTrue; + } + if (paperWidth < 0) { + fprintf(stderr,"paper width should be plus\n"); + exit(1); + } + if (paperWidth > 0) { + pageWidth = paperWidth; + position = gTrue; + } + if (paperHeight < 0) { + fprintf(stderr,"paper height should be plus\n"); + exit(1); + } + if (paperHeight > 0) { + pageLength = paperHeight; + position = gTrue; + } + /* paper margin */ + if (aMargin >= 0) { + margin = aMargin; + position = gTrue; + } + pageLeft = margin; + pageRight = pageWidth - margin; + pageBottom = margin; + pageTop = pageLength - margin; + if (landscape) { + orientation = 1; + } + if (orientation < 0 || orientation > 3) { + fprintf(stderr,"orientation value should be one of (0,1,2,3)\n"); + exit(1); + } + + if (leftMargin >= 0) { + switch (orientation & 3) { + case 0 : + pageLeft = leftMargin; + break; + case 1 : + pageBottom = leftMargin; + break; + case 2 : + pageRight = pageWidth - leftMargin; + break; + case 3 : + pageTop = pageLength - leftMargin; + break; + } + position = gTrue; + } + if (rightMargin >= 0) { + switch (orientation & 3) { + case 0 : + pageRight = pageWidth - rightMargin; + break; + case 1 : + pageTop = pageLength - rightMargin; + break; + case 2 : + pageLeft = rightMargin; + break; + case 3 : + pageBottom = rightMargin; + break; + } + position = gTrue; + } + if (bottomMargin >= 0) { + switch (orientation & 3) { + case 0 : + pageBottom = bottomMargin; + break; + case 1 : + pageLeft = bottomMargin; + break; + case 2 : + pageTop = pageLength - bottomMargin; + break; + case 3 : + pageRight = pageWidth - bottomMargin; + break; + } + position = gTrue; + } + if (topMargin >= 0) { + switch (orientation & 3) { + case 0 : + pageTop = pageLength - topMargin; + break; + case 1 : + pageRight = pageWidth - topMargin; + break; + case 2 : + pageBottom = topMargin; + break; + case 3 : + pageLeft = topMargin; + break; + } + position = gTrue; + } + + switch (numberUp) { + case 1 : + case 2 : + case 4 : + case 6 : + case 8 : + case 9 : + case 16 : + break; + default : + fprintf(stderr, + "Unsupported number-up value %d, should be one of (1,2,4,6,8,16)\n", + numberUp); + exit(1); + break; + } + if (numberUpLayoutStr[0] != '\0') { + if (!strcasecmp(numberUpLayoutStr,"lrtb")) { + numberUpLayout = PDFTOPDF_LAYOUT_LRTB; + } else if (!strcasecmp(numberUpLayoutStr,"lrbt")) { + numberUpLayout = PDFTOPDF_LAYOUT_LRBT; + } else if (!strcasecmp(numberUpLayoutStr,"rltb")) { + numberUpLayout = PDFTOPDF_LAYOUT_RLTB; + } else if (!strcasecmp(numberUpLayoutStr,"rlbt")) { + numberUpLayout = PDFTOPDF_LAYOUT_RLBT; + } else if (!strcasecmp(numberUpLayoutStr,"tblr")) { + numberUpLayout = PDFTOPDF_LAYOUT_TBLR; + } else if (!strcasecmp(numberUpLayoutStr,"tbrl")) { + numberUpLayout = PDFTOPDF_LAYOUT_TBRL; + } else if (!strcasecmp(numberUpLayoutStr,"btlr")) { + numberUpLayout = PDFTOPDF_LAYOUT_BTLR; + } else if (!strcasecmp(numberUpLayoutStr,"btrl")) { + numberUpLayout = PDFTOPDF_LAYOUT_BTRL; + } else { + fprintf(stderr, "Unsupported number-up-layout value %s,\n" + " should be one of (lrtb,lrbt,rltb,rlbt,tblr,tbrl,btlr,btrl)\n", + numberUpLayoutStr); + exit(1); + } + } + if (reverseOrder) { + P2PDoc::options.reverse = gTrue; + } + if (pageBorderStr[0] != '\0') { + if (!strcasecmp(pageBorderStr,"none")) { + pageBorder = PDFTOPDF_BORDERNONE; + } else if (!strcasecmp(pageBorderStr,"single")) { + pageBorder = PDFTOPDF_BORDERHAIRLINE; + } else if (!strcasecmp(pageBorderStr,"single-thick")) { + pageBorder = PDFTOPDF_BORDERTHICK; + } else if (!strcasecmp(pageBorderStr,"double")) { + pageBorder = PDFTOPDF_BORDERDOUBLE | PDFTOPDF_BORDERHAIRLINE; + } else if (!strcasecmp(pageBorderStr,"double-thick")) { + pageBorder = PDFTOPDF_BORDERDOUBLE | PDFTOPDF_BORDERTHICK; + } else { + fprintf(stderr, "Unsupported page-border value %s,\n" + " should be one of (none,single,single-thick,double,double-thick)\n", + pageBorderStr); + exit(1); + } + } + if (pageSetStr[0] != '\0') { + if (strcasecmp(pageSetStr,"even") != 0 && + strcasecmp(pageSetStr,"odd") != 0) { + fprintf(stderr, "Page set should be odd or even\n"); + exit(1); + } + P2PDoc::options.pageSet = pageSetStr; + } + if (pageRangesStr[0] != '\0') { + P2PDoc::options.pageRanges = pageRangesStr; + } + if (positionStr[0] != '\0') { + if (strcasecmp(positionStr,"center") == 0) { + xposition = 0; + yposition = 0; + } else if (strcasecmp(positionStr,"top") == 0) { + xposition = 0; + yposition = 1; + } else if (strcasecmp(positionStr,"left") == 0) { + xposition = -1; + yposition = 0; + } else if (strcasecmp(positionStr,"right") == 0) { + xposition = 1; + yposition = 0; + } else if (strcasecmp(positionStr,"top-left") == 0) { + xposition = -1; + yposition = 1; + } else if (strcasecmp(positionStr,"top-right") == 0) { + xposition = 1; + yposition = 1; + } else if (strcasecmp(positionStr,"bottom") == 0) { + xposition = 0; + yposition = -1; + } else if (strcasecmp(positionStr,"bottom-left") == 0) { + xposition = -1; + yposition = -1; + } else if (strcasecmp(positionStr,"bottom-right") == 0) { + xposition = 1; + yposition = -1; + } else { + fprintf(stderr, "Unsupported postion value %s,\n" + " should be one of (center,top,left,right,top-left,top-right,bottom,bottom-left,bottom-right).\n", + positionStr); + exit(1); + } + position = gTrue; + } + + if (collate) { + P2PDoc::options.collate = gTrue; + } + + if (aScaling > 0) { + scaling = aScaling * 0.01; + fitplot = gTrue; + } else if (fitplot) { + scaling = 1.0; + } + if (aNaturalScaling > 0) { + naturalScaling = aNaturalScaling * 0.01; + } + + /* embedding fonts into output PDF */ + P2PDoc::options.fontEmbedding = fontEmbedding; + P2PDoc::options.fontCompress = !fontNoCompress; + P2PDoc::options.contentsCompress = !contentNoCompress; + + if (P2PDoc::options.copies == 1) { + /* collate is not needed */ + P2PDoc::options.collate = gFalse; + } + + if (ownerPassword[0] != '\001') { + ownerPW = new GooString(ownerPassword); + } + if (userPassword[0] != '\001') { + userPW = new GooString(userPassword); + } +} + +int main(int argc, char *argv[]) { + PDFDoc *doc; + P2PDoc *p2pdoc; + P2POutputStream *str; + FILE *outfp; + + setErrorFunction(::myErrorFun); + parseOpts(&argc, argv); +#ifdef GLOBALPARAMS_HAS_A_ARG + globalParams = new GlobalParams(0); +#else + globalParams = new GlobalParams(); +#endif + + PDFRectangle box(pageLeft,pageBottom,pageRight,pageTop); + + if (argc >=3 && strcmp(argv[2],"-") != 0) { + if ((outfp = fopen(argv[2],"wb")) == NULL) { + error(-1,const_cast<char *>("Can't open output file:%s"),argv[3]); + exit(1); + } + } else { + outfp = stdout; + } + if (argc <= 1 || strcmp(argv[1],"-") == 0) { + /* stdin */ + Object obj; + BaseStream *str; + FILE *fp; + char buf[BUFSIZ]; + unsigned int n; + + fp = tmpfile(); + if (fp == NULL) { + error(-1,const_cast<char *>("Can't create temporary file")); + exit(1); + } + + /* copy stdin to the tmp file */ + while ((n = fread(buf,1,BUFSIZ,stdin)) > 0) { + if (fwrite(buf,1,n,fp) != n) { + error(-1,const_cast<char *>("Can't copy stdin to temporary file")); + fclose(fp); + exit(1); + } + } + rewind(fp); + + obj.initNull(); + str = new FileStream(fp,0,gFalse,0,&obj); + doc = new PDFDoc(str,ownerPW,userPW); + } else { + GooString *fileName = new GooString(argv[1]); + /* input filenmae is specified */ + doc = new PDFDoc(fileName,ownerPW,userPW); + } + if (!doc->isOk()) { + exitCode = 1; + goto err1; + } + if (!doc->okToChange() && !doc->okToAssemble()) { + error(-1,const_cast<char *>("Neither Changing, nor Assembling is allowed\n")); + exit(1); + } + p2pdoc = new P2PDoc(doc); + if (mirror) { + p2pdoc->mirror(); + } + + if (orientation != 0) { + p2pdoc->rotate(orientation); + } + + if (naturalScaling != 1.0) { + p2pdoc->scale(naturalScaling); + p2pdoc->position(&box,xposition,yposition); + } + + if (fitplot) { + p2pdoc->fit(&box,scaling); + p2pdoc->position(&box,xposition,yposition); + } + if (numberUp != 1) { + p2pdoc->nup(numberUp,&box,pageBorder,numberUpLayout, + xposition,yposition); + } else if (position) { + p2pdoc->position(&box,xposition,yposition); + } + if (P2PDoc::options.collate + && p2pdoc->getNumberOfPages() == 1 + && !P2PDoc::options.even) { + /* collate is not needed, disable it */ + /* Number of pages is changed by nup and page-ranges, + so check this here */ + P2PDoc::options.collate = gFalse; + } + + str = new P2POutputStream(outfp); /* PDF start here */ + p2pdoc->output(str); + + delete str; + delete p2pdoc; +err1: + delete doc; + + // Check for memory leaks + Object::memCheck(stderr); + gMemReport(stderr); + + return exitCode; +} + +/* replace memory allocation methods for memory check */ + +void * operator new(size_t size) +{ + return gmalloc(size); +} + +void operator delete(void *p) +{ + gfree(p); +} + +void * operator new[](size_t size) +{ + return gmalloc(size); +} + +void operator delete[](void *p) +{ + gfree(p); +} --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/P2PPageTree.h +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/P2PPageTree.h @@ -0,0 +1,68 @@ +/* + +Copyright (c) 2006-2007, BBR Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +/* + P2PPageTree.h + pdftopdf page tree +*/ +#ifndef _P2PPAGETREE_H_ +#define _P2PPAGETREE_H_ + +#include "goo/gmem.h" +#include "goo/gtypes.h" +#include "Object.h" +#include "Array.h" +#include "Catalog.h" +#include "P2PObject.h" +#include "P2PDoc.h" +#include "P2PPage.h" +#include "P2POutputStream.h" +#include "XRef.h" +#include "Page.h" + +class P2PPageTree : public P2PObject { +public: + P2PPageTree(Catalog *orgCatalogA, XRef *xrefA); + virtual ~P2PPageTree(); + /* output self and all pages */ + virtual void output(P2POutputStream *str, int copies, GBool collate); + int nup(int n, PDFRectangle *box, unsigned int borderFlag, + unsigned int layout, int xpos, int ypos); + void fit(PDFRectangle *box, double zoom); + void mirror(); + void rotate(int orientation); + void position(PDFRectangle *box, int xpos, int ypos); + void scale(double zoom); + int getNumberOfPages() { return numPages; } +private: + P2PPage **pages; + int numPages; + XRef *xref; + + void cleanPages(P2PPage **pagesA, int size); + void outputSelf(P2POutputStream *str, P2PObject **pageObjects, int len); + GBool checkPageRange(int no, const char *pageSet, const char *pageRange); +}; + +#endif --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/P2PXRef.h +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/P2PXRef.h @@ -0,0 +1,71 @@ +/* + +Copyright (c) 2006-2007, BBR Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +/* + P2PXRef.h + pdftopdf cross reference +*/ +#ifndef _P2PXREF_H_ +#define _P2PXREF_H_ + +#include "P2POutputStream.h" +#include "XRef.h" + +class P2PObject; + +class P2PXRef { +public: + /* get object from objects table */ + static P2PObject *get(int num, int gen) { + if (num >= objectsSize) return 0; + return objects[num]; + } + + /* return number of objects */ + static int getNObjects() { return currentNum+1; } + /* put object to table */ + static void put(P2PObject *obj); + static void put(P2PObject *obj, P2POutputStream *str); + /* remove object */ + static void remove(P2PObject *obj); + + static int output(P2POutputStream *str); + + /* output objects that are not output yet. */ + static void flush(P2POutputStream *str, XRef *xref); + + /* clean objects */ + static void clean(); + + +private: + /* objects table */ + static P2PObject **objects; + /* objects table size */ + static int objectsSize; + /* current object number */ + static int currentNum; +}; + +#endif --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/P2PCharCodeToUnicode.cxx +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/P2PCharCodeToUnicode.cxx @@ -0,0 +1,270 @@ +//======================================================================== +// +// P2PCharCodeToUnicode.cc +// +// BBR Inc. +// +// Based Poppler CharCodeToUnicode.h +// Copyright 2001-2003 Glyph & Cog, LLC +// +//======================================================================== + +#include <config.h> + +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + +#include <stdio.h> +#include <string.h> +#include "goo/gmem.h" +#include "goo/GooString.h" +#include "Error.h" +#include "GlobalParams.h" +#include "PSTokenizer.h" +#include "P2PCharCodeToUnicode.h" + +//------------------------------------------------------------------------ + +#define maxUnicodeString 8 + +struct P2PCharCodeToUnicodeString { + CharCode c; + Unicode u[maxUnicodeString]; + int len; +}; + +//------------------------------------------------------------------------ + +static int getCharFromFile(void *data) { + return fgetc((FILE *)data); +} + +//------------------------------------------------------------------------ + +P2PCharCodeToUnicode *P2PCharCodeToUnicode::parseCMapFromFile( + GooString *fileName, int nBits) { + P2PCharCodeToUnicode *ctu; + FILE *f; + + ctu = new P2PCharCodeToUnicode(); + if ((f = globalParams->findToUnicodeFile(fileName))) { + ctu->parseCMap1(&getCharFromFile, f, nBits); + fclose(f); + } else { + error(-1, const_cast<char *>("Couldn't find ToUnicode CMap file for '%s'"), + fileName->getCString()); + } + return ctu; +} + +void P2PCharCodeToUnicode::parseCMap1(int (*getCharFunc)(void *), void *data, + int nBits) { + PSTokenizer *pst; + char tok1[256], tok2[256], tok3[256]; + int nDigits, n1, n2, n3; + CharCode i; + CharCode code1, code2; + GooString *name; + FILE *f; + + nDigits = nBits / 4; + pst = new PSTokenizer(getCharFunc, data); + pst->getToken(tok1, sizeof(tok1), &n1); + while (pst->getToken(tok2, sizeof(tok2), &n2)) { + if (!strcmp(tok2, "usecmap")) { + if (tok1[0] == '/') { + name = new GooString(tok1 + 1); + if ((f = globalParams->findToUnicodeFile(name))) { + parseCMap1(&getCharFromFile, f, nBits); + fclose(f); + } else { + error(-1, const_cast<char *>("Couldn't find ToUnicode CMap file for '%s'"), + name->getCString()); + } + delete name; + } + pst->getToken(tok1, sizeof(tok1), &n1); + } else if (!strcmp(tok2, "beginbfchar")) { + while (pst->getToken(tok1, sizeof(tok1), &n1)) { + if (!strcmp(tok1, "endbfchar")) { + break; + } + if (!pst->getToken(tok2, sizeof(tok2), &n2) || + !strcmp(tok2, "endbfchar")) { + error(-1, const_cast<char *>("Illegal entry in bfchar block in ToUnicode CMap")); + break; + } + if (!(n1 == 2 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>' && + tok2[0] == '<' && tok2[n2 - 1] == '>')) { + + // check there was no line jump inside the token and so the length is + // longer than it should be + int countAux = 0; + for (int k = 0; k < n1; k++) + if (tok1[k] != '\n' && tok1[k] != '\r') countAux++; + + if (!(countAux == 2 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>' && + tok2[0] == '<' && tok2[n2 - 1] == '>')) { + error(-1, const_cast<char *>("Illegal entry in bfchar block in ToUnicode CMap")); + continue; + } + } + tok1[n1 - 1] = tok2[n2 - 1] = '\0'; + if (sscanf(tok1 + 1, "%x", &code1) != 1) { + error(-1, const_cast<char *>("Illegal entry in bfchar block in ToUnicode CMap")); + continue; + } + addMapping(code1, tok2 + 1, n2 - 2, 0); + } + pst->getToken(tok1, sizeof(tok1), &n1); + } else if (!strcmp(tok2, "beginbfrange")) { + while (pst->getToken(tok1, sizeof(tok1), &n1)) { + if (!strcmp(tok1, "endbfrange")) { + break; + } + if (!pst->getToken(tok2, sizeof(tok2), &n2) || + !strcmp(tok2, "endbfrange") || + !pst->getToken(tok3, sizeof(tok3), &n3) || + !strcmp(tok3, "endbfrange")) { + error(-1, const_cast<char *>("Illegal entry in bfrange block in ToUnicode CMap")); + break; + } + if (!(n1 == 2 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>' && + n2 == 2 + nDigits && tok2[0] == '<' && tok2[n2 - 1] == '>')) { + // check there was no line jump inside the token and so the length is + // longer than it should be + int countAux = 0; + for (int k = 0; k < n1; k++) + if (tok1[k] != '\n' && tok1[k] != '\r') countAux++; + + int countAux2 = 0; + for (int k = 0; k < n1; k++) + if (tok2[k] != '\n' && tok2[k] != '\r') countAux++; + + if (!(countAux == 2 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>' && + countAux2 == 2 + nDigits && tok2[0] == '<' && tok2[n2 - 1] == '>')) { + error(-1, const_cast<char *>("Illegal entry in bfrange block in ToUnicode CMap")); + continue; + } + } + tok1[n1 - 1] = tok2[n2 - 1] = '\0'; + if (sscanf(tok1 + 1, "%x", &code1) != 1 || + sscanf(tok2 + 1, "%x", &code2) != 1) { + error(-1, const_cast<char *>("Illegal entry in bfrange block in ToUnicode CMap")); + continue; + } + if (!strcmp(tok3, "[")) { + i = 0; + while (pst->getToken(tok1, sizeof(tok1), &n1) && + code1 + i <= code2) { + if (!strcmp(tok1, "]")) { + break; + } + if (tok1[0] == '<' && tok1[n1 - 1] == '>') { + tok1[n1 - 1] = '\0'; + addMapping(code1 + i, tok1 + 1, n1 - 2, 0); + } else { + error(-1, const_cast<char *>("Illegal entry in bfrange block in ToUnicode CMap")); + } + ++i; + } + } else if (tok3[0] == '<' && tok3[n3 - 1] == '>') { + tok3[n3 - 1] = '\0'; + for (i = 0; code1 <= code2; ++code1, ++i) { + addMapping(code1, tok3 + 1, n3 - 2, i); + } + + } else { + error(-1, const_cast<char *>("Illegal entry in bfrange block in ToUnicode CMap")); + } + } + pst->getToken(tok1, sizeof(tok1), &n1); + } else { + strcpy(tok1, tok2); + } + } + delete pst; +} + +void P2PCharCodeToUnicode::addMapping(CharCode code, char *uStr, int n, + int offset) { + CharCode oldLen, i; + Unicode u; + char uHex[5]; + int j; + + if (code >= mapLen) { + oldLen = mapLen; + mapLen = (code + 256) & ~255; + map = (Unicode *)greallocn(map, mapLen, sizeof(Unicode)); + for (i = oldLen; i < mapLen; ++i) { + map[i] = 0; + } + } + if (n <= 4) { + if (sscanf(uStr, "%x", &u) != 1) { + error(-1, const_cast<char *>("Illegal entry in ToUnicode CMap")); + return; + } + map[code] = u + offset; + } else { + if (sMapLen >= sMapSize) { + sMapSize = sMapSize + 16; + sMap = (P2PCharCodeToUnicodeString *) + greallocn(sMap, sMapSize, sizeof(P2PCharCodeToUnicodeString)); + } + map[code] = 0; + sMap[sMapLen].c = code; + sMap[sMapLen].len = n / 4; + for (j = 0; j < sMap[sMapLen].len && j < maxUnicodeString; ++j) { + strncpy(uHex, uStr + j*4, 4); + uHex[4] = '\0'; + if (sscanf(uHex, "%x", &sMap[sMapLen].u[j]) != 1) { + error(-1, const_cast<char *>("Illegal entry in ToUnicode CMap")); + } + } + sMap[sMapLen].u[sMap[sMapLen].len - 1] += offset; + ++sMapLen; + } +} + +P2PCharCodeToUnicode::P2PCharCodeToUnicode() { + CharCode i; + + mapLen = 256; + map = (Unicode *)gmallocn(mapLen, sizeof(Unicode)); + for (i = 0; i < mapLen; ++i) { + map[i] = 0; + } + sMap = NULL; + sMapLen = sMapSize = 0; +} + +P2PCharCodeToUnicode::~P2PCharCodeToUnicode() { + gfree(map); + if (sMap) { + gfree(sMap); + } +} + +int P2PCharCodeToUnicode::mapToUnicode(CharCode c, Unicode *u, int size) { + int i, j; + + if (c >= mapLen) { + return 0; + } + if (map[c]) { + u[0] = map[c]; + return 1; + } + for (i = 0; i < sMapLen; ++i) { + if (sMap[i].c == c) { + for (j = 0; j < sMap[i].len && j < size; ++j) { + u[j] = sMap[i].u[j]; + } + return j; + } + } + return 0; +} --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/P2PPattern.h +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/P2PPattern.h @@ -0,0 +1,70 @@ +/* + +Copyright (c) 2006-2007, BBR Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +/* + P2PPattern.h + pdftopdf pattern object +*/ +#ifndef _P2PPATTERN_H_ +#define _P2PPATTERN_H_ + +#include "goo/gmem.h" +#include "Object.h" +#include "P2PObject.h" +#include "GfxState.h" +#include "Dict.h" +#include "XRef.h" +#include "P2POutputStream.h" +#include "P2PMatrix.h" + + +class P2PPattern: public P2PObject { +public: + P2PPattern(Object *objA, XRef *xrefA, P2PMatrix *matA); + ~P2PPattern(); + virtual void output(P2POutputStream *str, XRef *xrefA); + class OrgPattern : public P2PObject { + public: + OrgPattern(int orgNumA, int orgGenA, XRef *xref); + OrgPattern(Object *objA); + ~OrgPattern(); + void reference() { refCount++; } + int free() { return --refCount; } + GfxPattern *getPattern() { return pattern; } + Object *getOrgObject() { return &orgObj; } + private: + GfxPattern *pattern; + int refCount; + Object orgObj; + }; +private: + void outputTilingPattern(P2POutputStream *str, GfxPattern *patternA, + XRef *xref); + void outputShadingPattern(P2POutputStream *str, GfxPattern *patternA, + Object *objA, XRef *xref); + OrgPattern *pattern; + P2PMatrix mat; +}; + +#endif --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/P2PXRef.cxx +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/P2PXRef.cxx @@ -0,0 +1,159 @@ +/* + +Copyright (c) 2006-2007, BBR Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +/* + P2PXRef.cc + pdftopdf cross reference +*/ + +#include <config.h> +#include <string.h> +#include "goo/gmem.h" +#include "P2PXRef.h" +#include "P2PObject.h" +#include "Error.h" + +/* increment size for object table */ +#define INCSIZE 1024 + +P2PObject **P2PXRef::objects = 0; +int P2PXRef::objectsSize = 0; +int P2PXRef::currentNum = 1; + +void P2PXRef::put(P2PObject *obj) +{ + int num, gen; + + obj->getNum(&num,&gen); + if (num > 0) return; /* already registered */ + if (objectsSize == 0) { + /* first time, alloc table */ + objects = new P2PObject *[INCSIZE]; + objectsSize = INCSIZE; + memset(objects,0,objectsSize*sizeof(P2PObject *)); + } else if (++currentNum >= objectsSize) { + /* enlarge table */ + P2PObject **oldp = objects; + objectsSize += INCSIZE; + objects = new P2PObject *[objectsSize]; + memcpy(objects,oldp,(objectsSize-INCSIZE)*sizeof(P2PObject *)); + delete[] oldp; + } + obj->setNum(currentNum,0); + objects[currentNum] = obj; +} + +void P2PXRef::put(P2PObject *obj, P2POutputStream *str) +{ + put(obj); + obj->setOffset(str); +} + +void P2PXRef::remove(P2PObject *obj) +{ + int num, gen; + + obj->getNum(&num,&gen); + if (num > 0) { + objects[num] = 0; + } +} + +void P2PXRef::flush(P2POutputStream *str, XRef *xref) +{ + int i; + int n; + GBool f; + + /* first phase */ + do { + f = gFalse; + n = getNObjects(); + for (i = 1;i < n;i++) { + if (objects[i] != 0 && objects[i]->getOffset() < 0 + && !objects[i]->isSecondPhase()) { + objects[i]->output(str,xref); + f = gTrue; + } + } + } while (f); + /* second phase */ + do { + f = gFalse; + n = getNObjects(); + for (i = 1;i < n;i++) { + if (objects[i] != 0 && objects[i]->getOffset() < 0) { + objects[i]->output(str,xref); + f = gTrue; + } + } + } while (f); +} + +int P2PXRef::output(P2POutputStream *str) +{ + int xrefOffset = str->getPosition(); + int i; + int n = getNObjects(); + + str->puts("xref\n"); + str->printf("0 %d\n", n); + str->puts("0000000000 65535 f \n"); + for (i = 1;i < n;i++) { + int num, gen; + int offset; + + if (objects[i] == 0) { + /* freed object */ + /* this situation is error. */ + /* but continue */ + str->puts("0000000000 00000 f \n"); + error(-1,const_cast<char *>("freed object:%d found\n"),i); + } else { + objects[i]->getNum(&num,&gen); + offset = objects[i]->getOffset(); + + if (offset < 0) { + /* not output yet. error */ + error(-1,const_cast<char *>("not output object:%d found\n"),i); + } else { + str->printf("%010d %05d n \n",offset,gen); + } + } + } + return xrefOffset; +} + +void P2PXRef::clean() +{ + int i; + int n = getNObjects(); + + for (i = 1;i < n;i++) { + if (objects[i] != 0) { + delete objects[i]; + objects[i] = 0; + } + } +} --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/UGooString.h +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/UGooString.h @@ -0,0 +1,55 @@ +//======================================================================== +// +// UGooString.h +// +// Unicode string +// +// Copyright 2005 Albert Astals Cid <aacid@kde.org> +// +//======================================================================== + +#ifndef UGooString_H +#define UGooString_H + +#include "CharTypes.h" + +class GooString; + +class UGooString +{ +public: + // Create an unicode string + UGooString(Unicode *u, int l); + + // Create a unicode string from <str>. + UGooString(GooString &str); + + // Copy the unicode string + UGooString(const UGooString &str); + + // Create a unicode string from <str>. + UGooString(const char *str); + + // Destructor. + ~UGooString(); + + // Get length. + int getLength() const { return length; } + + // Compare two strings: -1:< 0:= +1:> + int cmp(UGooString *str) const; + + // get the unicode + Unicode *unicode() const { return s; } + + // get the const char* + char *getCString() const; + +private: + void initChar(GooString &str); + + int length; + Unicode *s; +}; + +#endif --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/P2PObject.cxx +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/P2PObject.cxx @@ -0,0 +1,117 @@ +/* + +Copyright (c) 2006-2007, BBR Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +/* + P2PObject.cc + pdftopdf Object +*/ + +#include <config.h> +#include <string.h> +#include "goo/gmem.h" +#include "P2PObject.h" +#include "P2PXRef.h" + +/* orginal number hash table size. should be 2^n */ +#define ORGTABLESIZE 4096 + +P2PObject **P2PObject::orgTable = 0; + +int P2PObject::hash(int orgNumA, int orgGenA) +{ + return orgNumA & (ORGTABLESIZE-1); +} + +void P2PObject::put() +{ + if (orgTable == 0) { + /* first time, alloc table */ + orgTable = new P2PObject *[ORGTABLESIZE]; + memset(orgTable,0,ORGTABLESIZE*sizeof(P2PObject *)); + } + + if (orgNum > 0 && orgGen >=0) { + /* put this into hashtable */ + int hv = hash(orgNum, orgGen); + P2PObject **p; + + for (p = &orgTable[hv];*p != 0;p = &((*p)->next)); + *p = this; + } +} + +void P2PObject::remove() +{ + if (orgNum > 0 && orgGen >=0) { + /* remove this from hashtable */ + int hv = hash(orgNum, orgGen); + P2PObject **p; + + for (p = &orgTable[hv];*p != 0;p = &((*p)->next)) { + if (*p == this) { + *p = next; + next = 0; + break; + } + } + } +} + +P2PObject *P2PObject::find(int orgNumA, int orgGenA) +{ + if (orgNumA > 0 && orgGenA >=0) { + /* remove this from hashtable */ + int hv = hash(orgNumA, orgGenA); + P2PObject *p; + + for (p = orgTable[hv];p != 0;p = p->next) { + if (p->orgNum == orgNumA && p->orgGen == orgGenA) { + return p; + } + } + } + return 0; +} + +void P2PObject::outputBegin(P2POutputStream *str) +{ + int num, gen; + + P2PXRef::put(this,str); + getNum(&num,&gen); + str->printf("%d %d obj\n",num,gen); +} + +void P2PObject::outputEnd(P2POutputStream *str) +{ + str->puts("endobj\n"); +} + +void P2PObject::outputRef(P2POutputStream *str) +{ + int num, gen; + + getNum(&num,&gen); + str->printf("%d %d R",num,gen); +} --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/P2PPage.cxx +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/P2PPage.cxx @@ -0,0 +1,727 @@ +/* + +Copyright (c) 2006-2007, BBR Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +/* + P2PPage.cc + pdftopdf page +*/ + +#include <config.h> +#include "goo/gmem.h" +#include "P2PPage.h" +#include "P2PPageTree.h" +#include "P2POutput.h" +#include "P2PGfx.h" +#include "P2PDoc.h" +#include "P2PFont.h" + +#define NUP_MARGIN 3 +#define NUP_PAGE_MARGIN 4 + + +/* Constructor */ +P2PPage::P2PPage(Page *orgPageA, XRef *xrefA) +{ + numOrgPages = 1; + orgPages = new OrgPage [1]; + orgPages[0].page = orgPageA; + + xref = xrefA; + mediaBox = *orgPageA->getMediaBox(); + cropBox = *orgPageA->getCropBox(); + haveCropBox = orgPageA->isCropped(); + bleedBox = *orgPageA->getBleedBox(); + trimBox = *orgPageA->getTrimBox(); + artBox = *orgPageA->getArtBox(); + + /* when 0, use original resource dictionary of orgPages[0] */ + resources = 0; +} + +/* Constructor for a empty page */ +P2PPage::P2PPage(PDFRectangle *mediaBoxA, XRef *xrefA) +{ + numOrgPages = 1; + orgPages = new OrgPage [1]; + orgPages[0].page = 0; + + xref = xrefA; + if (mediaBoxA != 0) { + mediaBox = *mediaBoxA; + } else { + mediaBox.x2 = mediaBox.y2 = 1; + } + haveCropBox = gFalse; + bleedBox = mediaBox; + trimBox = mediaBox; + artBox = mediaBox; + + /* when 0, use original resource dictionary of orgPages[0] */ + resources = 0; +} + +void P2PPage::nupCalcLayout(int n, unsigned int layout, PDFRectangle *box, + PDFRectangle *rects) +{ + double aw = box->x2 - box->x1; + double ah = box->y2 - box->y1; + int nx, ny; + int *nxp, *nyp; + double advx, advy, sx, sy, x, y; + double w,h; + int i,ix,iy; + + if (aw > ah){ + /* landscape */ + nxp = &ny; + nyp = &nx; + } else { + /* portlate */ + nxp = &nx; + nyp = &ny; + } + /* should be h >= w here */ + switch (n) { + case 2: + *nxp = 1; + *nyp = 2; + break; + case 4: + *nxp = 2; + *nyp = 2; + break; + case 6: + *nxp = 2; + *nyp = 3; + break; + case 8: + *nxp = 2; + *nyp = 4; + break; + case 9: + *nxp = 3; + *nyp = 3; + break; + default: + case 16: + *nxp = 4; + *nyp = 4; + break; + } + w = (box->x2 - box->x1)/nx; + h = (box->y2 - box->y1)/ny; + if ((layout & PDFTOPDF_LAYOUT_NEGATEX) != 0) { + advx = -w; + sx = box->x2 + advx; + } else { + advx = w; + sx = box->x1; + } + if ((layout & PDFTOPDF_LAYOUT_NEGATEY) != 0) { + advy = -h; + sy = box->y2 + advy; + } else { + advy = h; + sy = box->y1; + } + if ((layout & PDFTOPDF_LAYOUT_VERTICAL) != 0) { + i = 0; + for (x = sx, ix = 0;ix < nx;ix++) { + for (y = sy, iy = 0;iy < ny;iy++) { + rects[i].x1 = x+NUP_MARGIN; + rects[i].x2 = x+w-NUP_MARGIN; + rects[i].y1 = y+NUP_MARGIN; + rects[i].y2 = y+h-NUP_MARGIN; + i++; + y += advy; + } + x += advx; + } + } else { + i = 0; + for (y = sy, iy = 0;iy < ny;iy++) { + for (x = sx, ix = 0;ix < nx;ix++) { + rects[i].x1 = x+NUP_MARGIN; + rects[i].x2 = x+w-NUP_MARGIN; + rects[i].y1 = y+NUP_MARGIN; + rects[i].y2 = y+h-NUP_MARGIN; + i++; + x += advx; + } + y += advy; + } + } +} + +/* Construct nup page */ +P2PPage::P2PPage(int n, P2PPage **pages, int len, PDFRectangle *box, + unsigned int borderFlagA, + unsigned int layout, XRef *xrefA, int xpos, int ypos) +{ + int i; + PDFRectangle rects[16]; + + xref = xrefA; + numOrgPages = len; + orgPages = new OrgPage [len]; + mediaBox = *box; + cropBox = mediaBox; + haveCropBox = gFalse; + bleedBox = cropBox; + trimBox = cropBox; + artBox = cropBox; + + if (n == 8 || n == 6 || n == 2) { + /* Rotating is reqiured, layout change is needed. + rotating is done in fit method, only change layout here */ + unsigned int t; + + t = layout ^ (PDFTOPDF_LAYOUT_NEGATEX | PDFTOPDF_LAYOUT_VERTICAL); + /* swap x and y */ + layout = ((t << 1) & 2) | ((t >> 1) & 1) | (t & 4); + } + nupCalcLayout(n,layout,&mediaBox,rects); + resources = new P2PResources(xref); + for (i = 0;i < len;i++) { + PDFRectangle rBox; + + orgPages[i] = pages[i]->orgPages[0]; /* copy */ + orgPages[i].frame = rects[i]; + orgPages[i].borderFlag = borderFlagA; + /* fixup rect to fit inner rectangle */ + rects[i].x1 += NUP_PAGE_MARGIN; + rects[i].y1 += NUP_PAGE_MARGIN; + rects[i].x2 -= NUP_PAGE_MARGIN; + rects[i].y2 -= NUP_PAGE_MARGIN; + + /* do fitting page contents */ + orgPages[i].fit(&rects[i],&(pages[i]->mediaBox),1.0,&rBox); + orgPages[i].position(&rects[i],&rBox,xpos,ypos); + + /* merge resources */ + if (pages[i]->resources != 0) { + orgPages[i].mappingTable + = resources->merge(pages[i]->resources); + } else if (orgPages[i].page != 0) { + orgPages[i].mappingTable + = resources->merge(orgPages[i].page->getResourceDict()); + } + } +} + +P2PPage::~P2PPage() +{ + if (resources != 0) { + delete resources; + resources = 0; + } + if (orgPages != 0) { + delete[] orgPages; + } +} + +void P2PPage::outputPDFRectangle(PDFRectangle *rect, P2POutputStream *str) +{ + str->printf("[ %f %f %f %f ]",rect->x1,rect->y1,rect->x2,rect->y2); +} + +void P2PPage::outputPDFRectangleForPath(PDFRectangle *rect, P2POutputStream *str) +{ + double x,y,w,h; + + if (rect->x1 > rect->x2) { + x = rect->x2; + w = rect->x1 - rect->x2; + } else { + x = rect->x1; + w = rect->x2 - rect->x1; + } + if (rect->y1 > rect->y2) { + y = rect->y2; + h = rect->y1 - rect->y2; + } else { + y = rect->y1; + h = rect->y2 - rect->y1; + } + str->printf("%f %f %f %f",x,y,w,h); +} + +void P2PPage::transPDFRectangle(PDFRectangle *rect, P2PMatrix *matA) +{ + matA->apply(rect->x1, rect->y1, &(rect->x1), &(rect->y1)); + matA->apply(rect->x2, rect->y2, &(rect->x2), &(rect->y2)); +} + +void P2PPage::outputSelf(P2POutputStream *str, P2PPageTree *tree, + P2PObject *copiedObj, P2PFontResource *fontResource) +{ + if (copiedObj == 0) { + outputBegin(str); + } else { + copiedObj->outputBegin(str); + } + str->puts("<< /Type /Page /Parent "); + tree->outputRef(str); + str->puts("\n/MediaBox "); + outputPDFRectangle(&mediaBox,str); + if (haveCropBox && !eqPDFRectangle(&mediaBox,&cropBox)) { + str->puts("\n/CropBox "); + outputPDFRectangle(&cropBox,str); + } + if (!eqPDFRectangle(&cropBox,&bleedBox)) { + str->puts("\n/BleedBox "); + outputPDFRectangle(&bleedBox,str); + } + if (eqPDFRectangle(&trimBox,&artBox)) { + str->puts("\n/TrimBox "); + outputPDFRectangle(&trimBox,str); + } else { + str->puts("\n/ArtBox "); + outputPDFRectangle(&artBox,str); + } + + if (numOrgPages > 1 || orgPages[0].page != 0) { + /* not empty page */ + P2PXRef::put(&contents); + str->puts("\n/Contents "); + contents.outputRef(str); + + str->puts("\n/Resources "); + if (resources != 0) { + resources->output(str,fontResource); + } else { + Dict *dict = orgPages[0].page->getResourceDict(); + + if (dict != 0) { + if (fontResource != 0 && fontResource->getNDicts() > 0) { + /* replace font resource */ + const char *p = "Font"; + P2PObject *objp = fontResource; + + P2POutput::outputDict(dict,&p,&objp,1,str,xref); + } else { + P2POutput::outputDict(dict,str,xref); + } + } else { + str->puts("<< >>"); + } + } + } else { + /* empty page */ + str->puts("\n/Resources << >>"); + } + str->puts(" >>\n"); + if (copiedObj == 0) { + outputEnd(str); + } else { + copiedObj->outputEnd(str); + } +} + +void P2PPage::outputContents(P2POutputStream *str, P2PFontResource *fontResource) +{ + int i; + int start; + int len; + Object lenobj; + + /* if empty, do nothing */ + if (orgPages[0].page == 0) return; + + P2PGfx output(xref,str,fontResource,resources); + P2PObj *pobj = new P2PObj(); + + contents.outputBegin(str); + str->puts("<< /Length "); + P2PXRef::put(pobj); + pobj->outputRef(str); + if (P2PDoc::options.contentsCompress && str->canDeflate()) { + str->puts(" /Filter /FlateDecode "); + } + str->puts(" >>\n"); + str->puts("stream\n"); + start = str->getPosition(); + if (P2PDoc::options.contentsCompress) str->startDeflate(); + for (i = 0;i < numOrgPages;i++) { + Object contentsObj; + GBool save; + + save = orgPages[i].clipFrame || orgPages[i].trans; + if (save) { + str->puts("q "); + } + if (orgPages[i].page->getContents(&contentsObj) != 0 + && !contentsObj.isNull()) { + if (orgPages[i].clipFrame) { + outputPDFRectangleForPath(&orgPages[i].frame,str); + str->puts(" re W n "); + } + if (orgPages[i].borderFlag != 0) { + PDFRectangle inner = *(orgPages[i].page->getMediaBox()); + PDFRectangle ident(0,0,1,1); + double xs,ys; + + transPDFRectangle(&ident,&(orgPages[i].mat)); + xs = ident.x2-ident.x1 > 0 ? 1: -1; + ys = ident.y2-ident.y1 > 0 ? 1: -1; + + str->puts("q "); + if ((orgPages[i].borderFlag & PDFTOPDF_BORDERHAIRLINE) != 0) { + str->puts("0 w "); + } + if ((orgPages[i].borderFlag & PDFTOPDF_BORDERDOUBLE) != 0) { + PDFRectangle outer = *(orgPages[i].page->getMediaBox()); + + transPDFRectangle(&outer,&(orgPages[i].mat)); + outer.x1 -= 3*xs; + outer.y1 -= 3*ys; + outer.x2 += 3*xs; + outer.y2 += 3*ys; + outputPDFRectangleForPath(&outer,str); + str->puts(" re S "); + } + + transPDFRectangle(&inner,&(orgPages[i].mat)); + inner.x1 -= 1*xs; + inner.y1 -= 1*ys; + inner.x2 += 1*xs; + inner.y2 += 1*ys; + outputPDFRectangleForPath(&inner,str); + str->puts(" re S Q "); + } + + if (orgPages[i].trans) { + orgPages[i].mat.output(str); + str->puts(" cm "); + } + + output.outputContents(&contentsObj,orgPages[i].mappingTable, + orgPages[i].page->getResourceDict(),&(orgPages[i].mat)); + contentsObj.free(); + } + if (save) { + str->puts(" Q\n"); + } + } + if (P2PDoc::options.contentsCompress) str->endDeflate(); + len = str->getPosition()-start; + str->puts("\nendstream\n"); + contents.outputEnd(str); + /* set length object value */ + lenobj.initInt(len); + pobj->setObj(&lenobj); + lenobj.free(); + pobj->output(str,xref); +} + +void P2PPage::output(P2POutputStream *str, P2PPageTree *tree, P2PObject *copiedObj) +{ + P2PFontResource fontResource; + P2PFontResource *fr = 0; + + if (resources == 0 && orgPages[0].page != 0/* not empty page */) { + /* make P2PResource for pattern handling */ + /* when number-upped, page must have P2PResource already. + so, we handling one page case */ + resources = new P2PResources(xref); + orgPages[0].mappingTable + = resources->merge(orgPages[0].page->getResourceDict()); + } + /* setup pattern dict for translation */ + if (resources != 0) resources->setupPattern(); + if (copiedObj == 0) { + if (P2PDoc::options.fontEmbedding && orgPages[0].page != 0) { + /* only not empty page */ + if (resources != 0) { + fontResource.setup(resources,xref); + } else { + fontResource.setup(orgPages[0].page->getResourceDict(),xref); + } + fr = &fontResource; + } + } + outputContents(str,fr); + outputSelf(str,tree,copiedObj,fr); +} + +void P2PPage::fit(PDFRectangle *box, double zoom) +{ + PDFRectangle rBox; + /* only first orginal page is fitted */ + orgPages[0].fit(box,&mediaBox,zoom,&rBox); + + mediaBox = rBox; + cropBox = mediaBox; + haveCropBox = gFalse; + bleedBox = cropBox; + trimBox = cropBox; + artBox = cropBox; + +} + +void P2PPage::mirror() +{ + P2PMatrix mat(-1,0,0,1,mediaBox.x2-mediaBox.x1,0); + + /* only first orginale page is mirrored */ + orgPages[0].mat.trans(&mat); + orgPages[0].trans = gTrue; +} + +void P2PPage::rotate(int orientation) +{ + PDFRectangle rBox; + + /* only first orginal page */ + orgPages[0].rotate(&mediaBox,orientation,&rBox); + + mediaBox = rBox; + cropBox = mediaBox; + haveCropBox = gFalse; + bleedBox = cropBox; + trimBox = cropBox; + artBox = cropBox; +} + +void P2PPage::position(PDFRectangle *box, int xpos, int ypos) +{ + /* only first orginal page */ + orgPages[0].position(box,&mediaBox,xpos,ypos); + + mediaBox = *box; + cropBox = mediaBox; + haveCropBox = gFalse; + bleedBox = cropBox; + trimBox = cropBox; + artBox = cropBox; +} + +void P2PPage::scale(double zoom) +{ + PDFRectangle rBox; + + /* only first orginal page */ + orgPages[0].scale(&mediaBox,zoom,&rBox); + + mediaBox = rBox; + cropBox = mediaBox; + haveCropBox = gFalse; + bleedBox = cropBox; + trimBox = cropBox; + artBox = cropBox; +} + +P2PPage::OrgPage::OrgPage() +{ + page = 0; + mappingTable = 0; + trans = gFalse; + borderFlag = 0; + clipFrame = gFalse; +} + +P2PPage::OrgPage::~OrgPage() +{ + if (mappingTable != 0) { + delete mappingTable; + } +} + +void P2PPage::OrgPage::position(PDFRectangle *box, PDFRectangle *oldBox, + int xpos, int ypos) +{ + double mx,my; + + mx = box->x1 - oldBox->x1; + my = box->y1 - oldBox->y1; + switch (xpos) { + default: + case 0: + /* center */ + mx += (box->x2-box->x1 - (oldBox->x2-oldBox->x1))/2; + break; + case -1: + /* left */ + break; + case 1: + /* right */ + mx += (box->x2-box->x1 - (oldBox->x2-oldBox->x1)); + break; + } + switch (ypos) { + default: + case 0: + /* center */ + my += (box->y2-box->y1 - (oldBox->y2-oldBox->y1))/2; + break; + case -1: + /* bottom */ + break; + case 1: + /* top */ + my += (box->y2-box->y1 - (oldBox->y2-oldBox->y1)); + break; + } + mat.move(mx,my); + trans = gTrue; +} + +void P2PPage::OrgPage::fit(PDFRectangle *box, PDFRectangle *oldBox, + double zoom, PDFRectangle *rBox) +{ + double w,h,ow,oh; + GBool landscape, oLandscape; + double scalex; + double scaley; + + w = box->x2-box->x1; + if (w < 0) w = -w; + h = box->y2-box->y1; + if (h < 0) h = -h; + ow = oldBox->x2-oldBox->x1; + if (ow < 0) ow = -ow; + oh = oldBox->y2-oldBox->y1; + if (oh < 0) oh = -oh; + landscape = (w > h); + oLandscape = (ow > oh); + if (landscape != oLandscape) { + /* rotate */ + mat.move(-oldBox->x1,-oldBox->y1); + mat.rotate(-90); + mat.move(0,ow); + if (rBox != 0) { + rBox->x1 = rBox->y1 = 0; + rBox->x2 = oldBox->y2; + rBox->y2 = oldBox->x2; + } + + scalex = w/oh*zoom; + scaley = h/ow*zoom; + if (scalex > scaley) { + mat.scale(scaley); + + if (rBox != 0) { + rBox->x2 *= scaley; + rBox->y2 *= scaley; + } + } else { + mat.scale(scalex); + + if (rBox != 0) { + rBox->x2 *= scalex; + rBox->y2 *= scalex; + } + } + mat.move(box->x1,box->y1); + if (rBox != 0) { + rBox->x1 += box->x1; + rBox->x2 += box->x1; + rBox->y1 += box->y1; + rBox->y2 += box->y1; + } + } else { + double mx, my; + + scalex = w/ow*zoom; + scaley = h/oh*zoom; + if (scalex > scaley) { + mat.scale(scaley); + if (rBox != 0) { + rBox->x1 = oldBox->x1*scaley; + rBox->y1 = oldBox->y1*scaley; + rBox->x2 = oldBox->x2*scaley; + rBox->y2 = oldBox->y2*scaley; + } + } else { + mat.scale(scalex); + if (rBox != 0) { + rBox->x1 = oldBox->x1*scalex; + rBox->y1 = oldBox->y1*scalex; + rBox->x2 = oldBox->x2*scalex; + rBox->y2 = oldBox->y2*scalex; + } + } + mx = -rBox->x1+box->x1; + my = -rBox->y1+box->y1; + mat.move(mx,my); + if (rBox != 0) { + rBox->x1 += mx; + rBox->x2 += mx; + rBox->y1 += my; + rBox->y2 += my; + } + } + trans = gTrue; +} + +void P2PPage::OrgPage::rotate(PDFRectangle *box, + int orientation, PDFRectangle *rBox) +{ + PDFRectangle nbox; + double t; + + /* move to origin point */ + mat.move(-box->x1, -box->y1); + rBox->x1 = rBox->y1 = 0; + rBox->x2 = box->x2-box->x1; + rBox->y2 = box->y2-box->y1; + + switch (orientation) { + case 0: + /* 0 degree */ + break; + case 1: + /* 90 degree */ + mat.rotate(90); + mat.move(rBox->y2,0); + t = rBox->y2; + rBox->y2 = rBox->x2; + rBox->x2 = t; + break; + case 2: + /* 180 degree */ + mat.rotate(180); + mat.move(rBox->x2,rBox->y2); + break; + case 3: + /* -90 degree */ + mat.rotate(270); + mat.move(0,rBox->x2); + t = rBox->y2; + rBox->y2 = rBox->x2; + rBox->x2 = t; + break; + } + trans = gTrue; + return; +} + +void P2PPage::OrgPage::scale(PDFRectangle *box, double zoom, PDFRectangle *rBox) +{ + mat.scale(zoom,zoom); + rBox->x1 = box->x1*zoom; + rBox->y1 = box->y1*zoom; + rBox->x2 = box->x2*zoom; + rBox->y2 = box->y2*zoom; +} --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/parseargs.c +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/parseargs.c @@ -0,0 +1,190 @@ +/* + * parseargs.h + * + * Command line argument parser. + * + * Copyright 1996-2003 Glyph & Cog, LLC + */ + +#include <stdio.h> +#include <stddef.h> +#include <string.h> +#include <stdlib.h> +#include <ctype.h> +#include "parseargs.h" + +static ArgDesc *findArg(ArgDesc *args, char *arg); +static GBool grabArg(ArgDesc *arg, int i, int *argc, char *argv[]); + +GBool parseArgs(ArgDesc *args, int *argc, char *argv[]) { + ArgDesc *arg; + int i, j; + GBool ok; + + ok = gTrue; + i = 1; + while (i < *argc) { + if (!strcmp(argv[i], "--")) { + --*argc; + for (j = i; j < *argc; ++j) + argv[j] = argv[j+1]; + break; + } else if ((arg = findArg(args, argv[i]))) { + if (!grabArg(arg, i, argc, argv)) + ok = gFalse; + } else { + ++i; + } + } + return ok; +} + +void printUsage(char *program, char *otherArgs, ArgDesc *args) { + ArgDesc *arg; + char *typ; + int w, w1; + + w = 0; + for (arg = args; arg->arg; ++arg) { + if ((w1 = strlen(arg->arg)) > w) + w = w1; + } + + fprintf(stderr, "Usage: %s [options]", program); + if (otherArgs) + fprintf(stderr, " %s", otherArgs); + fprintf(stderr, "\n"); + + for (arg = args; arg->arg; ++arg) { + fprintf(stderr, " %s", arg->arg); + w1 = 9 + w - strlen(arg->arg); + switch (arg->kind) { + case argInt: + case argIntDummy: + typ = " <int>"; + break; + case argFP: + case argFPDummy: + typ = " <fp>"; + break; + case argString: + case argStringDummy: + typ = " <string>"; + break; + case argFlag: + case argFlagDummy: + default: + typ = ""; + break; + } + fprintf(stderr, "%-*s", w1, typ); + if (arg->usage) + fprintf(stderr, ": %s", arg->usage); + fprintf(stderr, "\n"); + } +} + +static ArgDesc *findArg(ArgDesc *args, char *arg) { + ArgDesc *p; + + for (p = args; p->arg; ++p) { + if (p->kind < argFlagDummy && !strcmp(p->arg, arg)) + return p; + } + return NULL; +} + +static GBool grabArg(ArgDesc *arg, int i, int *argc, char *argv[]) { + int n; + int j; + GBool ok; + + ok = gTrue; + n = 0; + switch (arg->kind) { + case argFlag: + *(GBool *)arg->val = gTrue; + n = 1; + break; + case argInt: + if (i + 1 < *argc && isInt(argv[i+1])) { + *(int *)arg->val = atoi(argv[i+1]); + n = 2; + } else { + ok = gFalse; + n = 1; + } + break; + case argFP: + if (i + 1 < *argc && isFP(argv[i+1])) { + *(double *)arg->val = atof(argv[i+1]); + n = 2; + } else { + ok = gFalse; + n = 1; + } + break; + case argString: + if (i + 1 < *argc) { + strncpy((char *)arg->val, argv[i+1], arg->size - 1); + ((char *)arg->val)[arg->size - 1] = '\0'; + n = 2; + } else { + ok = gFalse; + n = 1; + } + break; + default: + fprintf(stderr, "Internal error in arg table\n"); + n = 1; + break; + } + if (n > 0) { + *argc -= n; + for (j = i; j < *argc; ++j) + argv[j] = argv[j+n]; + } + return ok; +} + +GBool isInt(char *s) { + if (*s == '-' || *s == '+') + ++s; + while (isdigit(*s)) + ++s; + if (*s) + return gFalse; + return gTrue; +} + +GBool isFP(char *s) { + int n; + + if (*s == '-' || *s == '+') + ++s; + n = 0; + while (isdigit(*s)) { + ++s; + ++n; + } + if (*s == '.') + ++s; + while (isdigit(*s)) { + ++s; + ++n; + } + if (n > 0 && (*s == 'e' || *s == 'E')) { + ++s; + if (*s == '-' || *s == '+') + ++s; + n = 0; + if (!isdigit(*s)) + return gFalse; + do { + ++s; + } while (isdigit(*s)); + } + if (*s) + return gFalse; + return gTrue; +} --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/P2POutput.cxx +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/P2POutput.cxx @@ -0,0 +1,294 @@ +/* + +Copyright (c) 2006-2007, BBR Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +/* + P2POutput.cc + pdftopdf output pdf routines +*/ + +#include <config.h> +#include "goo/gmem.h" +#include "UGooString.h" +#include "P2POutput.h" +#include "P2PObject.h" +#include <ctype.h> +#include "Error.h" + +void P2POutput::outputDict(Dict *dict, const char **keys, + P2PObject **objs, int len, P2POutputStream *str, XRef *xref) +{ + int i; + int n = dict->getLength(); + int j; + + str->puts("<<"); + for (i = 0;i < n;i++) { +#ifdef HAVE_UGOOSTRING_H + char *key = dict->getKey(i)->getCString(); +#else + char *key = dict->getKey(i); +#endif + Object obj; + + for (j = 0;j < len;j++) { + if (strcmp(keys[j],key) == 0) { + goto next_key; + } + } + str->putchar('\n'); + outputName(key,str); + str->putchar(' '); + dict->getValNF(i,&obj); + outputObject(&obj,str,xref); + obj.free(); +next_key:; +#ifdef HAVE_UGOOSTRING_H + delete[] key; +#endif + } + for (j = 0;j < len;j++) { + int num, gen; + + str->putchar('\n'); + outputName(keys[j],str); + str->putchar(' '); + objs[j]->getNum(&num,&gen); + if (num > 0) { + objs[j]->outputRef(str); + } else { + objs[j]->output(str,xref); + } + } + str->puts("\n>>"); +} + +void P2POutput::outputDict(Dict *dict, P2POutputStream *str, XRef *xref) +{ + int i; + int n = dict->getLength(); + + str->puts("<< "); + for (i = 0;i < n;i++) { +#ifdef HAVE_UGOOSTRING_H + char *key = dict->getKey(i)->getCString(); +#else + char *key = dict->getKey(i); +#endif + Object obj; + + outputName(key,str); + str->putchar(' '); + dict->getValNF(i,&obj); + outputObject(&obj,str,xref); + obj.free(); + str->putchar('\n'); +#ifdef HAVE_UGOOSTRING_H + delete[] key; +#endif + } + str->puts(">>"); +} + +void P2POutput::outputStream(Stream *stream, P2POutputStream *str, XRef *xref) +{ + Dict *dict; + int len; + int c; + +#ifdef HAVE_GETUNDECODEDSTREAM + stream = stream->getUndecodedStream(); +#else + stream = stream->getBaseStream(); +#endif + dict = stream->getDict(); + /* output dictionary part */ + outputDict(dict,str,xref); + str->puts("\nstream\n"); + stream->reset(); + for (len = 0;(c = stream->getChar()) != EOF;len++) { + str->putchar(c); + } + str->puts("endstream"); +} + +void P2POutput::outputRef(Ref *ref, P2POutputStream *str, XRef *xref) +{ + P2PObject *p2pobj; + Object obj; + + if ((p2pobj = P2PObject::find(ref->num,ref->gen)) == 0) { + xref->fetch(ref->num,ref->gen,&obj); + p2pobj = new P2PObj(&obj); + obj.free(); + } + P2PXRef::put(p2pobj); + p2pobj->outputRef(str); +} + +void P2POutput::outputArray(Array *array, P2POutputStream *str, XRef *xref, + Dict *mapDict) +{ + int i; + int n = array->getLength(); + + str->puts("[ "); + for (i = 0;i < n;i++) { + Object obj; + + array->getNF(i,&obj); + outputObject(&obj,str,xref,mapDict); + obj.free(); + str->putchar('\n'); + } + str->puts("]"); +} + +void P2POutput::outputName(const char *name, P2POutputStream *str, Dict *mapDict) +{ + const char *p; +#ifdef HAVE_UGOOSTRING_H + UGooString nameStr(name); +#else + char *nameStr = const_cast<char *>(name); +#endif + Object obj; + + if (mapDict != 0 && mapDict->lookupNF(nameStr,&obj) != 0) { + if (obj.isName()) { + /* map name */ + name = obj.getName(); + } + } + str->putchar('/'); + for (p = name;*p != '\0';p++) { + if (*p >= 33 && *p <= 126 && *p != '/' && *p != '#') { + str->putchar(*p); + } else { + str->printf("#%02x",*p & 0xff); + } + } + obj.free(); +} + +void P2POutput::outputString(const char *s, int len, P2POutputStream *str) +{ + const char *p = s; + int i; + + str->putchar('('); + for (i = 0;i < len;i++,p++) { + switch (*p) { + case '\n': + str->puts("\\n"); + break; + case '\r': + str->puts("\\r"); + break; + case '\t': + str->puts("\\t"); + break; + case '\b': + str->puts("\\b"); + break; + case '\f': + str->puts("\\f"); + break; + case '(': + str->puts("\\("); + break; + case ')': + str->puts("\\)"); + break; + case '\\': + str->puts("\\\\"); + break; + default: + if (isprint(*p)) { + str->putchar(*p); + } else { + str->printf("\\%03o",*p & 0xff); + } + break; + } + } + str->putchar(')'); +} + +void P2POutput::outputObject(Object *obj, P2POutputStream *str, XRef *xref, + Dict *mapDict) +{ + switch (obj->getType()) { + case objBool: + if (obj->getBool()) { + str->puts("true"); + } else { + str->puts("false"); + } + break; + case objInt: + str->printf("%d",obj->getInt()); + break; + case objReal: + str->printf("%f",obj->getReal()); + break; + case objString: + outputString(obj->getString()->getCString(), + obj->getString()->getLength(), str); + break; + case objName: + outputName(obj->getName(),str,mapDict); + break; + case objNull: + str->puts("null"); + break; + case objArray: + outputArray(obj->getArray(),str,xref,mapDict); + break; + case objDict: + outputDict(obj->getDict(),str,xref); + break; + case objStream: + outputStream(obj->getStream(),str,xref); + break; + case objRef: + { + Ref ref = obj->getRef(); + + outputRef(&ref,str,xref); + } + break; + case objCmd: + str->puts(obj->getCmd()); + break; + case objError: + str->puts("<error>"); + break; + case objEOF: + str->puts("<EOF>"); + break; + case objNone: + str->puts("<none>"); + break; + } +} --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/P2PCMap.cxx +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/P2PCMap.cxx @@ -0,0 +1,444 @@ +//======================================================================== +// +// P2PCMap.cc +// +// Copyright 2001-2003 Glyph & Cog, LLC +// 2007 Modefied by BBR Inc. +// +//======================================================================== + +#include <config.h> + +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <ctype.h> +#include "goo/gmem.h" +#include "goo/gfile.h" +#include "goo/GooString.h" +#include "Error.h" +#include "GlobalParams.h" +#include "PSTokenizer.h" +#include "P2PCMap.h" + +//------------------------------------------------------------------------ + +struct CMapVectorEntry { + GBool isVector; + union { + CMapVectorEntry *vector; + CID cid; + }; +}; + +//------------------------------------------------------------------------ + +static int getCharFromFile(void *data) { + return fgetc((FILE *)data); +} + +//------------------------------------------------------------------------ + +P2PCMap *P2PCMap::parse(P2PCMapCache *cache, GooString *collectionA, + GooString *cMapNameA) { + FILE *f; + P2PCMap *cmap; + PSTokenizer *pst; + char tok1[256], tok2[256], tok3[256]; + int n1, n2, n3; + Guint start, end, code; + + if (!(f = globalParams->findCMapFile(collectionA, cMapNameA))) { + + // Check for an identity CMap. + if (!cMapNameA->cmp("Identity") || !cMapNameA->cmp("Identity-H")) { + return new P2PCMap(collectionA->copy(), cMapNameA->copy(), 0); + } + if (!cMapNameA->cmp("Identity-V")) { + return new P2PCMap(collectionA->copy(), cMapNameA->copy(), 1); + } + + error(-1, + const_cast<char *>("Couldn't find '%s' CMap file for '%s' collection"), + cMapNameA->getCString(), collectionA->getCString()); + return NULL; + } + + cmap = new P2PCMap(collectionA->copy(), cMapNameA->copy()); + + pst = new PSTokenizer(&getCharFromFile, f); + pst->getToken(tok1, sizeof(tok1), &n1); + while (pst->getToken(tok2, sizeof(tok2), &n2)) { + if (!strcmp(tok2, "usecmap")) { + if (tok1[0] == '/') { + cmap->useCMap(cache, tok1 + 1); + } + pst->getToken(tok1, sizeof(tok1), &n1); + } else if (!strcmp(tok1, "/WMode")) { + cmap->wMode = atoi(tok2); + pst->getToken(tok1, sizeof(tok1), &n1); + } else if (!strcmp(tok2, "begincodespacerange")) { + while (pst->getToken(tok1, sizeof(tok1), &n1)) { + if (!strcmp(tok1, "endcodespacerange")) { + break; + } + if (!pst->getToken(tok2, sizeof(tok2), &n2) || + !strcmp(tok2, "endcodespacerange")) { + error(-1, const_cast<char *>("Illegal entry in codespacerange block in CMap")); + break; + } + if (tok1[0] == '<' && tok2[0] == '<' && + n1 == n2 && n1 >= 4 && (n1 & 1) == 0) { + tok1[n1 - 1] = tok2[n1 - 1] = '\0'; + sscanf(tok1 + 1, "%x", &start); + sscanf(tok2 + 1, "%x", &end); + n1 = (n1 - 2) / 2; + cmap->addCodeSpace(cmap->vector, start, end, n1); + } + } + pst->getToken(tok1, sizeof(tok1), &n1); + } else if (!strcmp(tok2, "begincidchar")) { + while (pst->getToken(tok1, sizeof(tok1), &n1)) { + if (!strcmp(tok1, "endcidchar")) { + break; + } + if (!pst->getToken(tok2, sizeof(tok2), &n2) || + !strcmp(tok2, "endcidchar")) { + error(-1, const_cast<char *>("Illegal entry in cidchar block in CMap")); + break; + } + if (!(tok1[0] == '<' && tok1[n1 - 1] == '>' && + n1 >= 4 && (n1 & 1) == 0)) { + error(-1, const_cast<char *>("Illegal entry in cidchar block in CMap")); + continue; + } + tok1[n1 - 1] = '\0'; + if (sscanf(tok1 + 1, "%x", &code) != 1) { + error(-1, const_cast<char *>("Illegal entry in cidchar block in CMap")); + continue; + } + n1 = (n1 - 2) / 2; + cmap->addCIDs(code, code, n1, (CID)atoi(tok2)); + } + pst->getToken(tok1, sizeof(tok1), &n1); + } else if (!strcmp(tok2, "begincidrange")) { + while (pst->getToken(tok1, sizeof(tok1), &n1)) { + if (!strcmp(tok1, "endcidrange")) { + break; + } + if (!pst->getToken(tok2, sizeof(tok2), &n2) || + !strcmp(tok2, "endcidrange") || + !pst->getToken(tok3, sizeof(tok3), &n3) || + !strcmp(tok3, "endcidrange")) { + error(-1, const_cast<char *>("Illegal entry in cidrange block in CMap")); + break; + } + if (tok1[0] == '<' && tok2[0] == '<' && + n1 == n2 && n1 >= 4 && (n1 & 1) == 0) { + tok1[n1 - 1] = tok2[n1 - 1] = '\0'; + sscanf(tok1 + 1, "%x", &start); + sscanf(tok2 + 1, "%x", &end); + n1 = (n1 - 2) / 2; + cmap->addCIDs(start, end, n1, (CID)atoi(tok3)); + } + } + pst->getToken(tok1, sizeof(tok1), &n1); + } else { + strcpy(tok1, tok2); + } + } + delete pst; + + fclose(f); + + return cmap; +} + +P2PCMap::P2PCMap(GooString *collectionA, GooString *cMapNameA) { + int i; + + collection = collectionA; + cMapName = cMapNameA; + wMode = 0; + vector = (CMapVectorEntry *)gmallocn(256, sizeof(CMapVectorEntry)); + for (i = 0; i < 256; ++i) { + vector[i].isVector = gFalse; + vector[i].cid = 0; + } + refCnt = 1; +#if MULTITHREADED + gInitMutex(&mutex); +#endif +} + +P2PCMap::P2PCMap(GooString *collectionA, GooString *cMapNameA, int wModeA) { + collection = collectionA; + cMapName = cMapNameA; + wMode = wModeA; + vector = NULL; + refCnt = 1; +#if MULTITHREADED + gInitMutex(&mutex); +#endif +} + +void P2PCMap::useCMap(P2PCMapCache *cache, char *useName) { + GooString *useNameStr; + P2PCMap *subCMap; + + useNameStr = new GooString(useName); + subCMap = cache->getCMap(collection, useNameStr); + delete useNameStr; + if (!subCMap) { + return; + } + copyVector(vector, subCMap->vector); + subCMap->decRefCnt(); +} + +void P2PCMap::copyVector(CMapVectorEntry *dest, CMapVectorEntry *src) { + int i, j; + + for (i = 0; i < 256; ++i) { + if (src[i].isVector) { + if (!dest[i].isVector) { + dest[i].isVector = gTrue; + dest[i].vector = + (CMapVectorEntry *)gmallocn(256, sizeof(CMapVectorEntry)); + for (j = 0; j < 256; ++j) { + dest[i].vector[j].isVector = gFalse; + dest[i].vector[j].cid = 0; + } + } + copyVector(dest[i].vector, src[i].vector); + } else { + if (dest[i].isVector) { + error(-1, const_cast<char *>("Collision in usecmap")); + } else { + dest[i].cid = src[i].cid; + } + } + } +} + +void P2PCMap::addCodeSpace(CMapVectorEntry *vec, Guint start, Guint end, + Guint nBytes) { + Guint start2, end2; + int startByte, endByte, i, j; + + if (nBytes > 1) { + startByte = (start >> (8 * (nBytes - 1))) & 0xff; + endByte = (end >> (8 * (nBytes - 1))) & 0xff; + start2 = start & ((1 << (8 * (nBytes - 1))) - 1); + end2 = end & ((1 << (8 * (nBytes - 1))) - 1); + for (i = startByte; i <= endByte; ++i) { + if (!vec[i].isVector) { + vec[i].isVector = gTrue; + vec[i].vector = + (CMapVectorEntry *)gmallocn(256, sizeof(CMapVectorEntry)); + for (j = 0; j < 256; ++j) { + vec[i].vector[j].isVector = gFalse; + vec[i].vector[j].cid = 0; + } + } + addCodeSpace(vec[i].vector, start2, end2, nBytes - 1); + } + } +} + +void P2PCMap::addCIDs(Guint start, Guint end, Guint nBytes, CID firstCID) { + CMapVectorEntry *vec; + CID cid; + int byte; + Guint i; + + vec = vector; + for (i = nBytes - 1; i >= 1; --i) { + byte = (start >> (8 * i)) & 0xff; + if (!vec[byte].isVector) { + error(-1, const_cast<char *>("Invalid CID (%0*x - %0*x) in CMap"), + 2*nBytes, start, 2*nBytes, end); + return; + } + vec = vec[byte].vector; + } + cid = firstCID; + for (byte = (int)(start & 0xff); byte <= (int)(end & 0xff); ++byte) { + if (vec[byte].isVector) { + error(-1, const_cast<char *>("Invalid CID (%0*x - %0*x) in CMap"), + 2*nBytes, start, 2*nBytes, end); + } else { + vec[byte].cid = cid; + } + ++cid; + } +} + +P2PCMap::~P2PCMap() { + delete collection; + delete cMapName; + if (vector) { + freeCMapVector(vector); + } +#if MULTITHREADED + gDestroyMutex(&mutex); +#endif +} + +void P2PCMap::freeCMapVector(CMapVectorEntry *vec) { + int i; + + for (i = 0; i < 256; ++i) { + if (vec[i].isVector) { + freeCMapVector(vec[i].vector); + } + } + gfree(vec); +} + +void P2PCMap::incRefCnt() { +#if MULTITHREADED + gLockMutex(&mutex); +#endif + ++refCnt; +#if MULTITHREADED + gUnlockMutex(&mutex); +#endif +} + +void P2PCMap::decRefCnt() { + GBool done; + +#if MULTITHREADED + gLockMutex(&mutex); +#endif + done = --refCnt == 0; +#if MULTITHREADED + gUnlockMutex(&mutex); +#endif + if (done) { + delete this; + } +} + +GBool P2PCMap::match(GooString *collectionA, GooString *cMapNameA) { + return !collection->cmp(collectionA) && !cMapName->cmp(cMapNameA); +} + +CID P2PCMap::getCID(char *s, int len, int *nUsed) { + CMapVectorEntry *vec; + int n, i; + + if (!(vec = vector)) { + // identity CMap + *nUsed = 2; + if (len < 2) { + return 0; + } + return ((s[0] & 0xff) << 8) + (s[1] & 0xff); + } + n = 0; + while (1) { + if (n >= len) { + *nUsed = n; + return 0; + } + i = s[n++] & 0xff; + if (!vec[i].isVector) { + *nUsed = n; + return vec[i].cid; + } + vec = vec[i].vector; + } +} + +void P2PCMap::setReverseMapVector(Guint startCode, CMapVectorEntry *vec, + Guint *rmap, Guint rmapSize, Guint ncand) { + int i; + + if (vec == 0) return; + for (i = 0;i < 256;i++) { + if (vec[i].isVector) { + setReverseMapVector((startCode+i) << 8, + vec[i].vector,rmap,rmapSize,ncand); + } else { + Guint cid = vec[i].cid; + + if (cid < rmapSize) { + unsigned int cand; + + for (cand = 0;cand < ncand;cand++) { + Guint code = startCode+i; + Guint idx = cid*ncand+cand; + if (rmap[idx] == 0) { + rmap[idx] = code; + break; + } else if (rmap[idx] == code) { + break; + } + } + } + } + } +} + +void P2PCMap::setReverseMap(Guint *rmap, Guint rmapSize, Guint ncand) { + setReverseMapVector(0,vector,rmap,rmapSize,ncand); +} + +//------------------------------------------------------------------------ + +P2PCMapCache::P2PCMapCache() { + int i; + + for (i = 0; i < cMapCacheSize; ++i) { + cache[i] = NULL; + } +} + +P2PCMapCache::~P2PCMapCache() { + int i; + + for (i = 0; i < cMapCacheSize; ++i) { + if (cache[i]) { + cache[i]->decRefCnt(); + } + } +} + +P2PCMap *P2PCMapCache::getCMap(GooString *collection, GooString *cMapName) { + P2PCMap *cmap; + int i, j; + + if (cache[0] && cache[0]->match(collection, cMapName)) { + cache[0]->incRefCnt(); + return cache[0]; + } + for (i = 1; i < cMapCacheSize; ++i) { + if (cache[i] && cache[i]->match(collection, cMapName)) { + cmap = cache[i]; + for (j = i; j >= 1; --j) { + cache[j] = cache[j - 1]; + } + cache[0] = cmap; + cmap->incRefCnt(); + return cmap; + } + } + if ((cmap = P2PCMap::parse(this, collection, cMapName))) { + if (cache[cMapCacheSize - 1]) { + cache[cMapCacheSize - 1]->decRefCnt(); + } + for (j = cMapCacheSize - 1; j >= 1; --j) { + cache[j] = cache[j - 1]; + } + cache[0] = cmap; + cmap->incRefCnt(); + return cmap; + } + return NULL; +} --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/P2PResources.h +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/P2PResources.h @@ -0,0 +1,113 @@ +/* + +Copyright (c) 2006-2007, BBR Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +/* + P2PResources.h + pdftopdf resouces dictionary +*/ +#ifndef _P2PRESOURCES_H_ +#define _P2PRESOURCES_H_ + +#include "goo/gmem.h" +#include "Object.h" +#include "P2PObject.h" +#include "Dict.h" +#include "XRef.h" +#include "P2POutputStream.h" +#include "P2PPattern.h" +#include "UGooString.h" + +class P2PResourceMap; +class P2PFontResource; + +class P2PResources: public P2PObject { +public: + enum { + ExtGState = 0, + ColorSpace, + Pattern, + Shading, + XObject, + Font, + NDict + }; + static const char *dictNames[NDict]; + P2PResources(XRef *xrefA); + ~P2PResources(); + void output(P2POutputStream *str, P2PFontResource *fontResource); + /* merge resources and return mapping table */ + P2PResourceMap *merge(Dict *res); + P2PResourceMap *merge(P2PResources *res); + Dict *getFontResource() { + return dictionaries[Font]; + } + Dict *getExtGState() { + return dictionaries[ExtGState]; + } + void setupPattern(); + void refPattern(char *name, P2PMatrix *matA); + + class P2PPatternDict { + public: + P2PPatternDict() { + name = 0; + pattern = 0; + } + ~P2PPatternDict() { + if (name != 0) delete[] name; + if (pattern != 0) delete pattern; + } + char *name; + P2PPattern *pattern; + }; +private: + XRef *xref; + Dict *dictionaries[NDict]; + unsigned int resourceNo; + P2PPatternDict *patternDict; + int nPattern; + + void mergeOneDict(Dict *dst, Dict *src, Dict *map, GBool unify); +#ifdef HAVE_UGOOSTRING_H + void addDict(Dict *dict, Object *obj, UGooString *srckey, Dict *map); +#else + void addDict(Dict *dict, Object *obj, char *srckey, Dict *map); +#endif +#ifdef HAVE_UGOOSTRING_H + void addMap(UGooString *org, char *mapped, Dict *map); +#else + void addMap(char *org, char *mapped, Dict *map); +#endif +}; + +/* resource name mapping table */ +class P2PResourceMap { +public: + P2PResourceMap(); + ~P2PResourceMap(); + + Dict *tables[P2PResources::NDict]; +}; + +#endif --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/P2POutputStream.h +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/P2POutputStream.h @@ -0,0 +1,71 @@ +/* + +Copyright (c) 2006-2007, BBR Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +/* + P2POutputStream.h + pdftopdf stream for output +*/ +#ifndef _P2POUTPUTSTREAM_H_ +#define _P2POUTPUTSTREAM_H_ + +#include "goo/gtypes.h" + +#include <config.h> +#ifndef HAVE_ZLIB_H +#undef HAVE_LIBZ +#endif +#include <stdio.h> +#ifdef HAVE_LIBZ +#include <zlib.h> +#endif + +class P2POutputStream { +public: + P2POutputStream(FILE *fpA); + ~P2POutputStream(); + int write(const void *buf, int n); + int printf(const char *format, ...); + int putchar(int c); + int puts(const char *str); + int getPosition() { return position; } + GBool canDeflate() { +#ifdef HAVE_LIBZ + return gTrue; +#else + return gFalse; +#endif + } + void startDeflate(); + void endDeflate(); +private: + FILE *fp; + /* output position */ + int position; +#ifdef HAVE_LIBZ + z_stream zstream; + GBool deflating; +#endif +}; + +#endif --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/pdftopdf.cxx +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/pdftopdf.cxx @@ -0,0 +1,718 @@ +/* +Copyright (c) 2006-2007, BBR Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +/* + pdftopdf.cc + pdf to pdf filter +*/ + +#include <config.h> +#include <stdio.h> +#include <stdlib.h> +#include "goo/GooString.h" +#include "goo/gmem.h" +#include "Object.h" +#include "Stream.h" +#include "PDFDoc.h" +#include "P2PDoc.h" +#include "P2POutputStream.h" +#include <cups/cups.h> +#include <stdarg.h> +#include "Error.h" +#include "GlobalParams.h" +#include "PDFFTrueTypeFont.h" + +namespace { + int exitCode = 0; + GBool fitplot = gFalse; + GBool mirror = gFalse; + int numberUp = 1; + unsigned int numberUpLayout = PDFTOPDF_LAYOUT_LRTB; + unsigned int pageBorder = PDFTOPDF_BORDERNONE; + double pageLeft = 18.0; + double pageRight = 594.0; + double pageBottom = 36.0; + double pageTop = 756.0; + double pageWidth = 612.0; + double pageLength = 792.0; + GBool emitJCL = gTrue; + ppd_file_t *ppd = 0; + int xposition = 0; + int yposition = 0; + GBool position = gFalse; + int orientation = 0; + double scaling = 1.0; + double naturalScaling = 1.0; + int deviceCopies = 1; + GBool deviceCollate = gFalse; + GBool deviceReverse = gFalse; +}; + +void CDECL myErrorFun(int pos, char *msg, va_list args) +{ + if (pos >= 0) { + fprintf(stderr, "ERROR (%d): ", pos); + } else { + fprintf(stderr, "ERROR: "); + } + vfprintf(stderr, msg, args); + fprintf(stderr, "\n"); + fflush(stderr); +} + +GBool checkFeature(const char *feature, int num_options, cups_option_t *options) +{ + const char *val; + ppd_attr_t *attr; + + return ((val = cupsGetOption(feature,num_options,options)) != 0 && + (!strcasecmp(val, "true") || !strcasecmp(val, "on") || + !strcasecmp(val, "yes"))) || + ((attr = ppdFindAttr(ppd,feature,0)) != 0 && + (!strcasecmp(attr->value, "true") + || !strcasecmp(attr->value, "on") || + !strcasecmp(attr->value, "yes"))); +} + +void emitJCLOptions(FILE *fp, int copies) +{ + int section; + ppd_choice_t **choices; + int i; + char buf[1024]; + ppd_attr_t *attr; + int pdftoopvp = 0; + + if (ppd == 0) return; + if ((attr = ppdFindAttr(ppd,"pdftopdfJCLBegin",NULL)) != NULL) { + int n = strlen(attr->value); + pdftoopvp = 1; + for (i = 0;i < n;i++) { + if (attr->value[i] == '\r' || attr->value[i] == '\n') { + /* skip new line */ + continue; + } + fputc(attr->value[i],fp); + } + } + + snprintf(buf,sizeof(buf),"%d",copies); + if (ppdFindOption(ppd,"Copies") != NULL) { + ppdMarkOption(ppd,"Copies",buf); + } else { + if ((attr = ppdFindAttr(ppd,"pdftopdfJCLCopies",buf)) != NULL) { + fputs(attr->value,fp); + } else if (pdftoopvp) { + fprintf(fp,"Copies=%d;",copies); + } + } + for (section = (int)PPD_ORDER_ANY; + section <= (int)PPD_ORDER_PROLOG;section++) { + int n; + + n = ppdCollect(ppd,(ppd_section_t)section,&choices); + for (i = 0;i < n;i++) { + snprintf(buf,sizeof(buf),"pdftopdfJCL%s", + ((ppd_option_t *)(choices[i]->option))->keyword); + if ((attr = ppdFindAttr(ppd,buf,choices[i]->choice)) != NULL) { + fputs(attr->value,fp); + } else if (pdftoopvp) { + fprintf(fp,"%s=%s;", + ((ppd_option_t *)(choices[i]->option))->keyword, + choices[i]->choice); + } + } + } + fputc('\n',fp); +} + +void parseOpts(int argc, char **argv) +{ + int num_options; + cups_option_t *options; + const char *val; + ppd_attr_t *attr; + ppd_choice_t *choice; + ppd_size_t *pagesize; + int intval; + + if (argc < 6 || argc > 7) { + error(-1,const_cast<char *>("%s job-id user title copies options [file]"), + argv[0]); + exit(1); + } + P2PDoc::options.jobId = atoi(argv[1]); + P2PDoc::options.user = argv[2]; + P2PDoc::options.title = argv[3]; + P2PDoc::options.copies = atoi(argv[4]); + + ppd = ppdOpenFile(getenv("PPD")); + ppdMarkDefaults(ppd); + options = NULL; + num_options = cupsParseOptions(argv[5],0,&options); + cupsMarkOptions(ppd,num_options,options); + if (P2PDoc::options.copies == 1 + && (choice = ppdFindMarkedChoice(ppd,"Copies")) != NULL) { + P2PDoc::options.copies = atoi(choice->choice); + } + if (P2PDoc::options.copies == 0) P2PDoc::options.copies = 1; + if ((pagesize = ppdPageSize(ppd,0)) != 0) { + pageWidth = pagesize->width; + pageLength = pagesize->length; + pageTop = pagesize->top; + pageBottom = pagesize->bottom; + pageLeft = pagesize->left; + pageRight = pagesize->right; + } + if ((val = cupsGetOption("landscape",num_options,options)) != 0) { + if (strcasecmp(val, "no") != 0 && strcasecmp(val, "off") != 0 && + strcasecmp(val, "false") != 0) { + if (ppd && ppd->landscape > 0) { + orientation = 1; + } else { + orientation = 3; + } + } + } else if ((val = + cupsGetOption("orientation-requested",num_options,options)) != 0) { + /* + * Map IPP orientation values to 0 to 3: + * + * 3 = 0 degrees = 0 + * 4 = 90 degrees = 1 + * 5 = -90 degrees = 3 + * 6 = 180 degrees = 2 + */ + + orientation = atoi(val) - 3; + if (orientation >= 2) { + orientation ^= 1; + } + } + if ((val = cupsGetOption("page-left",num_options,options)) != 0) { + switch (orientation & 3) { + case 0 : + pageLeft = (float)atof(val); + break; + case 1 : + pageBottom = (float)atof(val); + break; + case 2 : + pageRight = pageWidth - (float)atof(val); + break; + case 3 : + pageTop = pageLength - (float)atof(val); + break; + } + } + if ((val = cupsGetOption("page-right",num_options,options)) != 0) { + switch (orientation & 3) { + case 0 : + pageRight = pageWidth - (float)atof(val); + break; + case 1 : + pageTop = pageLength - (float)atof(val); + break; + case 2 : + pageLeft = (float)atof(val); + break; + case 3 : + pageBottom = (float)atof(val); + break; + } + } + if ((val = cupsGetOption("page-bottom",num_options,options)) != 0) { + switch (orientation & 3) { + case 0 : + pageBottom = (float)atof(val); + break; + case 1 : + pageLeft = (float)atof(val); + break; + case 2 : + pageTop = pageLength - (float)atof(val); + break; + case 3 : + pageRight = pageWidth - (float)atof(val); + break; + } + } + if ((val = cupsGetOption("page-top",num_options,options)) != 0) { + switch (orientation & 3) { + case 0 : + pageTop = pageLength - (float)atof(val); + break; + case 1 : + pageRight = pageWidth - (float)atof(val); + break; + case 2 : + pageBottom = (float)atof(val); + break; + case 3 : + pageLeft = (float)atof(val); + break; + } + } + if (ppdIsMarked(ppd,"Duplex","DuplexNoTumble") || + ppdIsMarked(ppd,"Duplex","DuplexTumble") || + ppdIsMarked(ppd,"JCLDuplex","DuplexNoTumble") || + ppdIsMarked(ppd,"JCLDuplex","DuplexTumble") || + ppdIsMarked(ppd,"EFDuplex","DuplexNoTumble") || + ppdIsMarked(ppd,"EFDuplex","DuplexTumble") || + ppdIsMarked(ppd,"KD03Duplex","DuplexNoTumble") || + ppdIsMarked(ppd,"KD03Duplex","DuplexTumble")) { + P2PDoc::options.duplex = gTrue; + } else if ((val = cupsGetOption("Duplex",num_options,options)) != 0 && + (!strcasecmp(val, "true") || !strcasecmp(val, "on") || + !strcasecmp(val, "yes"))) { + /* for compatiblity */ + if (ppdFindOption(ppd,"Duplex") != NULL) { + ppdMarkOption(ppd,"Duplex","True"); + ppdMarkOption(ppd,"Duplex","On"); + P2PDoc::options.duplex = gTrue; + } + } else if ((val = cupsGetOption("sides",num_options,options)) != 0 && + (!strcasecmp(val, "two-sided-long-edge") || + !strcasecmp(val, "two-sided-short-edge"))) { + /* for compatiblity */ + if (ppdFindOption(ppd,"Duplex") != NULL) { + ppdMarkOption(ppd,"Duplex","True"); + ppdMarkOption(ppd,"Duplex","On"); + P2PDoc::options.duplex = gTrue; + } + } + + if ((val = cupsGetOption("fitplot",num_options,options)) != 0 && + (!strcasecmp(val, "true") || !strcasecmp(val, "on") || + !strcasecmp(val, "yes"))) { + fitplot = gTrue; + } + if ((val = cupsGetOption("number-up",num_options,options)) != 0) { + switch (intval = atoi(val)) { + case 1 : + case 2 : + case 4 : + case 6 : + case 8 : + case 9 : + case 16 : + numberUp = intval; + break; + default : + error(-1, + const_cast<char *>("Unsupported number-up value %d, using number-up=1!\n"), + intval); + break; + } + } + if ((val = cupsGetOption("number-up-layout",num_options,options)) != 0) { + if (!strcasecmp(val,"lrtb")) { + numberUpLayout = PDFTOPDF_LAYOUT_LRTB; + } else if (!strcasecmp(val,"lrbt")) { + numberUpLayout = PDFTOPDF_LAYOUT_LRBT; + } else if (!strcasecmp(val,"rltb")) { + numberUpLayout = PDFTOPDF_LAYOUT_RLTB; + } else if (!strcasecmp(val,"rlbt")) { + numberUpLayout = PDFTOPDF_LAYOUT_RLBT; + } else if (!strcasecmp(val,"tblr")) { + numberUpLayout = PDFTOPDF_LAYOUT_TBLR; + } else if (!strcasecmp(val,"tbrl")) { + numberUpLayout = PDFTOPDF_LAYOUT_TBRL; + } else if (!strcasecmp(val,"btlr")) { + numberUpLayout = PDFTOPDF_LAYOUT_BTLR; + } else if (!strcasecmp(val,"btrl")) { + numberUpLayout = PDFTOPDF_LAYOUT_BTRL; + } else { + error(-1, const_cast<char *>("Unsupported number-up-layout value %s," + " using number-up-layout=lrtb!\n"), val); + } + } + if ((val = cupsGetOption("OutputOrder",num_options,options)) != 0) { + if (!strcasecmp(val, "Reverse")) { + P2PDoc::options.reverse = gTrue; + } + } else if (ppd) { + /* + * Figure out the right default output order from the PPD file... + */ + + if ((choice = ppdFindMarkedChoice(ppd,"OutputOrder")) != 0) { + P2PDoc::options.reverse = !strcasecmp(choice->choice,"Reverse"); + } else if ((choice = ppdFindMarkedChoice(ppd,"OutputBin")) != 0 && + (attr = ppdFindAttr(ppd,"PageStackOrder",choice->choice)) != 0 && + attr->value) { + P2PDoc::options.reverse = !strcasecmp(attr->value,"Reverse"); + } else if ((attr = ppdFindAttr(ppd,"DefaultOutputOrder",0)) != 0 && + attr->value) { + P2PDoc::options.reverse = !strcasecmp(attr->value,"Reverse"); + } + } + if ((val = cupsGetOption("page-border",num_options,options)) != 0) { + if (!strcasecmp(val,"none")) { + pageBorder = PDFTOPDF_BORDERNONE; + } else if (!strcasecmp(val,"single")) { + pageBorder = PDFTOPDF_BORDERHAIRLINE; + } else if (!strcasecmp(val,"single-thick")) { + pageBorder = PDFTOPDF_BORDERTHICK; + } else if (!strcasecmp(val,"double")) { + pageBorder = PDFTOPDF_BORDERDOUBLE | PDFTOPDF_BORDERHAIRLINE; + } else if (!strcasecmp(val,"double-thick")) { + pageBorder = PDFTOPDF_BORDERDOUBLE | PDFTOPDF_BORDERTHICK; + } else { + error(-1, const_cast<char *>("Unsupported page-border value %s, using " + "page-border=none!\n"), val); + } + } + P2PDoc::options.pageLabel = cupsGetOption("page-label",num_options,options); + P2PDoc::options.pageSet = cupsGetOption("page-set",num_options,options); + P2PDoc::options.pageRanges = cupsGetOption("page-ranges",num_options,options); + + if ((val = cupsGetOption("mirror",num_options,options)) != 0 && + (!strcasecmp(val,"true") || !strcasecmp(val,"on") || + !strcasecmp(val,"yes"))) { + mirror = gTrue; + } + if ((val = cupsGetOption("emit-jcl",num_options,options)) != 0 && + (!strcasecmp(val,"false") || !strcasecmp(val,"off") || + !strcasecmp(val,"no") || !strcmp(val,"0"))) { + emitJCL = gFalse; + } + if ((val = cupsGetOption("position",num_options,options)) != 0) { + if (strcasecmp(val,"center") == 0) { + xposition = 0; + yposition = 0; + } else if (strcasecmp(val,"top") == 0) { + xposition = 0; + yposition = 1; + } else if (strcasecmp(val,"left") == 0) { + xposition = -1; + yposition = 0; + } else if (strcasecmp(val,"right") == 0) { + xposition = 1; + yposition = 0; + } else if (strcasecmp(val,"top-left") == 0) { + xposition = -1; + yposition = 1; + } else if (strcasecmp(val,"top-right") == 0) { + xposition = 1; + yposition = 1; + } else if (strcasecmp(val,"bottom") == 0) { + xposition = 0; + yposition = -1; + } else if (strcasecmp(val,"bottom-left") == 0) { + xposition = -1; + yposition = -1; + } else if (strcasecmp(val,"bottom-right") == 0) { + xposition = 1; + yposition = -1; + } + position = gTrue; + } + + if ((val = cupsGetOption("multiple-document-handling",num_options,options)) + != 0) { + P2PDoc::options.collate = + strcasecmp(val,"separate-documents-uncollated-copies") != 0; + } + if ((val = cupsGetOption("Collate",num_options,options)) != 0) { + if (strcasecmp(val,"True") == 0) { + P2PDoc::options.collate = gTrue; + } + } else { + if ((choice = ppdFindMarkedChoice(ppd,"Collate")) != NULL + && (!strcasecmp(choice->choice,"true") + || !strcasecmp(choice->choice, "on") + || !strcasecmp(choice->choice, "yes"))) { + P2PDoc::options.collate = gTrue; + } + } + + if ((val = cupsGetOption("scaling",num_options,options)) != 0) { + scaling = atoi(val) * 0.01; + fitplot = gTrue; + } else if (cupsGetOption("fitplot",num_options,options)) { + scaling = 1.0; + } + if ((val = cupsGetOption("natural-scaling",num_options,options)) != 0) { + naturalScaling = atoi(val) * 0.01; + } + /* adujst to even page when duplex */ + if (checkFeature("cupsEvenDuplex",num_options,options)) { + P2PDoc::options.even = gTrue; + } + + /* embedding fonts into output PDF */ + if (checkFeature("pdftopdfFontEmbedding",num_options,options)) { + P2PDoc::options.fontEmbedding = gTrue; + } + /* embedding whole font file into output PDF */ + if (checkFeature("pdftopdfFontEmbeddingWhole",num_options,options)) { + P2PDoc::options.fontEmbeddingWhole = gTrue; + } + /* embedding pre-loaded fonts specified in PPD into output PDF */ + if (checkFeature("pdftopdfFontEmbeddingPreLoad",num_options,options)) { + P2PDoc::options.fontEmbeddingPreLoad = gTrue; + } + /* compressing embedded fonts */ + if (checkFeature("pdftopdfFontCompress",num_options,options)) { + P2PDoc::options.fontCompress = gTrue; + } + /* compressing page contents */ + if (checkFeature("pdftopdfContentsCompress",num_options,options)) { + P2PDoc::options.contentsCompress = gTrue; + } + + /* pre-loaded fonts */ + if (ppd != 0) { + P2PDoc::options.numPreFonts = ppd->num_fonts; + P2PDoc::options.preFonts = ppd->fonts; + } + + if (P2PDoc::options.copies == 1) { + /* collate is not needed */ + P2PDoc::options.collate = gFalse; + ppdMarkOption(ppd,"Collate","False"); + } + if (!P2PDoc::options.duplex) { + /* evenDuplex is not needed */ + P2PDoc::options.even = gFalse; + } + + /* check collate device */ + if (P2PDoc::options.collate) { + if ((choice = ppdFindMarkedChoice(ppd,"Collate")) != NULL && + !strcasecmp(choice->choice,"true")) { + ppd_option_t *opt; + + if ((opt = ppdFindOption(ppd,"Collate")) != NULL && + !opt->conflicted) { + deviceCollate = gTrue; + } else { + ppdMarkOption(ppd,"Collate","False"); + } + } + } + /* check OutputOrder device */ + if (P2PDoc::options.reverse) { + if (ppdFindOption(ppd,"OutputOrder") != NULL) { + deviceReverse = gTrue; + } + } + if (ppd != NULL && + !ppd->manual_copies && P2PDoc::options.collate && !deviceCollate) { + /* Copying by device , software collate is impossible */ + /* Enable software copying */ + ppd->manual_copies = 1; + } + if (P2PDoc::options.copies > 1 && (ppd == NULL || ppd->manual_copies) + && P2PDoc::options.duplex) { + /* Enable software collate , or same pages are printed in both sides */ + P2PDoc::options.collate = gTrue; + if (deviceCollate) { + deviceCollate = gFalse; + ppdMarkOption(ppd,"Collate","False"); + } + } + if (P2PDoc::options.duplex && P2PDoc::options.collate && !deviceCollate) { + /* Enable evenDuplex or the first page may be printed other side of the + end of precedings */ + P2PDoc::options.even = gTrue; + } + if (P2PDoc::options.duplex && P2PDoc::options.reverse && !deviceReverse) { + /* Enable evenDuplex or the first page may be empty. */ + P2PDoc::options.even = gTrue; + } + /* change feature for software */ + if (deviceCollate) { + P2PDoc::options.collate = gFalse; + } + if (deviceReverse) { + P2PDoc::options.reverse = gFalse; + } + + if (ppd != NULL) { + if (ppd->manual_copies) { + /* sure disable hardware copying */ + ppdMarkOption(ppd,"Copies","1"); + ppdMarkOption(ppd,"JCLCopies","1"); + } else { + /* change for hardware copying */ + deviceCopies = P2PDoc::options.copies; + P2PDoc::options.copies = 1; + } + } +} + +int main(int argc, char *argv[]) { + PDFDoc *doc; + P2PDoc *p2pdoc; + P2POutputStream *str; + + setErrorFunction(::myErrorFun); +#ifdef GLOBALPARAMS_HAS_A_ARG + globalParams = new GlobalParams(0); +#else + globalParams = new GlobalParams(); +#endif + parseOpts(argc, argv); + + PDFRectangle box(pageLeft,pageBottom,pageRight,pageTop); + + if (argc == 6) { + /* stdin */ + int fd; + Object obj; + BaseStream *str; + FILE *fp; + char buf[BUFSIZ]; + int n; + + fd = cupsTempFd(buf,sizeof(buf)); + if (fd < 0) { + error(-1,const_cast<char *>("Can't create temporary file")); + exit(1); + } + /* remove name */ + unlink(buf); + + /* copy stdin to the tmp file */ + while ((n = read(0,buf,BUFSIZ)) > 0) { + if (write(fd,buf,n) != n) { + error(-1,const_cast<char *>("Can't copy stdin to temporary file")); + close(fd); + exit(1); + } + } + if (lseek(fd,0,SEEK_SET) < 0) { + error(-1,const_cast<char *>("Can't rewind temporary file")); + close(fd); + exit(1); + } + + if ((fp = fdopen(fd,"rb")) == 0) { + error(-1,const_cast<char *>("Can't fdopen temporary file")); + close(fd); + exit(1); + } + + obj.initNull(); + str = new FileStream(fp,0,gFalse,0,&obj); + doc = new PDFDoc(str); + } else { + GooString *fileName = new GooString(argv[6]); + /* argc == 7 filenmae is specified */ + doc = new PDFDoc(fileName,NULL,NULL); + } + + if (!doc->isOk()) { + exitCode = 1; + goto err1; + } + if (!doc->okToPrintHighRes() && !doc->okToPrint()) { + error(-1,const_cast<char *>("Printing is not allowed\n")); + exit(1); + } + p2pdoc = new P2PDoc(doc); + if (mirror) { + p2pdoc->mirror(); + } + + if (orientation != 0) { + p2pdoc->rotate(orientation); + p2pdoc->position(&box,xposition,yposition); + } + + if (naturalScaling != 1.0) { + p2pdoc->scale(naturalScaling); + p2pdoc->position(&box,xposition,yposition); + } + + if (fitplot) { + p2pdoc->fit(&box,scaling); + p2pdoc->position(&box,xposition,yposition); + } + if (numberUp != 1) { + p2pdoc->nup(numberUp,&box,pageBorder,numberUpLayout, + xposition,yposition); + } else if (position) { + p2pdoc->position(&box,xposition,yposition); + } + if ((P2PDoc::options.collate || deviceCollate) + && p2pdoc->getNumberOfPages() == 1 + && !P2PDoc::options.even) { + /* collate is not needed, disable it */ + /* Number of pages is changed by nup and page-ranges, + so check this here */ + deviceCollate = gFalse; + P2PDoc::options.collate = gFalse; + ppdMarkOption(ppd,"Collate","False"); + } + + ppdEmit(ppd,stdout,PPD_ORDER_EXIT); + + if (emitJCL) { + ppdEmitJCL(ppd,stdout,P2PDoc::options.jobId,P2PDoc::options.user, + P2PDoc::options.title); + emitJCLOptions(stdout,deviceCopies); + } + str = new P2POutputStream(stdout); /* PDF start here */ + p2pdoc->output(str,deviceCopies,deviceCollate); +#ifndef CUPS_1_1 + if (emitJCL) { + ppdEmitJCLEnd(ppd,stdout); + } +#endif + + delete str; + delete p2pdoc; +err1: + delete doc; + + // Check for memory leaks + Object::memCheck(stderr); + gMemReport(stderr); + + return exitCode; +} + +/* replace memory allocation methods for memory check */ + +void * operator new(size_t size) +{ + return gmalloc(size); +} + +void operator delete(void *p) +{ + gfree(p); +} + +void * operator new[](size_t size) +{ + return gmalloc(size); +} + +void operator delete[](void *p) +{ + gfree(p); +} --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/P2PFont.cxx +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/P2PFont.cxx @@ -0,0 +1,1366 @@ +/* + +Copyright (c) 2006-2007, BBR Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +/* + P2PFont.cc + pdftopdf font manager +*/ + +#include <config.h> +#include <string.h> +#include <sys/types.h> +#include <unistd.h> +#include <fcntl.h> +#include "goo/gmem.h" +#include "P2PFont.h" +#include "GfxFont.h" +#include "Error.h" +#include "P2PXRef.h" +#include "BuiltinFontTables.h" +#include "P2PCMap.h" +#include "GlobalParams.h" +#include "PDFFTrueTypeFont.h" +#include "P2PDoc.h" +#include "CharCodeToUnicode.h" +#include "P2PCharCodeToUnicode.h" + +/* Size of CID (bytes) */ +#define CID_SIZE 2 +#define CIDTOGID_SIZE (1 << (8*CID_SIZE)) + +int P2PFontFile::nFontFiles = 0; +int P2PFontFile::fontFileListSize = 0; +P2PFontFile **P2PFontFile::fontFileList = 0; +char P2PFontFile::nextTag[7] = "AAAAA@"; + +#define FONT_FILE_LIST_INC 256 + + +P2PCIDToGID::P2PCIDToGID(P2PFontFile *fontFileA, GBool wmodeA) +{ + fontFile = fontFileA; + wmode = wmodeA; +} + +P2PCIDToGID::~P2PCIDToGID() +{ + /* must not delete fontFile */ +} + +void P2PCIDToGID::output(P2POutputStream *str, XRef *xref) +{ + P2PObj *lenObj = new P2PObj(); + int cp; + int len; + + P2PXRef::put(lenObj); + outputBegin(str); + str->puts("<< /Length "); + lenObj->outputRef(str); + if (P2PDoc::options.fontCompress && str->canDeflate()) { + str->puts(" /Filter /FlateDecode "); + } + str->puts(" >>\n" + "stream\n"); + cp = str->getPosition(); /* start position */ + if (P2PDoc::options.fontCompress) str->startDeflate(); + fontFile->outputCIDToGID(wmode,str,xref); + if (P2PDoc::options.fontCompress) str->endDeflate(); + len = str->getPosition() - cp; /* calculate length */ + str->puts("\nendstream\n"); + outputEnd(str); + + /* output length */ + lenObj->outputBegin(str); + str->printf("%d\n",len); + lenObj->outputEnd(str); +} + +char *P2PFontFile::getNextTag() +{ + int i; + + for (i = 5;i >= 0;i--) { + int c = nextTag[i]; + + nextTag[i] = ++c; + if (c <= 'Z') break; + nextTag[i] = 'A'; + } + return nextTag; +} + +P2PFontFile *P2PFontFile::getFontFile(GooString *fileNameA, + GfxFont *fontA, GfxFontType typeA, int faceIndexA) +{ + int i; + + for (i = 0;i < nFontFiles;i++) { + if (fontFileList[i] != 0 && strcmp(fileNameA->getCString(), + fontFileList[i]->getFileName()->getCString()) == 0 + && faceIndexA == fontFileList[i]->faceIndex) { + return fontFileList[i]; + } + } + if (nFontFiles >= fontFileListSize) { + int size = fontFileListSize + FONT_FILE_LIST_INC; + P2PFontFile **list; + + list = new P2PFontFile *[size]; + for (i = 0;i < nFontFiles;i++) { + list[i] = fontFileList[i]; + } + for (;i < size;i++) { + list[i] = 0; + } + delete fontFileList; + fontFileList = list; + fontFileListSize = size; + } + fontFileList[nFontFiles] = new P2PFontFile(fileNameA,fontA,typeA,faceIndexA); + P2PXRef::put(fontFileList[nFontFiles]); + return fontFileList[nFontFiles++]; +} + +P2PFontFile::P2PFontFile(GooString *fileNameA, GfxFont *fontA, + GfxFontType typeA, int faceIndexA) +{ + fileName = new GooString(fileNameA); + font = fontA; + type = typeA; + faceIndex = faceIndexA; + CIDToGID = 0; + CIDToGID_V = 0; + maxRefCID = 0; + fontName = 0; + setSecondPhase(gTrue); + if (type == fontCIDType2) { + charRefTable = new unsigned char[CIDTOGID_SIZE/8]; + memset(charRefTable,0,CIDTOGID_SIZE/8); + } else { + charRefTable = 0; + } + if (type == fontCIDType2 || type == fontTrueType) { + UGooString *fn; + + tfont.init(fileName->getCString(),faceIndex); + tfont.setupCmap(); + fn = tfont.getFontName(); + if (fn != 0) { + if (type == fontCIDType2 && !P2PDoc::options.fontEmbeddingWhole) { + char *tag; + Unicode *p; + int len; + int tagLen; + int fnLen; + int i,j; + Unicode *u; + + tag = getNextTag(); + tagLen = strlen(tag); + fnLen = fn->getLength(); + len = tagLen+1+fnLen; + /* use gmalloc because UGooString uses it */ + p = static_cast<Unicode *>(gmalloc(len*sizeof(Unicode))); + /* copy tag */ + for (i = 0;i < tagLen;i++) { + p[i] = tag[i]; + } + p[i++] = '+'; + /* copy font name */ + u = fn->unicode(); + for (j = 0;j < fnLen;j++) { + p[i++] = u[j]; + } + fontName = new UGooString(p,len); + } else { + fontName = new UGooString(*fn); + } + } + } +} + +P2PCIDToGID *P2PFontFile::getCIDToGID(GBool wmode) +{ + P2PCIDToGID **p; + + if (wmode) { + p = &CIDToGID_V; + } else { + p = &CIDToGID; + } + if (*p == 0) { + *p = new P2PCIDToGID(this,wmode); + P2PXRef::put(*p); + } + return *p; +} + +P2PFontFile::~P2PFontFile() +{ + if (fileName != 0) { + delete fileName; + } + if (charRefTable != 0) delete[] charRefTable; + if (fontName != 0) delete fontName; + /* font is deleted by P2PFontDict, you must not delete it here */ + /* must not delete CIDToGID */ +} + +GBool P2PFontFile::isIdentity() +{ + /* alway false now */ + return gFalse; +} + +void P2PFontFile::outputCIDToGID(GBool wmode, P2POutputStream *str, XRef *xref) +{ +#define N_UCS_CANDIDATES 2 + /* space characters */ + static unsigned long spaces[] = { + 0x2000,0x2001,0x2002,0x2003,0x2004,0x2005,0x2006,0x2007, + 0x2008,0x2009,0x200A,0x00A0,0x200B,0x2060,0x3000,0xFEFF, + 0 + }; + static const char *adobe_cns1_cmaps[] = { + "UniCNS-UTF32-V", + "UniCNS-UCS2-V", + "UniCNS-UTF32-H", + "UniCNS-UCS2-H", + 0 + }; + static const char *adobe_gb1_cmaps[] = { + "UniGB-UTF32-V", + "UniGB-UCS2-V", + "UniGB-UTF32-H", + "UniGB-UCS2-H", + 0 + }; + static const char *adobe_japan1_cmaps[] = { + "UniJIS-UTF32-V", + "UniJIS-UCS2-V", + "UniJIS-UTF32-H", + "UniJIS-UCS2-H", + 0 + }; + static const char *adobe_japan2_cmaps[] = { + "UniHojo-UTF32-V", + "UniHojo-UCS2-V", + "UniHojo-UTF32-H", + "UniHojo-UCS2-H", + 0 + }; + static const char *adobe_korea1_cmaps[] = { + "UniKS-UTF32-V", + "UniKS-UCS2-V", + "UniKS-UTF32-H", + "UniKS-UCS2-H", + 0 + }; + static struct CMapListEntry { + const char *collection; + const char *scriptTag; + const char *toUnicodeMap; + const char **CMaps; + } CMapList[] = { + { + "Adobe-CNS1", + "kana", + "Adobe-CNS1-UCS2", + adobe_cns1_cmaps, + }, + { + "Adobe-GB1", + "kana", + "Adobe-GB1-UCS2", + adobe_gb1_cmaps, + }, + { + "Adobe-Japan1", + "kana", + "Adobe-Japan1-UCS2", + adobe_japan1_cmaps, + }, + { + "Adobe-Japan2", + "kana", + "Adobe-Japan2-UCS2", + adobe_japan2_cmaps, + }, + { + "Adobe-Korea1", + "kana", + "Adobe-Korea1-UCS2", + adobe_korea1_cmaps, + }, + { + 0 + } + }; + unsigned int i; + Unicode *humap = 0; + Unicode *vumap = 0; + Unicode *tumap = 0; + + if (charRefTable == 0 || maxRefCID == 0) { + str->putchar(0); + str->putchar(0); + return; + } + tfont.setupGSUB(0); /* reset GSUB */ + if (font != 0) { + const char **cmapName; + P2PCMap *cMap; + CMapListEntry *lp; + CharCodeToUnicode *octu; + + GfxCIDFont *cidfont = static_cast<GfxCIDFont *>(font); + for (lp = CMapList;lp->collection != 0;lp++) { + if (strcmp(lp->collection,cidfont->getCollection()->getCString()) == 0) { + break; + } + } + tumap = new Unicode[maxRefCID+1]; + if (lp->collection != 0) { + GooString tname(lp->toUnicodeMap); + P2PCharCodeToUnicode *ctu; + if ((ctu = P2PCharCodeToUnicode::parseCMapFromFile(&tname,16)) != 0) { + CharCode cid; + for (cid = 0;cid <= maxRefCID ;cid++) { + int len; + Unicode ucodes[4]; + + len = ctu->mapToUnicode(cid,ucodes,4); + if (len == 1) { + tumap[cid] = ucodes[0]; + } else { + /* if not single character, ignore it */ + tumap[cid] = 0; + } + } + delete ctu; + } + vumap = new Unicode[maxRefCID+1]; + memset(vumap,0,sizeof(Unicode)*(maxRefCID+1)); + humap = new Unicode[(maxRefCID+1)*N_UCS_CANDIDATES]; + memset(humap,0,sizeof(Unicode)*(maxRefCID+1)*N_UCS_CANDIDATES); + for (cmapName = lp->CMaps;*cmapName != 0;cmapName++) { + GooString cname(*cmapName); + + if ((cMap = P2PCMap::parse(&cmapCache,cidfont->getCollection(),&cname)) + != 0) { + if (cMap->getWMode()) { + cMap->setReverseMap(vumap,maxRefCID+1,1); + } else { + cMap->setReverseMap(humap,maxRefCID+1,N_UCS_CANDIDATES); + } + cMap->decRefCnt(); + } + } + tfont.setupGSUB(lp->scriptTag); + } else { + error(-1,const_cast<char *>("Unknown character collection %s\n"), + cidfont->getCollection()->getCString()); + if ((octu = cidfont->getToUnicode()) != 0) { + CharCode cid; + for (cid = 0;cid <= maxRefCID ;cid++) { + int len; +#ifdef OLD_MAPTOUNICODE + Unicode ucode; + + len = octu->mapToUnicode(cid,&ucode,1); + humap[cid*N_UCS_CANDIDATES] = ucode; +#else + Unicode *ucode = NULL; + + len = octu->mapToUnicode(cid,&ucode); + humap[cid*N_UCS_CANDIDATES] = *ucode; +#endif + for (i = 1;i < N_UCS_CANDIDATES;i++) { + humap[cid*N_UCS_CANDIDATES+i] = 0; + } + } + octu->decRefCnt(); + } + } + } + for (i = 0;i <= maxRefCID;i++) { + Unicode unicode; + unsigned long gid; + int j; + + if ((charRefTable[i/8] & (1 << (i & (8-1)))) == 0) { + /* not referenced CID */ + gid = 0; + } else { + /* referenced CID */ + unicode = 0; + gid = 0; + if (humap != 0) { + for (j = 0;j < N_UCS_CANDIDATES + && gid == 0 && (unicode = humap[i*N_UCS_CANDIDATES+j]) != 0;j++) { + gid = tfont.getGID(unicode,gFalse, + P2PDoc::options.fontEmbeddingWhole ? 1 : 0); + } + } + if (gid == 0 && vumap != 0) { + unicode = vumap[i]; + if (unicode != 0) { + gid = tfont.getGID(unicode,gTrue, + P2PDoc::options.fontEmbeddingWhole ? 1 : 0); + if (gid == 0 && tumap != 0) { + if ((unicode = tumap[i]) != 0) { + gid = tfont.getGID(unicode,gTrue, + P2PDoc::options.fontEmbeddingWhole ? 1 : 0); + } + } + } + } + if (gid == 0 && tumap != 0) { + if ((unicode = tumap[i]) != 0) { + gid = tfont.getGID(unicode,gFalse, + P2PDoc::options.fontEmbeddingWhole ? 1 : 0); + } + } + if (gid == 0) { + /* special handling space characters */ + unsigned long *p; + + if (humap != 0) unicode = humap[i]; + if (unicode != 0) { + /* check if code is space character , so map code to 0x0020 */ + for (p = spaces;*p != 0;p++) { + if (*p == unicode) { + unicode = 0x20; + gid = tfont.getGID(unicode,wmode, + P2PDoc::options.fontEmbeddingWhole ? 1 : 0); + break; + } + } + } + } + } + /* output GID + size is 16bits. + should output big endian format. + */ + str->putchar((gid >> 8) & 0xff); + str->putchar(gid & 0xff); + } + if (humap != 0) delete[] humap; + if (vumap != 0) delete[] vumap; +} + +void P2PFontFile::output(P2POutputStream *str, XRef *xref) +{ + int fd; + char buf[BUFSIZ]; + int n; + P2PObj *lenObj = new P2PObj(); + P2PObj *len1Obj = 0; + int cp; + int len,len1 = 0; + +// fprintf(stderr,"INFO:Embedding font file from file %s\n", +// fileName->getCString()); + outputBegin(str); + /* output stream dictionary */ + str->puts("<< "); + switch (type) { + case fontType1C: + str->puts("/SubType /Type1C "); + /* should output Length1, Length2, Length3 */ + break; + case fontCIDType0C: + str->puts("/SubType /CIDFontType0C "); + /* should output Length1, Length2, Length3 */ + break; + case fontTrueType: + case fontCIDType2: + len1Obj = new P2PObj(); + P2PXRef::put(len1Obj); + str->puts("/Length1 "); + len1Obj->outputRef(str); + break; + case fontType1: + case fontCIDType0: + /* should output Length1, Length2, Length3 */ + break; + default: + break; + } + P2PXRef::put(lenObj); + str->puts("/Length "); + lenObj->outputRef(str); + if (P2PDoc::options.fontCompress && str->canDeflate()) { + str->puts(" /Filter /FlateDecode "); + } + str->puts(" >>\n"); + + /* output stream body */ + str->puts("stream\n"); + if (P2PDoc::options.fontCompress) str->startDeflate(); + cp = str->getPosition(); + switch (type) { + case fontCIDType2: + tfont.output(str); + len1 = tfont.getLength(); + break; + case fontType1: + case fontCIDType0: + case fontType1C: + case fontCIDType0C: + case fontTrueType: + default: + if ((fd = open(fileName->getCString(),O_RDONLY)) < 0) { + error(-1,const_cast<char *>("Cannot open FontFile:%s\n"),fileName->getCString()); + return; + } + while ((n = read(fd,buf,BUFSIZ)) > 0) { + char *p = buf; + int r; + + while (n > 0) { + r = str->write(p,n); + if (r <= 0) break; + n -= r; + p += r; + } + } + close(fd); + break; + } + + if (P2PDoc::options.fontCompress) str->endDeflate(); + len = str->getPosition()-cp; /* calculate length */ + str->puts("\nendstream\n"); + + outputEnd(str); + + /* output length */ + lenObj->outputBegin(str); + str->printf("%d\n",len); + lenObj->outputEnd(str); + + if (len1Obj != 0) { + /* output length1 */ + len1Obj->outputBegin(str); + str->printf("%d\n",len1); + len1Obj->outputEnd(str); + } +} + +P2PFontDescriptor::P2PFontDescriptor(Object *descriptorA, + GfxFont *fontA, GooString *fileName, GfxFontType typeA, + int faceIndexA, XRef *xref, int num, int gen) : P2PObject(num,gen) +{ + descriptorA->copy(&descriptor); + fontFile = P2PFontFile::getFontFile(fileName,fontA,typeA,faceIndexA); + type = typeA; +} + +P2PFontDescriptor::~P2PFontDescriptor() +{ + /* fontFile is pointed by multiple FontDescriptor, + so, don't delete it here. it is deleted by P2PXRef::clean() */ + + descriptor.free(); +} + +void P2PFontDescriptor::output(P2POutputStream *str, XRef *xref) +{ + P2PObject *objs[2]; + const char *keys[2]; + int objsIndex = 0; + P2PObj fnobj; + + /* only indirect referenced */ + outputBegin(str); + if (fontFile != 0) { + UGooString *fn; + + switch (type) { + case fontCIDType0: + case fontType1: + default: + keys[objsIndex] = "FontFile"; + break; + case fontCIDType2: + case fontTrueType: + keys[objsIndex] = "FontFile2"; + break; + case fontType1C: + case fontCIDType0C: + keys[objsIndex] = "FontFile3"; + break; + } + objs[objsIndex++] = fontFile; + fn = fontFile->getFontName(); + if (fn != 0) { + char *p; + + p = fn->getCString(); + fnobj.getObj()->initName(p); + keys[objsIndex] = "FontName"; + objs[objsIndex++] = &fnobj; + delete[] p; + } + } + P2POutput::outputDict(descriptor.getDict(),keys,objs,objsIndex,str,xref); + str->putchar('\n'); + outputEnd(str); +} + +P2PCIDFontDict::P2PCIDFontDict(Object *fontDictA, GfxFont *fontA, + GfxFontType typeA, GfxFontType embeddedTypeA, + P2PFontDescriptor *fontDescriptorA, int num, int gen) : P2PObject(num,gen) +{ + type = typeA; + embeddedType = embeddedTypeA; + fontDictA->copy(&fontDict); + fontDescriptor = fontDescriptorA; + font = fontA; +} + +P2PCIDFontDict::~P2PCIDFontDict() +{ + fontDict.free(); + /* must not delete font, it is deleted by P2PFontDict::~P2PFonrDict(). */ +} + +void P2PCIDFontDict::output(P2POutputStream *str, XRef *xref) +{ + P2PObject *objs[3]; + const char *keys[3]; + int objsIndex = 0; + P2PObj *subtypeObjp = 0; + P2PObj fnobj; + + if (embeddedType != type) { + /* change subtype */ + + subtypeObjp = new P2PObj(); + switch (embeddedType) { + case fontCIDType0: + subtypeObjp->getObj()->initName(const_cast<char *>("CIDFontType0")); + break; + case fontCIDType2: + subtypeObjp->getObj()->initName(const_cast<char *>("CIDFontType2")); + break; + case fontTrueType: + case fontUnknownType: + case fontType1: + case fontType1C: + case fontType3: + case fontCIDType0C: + default: + error(-1,const_cast<char *>("P2PCIDFontDict: Illegal embedded font type")); + goto end_output; + break; + } + keys[objsIndex] = "Subtype"; + objs[objsIndex++] = subtypeObjp; + } + if (embeddedType == fontCIDType2) { + /* Add CIDToGIDMap */ + P2PObject *objp; + P2PFontFile *fontFile; + + fontFile = fontDescriptor->getFontFile(); + if (fontFile != 0) { + UGooString *fn; + + if (!(fontFile->isIdentity())) { + keys[objsIndex] = "CIDToGIDMap"; + objp = fontFile->getCIDToGID(font->getWMode()); + objs[objsIndex++] = objp; + } + fn = fontFile->getFontName(); + if (fn != 0) { + char *p = fn->getCString(); + fnobj.getObj()->initName(p); + keys[objsIndex] = "BaseFont"; + objs[objsIndex++] = &fnobj; + delete[] p; + } + } + } + + outputBegin(str); + P2POutput::outputDict(fontDict.getDict(),keys,objs,objsIndex,str,xref); + str->putchar('\n'); + outputEnd(str); +end_output: + if (subtypeObjp != 0) { + delete subtypeObjp; + } +} + +P2PDescendantFontsWrapper::P2PDescendantFontsWrapper(P2PObject *elementA) +{ + element = elementA; +} + +P2PDescendantFontsWrapper::~P2PDescendantFontsWrapper() +{ + /* do nothing */ +} + +void P2PDescendantFontsWrapper::output(P2POutputStream *str, XRef *xref) +{ + str->puts("[ "); + element->outputRef(str); + str->puts(" ]"); +} + +void P2PFontDict::doReadFontDescriptor(Object *dictObj, + GfxFontType type, const char *name, XRef *xref) +{ + Dict *dict = dictObj->getDict(); + Object obj; + int num, gen; + P2PObject *p; + int faceIndex = 0; + + if (dict->lookupNF(const_cast<char *>("FontDescriptor"),&obj) == 0) { + /* no FontDescriptor */ + error(-1,const_cast<char *>("Font:%s has no FontDescriptor entry.\n"),name); + return; + } + if (!obj.isRef()) { + /* not indirect reference is error */ + error(-1,const_cast<char *>("FontDescriptor entry of Font:%s is not indirect.\n"),name); + goto end_read; + } + num = obj.getRefNum(); + gen = obj.getRefGen(); + if ((p = P2PObject::find(num,gen)) != 0) { + /* already read */ + fontDescriptor = static_cast<P2PFontDescriptor *>(p); + embeddedType = fontDescriptor->getType(); + } else { + GooString *fileName = font->getExtFontFile(); + P2PFontFile *fp; + UGooString *ugs; + + if (fileName == 0) { + DisplayFontParam *dfp = 0; + /* look for substitute font */ + + if (font->getName()) { + dfp = globalParams->getDisplayFont(font); + /* a caller must not delete dfp */ + } + if (dfp == 0) { + error(-1, const_cast<char *>("Couldn't find a font for %s. Not embedded\n"),name); + goto end_read; + } + switch (dfp->kind) { + case displayFontT1: +#if 0 + switch (type) { + case fontType1: + case fontCIDType0: +fprintf(stderr, "DEBUG:found a font:Type1 %s. Embedding Type1 Font\n",dfp->tt.fileName->getCString()); + break; + case fontCIDType0C: + case fontCIDType2: +fprintf(stderr, "DEBUG:found a mismatch type font:Type1 %s. Embedding Type1 Font\n",dfp->tt.fileName->getCString()); + embeddedType = fontCIDType0; + break; + case fontType1C: + case fontTrueType: +fprintf(stderr, "DEBUG:found a mismatch type font:Type1 %s. Embedding Type1 Font\n",dfp->tt.fileName->getCString()); + embeddedType = fontType1; + break; + default: + error(-1, const_cast<char *>("Illegal type font\n")); + goto end_read; + } + fileName = dfp->t1.fileName; +#else + error(-1, const_cast<char *>("Found a Type1 font for font:%s. Embedding Type1 font not supported yet."),name); + goto end_read; +#endif + break; + case displayFontTT: + switch (type) { + case fontCIDType2: + case fontTrueType: +//fprintf(stderr, "DEBUG:found a font:TrueType %s. Embedding TrueType Font\n",dfp->tt.fileName->getCString()); + break; + case fontCIDType0C: + case fontCIDType0: +//fprintf(stderr, "DEBUG:found a mismatch type font:TrueType %s. Embedding TrueType Font\n",dfp->tt.fileName->getCString()); + embeddedType = fontCIDType2; + break; + case fontType1: + case fontType1C: +//fprintf(stderr, "DEBUG:found a mismatch type font:TrueType %s. Embedding TrueType Font\n",dfp->tt.fileName->getCString()); + embeddedType = fontTrueType; + break; + default: + error(-1, const_cast<char *>("Illegal type font\n")); + goto end_read; + } + fileName = dfp->tt.fileName; + faceIndex = dfp->tt.faceIndex; + break; + default: + error(-1, const_cast<char *>("found a unknown type font for %s. Not embedded\n"),name); + goto end_read; + break; + } + } + /* reset obj */ + obj.free(); + + xref->fetch(num,gen,&obj); + if (!obj.isDict()) { + error(-1, const_cast<char *>("Font Descriptor of Font:%s is not Dictionary. Not embedded\n"),name); + goto end_read; + } +//fprintf(stderr, "DEBUG: Embedding Font fileName=%s for %s\n",fileName->getCString(),name); + fontDescriptor = new P2PFontDescriptor(&obj,font,fileName, + embeddedType, faceIndex, xref,num,gen); + P2PXRef::put(fontDescriptor); + fp = fontDescriptor->getFontFile(); + ugs = 0; + if (fp != 0) { + ugs = fp->getFontName(); + if (ugs != 0) { + char *cs = ugs->getCString(); + + fprintf(stderr, "INFO: Embedded Font=%s, from fileName=%s for %s\n", + cs,fileName->getCString(),name); + delete[] cs; + } + } + if (ugs == 0) { + fprintf(stderr, "INFO: Embedded Font from fileName=%s for %s\n", + fileName->getCString(),name); + } + } +end_read: + obj.free(); +} + +void P2PFontDict::read8bitFontDescriptor(GfxFontType type, const char *name, + XRef *xref) +{ + doReadFontDescriptor(&fontDict,type,name,xref); +} + +void P2PFontDict::readCIDFontDescriptor(GfxFontType type, const char *name, + XRef *xref) +{ + Object obj; + Object descendant; + Dict *dict = fontDict.getDict(); + int num = -1, gen = -1; + + if (dict->lookup(const_cast<char *>("DescendantFonts"),&obj) == 0) { + /* no DescendantFonts */ + error(-1,const_cast<char *>("Font:%s has no DescendantFonts entry.\n"),name); + return; + } + if (!obj.isArray() || obj.arrayGetNF(0,&descendant) == 0) { + /* illegal DescendantFonts */ + error(-1,const_cast<char *>("Font:%s has illegal DescendantFonts entry.\n"),name); + goto end_read; + } + if (descendant.isRef()) { + num = descendant.getRefNum(); + gen = descendant.getRefGen(); + + cidFontDict = static_cast<P2PCIDFontDict *>( + P2PObject::find(num,gen)); + if (cidFontDict == 0) { + /* reset obj */ + descendant.free(); + xref->fetch(num,gen,&descendant); + } + } + if (!descendant.isDict()) { + error(-1,const_cast<char *>("Font:%s has illegal DescendantFonts entry.\n"),name); + goto end_read1; + } + doReadFontDescriptor(&descendant,type,name,xref); + if (cidFontDict == 0) { + cidFontDict = new P2PCIDFontDict(&descendant,font,type, + embeddedType,fontDescriptor,num,gen); + if (num > 0) P2PXRef::put(cidFontDict); + } +end_read1: + descendant.free(); +end_read: + obj.free(); +} + +UGooString *P2PFontDict::getEmbeddingFontName() +{ + P2PFontDescriptor *desc = fontDescriptor; + + if (cidFontDict != 0) { + desc = cidFontDict->getFontDescriptor(); + } + if (desc != 0) { + P2PFontFile *file = desc->getFontFile(); + if (file != 0) return file->getFontName(); + } + return 0; +} + +void P2PFontDict::output(P2POutputStream *str, XRef *xref) +{ + int num, gen; + P2PObject *objs[2]; + const char *keys[2]; + int nobjs = 0; + UGooString *fn; + P2PObj fnobj; + + fn = getEmbeddingFontName(); + if (fn != 0) { + keys[nobjs] = "BaseFont"; + char *p = fn->getCString(); + fnobj.getObj()->initName(p); + objs[nobjs] = &fnobj; + nobjs++; + delete[] p; + } + /* output indirect referenced dictionary only */ + outputBegin(str); + if (cidFontDict != 0) { + cidFontDict->getNum(&num,&gen); + if (num < 0) { + /* not indirect referenced, change it indirect referenced */ + P2PDescendantFontsWrapper *wrap + = new P2PDescendantFontsWrapper(cidFontDict); + keys[nobjs] = "DescendantFonts"; + objs[nobjs] = wrap; + nobjs++; + + P2POutput::outputDict(fontDict.getDict(),keys,objs,nobjs,str,xref); + delete wrap; + P2PXRef::put(cidFontDict); + } else { + P2POutput::outputDict(fontDict.getDict(),keys,objs,nobjs,str,xref); + } + } else { + if (embeddedType != font->getType()) { + /* change subtype */ + P2PObj obj; + keys[nobjs] = "Subtype"; + objs[nobjs] = &obj; + nobjs++; + + switch (embeddedType) { + case fontTrueType: + obj.getObj()->initName(const_cast<char *>("TrueType")); + P2POutput::outputDict(fontDict.getDict(),keys,objs,nobjs,str,xref); + break; + case fontType1: + obj.getObj()->initName(const_cast<char *>("Type1")); + P2POutput::outputDict(fontDict.getDict(),keys,objs,nobjs,str,xref); + break; + case fontCIDType2: + case fontCIDType0: + case fontCIDType0C: + /* change is not needed */ + P2POutput::outputDict(fontDict.getDict(),keys,objs,nobjs,str,xref); + break; + case fontType1C: + case fontUnknownType: + case fontType3: + default: + error(-1,const_cast<char *>("P2PFontDict: Illegal embedded font type")); + return; + break; + } + } else { + P2POutput::outputDict(fontDict.getDict(),keys,objs,nobjs,str,xref); + } + } + str->putchar('\n'); + outputEnd(str); +} + +P2PFontDict::P2PFontDict(Object *fontDictA, XRef *xref, int num, int gen) + : P2PObject(num,gen) +{ + Ref embID; + Ref id; + Dict *dict; + Object name; + GfxFontType type; + + font = 0; + fontDescriptor = 0; + cidFontDict = 0; + if (fontDictA == 0 || !fontDictA->isDict()) return; + fontDictA->copy(&fontDict); + + dict = fontDict.getDict(); + dict->lookup(const_cast<char *>("BaseFont"),&name); + if (!name.isName()) { + error(-1,const_cast<char *>("FontDictionary has not name type BaseFont entry\n")); + goto end_setup; + } + /* font id and tag are not used */ + if ((font = GfxFont::makeFont(xref,const_cast<char *>(""), + id,fontDict.getDict())) == 0) { + error(-1,const_cast<char *>("Can't get font %s. Not embedded\n"), + name.getName()); + goto end_setup; + } + embeddedType = type = font->getType(); + if (!font->getEmbeddedFontID(&embID)) { + /* not embedded */ + int i; + const char *namep = name.getName(); + +//fprintf(stderr,"DEBUG:%s is not embedded\n",name.getName()); + + /* check builtin fonts */ + for (i = 0;i < nBuiltinFonts;i++) { + if (strcmp(namep, builtinFonts[i].name) == 0) { + /* built in font */ + /* don't embed built in font */ + fprintf(stderr,"INFO:%s is builtin font. not embedded.\n",namep); + goto end_setup; + } + } + + if (!P2PDoc::options.fontEmbeddingPreLoad) { + /* check pre-loaded fonts */ + for (i = 0;i < P2PDoc::options.numPreFonts;i++) { + if (strcmp(namep, P2PDoc::options.preFonts[i]) == 0) { + /* pre-loaded font */ + /* don't embed pre-loaded font */ + fprintf(stderr,"INFO:%s is pre-loaded font. not embedded.\n",namep); + goto end_setup; + } + } + } + + switch (type) { + case fontType3: + /* Type3 font is always embedded */ + /* do nothing */ + break; + case fontTrueType: + case fontUnknownType: + case fontType1: + case fontType1C: +#ifdef FONTTYPE_ENUM2 + case fontType1COT: + case fontTrueTypeOT: +#endif + /* 8bit font */ + read8bitFontDescriptor(type,name.getName(),xref); + break; + case fontCIDType0: + case fontCIDType0C: + case fontCIDType2: +#ifdef FONTTYPE_ENUM2 + case fontCIDType0COT: + case fontCIDType2OT: +#endif + /* CID font */ + readCIDFontDescriptor(type,name.getName(),xref); + break; + } + } else { + /* embedded */ + } +end_setup: + name.free(); +} + +P2PFontDict::~P2PFontDict() +{ + if (font != 0) { + delete font; + } + /* fontDescriptor is pointed by multiple FontDict, + so, don't delete it here. it is deleted by P2PXRef::clean() */ + /* cidFontDict is pointed by multiple FontDict, + so, don't delete it here. it is deleted by P2PXRef::clean() */ + + fontDict.free(); +} + +void P2PFontDict::showText(GooString *s) +{ + char *p; + int len; + int n; +#ifdef OLD_MAPTOUNICODE + Unicode u[8]; +#else + Unicode *u = NULL; +#endif + CharCode code; + int uLen; + double dx,dy,originX,originY; + P2PFontFile *fontFile; + + if (font == 0 || fontDescriptor == 0) return; + if ((fontFile = fontDescriptor->getFontFile()) == 0) return; + p = s->getCString(); + len = s->getLength(); + while (len > 0) { +#ifdef OLD_MAPTOUNICODE + n = font->getNextChar(p,len,&code,u,(sizeof(u)/sizeof(Unicode)),&uLen, + &dx,&dy,&originX,&originY); +#else + n = font->getNextChar(p,len,&code,&u,&uLen, + &dx,&dy,&originX,&originY); +#endif + code &= (CIDTOGID_SIZE-1); /* mask */ + fontFile->refChar(code); + p += n; + len -= n; + } +} + +P2PFontResource::P2PFontResource() +{ + keys = 0; + fontDicts = 0; + nDicts = 0; + nExtGState = 0; + extGStateKeys = 0; + extGStateFonts = 0; +} + +P2PFontResource::~P2PFontResource() +{ + int i; + + if (keys != 0) { + for (i = 0;i < nDicts;i++) { + delete keys[i]; + } + delete[] keys; + } + if (fontDicts != 0) { + for (i = 0;i < nDicts;i++) { + if (fontDicts[i] != 0) { + int num, gen; + + fontDicts[i]->getNum(&num,&gen); + if (num < 0) { + /* Not indirect referenced FontDict */ + /* output it as normal dictionary */ + /* so, not needed any more */ + delete fontDicts[i]; + } + /* indirect referenced FontDict is registered in P2PXRef */ + /* So, should not delete it. */ + } + } + delete[] fontDicts; + } + if (extGStateKeys != 0) { + for (i = 0;i < nExtGState;i++) { + delete extGStateKeys[i]; + } + delete[] extGStateKeys; + } + if (extGStateFonts != 0) { + /* indirect referenced FontDict is registered in P2PXRef */ + /* So, should not delete it. */ + delete[] extGStateFonts; + } +} + +void P2PFontResource::setup(P2PResources *resources, XRef *xref) +{ + doSetup(resources->getFontResource(),xref); + doSetupExtGState(resources->getExtGState(),xref); +} + +void P2PFontResource::setup(Dict *resources, XRef *xref) +{ + Object obj; + + if (resources == 0) return; + resources->lookup(const_cast<char *>("Font"),&obj); + if (obj.isDict()) { + doSetup(obj.getDict(),xref); + } + obj.free(); + resources->lookup(const_cast<char *>("ExtGState"),&obj); + if (obj.isDict()) { + doSetupExtGState(obj.getDict(),xref); + } + obj.free(); +} + +void P2PFontResource::doSetup(Dict *fontResource, XRef *xref) +{ + int i; + P2PFontDict *p = 0; + + if (fontResource == 0) return; + nDicts = fontResource->getLength(); + keys = new UGooString *[nDicts]; + fontDicts = new P2PFontDict *[nDicts]; + for (i = 0;i < nDicts;i++) { + Object obj; +#ifdef HAVE_UGOOSTRING_H + UGooString *key = fontResource->getKey(i); +#else + UGooString *key = new UGooString(fontResource->getKey(i)); +#endif + + fontResource->getValNF(i,&obj); + if (obj.isRef()) { + int num = obj.getRefNum(); + int gen = obj.getRefGen(); + if ((p = static_cast<P2PFontDict *>(P2PObject::find(num,gen))) == 0) { + Object fobj; + + xref->fetch(num,gen,&fobj); + if (fobj.isDict()) { + p = new P2PFontDict(&fobj,xref,num,gen); + /* register this in P2PXRef to output later */ + P2PXRef::put(p); + } + fobj.free(); + } + } + if (p != 0) { + keys[i] = new UGooString(*key); + fontDicts[i] = p; + } else if (obj.isDict()) { + keys[i] = new UGooString(*key); + fontDicts[i] = new P2PFontDict(&obj,xref); + P2PXRef::put(fontDicts[i]); + } else { + keys[i] = 0; + fontDicts[i] = 0; + } + obj.free(); + } +} + +void P2PFontResource::doSetupExtGState(Dict *extGState, XRef *xref) +{ + int i; + P2PFontDict *p = 0; + + if (extGState == 0) return; + nExtGState = extGState->getLength(); + extGStateKeys = new UGooString *[nExtGState]; + extGStateFonts = new P2PFontDict *[nExtGState]; + for (i = 0;i < nExtGState;i++) { + Object gstateObj; +#ifdef HAVE_UGOOSTRING_H + UGooString *key = extGState->getKey(i); +#else + char *key = extGState->getKey(i); +#endif + + extGStateKeys[i] = 0; + extGStateFonts[i] = 0; + extGState->getVal(i,&gstateObj); + if (gstateObj.isDict()) { + Object fontArrayObj; + Dict *gstate = gstateObj.getDict(); + + if (gstate->lookup(const_cast<char *>("Font"),&fontArrayObj) != 0) { + if (fontArrayObj.isArray() && fontArrayObj.arrayGetLength() > 0) { + Object fontRefObj; + + if (fontArrayObj.arrayGetNF(0,&fontRefObj) && fontRefObj.isRef()) { + int num = fontRefObj.getRefNum(); + int gen = fontRefObj.getRefGen(); + + if ((p = static_cast<P2PFontDict *>(P2PObject::find(num,gen))) + == 0) { + Object fontObj; + xref->fetch(num,gen,&fontObj); + if (fontObj.isDict()) { + p = new P2PFontDict(&fontObj,xref,num,gen); + /* register this in P2PXRef to output later */ + P2PXRef::put(p); + } + fontObj.free(); + } + } + fontRefObj.free(); + } +#ifdef HAVE_UGOOSTRING_H + extGStateKeys[i] = new UGooString(*key); +#else + extGStateKeys[i] = new UGooString(key); +#endif + extGStateFonts[i] = p; + } + fontArrayObj.free(); + } + gstateObj.free(); + } +} + +void P2PFontResource::output(P2POutputStream *str, XRef *xref) +{ + int i; + + str->puts("<< "); + for (i = 0;i < nDicts;i++) { + P2POutput::outputName(keys[i]->getCString(),str); + str->putchar(' '); + fontDicts[i]->outputRef(str); + str->putchar('\n'); + } + str->puts(" >>"); +} + +P2PFontDict *P2PFontResource::lookup(const UGooString &key) +{ + int i; + + for (i = 0;i < nDicts;i++) { + if (key.cmp(keys[i]) == 0) { + return fontDicts[i]; + } + } + return 0; +} + +P2PFontDict *P2PFontResource::lookupExtGState(const UGooString &key) +{ + int i; + + for (i = 0;i < nExtGState;i++) { + if (extGStateKeys != 0 && key.cmp(extGStateKeys[i]) == 0) { + return extGStateFonts[i]; + } + } + return 0; +} --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/P2PCatalog.h +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/P2PCatalog.h @@ -0,0 +1,64 @@ +/* + +Copyright (c) 2006-2007, BBR Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +/* + P2PCatalog.h + pdftopdf document catalog +*/ +#ifndef _P2PCATALOG_H_ +#define _P2PCATALOG_H_ + +#include "goo/gtypes.h" +#include "goo/gmem.h" +#include "Object.h" +#include "Catalog.h" +#include "P2PObject.h" +#include "P2PPageTree.h" +#include "P2POutputStream.h" +#include "XRef.h" +#include "Page.h" +#include "P2PDoc.h" + +class P2PCatalog: public P2PObject { +public: + P2PCatalog(Catalog *orgCatalogA, XRef *xrefA); + virtual ~P2PCatalog(); + /* output self and all pages */ + virtual void output(P2POutputStream *str, int copies, GBool collate); + int nup(int n, PDFRectangle *box, unsigned int borderFlag, + unsigned int layout, int xpos, int ypos); + void fit(PDFRectangle *box, double zoom); + void mirror(); + void rotate(int orientation); + void position(PDFRectangle *box, int xpos, int ypos); + void scale(double zoom); + int getNumberOfPages(); +private: + XRef *xref; + Catalog *orgCatalog; + P2PPageTree *pageTree; + void outputSelf(P2POutputStream *str); +}; + +#endif --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/P2PDoc.h +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/P2PDoc.h @@ -0,0 +1,122 @@ +/* + +Copyright (c) 2006-2007, BBR Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +/* + P2PDoc.h + pdftopdf document +*/ +#ifndef _P2PDOC_H_ +#define _P2PDOC_H_ + +#include "PDFDoc.h" +#include "P2POutputStream.h" +#include "P2PPage.h" + +#define PDFTOPDF_BORDERNONE 0 /* No border */ +#define PDFTOPDF_BORDERHAIRLINE 1 /* hairline border */ +#define PDFTOPDF_BORDERTHICK 2 /* thick border */ +#define PDFTOPDF_BORDERDOUBLE 4 /* double line border */ + +#define PDFTOPDF_LAYOUT_LRBT 0 /* Left to right, bottom to top */ +#define PDFTOPDF_LAYOUT_LRTB 1 /* Left to right, top to bottom */ +#define PDFTOPDF_LAYOUT_RLBT 2 /* Right to left, bottom to top */ +#define PDFTOPDF_LAYOUT_RLTB 3 /* Right to left, top to bottom */ +#define PDFTOPDF_LAYOUT_BTLR 4 /* Bottom to top, left to right */ +#define PDFTOPDF_LAYOUT_TBLR 5 /* Top to bottom, left to right */ +#define PDFTOPDF_LAYOUT_BTRL 6 /* Bottom to top, right to left */ +#define PDFTOPDF_LAYOUT_TBRL 7 /* Top to bottom, right to left */ + +#define PDFTOPDF_LAYOUT_NEGATEY 1 /* The bits for the layout */ +#define PDFTOPDF_LAYOUT_NEGATEX 2 /* definitions above... */ +#define PDFTOPDF_LAYOUT_VERTICAL 4 + +class P2PCatalog; + +class P2PDoc { +public: + struct Options { + Options() { + duplex = gFalse; + copies = 1; + collate = gFalse; + user = 0; + title = 0; + jobId = 0; + pageLabel = 0; + pageRanges = 0; + pageSet = 0; + reverse = gFalse; + even = gFalse; + contentsCompress = gFalse; + fontEmbedding = gFalse; + fontEmbeddingWhole = gFalse; + fontCompress = gFalse; + numPreFonts = 0; + preFonts = 0; + fontEmbeddingPreLoad = gFalse; + }; + ~Options() {} + + int orientation; + GBool duplex; + GBool collate; + int copies; + const char *user; + const char *title; + int jobId; + const char *pageLabel; + const char *pageRanges; + const char *pageSet; + GBool reverse; + GBool even; + GBool contentsCompress; + GBool fontEmbedding; + GBool fontEmbeddingWhole; + GBool fontCompress; + GBool fontEmbeddingPreLoad; + int numPreFonts; + char **preFonts; + }; + + static Options options; + + P2PDoc(PDFDoc *orgDocA); + + virtual ~P2PDoc(); + void output(P2POutputStream *str, int deviceCopies = 0, + bool deviceCollate = false); + int nup(int n, PDFRectangle *box, unsigned int borderFlag, + unsigned int layout, int xpos, int ypos); + void fit(PDFRectangle *box, double zoom); + void mirror(); + void rotate(int orientation); + void position(PDFRectangle *box, int xpos, int ypos); + void scale(double zoom); + int getNumberOfPages(); +private: + PDFDoc *orgDoc; + P2PCatalog *catalog; +}; + +#endif --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/P2PPattern.cxx +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/P2PPattern.cxx @@ -0,0 +1,232 @@ +/* + +Copyright (c) 2006-2007, BBR Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +/* + P2PPattern.cc + pdftopdf pattern object +*/ +#include "goo/gmem.h" +#include "Object.h" +#include "P2PObject.h" +#include "GfxState.h" +#include "Dict.h" +#include "XRef.h" +#include "P2POutputStream.h" +#include "P2PMatrix.h" +#include "P2PPattern.h" +#include "Error.h" +#include "P2PFont.h" +#include "P2PGfx.h" +#include "P2PDoc.h" + +P2PPattern::P2PPattern(Object *objA, XRef *xrefA, P2PMatrix *matA) +{ + P2PObject *pobj; + + mat = *matA; + if (objA->isRef()) { + pobj = P2PObject::find(objA->getRefNum(),objA->getRefGen()); + if (pobj != 0) { + pattern = static_cast<OrgPattern *>(pobj); + pattern->reference(); + } else { + pattern = new OrgPattern(objA->getRefNum(),objA->getRefGen(),xrefA); + } + } else if (objA->isDict()) { + pattern = new OrgPattern(objA); + } else { + error(-1,const_cast<char *>("Illegal Pattern object type")); + } +} + +P2PPattern::~P2PPattern() +{ + if (pattern != 0) { + int c = pattern->free(); + if (c <= 0) delete pattern; + pattern = 0; + } +} + +void P2PPattern::output(P2POutputStream *str, XRef *xrefA) +{ + GfxPattern *orgPattern; + + if (getOffset() >= 0) return; /* already output */ + if (pattern == 0 || (orgPattern = pattern->getPattern()) == 0) return; + switch (orgPattern->getType()) { + case 1: /* tiling pattern */ + outputTilingPattern(str,orgPattern, xrefA); + break; + case 2: /* shading pattern */ + outputShadingPattern(str,orgPattern,pattern->getOrgObject(),xrefA); + break; + default: + error(-1,const_cast<char *>("Unknown pattern type %d"),orgPattern->getType()); + break; + } +} + +void P2PPattern::outputTilingPattern(P2POutputStream *str, + GfxPattern *patternA, XRef *xref) +{ + P2PFontResource fontResource; + P2PFontResource *fr = 0; + Dict *resDict; + GfxTilingPattern *tilingPattern + = static_cast<GfxTilingPattern *>(patternA); + double *box; + double *orgMat; + Object lenobj; + int start; + int len; + + outputBegin(str); + + if (P2PDoc::options.fontEmbedding + && (resDict = tilingPattern->getResDict()) != 0) { + fontResource.setup(resDict,xref); + fr = &fontResource; + } + /* output dict part */ + str->puts("<< /Type /Pattern /PatternType 1"); + str->printf(" /PaintType %d",tilingPattern->getPaintType()); + str->printf(" /TilingType %d",tilingPattern->getTilingType()); + box = tilingPattern->getBBox(); + str->printf(" /BBox [ %f %f %f %f ]",box[0],box[1],box[2],box[3]); + str->printf(" /XStep %f",tilingPattern->getXStep()); + str->printf(" /YStep %f",tilingPattern->getYStep()); + str->puts(" /Resources "); + if ((resDict = tilingPattern->getResDict()) == 0) { + str->puts("<< /ProcSet [ /PDF ] >>"); + } else { + if (fr != 0) { + /* replace font resource */ + const char *p = "Font"; + P2PObject *objp = fr; + + P2POutput::outputDict(resDict,&p,&objp,1,str,xref); + } else { + P2POutput::outputDict(resDict,str,xref); + } + } + orgMat = tilingPattern->getMatrix(); + P2PMatrix porgMat(orgMat[0],orgMat[1],orgMat[2],orgMat[3], + orgMat[4],orgMat[5]); + porgMat.trans(&mat); + str->puts(" /Matrix [ "); + porgMat.output(str); + str->puts(" ]\n"); + str->puts(" /Length "); + P2PObj *pobj = new P2PObj(); + P2PXRef::put(pobj); + pobj->outputRef(str); + if (P2PDoc::options.contentsCompress && str->canDeflate()) { + str->puts(" /Filter /FlateDecode "); + } + str->puts(" >>\n"); + + /* output Contents */ + P2PGfx output(xref,str,fr,0); + str->puts("stream\n"); + start = str->getPosition(); + if (P2PDoc::options.contentsCompress) str->startDeflate(); + output.outputContents(tilingPattern->getContentStream(),0,resDict,&porgMat); + if (P2PDoc::options.contentsCompress) str->endDeflate(); + len = str->getPosition()-start; + str->puts("\nendstream\n"); + /* set length object value */ + lenobj.initInt(len); + pobj->setObj(&lenobj); + lenobj.free(); + + outputEnd(str); + + /* out length object */ + pobj->output(str,xref); +} + +void P2PPattern::outputShadingPattern(P2POutputStream *str, + GfxPattern *patternA, Object *objA, XRef *xref) +{ + GfxShadingPattern *shadingPattern + = static_cast<GfxShadingPattern *>(patternA); + double *orgMat; + Object matObj; + int i; + Object m[6]; + + outputBegin(str); + + orgMat = shadingPattern->getMatrix(); + P2PMatrix porgMat(orgMat[0],orgMat[1],orgMat[2],orgMat[3], + orgMat[4],orgMat[5]); + porgMat.trans(&mat); + /* make matrix object */ + matObj.initArray(xref); + for (i = 0;i < 6;i++) { + m[i].initReal(porgMat.mat[i]); + matObj.arrayAdd(&(m[i])); + } + + /* replace Matrix */ + const char *p = "Matrix"; + P2PObject *objp = new P2PObj(&matObj); + P2POutput::outputDict(objA->getDict(),&p,&objp,1,str,xref); + delete objp; + + outputEnd(str); + + matObj.free(); + for (i = 0;i < 6;i++) { + m[i].free(); + } +} + +P2PPattern::OrgPattern::OrgPattern(int orgNumA, int orgGenA, XRef *xref) + : P2PObject(orgNumA, orgGenA) +{ + pattern = 0; + refCount = 1; + xref->fetch(orgNumA,orgGenA,&orgObj); + if ((pattern = GfxPattern::parse(&orgObj)) == 0) { + error(-1,const_cast<char *>("Bad Pattern")); + } +} + +P2PPattern::OrgPattern::OrgPattern(Object *objA) +{ + pattern = 0; + refCount = 1; + objA->copy(&orgObj); + if ((pattern = GfxPattern::parse(&orgObj)) == 0) { + error(-1,const_cast<char *>("Bad Pattern")); + } +} + +P2PPattern::OrgPattern::~OrgPattern() +{ + if (pattern != 0) delete pattern; + orgObj.free(); +} --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/P2PFont.h +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/P2PFont.h @@ -0,0 +1,178 @@ +/* + +Copyright (c) 2006-2007, BBR Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +/* + P2PFont.h + pdftopdf Font manager +*/ +#ifndef _P2PFONT_H_ +#define _P2PFONT_H_ + +#include "goo/gmem.h" +#include "GfxFont.h" +#include "P2PObject.h" +#include "P2PResources.h" +#include "Dict.h" +#include "XRef.h" +#include "PDFFTrueTypeFont.h" +#include "P2PCMap.h" + +class P2PCIDToGID; + +class P2PFontFile : public P2PObject { +public: + ~P2PFontFile(); + static P2PFontFile *getFontFile(GooString *fileNameA, + GfxFont *fontA, GfxFontType typeA, int faceIndexA); + GooString *getFileName() { + return fileName; + } + void output(P2POutputStream *str, XRef *xref); + void outputCIDToGID(GBool wmode, P2POutputStream *str, XRef *xref); + GBool isIdentity(); + P2PCIDToGID *getCIDToGID(GBool wmode); + void refChar(CharCode cid) { + if (charRefTable == 0) return; + if (maxRefCID < cid) maxRefCID = cid; + /* mark reference bit */ + charRefTable[cid / 8] |= (1 << (cid & (8-1))); + } + UGooString *getFontName() { return fontName; } +private: + static char *getNextTag(); + P2PFontFile(GooString *fileNameA, GfxFont *fontA, + GfxFontType typeA, int faceIndexA); + static P2PFontFile **fontFileList; + static int nFontFiles; + static int fontFileListSize; + static char nextTag[7]; + + GooString *fileName; + GfxFont *font; + int faceIndex; + GfxFontType type; + P2PCIDToGID *CIDToGID; + P2PCIDToGID *CIDToGID_V; + unsigned char *charRefTable; + CharCode maxRefCID; + PDFFTrueTypeFont tfont; + UGooString *fontName; + P2PCMapCache cmapCache; +}; + +class P2PCIDToGID : public P2PObject { +public: + P2PCIDToGID(P2PFontFile *fontFileA, GBool wmodeA); + ~P2PCIDToGID(); + void output(P2POutputStream *str, XRef *xref); +private: + P2PFontFile *fontFile; + GBool wmode; +}; + +class P2PFontDescriptor : public P2PObject { +public: + P2PFontDescriptor(Object *descriptorA, GfxFont *fontA, + GooString *fileName, GfxFontType type, int faceIndexA, XRef *xref, + int num, int gen); + ~P2PFontDescriptor(); + void output(P2POutputStream *str, XRef *xref); + P2PFontFile *getFontFile() { return fontFile; } + GfxFontType getType() { return type; } +private: + P2PFontFile *fontFile; + Object descriptor; + GfxFontType type; +}; + +class P2PCIDFontDict : public P2PObject { +public: + P2PCIDFontDict(Object *fontDictA, GfxFont *fontA, GfxFontType typeA, + GfxFontType embeddedTypeA, + P2PFontDescriptor *fontDescriptorA, int num = -1, int gen = -1); + ~P2PCIDFontDict(); + void output(P2POutputStream *str, XRef *xref); + P2PFontDescriptor *getFontDescriptor() { return fontDescriptor; } +private: + Object fontDict; + GfxFontType type; + GfxFontType embeddedType; + P2PFontDescriptor *fontDescriptor; + GfxFont *font; +}; + +class P2PDescendantFontsWrapper : public P2PObject { +public: + P2PDescendantFontsWrapper(P2PObject *elementA); + ~P2PDescendantFontsWrapper(); + void output(P2POutputStream *str, XRef *xref); +private: + P2PObject *element; +}; + +class P2PFontDict : public P2PObject { +public: + P2PFontDict(Object *fontDictA, XRef *xref, int num = -1, int gen = -1); + ~P2PFontDict(); + void output(P2POutputStream *str, XRef *xref); + P2PCIDFontDict *getCIDFontDict() { return cidFontDict; } + void showText(GooString *s); + UGooString *getEmbeddingFontName(); +private: + void doReadFontDescriptor(Object *dictObj, GfxFontType type, + const char *name, XRef *xref); + void read8bitFontDescriptor(GfxFontType type, const char *name, + XRef *xref); + void readCIDFontDescriptor(GfxFontType type, const char *name, + XRef *xref); + P2PFontDescriptor *fontDescriptor; + GfxFont *font; + Object fontDict; + GfxFontType embeddedType; + P2PCIDFontDict *cidFontDict; +}; + +class P2PFontResource : public P2PObject { +public: + void setup(P2PResources *resources, XRef *xref); + void setup(Dict *resources, XRef *xref); + P2PFontDict *lookup(const UGooString &key); + P2PFontDict *lookupExtGState(const UGooString &key); + P2PFontResource(); + ~P2PFontResource(); + void output(P2POutputStream *str, XRef *xref); + int getNDicts() { return nDicts; } +private: + int getNExtGState() { return nExtGState; } + void doSetup(Dict *fontResource, XRef *xref); + void doSetupExtGState(Dict *extGState, XRef *xref); + int nDicts; + UGooString **keys; + P2PFontDict **fontDicts; + int nExtGState; + UGooString **extGStateKeys; + P2PFontDict **extGStateFonts; +}; + +#endif --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/PDFFTrueTypeFont.cxx +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/PDFFTrueTypeFont.cxx @@ -0,0 +1,1673 @@ +/* + +Copyright (c) 2006-2007, BBR Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +/* + PDFFTrueTypeFont.cc + TrueType font manager +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <unistd.h> +#include <sys/mman.h> +#include <string.h> +#include "PDFFTrueTypeFont.h" +#include "Error.h" + +#define TAG(a1,a2,a3,a4) (((a1) & 0xff) << 24 | \ + ((a2) & 0xff) << 16 | ((a3) & 0xff) << 8| ((a4) & 0xff)) + +#define TAG_TTC TAG('t','t','c','f') /* ttcf */ +#define TAG_NAME TAG('n','a','m','e') /* name */ +#define TAG_CMAP TAG('c','m','a','p') /* cmap */ +#define TAG_GSUB TAG('G','S','U','B') /* GSUB */ +#define TAG_KANA TAG('k','a','n','a') /* kana */ +#define TAG_VERT TAG('v','e','r','t') /* vert */ +#define TAG_VRT2 TAG('v','r','t','2') /* vrt2 */ +#define TAG_GLYF TAG('g','l','y','f') /* glyf */ +#define TAG_LOCA TAG('l','o','c','a') /* loca */ +#define TAG_HEAD TAG('h','e','a','d') /* head */ +#define TAG_HHEA TAG('h','h','e','a') /* hhea */ +#define TAG_HMTX TAG('h','m','t','x') /* hmtx */ +#define TAG_MAXP TAG('m','a','x','p') /* maxp */ +#define TAG_CVT TAG('c','v','t',' ') /* cvt */ +#define TAG_PREP TAG('p','r','e','p') /* prep */ +#define TAG_FPGM TAG('f','p','g','m') /* fpgm */ + +#define GIDMAP_TABLE_INC 1024 +#define OFFSET_TABLE_LEN 12 + +#ifdef PDFTOPDF +#define GLYF_INC 4096 +#define LOCA_INC 1024 +#define HMTX_INC 1024 + +/* generating font specifications */ +/* table directory entry index */ +#define TDIR_HEAD 0 +#define TDIR_HHEA 1 +#define TDIR_LOCA 2 +#define TDIR_MAXP 3 +#define TDIR_CVT 4 +#define TDIR_PREP 5 +#define TDIR_GLYF 6 +#define TDIR_HMTX 7 +#define TDIR_FPGM 8 + +/* number of tables */ +#define TDIR_LEN 9 + +/* (Maximum power of 2 <= numTables) x 16. */ +#define SEARCH_RANGE (8*16) +/* Log2(maximum power of 2 <= numTables) */ +#define ENTRY_SELECTOR 3 + +/* table sizes */ +#define HEAD_TABLE_LEN (54 + 2) /* 2 for padding */ +#define HHEA_TABLE_LEN 36 +#define MAXP_TABLE_LEN 32 + +/* table directory entry size */ +#define TABLE_DIR_ENTRY_LEN 16 + +/* length of longHorMetrics entry */ +#define LONGHORMETRIC_LEN (sizeof(USHORT)+sizeof(SHORT)) + +/* composite glyph script flags */ +#define CG_ARG_1_AND_2_ARE_WORDS (1 << 0) +#define CG_ARGS_ARE_XY_VALUES (1 << 1) +#define CG_ROUND_XY_TO_GRID (1 << 2) +#define CG_WE_HAVE_A_SCALE (1 << 3) +#define CG_RESERVED (1 << 4) +#define CG_MORE_COMPONENTS (1 << 5) +#define CG_WE_HAVE_AN_X_AND_Y_SCALE (1 << 6) +#define CG_WE_HAVE_A_TWO_BY_TWO (1 << 7) +#define CG_WE_HAVE_INSTRUCTIONS (1 << 8) +#define CG_USE_MY_METRICS (1 << 9) +#define CG_OVERLAP_COMPOUND (1 << 10) +#define CG_SCALED_COMPONENTS_OFFSET (1 << 11) +#define CG_UNSCALED_COMPONENT_OFFSET (1 << 12) +#endif + +#ifdef PDFTOPDF +unsigned long PDFFTrueTypeFont::mapGID(unsigned long orgGID) +{ + unsigned long i; + + if (orgGID == 0) return 0; + if (GIDMap == 0) { + GIDMapSize = GIDMAP_TABLE_INC; + GIDMap = new unsigned long [GIDMapSize]; + GIDMap[0] = 0; /* always map 0 to 0 */ + } + /* check if gid is already registered */ + for (i = 1;i < maxGID;i++) { + if (GIDMap[i] == orgGID) return i; + } + /* not found */ + /* then regsiter it */ + if (++maxGID >= GIDMapSize) { + /* realloc GIDMap */ + unsigned long *p; + unsigned int newSize; + + newSize = GIDMapSize + GIDMAP_TABLE_INC; + p = new unsigned long [newSize]; + memcpy(p,GIDMap,GIDMapSize*sizeof(unsigned long)); + delete[] GIDMap; + GIDMap = p; + GIDMapSize = newSize; + } + GIDMap[maxGID] = orgGID; +//fprintf(stderr,"DEBUG:map GID %d to %d\n",orgGID,maxGID); + return maxGID; +} + +void PDFFTrueTypeFont::allocNewLGHTable() +{ + /* Long version loca */ + loca = new ULONG [maxGID+2]; + locaSize = maxGID+2; + + /* allocate glyf */ + glyfSize = GLYF_INC; + cGlyfIndex = 0; + glyf = new unsigned char [glyfSize]; + + /* allocate hmtx */ + /* all long metric */ + hmtx = new LongHorMetric [maxGID+1]; + hmtxSize = maxGID+1; +} + +void PDFFTrueTypeFont::reallocNewLHTable() +{ + if (locaSize < maxGID+2) { + unsigned long newSize; + ULONG *np; + + newSize = locaSize+LOCA_INC; + np = new ULONG [newSize]; + memcpy(np,loca,locaSize*sizeof(ULONG)); + delete[] loca; + loca = np; + locaSize = newSize; + } + if (hmtxSize < maxGID+1) { + unsigned long newSize; + LongHorMetric *np; + + newSize = hmtxSize+HMTX_INC; + np = new LongHorMetric [newSize]; + memcpy(np,hmtx,hmtxSize*sizeof(LongHorMetric)); + delete[] hmtx; + hmtx = np; + hmtxSize = newSize; + } +} + +int PDFFTrueTypeFont::readOrgTables() +{ + if (getTableDirEntry(TAG_HEAD,&(orgTDir[TDIR_HEAD])) < 0) { + error(-1,const_cast<char *>("head table not found in font file %s"), + fileName); + return -1; + } + setOffset(orgTDir[TDIR_HEAD].offset); + if (head.read(this) < 0) { + return -1; + } + + if (getTableDirEntry(TAG_HHEA,&(orgTDir[TDIR_HHEA])) < 0) { + error(-1,const_cast<char *>("hhea table not found in font file %s"), + fileName); + return -1; + } + setOffset(orgTDir[TDIR_HHEA].offset); + if (hhea.read(this) < 0) { + return -1; + } + + if (getTableDirEntry(TAG_MAXP,&(orgTDir[TDIR_MAXP])) < 0) { + error(-1,const_cast<char *>("maxp table not found in font file %s"), + fileName); + return -1; + } + setOffset(orgTDir[TDIR_MAXP].offset); + if (maxp.read(this) < 0) { + return -1; + } + + if (getTableDirEntry(TAG_LOCA,&(orgTDir[TDIR_LOCA])) < 0) { + error(-1,const_cast<char *>("loca table not found in font file %s"), + fileName); + return -1; + } + + if (getTableDirEntry(TAG_GLYF,&(orgTDir[TDIR_GLYF])) < 0) { + error(-1,const_cast<char *>("glyf table not found in font file %s"), + fileName); + return -1; + } + + if (getTableDirEntry(TAG_HMTX,&(orgTDir[TDIR_HMTX])) < 0) { + error(-1,const_cast<char *>("hmtx table not found in font file %s"), + fileName); + return -1; + } + + if (getTableDirEntry(TAG_CVT,&(orgTDir[TDIR_CVT])) < 0) { + /* not found */ + orgTDir[TDIR_CVT].tag = 0; /* null */ + } + + if (getTableDirEntry(TAG_PREP,&(orgTDir[TDIR_PREP])) < 0) { + /* not found */ + orgTDir[TDIR_PREP].tag = 0; /* null */ + } + + if (getTableDirEntry(TAG_FPGM,&(orgTDir[TDIR_FPGM])) < 0) { + /* not found */ + orgTDir[TDIR_FPGM].tag = 0; /* null */ + } + return 0; +} + +void PDFFTrueTypeFont::outputWholeFile(P2POutputStream *str) +{ + int n = fileLength; + int r; + unsigned char *p = top; + + while (n > 0) { + r = str->write(p,n); + if (r <= 0) break; + n -= r; + p += r; + } + outputLength = fileLength; +} + +/* creating loca ,glyf and hmtx */ +void PDFFTrueTypeFont::createLGHTable() +{ + unsigned long i; + USHORT defWidth; + + /* allocate new tables */ + allocNewLGHTable(); + + locaEntrySize = head.indexToLocFormat == 0 ? 2 : 4; + + /* read the last longHorMetrics for default width */ + read(orgTDir[TDIR_HHEA].offset+(hhea.numberOfHMetrics-1)*(sizeof(USHORT) + +sizeof(SHORT)),&defWidth); + + /* NOTE: maxGID may be changed in this loop. */ + for (i = 0;i <= maxGID;i++) { + ULONG start, end; + unsigned long len; + SHORT numberOfContours; + unsigned long longHorMetricsLen + = hhea.numberOfHMetrics*(sizeof(USHORT)+sizeof(SHORT)); + + /* glyf */ + setOffset(orgTDir[TDIR_LOCA].offset+GIDMap[i]*locaEntrySize); + read(&start,locaEntrySize); + read(&end,locaEntrySize); + len = end-start; + /* convert start to offset from the top of file */ + start += orgTDir[TDIR_GLYF].offset; + + /* copy glyf entry */ + if (cGlyfIndex+len >= glyfSize) { + /* realloc glyf */ + unsigned char *p; + unsigned long newSize + = (cGlyfIndex+len+GLYF_INC-1)/GLYF_INC; + newSize *= GLYF_INC; + + p = new unsigned char [newSize]; + memcpy(p,glyf,cGlyfIndex); + delete[] glyf; + glyf = p; + glyfSize = newSize; + } + read(start,&numberOfContours); + if (numberOfContours < 0) { + /* composite glyph */ +//fprintf(stderr,"DEBUG: GID=%d is composite glyph\n",GIDMap[i]); + SHORT flags; + /* closure for copy */ + class _CopyGlyf { + public: + unsigned char *dst; + unsigned char *src; + + _CopyGlyf(unsigned char *dstA, unsigned char *srcA) { + dst = dstA; + src = srcA; + } + void copy(unsigned long n) { + memcpy(dst,src,n); + dst += n; + src += n; + } + void copy(unsigned char *p, unsigned long n) { + memcpy(dst,p,n); + dst += n; + src += n; + } + } copyGlyf(glyf+cGlyfIndex,top+start); + + int haveInstructions = 0; + + /* skip xMin,yMin,xMax,yMax */ + advance(sizeof(SHORT)*4); + + /* copy header */ + copyGlyf.copy(sizeof(SHORT)*5); + + do { + unsigned long oldMax; + SHORT mappedGID; + SHORT glyphIndex; + + read(&flags); + haveInstructions |= (flags & CG_WE_HAVE_INSTRUCTIONS) != 0; + /* copy flags */ + copyGlyf.copy(sizeof(flags)); + + read(&glyphIndex); +//fprintf(stderr,"DEBUG: composite ref GID=%d, maxGID=%d\n",glyphIndex,maxGID); + oldMax = maxGID; + mappedGID = mapGID(glyphIndex); + mappedGID = toBE(mappedGID); /* convert Big endian */ + /* put mapped GID */ + copyGlyf.copy(reinterpret_cast<unsigned char *>(&mappedGID), + sizeof(glyphIndex)); + + if (maxGID != oldMax) { + /* new GID has been added */ +//fprintf(stderr,"DEBUG: composite GID added\n"); + reallocNewLHTable(); + } + + if (flags & CG_ARG_1_AND_2_ARE_WORDS) { + /* copy argument1, argument2 */ + advance(sizeof(SHORT)*2); + copyGlyf.copy(sizeof(SHORT)*2); + } else { + /* copy arg1and2 */ + advance(sizeof(USHORT)); + copyGlyf.copy(sizeof(USHORT)); + } + if (flags & CG_WE_HAVE_A_SCALE) { + /* copy scale */ + advance(sizeof(F2Dot14)); + copyGlyf.copy(sizeof(F2Dot14)); + } else if (flags & CG_WE_HAVE_AN_X_AND_Y_SCALE) { + /* copy xscale, yscale */ + advance(sizeof(F2Dot14)*2); + copyGlyf.copy(sizeof(F2Dot14)*2); + } else if (flags & CG_WE_HAVE_A_TWO_BY_TWO) { + /* copy xscale, scale01, scale10, yscale */ + advance(sizeof(F2Dot14)*4); + copyGlyf.copy(sizeof(F2Dot14)*4); + } + } while (flags & CG_MORE_COMPONENTS); + if (haveInstructions) { + USHORT numInstr; + + read(&numInstr); + /* copy instructions */ + advance(sizeof(USHORT)+numInstr); + copyGlyf.copy(sizeof(USHORT)+numInstr); + } + } else { + /* single glyph */ + memcpy(glyf+cGlyfIndex,top+start,len); + } + loca[i] = cGlyfIndex; + cGlyfIndex += len; + + /* hmtx */ + if (GIDMap[i] < hhea.numberOfHMetrics) { + /* long version */ + setOffset(orgTDir[TDIR_HMTX].offset+GIDMap[i]*(sizeof(USHORT) + +sizeof(SHORT))); + read(&(hmtx[i].advanceWidth)); + read(&(hmtx[i].lsb)); + } else { + /* lsb only version */ + read(orgTDir[TDIR_HMTX].offset+longHorMetricsLen + +(GIDMap[i]-hhea.numberOfHMetrics)*sizeof(SHORT),&(hmtx[i].lsb)); + hmtx[i].advanceWidth = defWidth; + } + } + loca[i] = cGlyfIndex; /* last entry */ +} + +unsigned long PDFFTrueTypeFont::locaCheckSum() +{ + unsigned long sum = 0; + unsigned long i; + + for (i = 0;i < maxGID+2;i++) { + sum += loca[i]; + } + return sum; +} + +unsigned long PDFFTrueTypeFont::glyfCheckSum() +{ + unsigned long sum = 0; + unsigned long n = (cGlyfIndex+3)/4; + unsigned long i; + ULONG *p = reinterpret_cast<ULONG *>(glyf); + + for (i = 0;i < n;i++) { + sum += toBE(p[i]); + } + return sum; +} + +unsigned long PDFFTrueTypeFont::hmtxCheckSum() +{ + unsigned long sum = 0; + unsigned long i; + + for (i = 0;i < maxGID+1;i++) { + sum += hmtx[i].checkSum(); + } + return sum; +} + +void PDFFTrueTypeFont::setupNewTableDirectory() +{ + unsigned long toffset = OFFSET_TABLE_LEN+TABLE_DIR_ENTRY_LEN*TDIR_LEN; + + tDir[TDIR_HEAD].tag = TAG_HEAD; + tDir[TDIR_HEAD].checkSum = head.checkSum(); + tDir[TDIR_HEAD].offset = toffset; + tDir[TDIR_HEAD].length = HEAD_TABLE_LEN; + toffset += tDir[TDIR_HEAD].length; + + tDir[TDIR_HHEA].tag = TAG_HHEA; + tDir[TDIR_HHEA].checkSum = hhea.checkSum(); + tDir[TDIR_HHEA].offset = toffset; + tDir[TDIR_HHEA].length = HHEA_TABLE_LEN; + toffset += tDir[TDIR_HHEA].length; + + tDir[TDIR_LOCA].tag = TAG_LOCA; + tDir[TDIR_LOCA].checkSum = locaCheckSum(); + tDir[TDIR_LOCA].offset = toffset; + tDir[TDIR_LOCA].length = (maxGID+2)*sizeof(ULONG); + toffset += tDir[TDIR_LOCA].length; + + tDir[TDIR_MAXP].tag = TAG_MAXP; + tDir[TDIR_MAXP].checkSum = maxp.checkSum(); + tDir[TDIR_MAXP].offset = toffset; + tDir[TDIR_MAXP].length = MAXP_TABLE_LEN; + toffset += tDir[TDIR_MAXP].length; + + /* copy cvt table, so checkSum and length are same as original */ + tDir[TDIR_CVT].tag = TAG_CVT; + tDir[TDIR_CVT].offset = toffset; + if (orgTDir[TDIR_CVT].tag == 0) { + /* no cvt table in original font, output empty */ + tDir[TDIR_CVT].checkSum = TAG_CVT + toffset; + tDir[TDIR_CVT].length = 0; + } else { + tDir[TDIR_CVT].checkSum = orgTDir[TDIR_CVT].checkSum; + tDir[TDIR_CVT].length = orgTDir[TDIR_CVT].length; + } + toffset += tDir[TDIR_CVT].length; + + /* copy prep table, so checkSum and length are same as original */ + tDir[TDIR_PREP].tag = TAG_PREP; + tDir[TDIR_PREP].offset = toffset; + if (orgTDir[TDIR_PREP].tag == 0) { + /* no prep table in original font, output empty */ + tDir[TDIR_PREP].checkSum = TAG_PREP + toffset; + tDir[TDIR_PREP].length = 0; + } else { + tDir[TDIR_PREP].length = orgTDir[TDIR_PREP].length; + tDir[TDIR_PREP].checkSum = orgTDir[TDIR_PREP].checkSum; + } + toffset += tDir[TDIR_PREP].length; + + tDir[TDIR_GLYF].tag = TAG_GLYF; + tDir[TDIR_GLYF].checkSum = glyfCheckSum(); + tDir[TDIR_GLYF].offset = toffset; + tDir[TDIR_GLYF].length = cGlyfIndex; + toffset += tDir[TDIR_GLYF].length; + + tDir[TDIR_HMTX].tag = TAG_HMTX; + tDir[TDIR_HMTX].checkSum = hmtxCheckSum(); + tDir[TDIR_HMTX].offset = toffset; + tDir[TDIR_HMTX].length = (maxGID+1)*LONGHORMETRIC_LEN; + toffset += tDir[TDIR_HMTX].length; + + /* copy fpgm table, so checkSum and length are same as original */ + tDir[TDIR_FPGM].tag = TAG_FPGM; + tDir[TDIR_FPGM].offset = toffset; + if (orgTDir[TDIR_FPGM].tag == 0) { + /* no fpgm table in original font, output empty */ + tDir[TDIR_FPGM].checkSum = TAG_FPGM + toffset; + tDir[TDIR_FPGM].length = 0; + } else { + tDir[TDIR_FPGM].length = orgTDir[TDIR_FPGM].length; + tDir[TDIR_FPGM].checkSum = orgTDir[TDIR_FPGM].checkSum; + } + toffset += tDir[TDIR_FPGM].length; +} + +void PDFFTrueTypeFont::outputOffsetTable(P2POutputStream *str) +{ + write(str,static_cast<Fixed>(0x0010000)); /* version 1.0 */ + write(str,static_cast<USHORT>(TDIR_LEN)); /* numTable */ + write(str,static_cast<USHORT>(SEARCH_RANGE)); /* searchRange */ + write(str,static_cast<USHORT>(ENTRY_SELECTOR)); /* entrySelector */ + write(str,static_cast<USHORT>(TDIR_LEN*16-SEARCH_RANGE)); /* rangeShift */ +} + +unsigned long PDFFTrueTypeFont::offsetTableCheckSum() +{ + unsigned long sum = 0; + + sum += 0x0010000; /* version 1.0 */ + sum += TDIR_LEN << 16; /* numTable */ + sum += SEARCH_RANGE & 0xffff; /* searchRange */ + sum += ENTRY_SELECTOR << 16; /* entrySelector */ + sum += (TDIR_LEN*16-SEARCH_RANGE) & 0xffff; /* rangeShift */ + return sum; +} + +unsigned long PDFFTrueTypeFont::allCheckSum() +{ + unsigned long sum = 0; + int i; + + sum += offsetTableCheckSum(); + sum += tableDirectoryCheckSum(); + for (i = 0;i < TDIR_LEN;i++) { + sum += tDir[i].checkSum; + } + return sum; +} + +unsigned long PDFFTrueTypeFont::tableDirectoryCheckSum() +{ + int i; + unsigned long sum = 0; + + for (i = 0;i < TDIR_LEN;i++) { + sum += tDir[i].calcCheckSum(); + } + return sum; +} + +void PDFFTrueTypeFont::outputOrgData(P2POutputStream *str, + unsigned long offset, unsigned long len) +{ + str->write(top+offset,len); +} + +void PDFFTrueTypeFont::outputCvt(P2POutputStream *str) +{ + /* copy original data */ + outputOrgData(str,orgTDir[TDIR_CVT].offset,tDir[TDIR_CVT].length); +} + +void PDFFTrueTypeFont::outputPrep(P2POutputStream *str) +{ + /* copy original data */ + outputOrgData(str,orgTDir[TDIR_PREP].offset,tDir[TDIR_PREP].length); +} + +void PDFFTrueTypeFont::outputFpgm(P2POutputStream *str) +{ + /* copy original data */ + outputOrgData(str,orgTDir[TDIR_FPGM].offset,tDir[TDIR_FPGM].length); +} + +void PDFFTrueTypeFont::outputLoca(P2POutputStream *str) +{ + unsigned long i; + + for (i = 0;i < maxGID+2;i++) { + write(str,loca[i]); + } +} + +void PDFFTrueTypeFont::outputGlyf(P2POutputStream *str) +{ + str->write(glyf,cGlyfIndex); +} + +void PDFFTrueTypeFont::outputHmtx(P2POutputStream *str) +{ + unsigned long i; + + for (i = 0;i < maxGID+1;i++) { + hmtx[i].output(this,str); + } +} + +void PDFFTrueTypeFont::outputTableDirectory(P2POutputStream *str) +{ + unsigned int i; + + for (i = 0;i < TDIR_LEN;i++) { + tDir[i].output(this,str); + } +} + +void PDFFTrueTypeFont::output(P2POutputStream *str) +{ + if (GIDMap == 0) { + /* output whole file */ + outputWholeFile(str); + return; + } + + /* read or setup original tables */ + if (readOrgTables() < 0) { + /* error */ + return; + } + + /* creating loca ,glyf and hmtx */ + createLGHTable(); + + /* change rest table values */ + head.checkSumAdjustment = 0; + hhea.numberOfHMetrics = maxGID+1; /* all metrics are long format */ + maxp.numGlyphs = maxGID+1; + maxp.maxContours = maxGID+1; + maxp.maxCompositeContours = maxGID+1; + + setupNewTableDirectory(); + + /* calc Adjustment */ + head.checkSumAdjustment = 0xB1B0AFBA-allCheckSum(); + + /* output font */ + outputOffsetTable(str); + outputTableDirectory(str); + outputHead(str); + outputHhea(str); + outputLoca(str); + outputMaxp(str); + outputCvt(str); + outputPrep(str); + outputGlyf(str); + outputHmtx(str); + outputFpgm(str); + + /* setup table directory */ + freeNewTables(); +} + +void PDFFTrueTypeFont::freeNewTables() +{ + if (glyf != 0) { + delete[] glyf; + glyf = 0; + } + if (hmtx != 0) { + delete[] hmtx; + hmtx = 0; + hmtxSize = 0; + } + if (loca != 0) { + delete[] loca; + loca = 0; + locaSize = 0; + } +} + +int PDFFTrueTypeFont::Head::read(PDFFTrueTypeFont *font) +{ + font->read(&version); + if ((version & 0x10000) != 0x10000) { + error(-1,const_cast<char *>("Not supported head table version in file %s"), + font->fileName); + return -1; + } + font->read(&fontRevision); + font->read(&checkSumAdjustment); + font->read(&magicNumber); + font->read(&flags); + font->read(&unitsPerEm); + font->read(&created); + font->read(&modified); + font->read(&xMin); + font->read(&yMin); + font->read(&xMax); + font->read(&yMax); + font->read(&macStyle); + font->read(&lowestRecPPEM); + font->read(&fontDirectionHint); + font->read(&indexToLocFormat); + font->read(&glyphDataFormat); + return 0; +} + +void PDFFTrueTypeFont::Head::output(PDFFTrueTypeFont *font, P2POutputStream *str) +{ + font->write(str,version); + font->write(str,fontRevision); + font->write(str,checkSumAdjustment); + font->write(str,magicNumber); + font->write(str,flags); + font->write(str,unitsPerEm); + font->write(str,created); + font->write(str,modified); + font->write(str,xMin); + font->write(str,yMin); + font->write(str,xMax); + font->write(str,yMax); + font->write(str,macStyle); + font->write(str,lowestRecPPEM); + font->write(str,fontDirectionHint); + font->write(str,indexToLocFormat); + font->write(str,glyphDataFormat); + font->write(str,static_cast<USHORT>(0)); /* padding */ +} + +unsigned long PDFFTrueTypeFont::Head::checkSum() +{ + unsigned long sum = 0; + + sum += version; + sum += fontRevision; + sum += magicNumber; + sum += flags << 16; + sum += unitsPerEm & 0xffff; + sum += (created >> 32) & 0xffffffff; + sum += created & 0xffffffff; + sum += (modified >> 32) & 0xffffffff; + sum += modified & 0xffffffff; + sum += xMin << 16; + sum += yMin & 0xffff; + sum += xMax << 16; + sum += yMax & 0xffff; + sum += macStyle << 16; + sum += lowestRecPPEM & 0xffff; + sum += fontDirectionHint << 16; + sum += indexToLocFormat & 0xffff; + sum += glyphDataFormat << 16; + + return sum; +} + +int PDFFTrueTypeFont::Hhea::read(PDFFTrueTypeFont *font) +{ + font->read(&version); + if ((version & 0x10000) != 0x10000) { + error(-1,const_cast<char *>("Not supported hhea table version in file %s"), + font->fileName); + return -1; + } + font->read(&Ascender); + font->read(&Descender); + font->read(&LineGap); + font->read(&advanceWidthMax); + font->read(&minLeftSideBearing); + font->read(&minRightSideBearing); + font->read(&xMacExtent); + font->read(&caretSlopeRise); + font->read(&caretSlopeRun); + font->read(&caretOffset); + /* skip reserved */ + font->skip<SHORT>(); + font->skip<SHORT>(); + font->skip<SHORT>(); + font->skip<SHORT>(); + font->read(&metricDataFormat); + font->read(&numberOfHMetrics); + return 0; +} + +void PDFFTrueTypeFont::Hhea::output(PDFFTrueTypeFont *font, P2POutputStream *str) +{ + font->write(str,version); + font->write(str,Ascender); + font->write(str,Descender); + font->write(str,LineGap); + font->write(str,advanceWidthMax); + font->write(str,minLeftSideBearing); + font->write(str,minRightSideBearing); + font->write(str,xMacExtent); + font->write(str,caretSlopeRise); + font->write(str,caretSlopeRun); + font->write(str,caretOffset); + /* output reserved */ + font->write(str,static_cast<SHORT>(0)); + font->write(str,static_cast<SHORT>(0)); + font->write(str,static_cast<SHORT>(0)); + font->write(str,static_cast<SHORT>(0)); + font->write(str,metricDataFormat); + font->write(str,numberOfHMetrics); +} + +unsigned long PDFFTrueTypeFont::Hhea::checkSum() +{ + unsigned long sum = 0; + + sum += version; + sum += Ascender << 16; + sum += Descender & 0xffff; + sum += LineGap << 16; + sum += advanceWidthMax & 0xffff; + sum += minLeftSideBearing << 16; + sum += minRightSideBearing & 0xffff; + sum += xMacExtent << 16; + sum += caretSlopeRise & 0xffff; + sum += caretSlopeRun << 16; + sum += caretOffset & 0xffff; + sum += metricDataFormat << 16; + sum += numberOfHMetrics & 0xffff; + return sum; +} + +int PDFFTrueTypeFont::Maxp::read(PDFFTrueTypeFont *font) +{ + font->read(&version); + if ((version & 0x10000) != 0x10000) { + error(-1,const_cast<char *>("Not supported maxp table version in file %s"), + font->fileName); + return -1; + } + font->read(&numGlyphs); + font->read(&maxPoints); + font->read(&maxContours); + font->read(&maxCompositePoints); + font->read(&maxCompositeContours); + font->read(&maxZones); + font->read(&maxTwilightPoints); + font->read(&maxStorage); + font->read(&maxFunctionDefs); + font->read(&maxInstructionDefs); + font->read(&maxStackElements); + font->read(&maxSizeOfInstructions); + font->read(&maxComponentElements); + font->read(&maxComponentDepth); + return 0; +} + +void PDFFTrueTypeFont::Maxp::output(PDFFTrueTypeFont *font, P2POutputStream *str) +{ + font->write(str,version); + font->write(str,numGlyphs); + font->write(str,maxPoints); + font->write(str,maxContours); + font->write(str,maxCompositePoints); + font->write(str,maxCompositeContours); + font->write(str,maxZones); + font->write(str,maxTwilightPoints); + font->write(str,maxStorage); + font->write(str,maxFunctionDefs); + font->write(str,maxInstructionDefs); + font->write(str,maxStackElements); + font->write(str,maxSizeOfInstructions); + font->write(str,maxComponentElements); + font->write(str,maxComponentDepth); +} + +unsigned long PDFFTrueTypeFont::Maxp::checkSum() +{ + unsigned long sum = 0; + + sum += version; + sum += numGlyphs << 16; + sum += maxPoints & 0xffff; + sum += maxContours << 16; + sum += maxCompositePoints & 0xffff; + sum += maxCompositeContours << 16; + sum += maxZones & 0xffff; + sum += maxTwilightPoints << 16; + sum += maxStorage & 0xffff; + sum += maxFunctionDefs << 16; + sum += maxInstructionDefs & 0xffff; + sum += maxStackElements << 16; + sum += maxSizeOfInstructions & 0xffff; + sum += maxComponentElements << 16; + sum += maxComponentDepth & 0xffff; + return sum; +} + +void PDFFTrueTypeFont::TableDirectory::output(PDFFTrueTypeFont *font, + P2POutputStream *str) +{ + font->write(str,tag); + font->write(str,checkSum); + font->write(str,offset); + font->write(str,length); +} + +unsigned long PDFFTrueTypeFont::TableDirectory::calcCheckSum() +{ + unsigned long sum = 0; + + sum += tag; + sum += checkSum; + sum += offset; + sum += length; + return sum; +} +#endif + +int PDFFTrueTypeFont::setupCmap() +{ + ULONG cmapTable; + USHORT numCMTables; + unsigned int i; + USHORT format = 0; + unsigned int format4Offset = 0; + + if (cmap != 0) return 0; /* already setup */ + if (getTable(TAG_CMAP,&cmapTable) < 0) { + error(-1,const_cast<char *>("cmap table not found in font file %s"), + fileName); + return -1; + } + setOffset(cmapTable); + skip<USHORT>(); // skip version + read(&numCMTables); + + /* find unicode table */ + /* NOTICE: only support, Microsoft Unicode or platformID == 0 */ + for (i = 0;i < numCMTables;i++) { + USHORT platformID, encodingID; + ULONG subtable; + + read(&platformID); + read(&encodingID); + read(&subtable); + if ((platformID == 3 /* Microsoft */ && encodingID == 1 /* Unicode */) + || platformID == 0) { + unsigned long old = getOffset(); /* save current offset */ + + setOffset(subtable+cmapTable); + read(&format); + if (format == 4) { + /* found , but continue searching for format 12 */ + format4Offset = getOffset(); + } + setOffset(old); /* restore old offset */ + } else if ((platformID == 3 /* Microsoft */ && encodingID == 10 /* UCS-4 */) + || platformID == 0) { + unsigned long old = getOffset(); /* save current offset */ + + setOffset(subtable+cmapTable); + read(&format); + if (format == 12) { + /* found */ + break; + } + if (format == 4) { + /* found , but continue searching for format 12 */ + format4Offset = getOffset(); + } + setOffset(old); /* restore old offset */ + } + } + if (i >= numCMTables && format4Offset == 0) { + /* not found */ + error(-1,const_cast<char *>("cmap table: Microsoft, Unicode, format 4 or 12 subtable not found in font file %s"),fileName); + return -1; + } + if (format == 12) { + cmap = new CmapFormat12(); + cmap->read(this); + } else { + /* format 4 */ + setOffset(format4Offset); + cmap = new CmapFormat4(); + cmap->read(this); + } + + return 0; +} + +#ifdef PDFTOPDF +unsigned long PDFFTrueTypeFont::getGID(unsigned long unicode, int wmode, int whole) +#else +unsigned long PDFFTrueTypeFont::getGID(unsigned long unicode, int wmode) +#endif +{ + USHORT gid = 0; + + if (cmap == 0) return 0; + +//fprintf(stderr,"DEBUG:getGID %d\n",code); + gid = cmap->getGID(this, unicode); + + if (wmode && gid != 0) { + gid = mapToVertGID(unicode,gid); + } + +#ifdef PDFTOPDF + if (!whole) gid = mapGID(gid); +#endif + return gid; +} + +unsigned long PDFFTrueTypeFont::CmapFormat4::getGID(PDFFTrueTypeFont *font, + unsigned long unicode) +{ + USHORT gid = 0; + int a = -1; + int b = segCount - 1; + int m; + + if (unicode > endCode[b]) { + /* segment not found */ + /* illegal format */ + return 0; + } + while (b - a > 1) { + m = (a+b)/2; + if (endCode[m] < unicode) { + a = m; + } else { + b = m; + } + } + + if (unicode >= startCode[b]) { + if (idRangeOffset[b] != 0) { + ULONG off = idRangeOffsetTop + b*2 + + idRangeOffset[b] + + (unicode - startCode[b])*2; + font->read(off,&gid); + if (gid != 0) gid += idDelta[b]; + } else { + gid = unicode + idDelta[b]; + } + } + return gid; +} + +void PDFFTrueTypeFont::CmapFormat4::read(PDFFTrueTypeFont *font) +{ + unsigned int i; + + /* read subtable */ + font->read(&length); + font->read(&language); + font->read(&segCountX2); + segCount = segCountX2/2; + font->read(&searchRange); + font->read(&entrySelector); + font->read(&rangeShift); + endCode = new USHORT[segCount]; + for (i = 0;i < segCount;i++) { + font->read(&(endCode[i])); + } + font->skip<USHORT>(); // skip reservedPad + startCode = new USHORT[segCount]; + for (i = 0;i < segCount;i++) { + font->read(&(startCode[i])); + } + idDelta = new SHORT[segCount]; + for (i = 0;i < segCount;i++) { + font->read(&(idDelta[i])); + } + idRangeOffsetTop = font->getOffset(); + idRangeOffset = new USHORT[segCount]; + for (i = 0;i < segCount;i++) { + font->read(&(idRangeOffset[i])); + } +} + +unsigned long PDFFTrueTypeFont::CmapFormat12::getGID(PDFFTrueTypeFont *font, + unsigned long unicode) +{ + unsigned long gid = 0; + int a = -1; + int b = nGroups - 1; + int m; + + if (unicode > endCharCode[b]) { + /* segment not found */ + /* illegal format */ + return 0; + } + while (b - a > 1) { + m = (a+b)/2; + if (endCharCode[m] < unicode) { + a = m; + } else { + b = m; + } + } + + if (unicode >= startCharCode[b]) { + gid = startGlyphID[b] + unicode - startCharCode[b]; + } + return gid; +} + +void PDFFTrueTypeFont::CmapFormat12::read(PDFFTrueTypeFont *font) +{ + unsigned int i; + + /* read subtable */ + font->skip<USHORT>(); // skip reservedPad + font->read(&length); + font->read(&language); + font->read(&nGroups); + + startCharCode = new ULONG[nGroups]; + endCharCode = new ULONG[nGroups]; + startGlyphID = new ULONG[nGroups]; + for (i = 0;i < nGroups;i++) { + font->read(&(startCharCode[i])); + font->read(&(endCharCode[i])); + font->read(&(startGlyphID[i])); + } +} + +int PDFFTrueTypeFont::setOffsetTable(unsigned int faceIndexA) +{ + char *ext; + + offsetTable = 0; + /* check if file is TTC */ + if ((ext = strrchr(fileName,'.')) != 0 && strncasecmp(ext,".ttc",4) == 0) { + /* TTC file */ + /* set offsetTable */ + TAG TTCTag; + ULONG numFonts; + + setOffset(0); + read(&TTCTag); + if (TTCTag != TAG_TTC) { + error(-1,const_cast<char *>("Illegal TTCTag:0x%08lx of TTC file:%s"), + TTCTag,fileName); + return -1; + } + skip<ULONG>(); /* skip version */ + read(&numFonts); + if (numFonts <= faceIndexA) { + error(-1,const_cast<char *>("Too large faceIndex:%d of TTC file:%s : faces=%ld"), + faceIndexA,fileName,numFonts); + return -1; + } + advance(sizeof(ULONG)*faceIndexA); /* skip to the element */ + read(&offsetTable); + } + return 0; +} + +PDFFTrueTypeFont::PDFFTrueTypeFont() +{ +#ifdef PDFTOPDF + outputLength = 0; + GIDMap = 0; + GIDMapSize = 0; + maxGID = 0; + glyf = 0; + glyfSize = 0; + cGlyfIndex = 0; + hmtx = 0; + hmtxSize = 0; + loca = 0; + locaSize = 0; + locaEntrySize = 0; + tDir = new TableDirectory [TDIR_LEN]; + orgTDir = new TableDirectory [TDIR_LEN]; +#endif + cmap = 0; + top = 0; + offset = 0; + fileName = 0; + fileLength = 0; + fontFileFD = -1; + featureTable = 0; + lookupList = 0; + fontName = 0; + numTables = 0; + scriptTag = 0; +} + +UGooString *PDFFTrueTypeFont::getFontName() +{ + ULONG nameTable; + USHORT count; + USHORT stringOffset; + unsigned int i; + + if (fontName != 0) return fontName; + if (getTable(TAG_NAME,&nameTable) < 0) { + error(-1,const_cast<char *>("name table not found in font file %s"), + fileName); + return 0; + } + setOffset(nameTable); + skip<USHORT>(); /* skip format */ + read(&count); + read(&stringOffset); + for (i = 0;i < count;i++) { + USHORT nameID; + USHORT length; + USHORT so; + USHORT platformID; + USHORT encodingID; + USHORT languageID; + + //advance(sizeof(USHORT)*3); /* skip to nameID */ + read(&platformID); + read(&encodingID); + read(&languageID); + read(&nameID); + read(&length); + read(&so); + if (nameID == 6) { + /* PostScript name */ + if (platformID == 0 /* Unicode */ || platformID == 3 /* Microsoft */) { + /* Unicode */ + Unicode *p = new Unicode[length/2]; + unsigned int j; + + setOffset(nameTable+stringOffset+so); + for (j = 0;j < length/2;j++) { + USHORT u; + read(&u); + p[j] = u; + } + fontName = new UGooString(p,length/2); + return fontName; + } else { + unsigned int j; + Unicode *p = new Unicode[length]; + unsigned char *q = top+nameTable+stringOffset+so; + + for (j = 0;j < length;j++) { + p[j] = q[j]; + } + fontName = new UGooString(p,length); + return fontName; + } + } + } + return 0; +} + +int PDFFTrueTypeFont::init(const char *fileNameA, unsigned int faceIndexA) +{ + struct stat sbuf; + Fixed sfntVersion; + + offsetTable = 0; + fileName = new char [strlen(fileNameA)+1]; + strcpy(fileName,fileNameA); + if ((fontFileFD = open(fileName,O_RDONLY)) < 0) { + error(-1,const_cast<char *>("Can't open font file %s"),fileName); + return -1; + } + if (fstat(fontFileFD,&sbuf) < 0) { + error(-1,const_cast<char *>("Can't get stat of font file %s"),fileName); + goto error_end; + } + fileLength = sbuf.st_size; + if ((top = static_cast<unsigned char *>( + mmap(0,fileLength,PROT_READ,MAP_PRIVATE,fontFileFD,0))) == 0) { + error(-1,const_cast<char *>("mmap font file %s failed"),fileName); + goto error_end; + } + if (setOffsetTable(faceIndexA) < 0) goto error_end2; + setOffset(offsetTable); + read(&sfntVersion); + if (sfntVersion != 0x00010000) { + error(-1,const_cast<char *>("Illegal sfnt version in font file %s"), + fileName); + goto error_end2; + } + read(&numTables); + return 0; + +error_end2: + munmap(top,fileLength); +error_end: + close(fontFileFD); + fontFileFD = -1; + return -1; +} + +PDFFTrueTypeFont::~PDFFTrueTypeFont() +{ +#ifdef PDFTOPDF + if (cmap != 0) delete cmap; + if (GIDMap != 0) delete[] GIDMap; + if (tDir != 0) delete[] tDir; + if (orgTDir != 0) delete[] orgTDir; + freeNewTables(); +#endif + + if (top != 0) { + munmap(top,fileLength); + } + if (fontFileFD >= 0) close(fontFileFD); + if (fileName != 0) delete[] fileName; + if (fontName != 0) delete fontName; +} + +unsigned long PDFFTrueTypeFont::charToTag(const char *tagName) +{ + int n = strlen(tagName); + unsigned long tag = 0; + int i; + + if (n > 4) n = 4; + for (i = 0;i < n;i++) { + tag <<= 8; + tag |= tagName[i] & 0xff; + } + for (;i < 4;i++) { + tag <<= 8; + tag |= ' '; + } + return tag; +} + +/* + setup GSUB table data + Only supporting vertical text substitution. +*/ +int PDFFTrueTypeFont::setupGSUB(const char *tagName) +{ + ULONG gsubTable; + unsigned int i; + USHORT scriptList, featureList; + USHORT scriptCount; + TAG tag; + USHORT scriptTable; + USHORT langSys; + USHORT featureCount; + USHORT featureIndex; + USHORT ftable = 0; + USHORT llist; + ULONG oldOffset; + ULONG ttag; + + if (tagName == 0) { + featureTable = 0; + return 0; + } + ttag = charToTag(tagName); + if (featureTable != 0 && ttag == scriptTag) { + /* already setup GSUB */ + return 0; + } + scriptTag = ttag; + /* read GSUB Header */ + if (getTable(TAG_GSUB,&gsubTable) < 0) { + return 0; /* GSUB table not found */ + } + setOffset(gsubTable); + skip<Fixed>(); // skip version + read(&scriptList); + read(&featureList); + read(&llist); + + lookupList = llist+gsubTable; /* change to offset from top of file */ + /* read script list table */ + setOffset(gsubTable+scriptList); + read(&scriptCount); + /* find script */ + for (i = 0;i < scriptCount;i++) { + read(&tag); + read(&scriptTable); + if (tag == scriptTag) { + /* found */ + break; + } + } + if (i >= scriptCount) { + /* not found */ + return 0; + } + + /* read script table */ + /* use default language system */ + setOffset(gsubTable+scriptList+scriptTable); + read(&langSys); /* default language system */ + + /* read LangSys table */ + if (langSys == 0) { + /* no ldefault LangSys */ + return 0; + } + + setOffset(gsubTable+scriptList+scriptTable+langSys); + skip<USHORT>(); /* skip LookupOrder */ + read(&featureIndex); /* ReqFeatureIndex */ + if (featureIndex != 0xffff) { + oldOffset = getOffset(); + /* read feature record */ + setOffset(gsubTable+featureList); + + read(&featureCount); + setOffset(gsubTable+featureList+sizeof(USHORT)+ + featureIndex*(sizeof(TAG)+sizeof(USHORT))); + read(&tag); + if (tag == TAG_VRT2) { + /* vrt2 is preferred, overwrite vert */ + read(&ftable); + /* convert to offset from file top */ + featureTable = ftable+gsubTable+featureList; + return 0; + } else if (tag == TAG_VERT) { + read(&ftable); + } + setOffset(oldOffset); /* restore offset */ + } + read(&featureCount); + /* find 'vrt2' or 'vert' feature */ + for (i = 0;i < featureCount;i++) { + read(&featureIndex); + oldOffset = getOffset(); + /* read feature record */ + setOffset(gsubTable+featureList+sizeof(USHORT)+ + featureIndex*(sizeof(TAG)+sizeof(USHORT))); + read(&tag); + if (tag == TAG_VRT2) { + /* vrt2 is preferred, overwrite vert */ + read(&ftable); + break; + } else if (ftable == 0 && tag == TAG_VERT) { + read(&ftable); + } + setOffset(oldOffset); /* restore offset */ + } + if (ftable == 0) { + /* vert nor vrt2 are not found */ + return 0; + } + /* convert to offset from file top */ + featureTable = ftable+gsubTable+featureList; + return 0; +} + +int PDFFTrueTypeFont::getTableDirEntry(TAG tableTag, TableDirectory *ent) +{ + unsigned int i; + + /* set to the top of Table Directory entiries */ + setOffset(offsetTable+OFFSET_TABLE_LEN); + for (i = 0;i < numTables;i++) { + ULONG tag; + + read(&tag); + if (tag == tableTag) { + /* found */ + ent->tag = tag; + read(&(ent->checkSum)); + read(&(ent->offset)); + read(&(ent->length)); + return 0; + } + advance(sizeof(ULONG)*3); /* skip to next entry */ + } + return -1; /* not found */ +} + +int PDFFTrueTypeFont::getTable(TAG tableTag, ULONG *tableOffset, + ULONG *tableLength) +{ + TableDirectory ent; + + if (getTableDirEntry(tableTag,&ent) < 0) { + /* not found */ + return -1; + } + if (tableOffset != 0) { + *tableOffset = ent.offset; + } + if (tableLength != 0) { + *tableLength = ent.length; + } + return 0; +} + +unsigned long PDFFTrueTypeFont::doMapToVertGID(unsigned long orgGID) +{ + USHORT lookupCount; + USHORT lookupListIndex; + ULONG i; + unsigned long gid = 0; + + setOffset(featureTable+sizeof(USHORT)); + read(&lookupCount); + for (i = 0;i < lookupCount;i++) { + read(&lookupListIndex); + if ((gid = scanLookupList(lookupListIndex,orgGID)) != 0) { + break; + } + } + return gid; +} + +unsigned long PDFFTrueTypeFont::mapToVertGID(unsigned long code, + unsigned long orgGID) +{ + unsigned long mapped; + //unsigned long i; + + if (featureTable == 0) return orgGID; + if ((mapped = doMapToVertGID(orgGID)) != 0) { +//fprintf(stderr,"DEBUG:GSUB map %d to %d\n",orgGID,mapped); + return mapped; + } + return orgGID; +} + +unsigned long PDFFTrueTypeFont::scanLookupList(USHORT listIndex, + unsigned long orgGID) +{ + USHORT lookupTable; + USHORT subTableCount; + USHORT subTable; + ULONG i; + unsigned long gid = 0; + ULONG oldOffset = getOffset(); + + if (lookupList == 0) return 0; /* no lookup list */ + setOffset(lookupList+sizeof(USHORT)+listIndex*sizeof(USHORT)); + read(&lookupTable); + /* read lookup table */ + setOffset(lookupList+lookupTable); + skip<USHORT>(); /* skip LookupType */ + skip<USHORT>(); /* skip LookupFlag */ + read(&subTableCount); + for (i = 0;i < subTableCount;i++) { + read(&subTable); + if ((gid = scanLookupSubTable(lookupList+lookupTable+subTable,orgGID)) + != 0) break; + } + setOffset(oldOffset); /* restore offset */ + return gid; +} + +unsigned long PDFFTrueTypeFont::scanLookupSubTable(ULONG subTable, + unsigned long orgGID) +{ + USHORT format; + USHORT coverage; + SHORT delta; + SHORT glyphCount; + GlyphID substitute; + unsigned long gid = 0; + int coverageIndex; + ULONG oldOffset = getOffset(); + + setOffset(subTable); + read(&format); + read(&coverage); + if ((coverageIndex = + checkGIDInCoverage(subTable+coverage,orgGID)) >= 0) { + switch (format) { + case 1: + /* format 1 */ + read(&delta); + gid = orgGID+delta; + break; + case 2: + /* format 2 */ + read(&glyphCount); + if (glyphCount > coverageIndex) { + advance(coverageIndex*sizeof(GlyphID)); + read(&substitute); + gid = substitute; + } + break; + default: + /* unknown format */ + break; + } + } + setOffset(oldOffset); /* restore offset */ + return gid; +} + +int PDFFTrueTypeFont::checkGIDInCoverage(ULONG coverage, unsigned long orgGID) +{ + int index = -1; + ULONG oldOffset = getOffset(); + USHORT format; + USHORT count; + ULONG i; + + setOffset(coverage); + read(&format); + switch (format) { + case 1: + read(&count); + for (i = 0;i < count;i++) { + GlyphID gid; + + read(&gid); + if (gid == orgGID) { + /* found */ + index = i; + break; + } else if (gid > orgGID) { + /* not found */ + break; + } + } + break; + case 2: + read(&count); + for (i = 0;i < count;i++) { + GlyphID startGID, endGID; + USHORT startIndex; + + read(&startGID); + read(&endGID); + read(&startIndex); + if (startGID <= orgGID && orgGID <= endGID) { + /* found */ + index = startIndex+orgGID-startGID; + break; + } else if (orgGID <= endGID) { + /* not found */ + break; + } + } + break; + default: + break; + } + setOffset(oldOffset); /* restore offset */ + return index; +} --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/parseargs.h +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/parseargs.h @@ -0,0 +1,71 @@ +/* + * parseargs.h + * + * Command line argument parser. + * + * Copyright 1996-2003 Glyph & Cog, LLC + */ + +#ifndef PARSEARGS_H +#define PARSEARGS_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "goo/gtypes.h" + +/* + * Argument kinds. + */ +typedef enum { + argFlag, /* flag (present / not-present) */ + /* [val: GBool *] */ + argInt, /* integer arg */ + /* [val: int *] */ + argFP, /* floating point arg */ + /* [val: double *] */ + argString, /* string arg */ + /* [val: char *] */ + /* dummy entries -- these show up in the usage listing only; */ + /* useful for X args, for example */ + argFlagDummy, + argIntDummy, + argFPDummy, + argStringDummy +} ArgKind; + +/* + * Argument descriptor. + */ +typedef struct { + char *arg; /* the command line switch */ + ArgKind kind; /* kind of arg */ + void *val; /* place to store value */ + int size; /* for argString: size of string */ + char *usage; /* usage string */ +} ArgDesc; + +/* + * Parse command line. Removes all args which are found in the arg + * descriptor list <args>. Stops parsing if "--" is found (and removes + * it). Returns gFalse if there was an error. + */ +extern GBool parseArgs(ArgDesc *args, int *argc, char *argv[]); + +/* + * Print usage message, based on arg descriptor list. + */ +extern void printUsage(char *program, char *otherArgs, ArgDesc *args); + +/* + * Check if a string is a valid integer or floating point number. + */ +extern GBool isInt(char *s); +extern GBool isFP(char *s); + +#ifdef __cplusplus +} +#endif + +#endif --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/PDFFTrueTypeFont.h +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/PDFFTrueTypeFont.h @@ -0,0 +1,371 @@ +/* + +Copyright (c) 2006-2007, BBR Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +/* + PDFFTrueTypeFont.h + TrueType Font manager +*/ +#ifndef _PDFFTRUTYPEFONT_H_ +#define _PDFFTRUTYPEFONT_H_ + +#include <endian.h> +#include "UGooString.h" +#ifdef PDFTOPDF +#include "P2POutputStream.h" +#endif + +class PDFFTrueTypeFont { +public: + typedef unsigned char BYTE; + typedef signed char CHAR; + typedef unsigned short USHORT; + typedef signed short SHORT; + typedef unsigned long ULONG; + typedef signed long LONG; + typedef unsigned long Fixed; + typedef unsigned int FUNIT; + typedef signed short FWORD; + typedef unsigned short UFWORD; + typedef unsigned short F2Dot14; + typedef signed long long LONGDATETIME; + typedef unsigned long TAG; + typedef unsigned short GlyphID; + + PDFFTrueTypeFont(); + ~PDFFTrueTypeFont(); + int init(const char *fileNameA, unsigned int faceIndexA); + UGooString *getFontName(); + int setupCmap(); +#ifdef PDFTOPDF + unsigned long getGID(unsigned long unicode, int wmode, int whole); + void output(P2POutputStream *str); + int getLength() { return outputLength; } +#else + unsigned long getGID(unsigned long unicode, int wmode); +#endif + unsigned long mapToVertGID(unsigned long code, unsigned long orgGID); + int setupGSUB(const char *tagName); +private: + + /* table directory entry */ + class TableDirectory { + public: + ULONG tag; + ULONG checkSum; + ULONG offset; + ULONG length; +#ifdef PDFTOPDF + void output(PDFFTrueTypeFont *font, P2POutputStream *str); + unsigned long calcCheckSum(); +#endif + }; + +#ifdef PDFTOPDF + /* hhea table */ + class Hhea { + public: + Fixed version; + FWORD Ascender; + FWORD Descender; + FWORD LineGap; + UFWORD advanceWidthMax; + FWORD minLeftSideBearing; + FWORD minRightSideBearing; + FWORD xMacExtent; + SHORT caretSlopeRise; + SHORT caretSlopeRun; + SHORT caretOffset; + SHORT metricDataFormat; + USHORT numberOfHMetrics; + int read(PDFFTrueTypeFont *font); + void output(PDFFTrueTypeFont *font, P2POutputStream *str); + unsigned long checkSum(); + }; + + /* long format metrics */ + class LongHorMetric { + public: + USHORT advanceWidth; + SHORT lsb; + void output(PDFFTrueTypeFont *font, P2POutputStream *str) { + font->write(str,advanceWidth); + font->write(str,lsb); + } + unsigned long checkSum() { + return (advanceWidth << 16)+(lsb & 0xffff); + } + }; + + /* maxp table */ + class Maxp { + public: + Fixed version; + USHORT numGlyphs; + USHORT maxPoints; + USHORT maxContours; + USHORT maxCompositePoints; + USHORT maxCompositeContours; + USHORT maxZones; + USHORT maxTwilightPoints; + USHORT maxStorage; + USHORT maxFunctionDefs; + USHORT maxInstructionDefs; + USHORT maxStackElements; + USHORT maxSizeOfInstructions; + USHORT maxComponentElements; + USHORT maxComponentDepth; + int read(PDFFTrueTypeFont *font); + void output(PDFFTrueTypeFont *font, P2POutputStream *str); + unsigned long checkSum(); + }; + + /* head table */ + class Head { + public: + Fixed version; + Fixed fontRevision; + ULONG checkSumAdjustment; + ULONG magicNumber; + USHORT flags; + USHORT unitsPerEm; + LONGDATETIME created; + LONGDATETIME modified; + SHORT xMin; + SHORT yMin; + SHORT xMax; + SHORT yMax; + USHORT macStyle; + USHORT lowestRecPPEM; + SHORT fontDirectionHint; + SHORT indexToLocFormat; + SHORT glyphDataFormat; + int read(PDFFTrueTypeFont *font); + void output(PDFFTrueTypeFont *font, P2POutputStream *str); + unsigned long checkSum(); + }; + + int readOrgTables(); + void freeNewTables(); + void outputWholeFile(P2POutputStream *str); + void setupNewTableDirectory(); + /* allocate new loca, gfyf, hmtx table */ + void allocNewLGHTable(); + /* reallocate new loca and hmtx table */ + void reallocNewLHTable(); + /* create loca, gfyf, hmtx table */ + void createLGHTable(); + void outputOrgData(P2POutputStream *str, + unsigned long offset, unsigned long len); + void outputOffsetTable(P2POutputStream *str); + void outputTableDirectory(P2POutputStream *str); + void outputHead(P2POutputStream *str) { + head.output(this,str); + } + void outputHhea(P2POutputStream *str) { + hhea.output(this,str); + } + void outputLoca(P2POutputStream *str); + void outputMaxp(P2POutputStream *str) { + maxp.output(this,str); + } + void outputCvt(P2POutputStream *str); + void outputPrep(P2POutputStream *str); + void outputGlyf(P2POutputStream *str); + void outputHmtx(P2POutputStream *str); + void outputFpgm(P2POutputStream *str); + unsigned long locaCheckSum(); + unsigned long glyfCheckSum(); + unsigned long hmtxCheckSum(); + unsigned long offsetTableCheckSum(); + unsigned long tableDirectoryCheckSum(); + unsigned long allCheckSum(); + unsigned long mapGID(unsigned long orgGID); + template<class T> void write(P2POutputStream *str, T v) { + v = toBE(v); + str->write(&v,sizeof(T)); + } + + int outputLength; + unsigned long *GIDMap; + unsigned long GIDMapSize; + unsigned long maxGID; + unsigned char *glyf; + unsigned long glyfSize; + unsigned long cGlyfIndex; + LongHorMetric *hmtx; + unsigned long hmtxSize; + ULONG *loca; + unsigned long locaSize; + unsigned long locaEntrySize; + Hhea hhea; + Maxp maxp; + /* table directory */ + TableDirectory *tDir; + TableDirectory *orgTDir; + Head head; +#endif + + /* cmap */ + class Cmap { + public: + virtual unsigned long getGID(PDFFTrueTypeFont *font, + unsigned long unicode) = 0; + virtual void read(PDFFTrueTypeFont *font) = 0; + virtual ~Cmap() {}; + }; + + /* cmap format 4 */ + class CmapFormat4 : public Cmap { + public: + CmapFormat4() { + endCode = startCode = idRangeOffset = 0; + idDelta = 0; + } + + virtual ~CmapFormat4() { + if (endCode != 0) delete[] endCode; + if (startCode != 0) delete[] startCode; + if (idDelta != 0) delete[] idDelta; + if (idRangeOffset != 0) delete[] idRangeOffset; + } + virtual unsigned long getGID(PDFFTrueTypeFont *font, + unsigned long unicode); + virtual void read(PDFFTrueTypeFont *font); + private: + USHORT length; + USHORT language; + USHORT segCountX2; + USHORT segCount; + USHORT searchRange; + USHORT entrySelector; + USHORT rangeShift; + USHORT *endCode; + USHORT *startCode; + SHORT *idDelta; + ULONG idRangeOffsetTop; + USHORT *idRangeOffset; + + }; + + /* cmap format 12 */ + class CmapFormat12 : public Cmap { + public: + CmapFormat12() { + startCharCode = endCharCode = startGlyphID = 0; + } + + virtual ~CmapFormat12() { + if (startCharCode != 0) delete[] startCharCode; + if (endCharCode != 0) delete[] endCharCode; + if (startGlyphID != 0) delete[] startGlyphID; + } + virtual unsigned long getGID(PDFFTrueTypeFont *font, + unsigned long unicode); + virtual void read(PDFFTrueTypeFont *font); + private: + ULONG length; + ULONG language; + ULONG nGroups; + ULONG *startCharCode; + ULONG *endCharCode; + ULONG *startGlyphID; + }; + + + int setOffsetTable(unsigned int faceIndex); + unsigned long doMapToVertGID(unsigned long orgGID); + int getTableDirEntry(TAG tableTag, TableDirectory *ent); + int getTable(TAG tableTag, ULONG *tableOffset = 0, ULONG *tableLength = 0); + void setOffset(unsigned long offsetA) { offset = offsetA; } + unsigned long getOffset() { return offset; } + void advance(unsigned long adv) { offset += adv; } + void read(void *p, unsigned long len) { + unsigned char *d = static_cast<unsigned char *>(p); + unsigned char *s = top+offset; + unsigned char *e; + + if (offset+len > fileLength) { + e = top+fileLength-1; + } else { + e = top+offset+len-1; + } +#if __BYTE_ORDER == __LITTLE_ENDIAN + while (s <= e) { + *d++ = *e--; + } +#else /* BIG ENDIAN */ + while (s <= e) { + *d++ = *s++; + } +#endif + advance(len); + } + void read(unsigned long offsetA, void *p, unsigned long len) { + setOffset(offsetA); + read(p,len); + } + template<class T> void read(unsigned long offsetA, T *p) { + read(offsetA, p, sizeof(T)); + } + template<class T> void read(T *p) { + read(p, sizeof(T)); + } + template<class T> void skip() { advance(sizeof(T)); } + + /* convert to Big Endian */ + template<class T> static T toBE(T v) { +#if __BYTE_ORDER == __LITTLE_ENDIAN + T r = 0; + unsigned int i; + + for (i = 0;i < sizeof(T);i++) { + r <<= 8; + r |= (v & 0xff); + v >>= 8; + } + return r; +#else /* BIG ENDIAN */ + return v; +#endif + } + unsigned long scanLookupList(USHORT listIndex, unsigned long orgGID); + unsigned long scanLookupSubTable(ULONG subTable, unsigned long orgGID); + int checkGIDInCoverage(ULONG coverage, unsigned long orgGID); + unsigned long charToTag(const char *tagName); + + Cmap *cmap; + char *fileName; + int fontFileFD; + unsigned char *top; + unsigned long offset; + unsigned long fileLength; + ULONG offsetTable; + ULONG featureTable; + ULONG lookupList; + UGooString *fontName; + USHORT numTables; + ULONG scriptTag; +}; + +#endif --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/P2PDoc.cxx +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/P2PDoc.cxx @@ -0,0 +1,205 @@ +/* + +Copyright (c) 2006-2007, BBR Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +/* + P2PDoc.cc + pdftopdf doc +*/ + +#include <config.h> +#include "goo/gmem.h" +#include "P2PDoc.h" +#include "P2PXRef.h" +#include "XRef.h" +#include "P2PCatalog.h" +#include <time.h> + +P2PDoc::Options P2PDoc::options; + +/* Constructor */ +P2PDoc::P2PDoc(PDFDoc *orgDocA) +{ + orgDoc = orgDocA; + catalog = new P2PCatalog(orgDoc->getCatalog(),orgDoc->getXRef()); +} + +P2PDoc::~P2PDoc() +{ + delete catalog; + P2PXRef::clean(); +} + +void P2PDoc::output(P2POutputStream *str, int deviceCopies, bool deviceCollate) +{ + int xrefOffset; + int num, gen; + time_t curtime; + struct tm *curtm; + char curdate[255]; + char version[10]; + XRef *xref = orgDoc->getXRef(); + Object obj; + GBool outputTitle = gFalse; + GBool outputCreationDate = gFalse; + GBool outputModDate = gFalse; + GBool outputTrapped = gFalse; + GBool outputProducer = gFalse; + + /* get time data */ + curtime = time(NULL); + curtm = localtime(&curtime); + strftime(curdate, sizeof(curdate),"D:%Y%m%d%H%M%S%z", curtm); + + /* output header */ + snprintf(version,sizeof(version),"%%PDF-%3.1f\n",orgDoc->getPDFVersion()); + str->puts(version); + str->puts("%\0201\0202\0203\0204\n"); + str->puts("% This file was generated by pdftopdf\n"); + + /* + * output device copies commen + * This is not standard, but like PostScript. + */ + if (deviceCopies > 0) { + str->printf("%%%%PDFTOPDFNumCopies : %d\n",deviceCopies); + str->printf("%%%%PDFTOPDFCollate : %s\n",deviceCollate ? "true" : "false"); + } + + /* output body */ + catalog->output(str,options.copies,options.collate); + /* output objects that are not output yet. */ + P2PXRef::flush(str,xref); + + /* output cross reference */ + xrefOffset = P2PXRef::output(str); + + /* output trailer */ + catalog->getNum(&num,&gen); + str->puts("trailer\n"); + str->printf("<< /Size %d /Root %d %d R \n",P2PXRef::getNObjects(), + num,gen); + + str->puts("/Info << "); + if (orgDoc->getDocInfo(&obj) == 0) { + Dict *info = obj.getDict(); + int i; + int n = info->getLength(); + + for (i = 0;i < n;i++) { +#ifdef HAVE_UGOOSTRING_H + char *key = info->getKey(i)->getCString(); +#else + char *key = info->getKey(i); +#endif + Object val; + + if (info->getValNF(i,&val) != 0) { + P2POutput::outputName(key,str); + str->putchar(' '); + P2POutput::outputObject(&val,str,xref); + if (strcmp(key,"Producer") == 0) { + outputProducer = gTrue; + } else if (strcmp(key,"Trapped") == 0) { + outputTrapped = gTrue; + } else if (strcmp(key,"ModDate") == 0) { + outputModDate = gTrue; + } else if (strcmp(key,"CreationDate") == 0) { + outputCreationDate = gTrue; + } else if (strcmp(key,"Title") == 0) { + outputTitle = gTrue; + } + } + + val.free(); +#ifdef HAVE_UGOOSTRING_H + delete[] key; +#endif + } + obj.free(); + } + if (!outputTitle && options.title != 0) { + str->puts("/Title "); + P2POutput::outputString(options.title,strlen(options.title),str); + str->putchar(' '); + } + if (!outputCreationDate) str->printf("/CreationDate (%s) ",curdate); + if (!outputModDate) str->printf("/ModDate (%s) ",curdate); + if (!outputProducer) str->puts("/Producer (pdftopdf) "); + if (!outputTrapped) str->puts("/Trapped /False"); + str->puts(" >>\n"); + + str->puts(">>\n"); + str->puts("startxref\n"); + str->printf("%d\n",xrefOffset); + str->puts("%%EOF\n"); +} + +int P2PDoc::nup(int n, PDFRectangle *box, + unsigned int borderFlag, unsigned int layout, + int xpos, int ypos) +{ + if (n == 1) return 0; + switch (n) { + case 2: + case 4: + case 6: + case 8: + case 9: + case 16: + break; + default: + return -1; + } + return catalog->nup(n,box,borderFlag,layout,xpos,ypos); +} + +void P2PDoc::fit(PDFRectangle *box, double zoom) +{ + catalog->fit(box,zoom); +} + +void P2PDoc::mirror() +{ + catalog->mirror(); +} + +void P2PDoc::rotate(int orientation) +{ + catalog->rotate(orientation); +} + +void P2PDoc::position(PDFRectangle *box, int xpos, int ypos) +{ + catalog->position(box,xpos,ypos); +} + +void P2PDoc::scale(double zoom) +{ + catalog->scale(zoom); +} + +int P2PDoc::getNumberOfPages() +{ + return catalog->getNumberOfPages(); +} --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/P2PMatrix.h +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/P2PMatrix.h @@ -0,0 +1,149 @@ +/* + +Copyright (c) 2006-2007, BBR Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +/* + P2PMatrix.h + pdftopdf matrix +*/ +#ifndef _P2PMATRIX_H_ +#define _P2PMATRIX_H_ + +#include <math.h> +#include "P2POutputStream.h" + +class P2PMatrix { +public: + P2PMatrix() { + mat[0] = 1;mat[1] = 0;mat[2] = 0;mat[3] = 1;mat[4] = 0; mat[5] = 0; + } + + P2PMatrix(double m0, double m1, double m2, + double m3, double m4, double m5) { + mat[0] = m0;mat[1] = m1;mat[2] = m2; + mat[3] = m3;mat[4] = m4;mat[5] = m5; + } + + void output(P2POutputStream *str) { + str->printf("%f %f %f %f %f %f", + mat[0],mat[1],mat[2],mat[3],mat[4],mat[5]); + } + + void rotate(double x) { + double m0,m1,m2,m3,m4,m5; + + x = (x/180) * M_PI; + + m0 = mat[0]*cos(x)-mat[1]*sin(x); + m1 = mat[0]*sin(x)+mat[1]*cos(x); + m2 = mat[2]*cos(x)-mat[3]*sin(x); + m3 = mat[2]*sin(x)+mat[3]*cos(x); + m4 = mat[4]*cos(x)-mat[5]*sin(x); + m5 = mat[4]*sin(x)+mat[5]*cos(x); + + mat[0] = m0;mat[1] = m1;mat[2] = m2; + mat[3] = m3;mat[4] = m4;mat[5] = m5; + } + + void rotate(int x) { + /* special case */ + double m0,m1,m2,m3,m4,m5; + + if (x < 0 || (x % 90) != 0 || x >= 360) { + rotate(static_cast<double>(x)); + return; + } + switch (x / 90) { + case 1: + m0 = -mat[1]; + m1 = mat[0]; + m2 = -mat[3]; + m3 = mat[2]; + m4 = -mat[5]; + m5 = mat[4]; + break; + case 2: + m0 = -mat[0]; + m1 = -mat[1]; + m2 = -mat[2]; + m3 = -mat[3]; + m4 = -mat[4]; + m5 = -mat[5]; + break; + case 3: + m0 = mat[1]; + m1 = -mat[0]; + m2 = mat[3]; + m3 = -mat[2]; + m4 = mat[5]; + m5 = -mat[4]; + break; + case 0: + default: + break; + } + mat[0] = m0;mat[1] = m1;mat[2] = m2; + mat[3] = m3;mat[4] = m4;mat[5] = m5; + } + + void move(double x, double y) { + mat[4] += x; + mat[5] += y; + } + + void scale(double x, double y) { + mat[0] *= x; + mat[1] *= y; + mat[2] *= x; + mat[3] *= y; + mat[4] *= x; + mat[5] *= y; + } + + void scale(double x) { + scale(x,x); + } + + void trans(P2PMatrix *s) { + double m0,m1,m2,m3,m4,m5; + + m0 = mat[0]*s->mat[0]+mat[1]*s->mat[2]; + m1 = mat[0]*s->mat[1]+mat[1]*s->mat[3]; + m2 = mat[2]*s->mat[0]+mat[3]*s->mat[2]; + m3 = mat[2]*s->mat[1]+mat[3]*s->mat[3]; + m4 = mat[4]*s->mat[0]+mat[5]*s->mat[2]+s->mat[4]; + m5 = mat[4]*s->mat[1]+mat[5]*s->mat[3]+s->mat[5]; + + mat[0] = m0;mat[1] = m1;mat[2] = m2; + mat[3] = m3;mat[4] = m4;mat[5] = m5; + } + + void apply(double x, double y, double *rx, double *ry) { + *rx = x*mat[0]+y*mat[2]+mat[4]; + *ry = x*mat[1]+y*mat[3]+mat[5]; + } + + double mat[6]; +}; + +#endif --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/P2PCMap.h +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/P2PCMap.h @@ -0,0 +1,106 @@ +//======================================================================== +// +// P2PCMap.h +// +// Copyright 2001-2003 Glyph & Cog, LLC +// 2007 Modefied by BBR Inc. +// +//======================================================================== + +#ifndef CMAP_H +#define CMAP_H + +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + +#include "poppler-config.h" +#include "goo/gtypes.h" +#include "CharTypes.h" + +#if MULTITHREADED +#include <goo/GooMutex.h> +#endif + +class GooString; +struct CMapVectorEntry; +class P2PCMapCache; + +//------------------------------------------------------------------------ + +class P2PCMap { +public: + + // Create the CMap specified by <collection> and <cMapName>. Sets + // the initial reference count to 1. Returns NULL on failure. + static P2PCMap *parse(P2PCMapCache *cache, GooString *collectionA, + GooString *cMapNameA); + + ~P2PCMap(); + + void incRefCnt(); + void decRefCnt(); + + // Return collection name (<registry>-<ordering>). + GooString *getCollection() { return collection; } + + // Return true if this CMap matches the specified <collectionA>, and + // <cMapNameA>. + GBool match(GooString *collectionA, GooString *cMapNameA); + + // Return the CID corresponding to the character code starting at + // <s>, which contains <len> bytes. Sets *<nUsed> to the number of + // bytes used by the char code. + CID getCID(char *s, int len, int *nUsed); + + // Return the writing mode (0=horizontal, 1=vertical). + int getWMode() { return wMode; } + + void setReverseMap(Guint *rmap, Guint rmapSize, Guint ncand); + +private: + + P2PCMap(GooString *collectionA, GooString *cMapNameA); + P2PCMap(GooString *collectionA, GooString *cMapNameA, int wModeA); + void useCMap(P2PCMapCache *cache, char *useName); + void copyVector(CMapVectorEntry *dest, CMapVectorEntry *src); + void addCodeSpace(CMapVectorEntry *vec, Guint start, Guint end, + Guint nBytes); + void addCIDs(Guint start, Guint end, Guint nBytes, CID firstCID); + void freeCMapVector(CMapVectorEntry *vec); + void setReverseMapVector(Guint startCode, CMapVectorEntry *vec, + Guint *rmap, Guint rmapSize, Guint ncand); + + GooString *collection; + GooString *cMapName; + int wMode; // writing mode (0=horizontal, 1=vertical) + CMapVectorEntry *vector; // vector for first byte (NULL for + // identity CMap) + int refCnt; +#if MULTITHREADED + GooMutex mutex; +#endif +}; + +//------------------------------------------------------------------------ + +#define cMapCacheSize 4 + +class P2PCMapCache { +public: + + P2PCMapCache(); + ~P2PCMapCache(); + + // Get the <cMapName> CMap for the specified character collection. + // Increments its reference count; there will be one reference for + // the cache plus one for the caller of this function. Returns NULL + // on failure. + P2PCMap *getCMap(GooString *collection, GooString *cMapName); + +private: + + P2PCMap *cache[cMapCacheSize]; +}; + +#endif --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/P2PCharCodeToUnicode.h +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/P2PCharCodeToUnicode.h @@ -0,0 +1,52 @@ +//======================================================================== +// +// P2PCharCodeToUnicode.h +// Mapping from character codes to Unicode. +// BBR Inc. +// +// Based Poppler CharCodeToUnicode.h +// Copyright 2001-2003 Glyph & Cog, LLC +// +//======================================================================== + +#ifndef P2PCHARCODETOUNICODE_H +#define P2PCHARCODETOUNICODE_H + +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + +#include "CharTypes.h" + +struct P2PCharCodeToUnicodeString; + +//------------------------------------------------------------------------ + +class P2PCharCodeToUnicode { +public: + + // Parse a ToUnicode CMap for an 8- or 16-bit font from File + static P2PCharCodeToUnicode *parseCMapFromFile(GooString *fileName, + int nBits); + + ~P2PCharCodeToUnicode(); + + // Map a CharCode to Unicode. + int mapToUnicode(CharCode c, Unicode *u, int size); + + // Return the mapping's length, i.e., one more than the max char + // code supported by the mapping. + CharCode getLength() { return mapLen; } + +private: + + void parseCMap1(int (*getCharFunc)(void *), void *data, int nBits); + void addMapping(CharCode code, char *uStr, int n, int offset); + P2PCharCodeToUnicode(); + Unicode *map; + CharCode mapLen; + P2PCharCodeToUnicodeString *sMap; + int sMapLen, sMapSize; +}; + +#endif --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/Makefile +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/Makefile @@ -0,0 +1,98 @@ +# +# "$Id: Makefile 6649 2007-07-11 21:46:42Z till $" +# +# pdftopdf filter Makefile for the Common UNIX Printing System (CUPS). +# + +include ../Makedefs + +# +# Object files... +# + +LIBOBJS = \ + P2PCatalog.o \ + P2PDoc.o \ + P2PGfx.o \ + P2PObject.o \ + P2POutput.o \ + P2POutputStream.o \ + P2PPage.o \ + P2PPageTree.o \ + P2PResources.o \ + P2PXRef.o \ + P2PFont.o \ + PDFFTrueTypeFont.o \ + P2PPattern.o \ + P2PCharCodeToUnicode.o \ + P2PCMap.o \ + parseargs.o \ + UGooString.o + +OBJS = pdftopdf.o $(LIBOBJS) + +TARGETS = pdftopdf + + +# +# Make everything... +# + +all: $(TARGETS) + + +# +# Clean all object files... +# + +clean: + $(RM) $(OBJS) + $(RM) pdftopdf + + +# +# Update dependencies (without system header dependencies...) +# + +depend: + makedepend -Y -I.. -fDependencies $(OBJS:.o=.cxx) parseargs.c >/dev/null 2>&1 + + +# +# Install the filter... +# + +install: all + $(INSTALL_DIR) -m 755 $(SERVERBIN)/filter + $(INSTALL_BIN) pdftopdf $(SERVERBIN)/filter + + +# +# Uninstall the filter... +# + +uninstall: + $(RM) $(SERVERBIN)/filter/pdftopdf + -$(RMDIR) $(SERVERBIN)/filter + -$(RMDIR) $(SERVERBIN) + + +# +# pdftopdf +# + +pdftopdf: pdftopdf.o $(LIBOBJS) ../cups/$(LIBCUPS) + echo Linking $@... + $(CXX) $(LDFLAGS) -o $@ pdftopdf.o $(LIBOBJS) $(POPPLER_LIBS) $(CXXLIBS) -lm + + +# +# Dependencies... +# + +include Dependencies + + +# +# End of "$Id: Makefile 6649 2007-07-11 21:46:42Z till $". +# --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/UGooString.cxx +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/UGooString.cxx @@ -0,0 +1,94 @@ +//======================================================================== +// +// UGooString.cc +// +// Unicode string +// +// Copyright 2005 Albert Astals Cid <aacid@kde.org> +// +//======================================================================== + +#include <string.h> + +#include "goo/gmem.h" +#include "goo/GooString.h" +#include "PDFDocEncoding.h" +#include "UGooString.h" + +UGooString::UGooString(Unicode *u, int l) +{ + s = u; + length = l; +} + +UGooString::UGooString(GooString &str) +{ + if ((str.getChar(0) & 0xff) == 0xfe && (str.getChar(1) & 0xff) == 0xff) + { + length = (str.getLength() - 2) / 2; + s = (Unicode *)gmallocn(length, sizeof(Unicode)); + for (int j = 0; j < length; ++j) { + s[j] = ((str.getChar(2 + 2*j) & 0xff) << 8) | (str.getChar(3 + 2*j) & 0xff); + } + } else + initChar(str); +} + +UGooString::UGooString(const UGooString &str) +{ + length = str.length; + s = (Unicode *)gmallocn(length, sizeof(Unicode)); + memcpy(s, str.s, length * sizeof(Unicode)); +} + +UGooString::UGooString(const char *str) +{ + GooString aux(str); + initChar(aux); +} + +void UGooString::initChar(GooString &str) +{ + length = str.getLength(); + s = (Unicode *)gmallocn(length, sizeof(Unicode)); + bool anyNonEncoded = false; + for (int j = 0; j < length && !anyNonEncoded; ++j) { + s[j] = pdfDocEncoding[str.getChar(j) & 0xff]; + if (!s[j]) anyNonEncoded = true; + } + if ( anyNonEncoded ) + { + for (int j = 0; j < length; ++j) { + s[j] = str.getChar(j); + } + } +} + +UGooString::~UGooString() +{ + gfree(s); +} + +int UGooString::cmp(UGooString *str) const +{ + int n1, n2, i, x; + Unicode *p1, *p2; + + n1 = length; + n2 = str->length; + for (i = 0, p1 = s, p2 = str->s; i < n1 && i < n2; ++i, ++p1, ++p2) { + x = *p1 - *p2; + if (x != 0) { + return x; + } + } + return n1 - n2; +} + +char *UGooString::getCString() const +{ + char *res = new char[length + 1]; + for (int i = 0; i < length; i++) res[i] = s[i]; + res[length] = '\0'; + return res; +} --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/P2PResources.cxx +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/P2PResources.cxx @@ -0,0 +1,313 @@ +/* + +Copyright (c) 2006-2007, BBR Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +/* + P2PResources.cc + pdftopdf resources dictionary +*/ + +#include <config.h> +#include <string.h> +#include "goo/gmem.h" +#include "P2PResources.h" +#include "P2PFont.h" + +P2PResourceMap::P2PResourceMap() +{ + int i; + + for (i = 0;i < P2PResources::NDict;i++) { + tables[i] = 0; + } +} + +P2PResourceMap::~P2PResourceMap() +{ + int i; + + for (i = 0;i < P2PResources::NDict;i++) { + if (tables[i] != 0) { + delete tables[i]; + } + } +} + +const char *P2PResources::dictNames[NDict] = { + "ExtGState", + "ColorSpace", + "Pattern", + "Shading", + "XObject", + "Font" +}; + +P2PResources::P2PResources(XRef *xrefA) +{ + int i; + + xref = xrefA; + for (i = 0;i < NDict;i++) { + dictionaries[i] = 0; + } + resourceNo = 0; + patternDict = 0; + nPattern = 0; +} + +P2PResources::~P2PResources() +{ + int i; + + for (i = 0;i < NDict;i++) { + if (dictionaries[i] != 0) { + delete dictionaries[i]; + } + } + if (patternDict != 0) delete[] patternDict; +} + +void P2PResources::output(P2POutputStream *str, P2PFontResource *fontResource) +{ + int i; + str->puts("<<"); + + for (i = 0;i < NDict;i++) { + if (i == Font && fontResource != 0 && fontResource->getNDicts() > 0) { + str->printf(" /%s ",dictNames[i]); + fontResource->output(str,xref); + str->putchar('\n'); + } else if (i == Pattern) { + if (nPattern > 0) { + int j; + + str->printf(" /%s << ",dictNames[i]); + for (j = 0;j < nPattern;j++) { + if (patternDict[j].pattern != 0) { + /* output body later */ + P2PXRef::put(patternDict[j].pattern); + /* output refrence here */ + P2POutput::outputName(patternDict[j].name,str); + str->putchar(' '); + patternDict[j].pattern->outputRef(str); + str->putchar('\n'); + } + } + str->puts(">>\n"); + } + } else { + if (dictionaries[i] != 0) { + str->printf(" /%s ",dictNames[i]); + P2POutput::outputDict(dictionaries[i],str,xref); + str->putchar('\n'); + } + } + } + /* output ProcSet */ + /* Notice: constant values */ + str->puts(" /ProcSet [ /PDF /Text ] "); + + /* Notice: no Properties */ + + str->puts(">>"); +} + +P2PResourceMap *P2PResources::merge(Dict *res) +{ + P2PResourceMap *map = 0; + Object obj; + int i; + + if (res == 0) return 0; + for (i = 0;i < NDict;i++) { + if (res->lookup(const_cast<char *>(dictNames[i]),&obj) != 0 + && obj.isDict()) { + if (map == 0) { + map = new P2PResourceMap(); + } + if (dictionaries[i] == 0) { + dictionaries[i] = new Dict(xref); + } + if (map->tables[i] == 0) { + map->tables[i] = new Dict((XRef *)0); + } + mergeOneDict(dictionaries[i],obj.getDict(),map->tables[i],i != Pattern); + obj.free(); + } + } + return map; +} + +P2PResourceMap *P2PResources::merge(P2PResources *res) +{ + P2PResourceMap *map = 0; + int i; + + for (i = 0;i < NDict;i++) { + if (res->dictionaries[i] != 0) { + if (map == 0) { + map = new P2PResourceMap(); + } + if (dictionaries[i] == 0) { + dictionaries[i] = new Dict(xref); + } + if (map->tables[i] == 0) { + map->tables[i] = new Dict((XRef *)0); + } + mergeOneDict(dictionaries[i],res->dictionaries[i],map->tables[i], + i != Pattern); + } + } + + return map; +} + +void P2PResources::mergeOneDict(Dict *dst, Dict *src, Dict *map, GBool unify) +{ + int i,j; + int srcn = src->getLength(); + int dstn; + + for (i = 0;i < srcn;i++) { + Object srcobj; + GBool found = gFalse; +#ifdef HAVE_UGOOSTRING_H + UGooString *srckey; +#else + char *srckey; +#endif + + src->getValNF(i,&srcobj); + srckey = src->getKey(i); + if (srcobj.isRef() && unify) { + dstn = dst->getLength(); + for (j = 0;j < dstn;j++) { + Object dstobj; + + dst->getValNF(j,&dstobj); + if (dstobj.isRef() && srcobj.getRefNum() == dstobj.getRefNum() + && srcobj.getRefGen() == dstobj.getRefGen()) { + /* add to map */ +#ifdef HAVE_UGOOSTRING_H + addMap(srckey,dst->getKey(j)->getCString(),map); +#else + addMap(srckey,dst->getKey(j),map); +#endif + found = gTrue; + } + dstobj.free(); + } + } + if (!found) { + /* add to dst */ + addDict(dst,&srcobj,srckey,map); + } else { + srcobj.free(); + } + } +} + +#ifdef HAVE_UGOOSTRING_H +void P2PResources::addDict(Dict *dict, Object *obj, + UGooString *srckey, Dict *map) +{ + char name[20]; + Object tobj; + + snprintf(name,20,"R%d",resourceNo++); + dict->addOwnVal(name,obj); + addMap(srckey,name,map); +} +#else +void P2PResources::addDict(Dict *dict, Object *obj, + char *srckey, Dict *map) +{ + char name[20]; + Object tobj; + + snprintf(name,20,"R%d",resourceNo++); + dict->add(strdup(name),obj); + addMap(srckey,name,map); +} +#endif + +#ifdef HAVE_UGOOSTRING_H +void P2PResources::addMap(UGooString *org, char *mapped, Dict *map) +{ + Object obj; + + obj.initName(mapped); + map->add(*org,&obj); +} +#else +void P2PResources::addMap(char *org, char *mapped, Dict *map) +{ + Object obj; + + obj.initName(mapped); + map->add(strdup(org),&obj); +} +#endif + +void P2PResources::setupPattern() +{ + int i; + + if (patternDict != NULL) { + delete[] patternDict; + patternDict = 0; + nPattern = 0; + } + if (dictionaries[Pattern] == 0) return; + nPattern = dictionaries[Pattern]->getLength(); + patternDict = new P2PPatternDict[nPattern]; + /* setting names */ + for (i = 0;i < nPattern;i++) { +#ifdef HAVE_UGOOSTRING_H + char *p = dictionaries[Pattern]->getKey(i)->getCString(); +#else + char *p = strdup(dictionaries[Pattern]->getKey(i)); +#endif + patternDict[i].name = p; + } +} + +void P2PResources::refPattern(char *name, P2PMatrix *matA) +{ + int i; + + if (dictionaries[Pattern] == 0) return; /* no pattern */ + for (i = 0;i < nPattern;i++) { + if (strcmp(name,patternDict[i].name) == 0) { + if (patternDict[i].pattern == 0) { + Object patObj; + + dictionaries[Pattern]->lookupNF(name,&patObj); + if (patObj.isRef() || patObj.isDict()) { + patternDict[i].pattern = new P2PPattern(&patObj,xref,matA); + } + patObj.free(); + } + } + } +} --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/P2PCatalog.cxx +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/P2PCatalog.cxx @@ -0,0 +1,99 @@ +/* + +Copyright (c) 2006-2007, BBR Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +/* + P2PCatalog.cc + pdftopdf document catalog +*/ + +#include <config.h> +#include "goo/gmem.h" +#include "P2PCatalog.h" +#include "P2PXRef.h" + + +/* Constructor */ +P2PCatalog::P2PCatalog(Catalog *orgCatalogA, XRef *xrefA) +{ + orgCatalog = orgCatalogA; + pageTree = new P2PPageTree(orgCatalog,xrefA); + xref = xrefA; +} + +P2PCatalog::~P2PCatalog() +{ + delete pageTree; +} + +void P2PCatalog::outputSelf(P2POutputStream *str) +{ + outputBegin(str); + str->puts("<< /Type /Catalog /Pages "); + P2PXRef::put(pageTree); + pageTree->outputRef(str); + str->puts(" >>\n"); + outputEnd(str); +} + +void P2PCatalog::output(P2POutputStream *str, int copies, GBool collate) +{ + outputSelf(str); + pageTree->output(str,copies,collate); +} + +int P2PCatalog::nup(int n, PDFRectangle *box, unsigned int borderFlag, + unsigned int layout, int xpos, int ypos) +{ + return pageTree->nup(n,box,borderFlag,layout,xpos,ypos); +} + +void P2PCatalog::fit(PDFRectangle *box, double zoom) +{ + pageTree->fit(box,zoom); +} + +void P2PCatalog::mirror() +{ + pageTree->mirror(); +} + +void P2PCatalog::rotate(int orientation) +{ + pageTree->rotate(orientation); +} + +void P2PCatalog::position(PDFRectangle *box, int xpos, int ypos) +{ + pageTree->position(box,xpos,ypos); +} + +void P2PCatalog::scale(double zoom) +{ + pageTree->scale(zoom); +} + +int P2PCatalog::getNumberOfPages() +{ + return pageTree->getNumberOfPages(); +} --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/P2POutput.h +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/P2POutput.h @@ -0,0 +1,55 @@ +/* + +Copyright (c) 2006-2007, BBR Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +/* + P2POutput.h + pdftopdf output pdf routines +*/ +#ifndef _P2POUTPUT_H_ +#define _P2POUTPUT_H_ + +#include "goo/gmem.h" +#include "Object.h" +#include "P2POutputStream.h" +#include "Dict.h" +#include "Stream.h" +#include "Array.h" +#include "Page.h" +#include "XRef.h" + +class P2PObject; + +namespace P2POutput { + void outputDict(Dict *dict, const char **keys, + P2PObject **objs, int len, P2POutputStream *str, XRef *xref); + void outputDict(Dict *dict, P2POutputStream *str, XRef *xref); + void outputArray(Array *array, P2POutputStream *str, XRef *xref, Dict *mapDict = 0); + void outputStream(Stream *stream, P2POutputStream *str, XRef *xref); + void outputRef(Ref *ref, P2POutputStream *str, XRef *xref); + void outputString(const char *s, int len, P2POutputStream *str); + void outputName(const char *name, P2POutputStream *str, Dict *mapDict = 0); + void outputObject(Object *obj, P2POutputStream *str, XRef *xref, Dict *mapDict = 0); +}; + +#endif --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/P2PGfx.cxx +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/P2PGfx.cxx @@ -0,0 +1,732 @@ +/* + P2PGfx.cc + developped by BBR Inc. 2006-2007 + + This file is based on Gfx.cc + Gfx.cc copyright notice is follows + and is licensed under GPL. +*/ +//======================================================================== +// +// Gfx.cc +// +// Copyright 1996-2003 Glyph & Cog, LLC +// +//======================================================================== + +#include <config.h> + + +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + +#include <stdlib.h> +#include <stdio.h> +#include <stddef.h> +#include <string.h> +#include <math.h> +#include "goo/gmem.h" +#include "goo/GooTimer.h" +#include "goo/GooHash.h" +#include "GlobalParams.h" +#include "CharTypes.h" +#include "Object.h" +#include "Array.h" +#include "Dict.h" +#include "Stream.h" +#include "Lexer.h" +#include "Parser.h" +#include "GfxFont.h" +#include "GfxState.h" +#include "OutputDev.h" +#include "Page.h" +#include "Error.h" +#include "Gfx.h" +#include "ProfileData.h" +#include "UGooString.h" +#include "P2PGfx.h" +#include "P2POutputStream.h" +#include "P2POutput.h" +#include "P2PResources.h" + +//------------------------------------------------------------------------ +// Operator table +//------------------------------------------------------------------------ + +#ifdef WIN32 // this works around a bug in the VC7 compiler +# pragma optimize("",off) +#endif + +P2PGfx::P2POperator P2PGfx::opTab[] = { + {"\"", 3, {tchkNum, tchkNum, tchkString}, + &P2PGfx::opMoveSetShowText}, + {"'", 1, {tchkString}, + &P2PGfx::opMoveShowText}, + {"BI", 0, {tchkNone}, + &P2PGfx::opBeginImage}, + {"CS", 1, {tchkName}, + &P2PGfx::opSetStrokeColorSpace}, + {"Do", 1, {tchkName}, + &P2PGfx::opXObject}, + {"Q", 0, {tchkNone}, + &P2PGfx::opRestore}, + {"SCN", -5, {tchkSCN, tchkSCN, tchkSCN, tchkSCN, + tchkSCN}, + &P2PGfx::opSetStrokeColorN}, + {"TJ", 1, {tchkArray}, + &P2PGfx::opShowSpaceText}, + {"Tf", 2, {tchkName, tchkNum}, + &P2PGfx::opSetFont}, + {"Tj", 1, {tchkString}, + &P2PGfx::opShowText}, + {"cs", 1, {tchkName}, + &P2PGfx::opSetFillColorSpace}, + {"gs", 1, {tchkName}, + &P2PGfx::opSetExtGState}, + {"q", 0, {tchkNone}, + &P2PGfx::opSave}, + {"scn", -5, {tchkSCN, tchkSCN, tchkSCN, tchkSCN, + tchkSCN}, + &P2PGfx::opSetFillColorN}, + {"sh", 1, {tchkName}, + &P2PGfx::opShFill}, +}; + +#ifdef WIN32 // this works around a bug in the VC7 compiler +# pragma optimize("",on) +#endif + +#define numOps (sizeof(opTab) / sizeof(P2POperator)) + +//------------------------------------------------------------------------ +// P2PGfx +//------------------------------------------------------------------------ + +P2PGfx::P2PGfx(XRef *xrefA, P2POutputStream *strA, + P2PFontResource *fontResourceA, P2PResources *resourcesA) +{ + xref = xrefA; + str = strA; + fontResource = fontResourceA; + resources = resourcesA; +} + +P2PGfx::~P2PGfx() { +} + +void P2PGfx::outputContents(Object *obj, P2PResourceMap *mappingTableA, + Dict *orgResourceA, P2PMatrix *matA) +{ + Object obj2; + int i; + + mappingTable = mappingTableA; + mat = matA; + orgCSResource = 0; + if (orgResourceA != 0) { + orgResourceA->lookup(const_cast<char *>("ColorSpace"),&obj2); + if (obj2.isDict()) { + orgCSResource = obj2.getDict(); + orgCSResource->incRef(); + } + } + obj2.free(); + if (obj->isArray()) { + for (i = 0; i < obj->arrayGetLength(); ++i) { + obj->arrayGet(i, &obj2); + if (!obj2.isStream()) { + error(-1, const_cast<char *>("Weird page contents")); + obj2.free(); + return; + } + obj2.free(); + } + } else if (!obj->isStream()) { + error(-1, const_cast<char *>("Weird page contents")); + return; + } +#ifdef PARSER_HAS_2_ARGS + parser = new Parser(xref, new Lexer(xref, obj)); +#else + parser = new Parser(xref, new Lexer(xref, obj), gTrue); +#endif + go(); + delete parser; + parser = NULL; +} + +void P2PGfx::go() +{ + Object obj; + Object args[maxArgs]; + int numArgs, i; + + // scan a sequence of objects + numArgs = 0; + parser->getObj(&obj); + while (!obj.isEOF()) { + + // got a command - execute it + if (obj.isCmd()) { + // Run the operation + execOp(&obj, args, numArgs); + + obj.free(); + for (i = 0; i < numArgs; ++i) + args[i].free(); + numArgs = 0; + } else if (numArgs < maxArgs) { + args[numArgs++] = obj; + + // too many arguments - something is wrong + } else { + error(getPos(), const_cast<char *>("Too many args in content stream")); + obj.free(); + } + + // grab the next object + parser->getObj(&obj); + } + obj.free(); + + // args at end with no command + if (numArgs > 0) { + error(getPos(), const_cast<char *>("Leftover args in content stream")); + for (i = 0; i < numArgs; ++i) + args[i].free(); + } +} + +void P2PGfx::outputOp(const char *name, Object args[], int numArgs) +{ + int i; + + for (i = 0;i < numArgs;i++) { + P2POutput::outputObject(&args[i],str,xref); + str->putchar(' '); + } + str->printf(" %s ",name); +} + +void P2PGfx::execOp(Object *cmd, Object args[], int numArgs) { + P2POperator *op; + char *name; + Object *argPtr; + int i; + + // find operator + name = cmd->getCmd(); + if (!(op = findOp(name))) { + outputOp(name,args,numArgs); + return; + } + + // type check args + argPtr = args; + if (op->numArgs >= 0) { + if (numArgs < op->numArgs) { + error(getPos(), const_cast<char *>("Too few (%d) args to '%s' operator"), + numArgs, name); + return; + } + if (numArgs > op->numArgs) { + argPtr += numArgs - op->numArgs; + numArgs = op->numArgs; + } + } else { + if (numArgs > -op->numArgs) { + error(getPos(), const_cast<char *>("Too many (%d) args to '%s' operator"), + numArgs, name); + return; + } + } + for (i = 0; i < numArgs; ++i) { + if (!checkArg(&argPtr[i], op->tchk[i])) { + error(getPos(), + const_cast<char *>("Arg #%d to '%s' operator is wrong type (%s)"), + i, name, argPtr[i].getTypeName()); + return; + } + } + + // do it + (this->*op->func)(argPtr, numArgs); +} + +P2PGfx::P2POperator *P2PGfx::findOp(char *name) { + int a, b, m, cmp = 1; + + a = -1; + b = numOps; + // invariant: opTab[a] < name < opTab[b] + while (b - a > 1) { + m = (a + b) / 2; + cmp = strcmp(opTab[m].name, name); + if (cmp < 0) + a = m; + else if (cmp > 0) + b = m; + else + a = b = m; + } + if (cmp != 0) + return NULL; + return &opTab[a]; +} + +GBool P2PGfx::checkArg(Object *arg, TchkType type) { + switch (type) { + case tchkBool: return arg->isBool(); + case tchkInt: return arg->isInt(); + case tchkNum: return arg->isNum(); + case tchkString: return arg->isString(); + case tchkName: return arg->isName(); + case tchkArray: return arg->isArray(); + case tchkProps: return arg->isDict() || arg->isName(); + case tchkSCN: return arg->isNum() || arg->isName(); + case tchkNone: return gFalse; + } + return gFalse; +} + +int P2PGfx::getPos() { + return parser ? parser->getPos() : -1; +} + +void P2PGfx::opSetStrokeColorSpace(Object args[], int numArgs) +{ + if (mappingTable != 0) { + P2POutput::outputObject(&args[0],str,xref, + mappingTable->tables[P2PResources::ColorSpace]); + } else { + P2POutput::outputObject(&args[0],str,xref); + } + str->puts(" CS "); +} + +void P2PGfx::opXObject(Object args[], int numArgs) +{ + if (mappingTable != 0) { + P2POutput::outputObject(&args[0],str,xref, + mappingTable->tables[P2PResources::XObject]); + } else { + P2POutput::outputObject(&args[0],str,xref); + } + str->puts(" Do "); +} + +void P2PGfx::opSetStrokeColorN(Object args[], int numArgs) +{ + int i; + + for (i = 0;i < numArgs-1;i++) { + P2POutput::outputObject(&args[i],str,xref); + str->putchar(' '); + } + if (mappingTable != 0 && args[i].isName()) { + P2POutput::outputObject(&args[i],str,xref, + mappingTable->tables[P2PResources::Pattern]); + str->putchar(' '); + } else { + P2POutput::outputObject(&args[i],str,xref); + str->putchar(' '); + } + if (args[i].isName() && resources != 0) { + /* check pattern */ + Object obj; + + char *name = args[i].getName(); + if (mappingTable != 0 + && mappingTable->tables[P2PResources::Pattern] != 0) { + mappingTable->tables[P2PResources::Pattern]->lookup(name,&obj); + name = obj.getName(); + } + resources->refPattern(name,mat); + obj.free(); + } + str->puts("SCN "); +} + +void P2PGfx::opSetFont(Object args[], int numArgs) +{ + if (mappingTable != 0) { + P2POutput::outputObject(&args[0],str,xref, + mappingTable->tables[P2PResources::Font]); + } else { + P2POutput::outputObject(&args[0],str,xref); + } + if (fontResource != 0) { + if (mappingTable != 0) { + Dict *map = mappingTable->tables[P2PResources::Font]; + if (map != 0) { + Object obj; +#ifdef HAVE_UGOOSTRING_H + UGooString nameStr(args[0].getName()); + + map->lookupNF(nameStr,&obj); +#else + map->lookupNF(args[0].getName(),&obj); +#endif + if (obj.isName()) { + state.setFont(fontResource->lookup(obj.getName())); + } + obj.free(); + } + } else { + state.setFont(fontResource->lookup(args[0].getName())); + } + } + str->putchar(' '); + P2POutput::outputObject(&args[1],str,xref); + str->puts(" Tf "); +} + +void P2PGfx::opSetFillColorSpace(Object args[], int numArgs) +{ + if (mappingTable != 0) { + P2POutput::outputObject(&args[0],str,xref, + mappingTable->tables[P2PResources::ColorSpace]); + } else { + P2POutput::outputObject(&args[0],str,xref); + } + str->puts(" cs "); +} + +void P2PGfx::opSetExtGState(Object args[], int numArgs) +{ + if (mappingTable != 0) { + P2POutput::outputObject(&args[0],str,xref, + mappingTable->tables[P2PResources::ExtGState]); + if (fontResource != 0) { + Dict *map = mappingTable->tables[P2PResources::ExtGState]; + if (map != 0) { + Object obj; +#ifdef HAVE_UGOOSTRING_H + UGooString nameStr(args[0].getName()); + + map->lookupNF(nameStr,&obj); +#else + map->lookupNF(args[0].getName(),&obj); +#endif + if (obj.isName()) { + state.setFont(fontResource->lookupExtGState(obj.getName())); + } + obj.free(); + } + } + } else { + P2POutput::outputObject(&args[0],str,xref); + if (fontResource != 0) { + if (args[0].isName()) { + state.setFont(fontResource->lookupExtGState(args[0].getName())); + } + } + } + str->puts(" gs "); +} + +void P2PGfx::opSetFillColorN(Object args[], int numArgs) +{ + int i; + + for (i = 0;i < numArgs-1;i++) { + P2POutput::outputObject(&args[i],str,xref); + str->putchar(' '); + } + if (mappingTable != 0 && args[i].isName()) { + P2POutput::outputObject(&args[i],str,xref, + mappingTable->tables[P2PResources::Pattern]); + str->putchar(' '); + } else { + P2POutput::outputObject(&args[i],str,xref); + str->putchar(' '); + } + if (args[i].isName() && resources != 0) { + /* check pattern */ + Object obj; + + char *name = args[i].getName(); + if (mappingTable != 0 + && mappingTable->tables[P2PResources::Pattern] != 0) { + mappingTable->tables[P2PResources::Pattern]->lookup(name,&obj); + name = obj.getName(); + } + resources->refPattern(name,mat); + obj.free(); + } + str->puts("scn "); +} + +void P2PGfx::opShFill(Object args[], int numArgs) +{ + if (mappingTable != 0) { + P2POutput::outputObject(&args[0],str,xref, + mappingTable->tables[P2PResources::Shading]); + } else { + P2POutput::outputObject(&args[0],str,xref); + } + str->puts(" sh "); +} + +void P2PGfx::opMoveSetShowText(Object args[], int numArgs) +{ + P2PFontDict *f; + + if ((f = state.getFont()) != 0) f->showText(args[2].getString()); + outputOp("\"",args,numArgs); +} + +void P2PGfx::opMoveShowText(Object args[], int numArgs) +{ + P2PFontDict *f; + + if ((f = state.getFont()) != 0) f->showText(args[0].getString()); + outputOp("'",args,numArgs); +} + +void P2PGfx::opShowSpaceText(Object args[], int numArgs) +{ + P2PFontDict *f; + + if ((f = state.getFont()) != 0) { + Array *a; + int i, n; + + a = args[0].getArray(); + n = a->getLength(); + for (i = 0;i < n;i++) { + Object obj; + + a->get(i,&obj); + if (obj.isString()) { + f->showText(obj.getString()); + } + obj.free(); + } + } + outputOp("TJ",args,numArgs); +} + +void P2PGfx::opShowText(Object args[], int numArgs) +{ + P2PFontDict *f; + + if ((f = state.getFont()) != 0) f->showText(args[0].getString()); + outputOp("Tj",args,numArgs); +} + +void P2PGfx::opSave(Object args[], int numArgs) +{ + state.save(); + str->puts(" q "); +} + +void P2PGfx::opRestore(Object args[], int numArgs) +{ + state.restore(); + str->puts(" Q "); +} + +void P2PGfx::opBeginImage(Object args[], int numArgs) +{ + Object dict; + char *key; + Stream *imageStr; + Object obj; + + /* output BI */ + str->puts(" BI"); + /* handle dictionary */ + dict.initDict(xref); + parser->getObj(&obj); + while (!obj.isCmd(const_cast<char *>("ID")) && !obj.isEOF()) { + str->putchar(' '); + if (!obj.isName()) { + error(getPos(), const_cast<char *>("Inline image dictionary key must be a name object")); + P2POutput::outputObject(&obj,str,xref); + str->putchar(' '); + obj.free(); + } else { + key = copyString(obj.getName()); + if (strcmp("Filter",key) != 0 && strcmp("F",key) != 0 + && strcmp("DecodeParms",key) != 0 && strcmp("DP",key) != 0) { + /* when Filter or DecodeParms, not ouput because image is decoded. */ + P2POutput::outputObject(&obj,str,xref); + str->putchar(' '); + } + obj.free(); + parser->getObj(&obj); + if (obj.isEOF() || obj.isError()) { + gfree(key); + break; + } + if (mappingTable != 0 && + (strcmp(key,"ColorSpace") == 0 || strcmp(key,"CS") == 0)) { + /* colorspace */ + /* resource mapping is needed */ + P2POutput::outputObject(&obj,str,xref, + mappingTable->tables[P2PResources::ColorSpace]); + } else if (strcmp("Filter",key) != 0 && strcmp("F",key) != 0 + && strcmp("DecodeParms",key) != 0 && strcmp("DP",key) != 0) { + /* when Filter or DecodeParms, not ouput because image is decoded. */ + P2POutput::outputObject(&obj,str,xref); + } + dict.dictAdd(key,&obj); + } + parser->getObj(&obj); + } + + if (obj.isEOF()) { + error(getPos(), const_cast<char *>("End of file in inline image")); + obj.free(); + dict.free(); + } else if (obj.isError()) { + error(getPos(), const_cast<char *>("Error in inline image")); + obj.free(); + dict.free(); + } else { + int c1, c2; + + /* ouput ID */ + str->putchar(' '); + P2POutput::outputObject(&obj,str,xref); + str->putchar('\n'); + obj.free(); + + /* make image stream */ + imageStr = new EmbedStream(parser->getStream(), &dict, gFalse,0); + imageStr = imageStr->addFilters(&dict); + doImage(imageStr); + /* handle EI */ + c1 = imageStr->getBaseStream()->getChar(); + c2 = imageStr->getBaseStream()->getChar(); + while (!(c1 == 'E' && c2 == 'I') && c2 != EOF) { + c1 = c2; + c2 = imageStr->getBaseStream()->getChar(); + } + delete imageStr; + str->puts("EI\n"); + } +} + +void P2PGfx::doImage(Stream *istr) +{ + Dict *dict; + int width, height; + int bits; + GBool mask; + Object obj1, obj2; + int i, j; + GfxColorSpace *colorSpace = NULL; + int nComponents; + int bytes; + Guchar *lineBuf; + + // get info from the stream + bits = 0; + + // get stream dict + dict = istr->getDict(); + + // get size + dict->lookup(const_cast<char *>("Width"), &obj1); + if (obj1.isNull()) { + obj1.free(); + dict->lookup(const_cast<char *>("W"), &obj1); + } + if (!obj1.isInt()) + goto err2; + width = obj1.getInt(); + obj1.free(); + dict->lookup(const_cast<char *>("Height"), &obj1); + if (obj1.isNull()) { + obj1.free(); + dict->lookup(const_cast<char *>("H"), &obj1); + } + if (!obj1.isInt()) + goto err2; + height = obj1.getInt(); + obj1.free(); + + // image or mask? + dict->lookup(const_cast<char *>("ImageMask"), &obj1); + if (obj1.isNull()) { + obj1.free(); + dict->lookup(const_cast<char *>("IM"), &obj1); + } + mask = gFalse; + if (obj1.isBool()) + mask = obj1.getBool(); + else if (!obj1.isNull()) + goto err2; + obj1.free(); + + // bit depth + if (bits == 0) { + dict->lookup(const_cast<char *>("BitsPerComponent"), &obj1); + if (obj1.isNull()) { + obj1.free(); + dict->lookup(const_cast<char *>("BPC"), &obj1); + } + if (obj1.isInt()) { + bits = obj1.getInt(); + } else if (mask) { + bits = 1; + } else { + goto err2; + } + obj1.free(); + } + + // display a mask + if (mask) { + nComponents = 1; + } else { + // get color space + dict->lookup(const_cast<char *>("ColorSpace"), &obj1); + if (obj1.isNull()) { + obj1.free(); + dict->lookup(const_cast<char *>("CS"), &obj1); + } + if (obj1.isName() && orgCSResource != 0) { + orgCSResource->lookup(obj1.getName(), &obj2); + if (!obj2.isNull()) { + obj1.free(); + obj1 = obj2; + } else { + obj2.free(); + } + } + if (!obj1.isNull()) { + colorSpace = GfxColorSpace::parse(&obj1); + } + obj1.free(); + if (!colorSpace) { + goto err1; + } + nComponents = colorSpace->getNComps(); + delete colorSpace; + } + istr->reset(); + /* number of bytes per line */ + bytes = (bits*nComponents*width+7)/8; + + /* then, out image body */ + lineBuf = new Guchar[bytes]; + for (i = 0;i < height;i++) { + for (j = 0;j < bytes;j++) { + lineBuf[j] = istr->getChar(); + } + str->write(lineBuf,bytes); + } + str->putchar('\n'); + delete[] lineBuf; + + return; + + err2: + obj1.free(); + err1: + error(getPos(), const_cast<char *>("Bad image parameters")); +} --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/P2PObject.h +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/P2PObject.h @@ -0,0 +1,165 @@ +/* + +Copyright (c) 2006-2007, BBR Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +/* + P2PObject.h + pdftopdf object +*/ +#ifndef _P2POBJECT_H_ +#define _P2POBJECT_H_ + +#include "P2POutputStream.h" +#include "P2PXRef.h" +#include "Object.h" +#include "P2POutput.h" +#include "Error.h" +#include "XRef.h" + +class P2PObject { +public: + /* find object with original object number and generation */ + static P2PObject *find(int orgNumA, int orgGenA); + + P2PObject() { + next = 0; + offset = -1; + orgNum = -1; + orgGen = -1; + num = -1; + gen = -1; + secondPhase = gFalse; + put(); + } + P2PObject(int orgNumA, int orgGenA) { + next = 0; + offset = -1; + orgNum = orgNumA; + orgGen = orgGenA; + num = -1; + gen = -1; + secondPhase = gFalse; + put(); + } + + virtual ~P2PObject() { + remove(); + P2PXRef::remove(this); + } + void setOffset(int offsetA) { + offset = offsetA; + } + void setOffset(P2POutputStream *str) { + offset = str->getPosition(); + } + int getOffset() { return offset; } + + void setNum(int numA, int genA) { + num = numA; + gen = genA; + } + + void getNum(int *numA, int *genA) { + *numA = num; + *genA = gen; + } + + /* output begin object */ + void outputBegin(P2POutputStream *str); + /* output end object */ + void outputEnd(P2POutputStream *str); + /* output reference */ + void outputRef(P2POutputStream *str); + + /* output as an object */ + virtual void output(P2POutputStream *str, XRef *xref) { + error(-1,const_cast<char *>("Illegal output call of P2PObject:%d"),num); + } + + GBool isSecondPhase() { return secondPhase; } + void setSecondPhase(GBool v) { secondPhase = v; } + +private: + /* original object number hash table */ + static P2PObject **orgTable; + /* hash function */ + static int hash(int num, int gen); + + /* put this into original object number table */ + void put(); + /* remove this from original object number able */ + void remove(); + + /* original object number */ + int orgNum; + /* original object generation */ + int orgGen; + + /* object number */ + int num; + /* object generation */ + int gen; + /* offset in output file */ + /* when minus value, not output this yet. */ + int offset; + /* next object pointer for list */ + P2PObject *next; + /* flag indicating that should be output in second phase */ + GBool secondPhase; +}; + +class P2PObj : public P2PObject { +public: + P2PObj() {} + P2PObj(Object *objA) { + objA->copy(&obj); + } + + virtual ~P2PObj() { + obj.free(); + } + + virtual void output(P2POutputStream *str, XRef *xref) { + if (getOffset() < 0) { + int num, gen; + + getNum(&num,&gen); + if (num > 0) outputBegin(str); + P2POutput::outputObject(&obj,str,xref); + str->putchar('\n'); + if (num > 0) outputEnd(str); + } + } + void setObj(Object *objA) { + obj.free(); + objA->copy(&obj); + } + Object *getObj() { + return &obj; + } + +private: + Object obj; +}; + +#endif --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/P2PGfx.h +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/P2PGfx.h @@ -0,0 +1,143 @@ +/* + P2PGfx.h + developped by BBR Inc. 2006-2007 + + This file is based on Gfx.h + Gfx.h copyright notice is follows + and is licensed under GPL. +*/ +//======================================================================== +// +// Gfx.h +// +// Copyright 1996-2003 Glyph & Cog, LLC +// +//======================================================================== + +#ifndef _P2PGFX_H_ +#define _P2PGFX_H_ + +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + +#include "goo/gtypes.h" +#include "Object.h" +#include "Gfx.h" +#include "P2POutputStream.h" +#include "P2PResources.h" +#include "P2PFont.h" +#include "P2PMatrix.h" + +class GooString; +class XRef; +class Array; +class Stream; +class Parser; +class Dict; +class P2PGfx; + +//------------------------------------------------------------------------ +// P2PGfx +//------------------------------------------------------------------------ + +class P2PGfx { +public: + + // Constructor + P2PGfx(XRef *xrefA, P2POutputStream *strA, P2PFontResource *fontResourceA, + P2PResources *resourcesA); + ~P2PGfx(); + + // Interpret a stream or array of streams. + void outputContents(Object *obj, P2PResourceMap *mappingTableA, + Dict *orgResourceA, P2PMatrix *matA); + +private: + struct P2POperator { + char name[4]; + int numArgs; + TchkType tchk[maxArgs]; + void (P2PGfx::*func)(Object args[], int numArgs); + }; + + class P2PGfxState { + public: + P2PGfxState() { + font = 0; + next = 0; + } + + ~P2PGfxState() { + if (next != 0) { + delete next; + } + } + + void copy(P2PGfxState *src) { + font = src->font; + } + + P2PGfxState(P2PGfxState *src) { + copy(src); + next = 0; + } + + P2PFontDict *getFont() { return font; } + + void setFont(P2PFontDict *fontA) { + if (fontA != 0) font = fontA; + } + + void save() { + next = new P2PGfxState(this); + } + void restore() { + if (next != 0) { + copy(next); + next = next->next; + } + } + private: + P2PFontDict *font; // current font + P2PGfxState *next; + }; + + XRef *xref; // the xref table for this PDF file + P2POutputStream *str; // output stream + P2PResourceMap *mappingTable; // resouce name mapping table + P2PFontResource *fontResource; // font resource + P2PGfxState state; + Dict *orgCSResource; // Color Space resource dictionay of original page + P2PResources *resources; + P2PMatrix *mat; + + Parser *parser; // parser for page content stream(s) + + static P2POperator opTab[]; // table of operators + + void go(); + void execOp(Object *cmd, Object args[], int numArgs); + P2POperator *findOp(char *name); + GBool checkArg(Object *arg, TchkType type); + int getPos(); + void outputOp(const char *name, Object args[], int numArgs); + void opSetStrokeColorSpace(Object args[], int numArgs); + void opXObject(Object args[], int numArgs); + void opSetStrokeColorN(Object args[], int numArgs); + void opSetFont(Object args[], int numArgs); + void opSetFillColorSpace(Object args[], int numArgs); + void opSetExtGState(Object args[], int numArgs); + void opSetFillColorN(Object args[], int numArgs); + void opShFill(Object args[], int numArgs); + void opMoveSetShowText(Object args[], int numArgs); + void opMoveShowText(Object args[], int numArgs); + void opShowSpaceText(Object args[], int numArgs); + void opShowText(Object args[], int numArgs); + void opSave(Object args[], int numArgs); + void opRestore(Object args[], int numArgs); + void opBeginImage(Object args[], int numArgs); + void doImage(Stream *istr); +}; + +#endif --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/P2POutputStream.cxx +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/P2POutputStream.cxx @@ -0,0 +1,184 @@ +/* + +Copyright (c) 2006-2007, BBR Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +/* + P2POutputStream.cc + pdftopdf stream for output +*/ + +#include <config.h> +#include "goo/gmem.h" +#include "P2POutputStream.h" +#include <stdarg.h> +#include <string.h> +#include <Error.h> + +#define LINEBUFSIZE 1024 + + +/* Constructor */ +P2POutputStream::P2POutputStream(FILE *fpA) +{ + fp = fpA; + position = 0; + deflating = gFalse; +} + +P2POutputStream::~P2POutputStream() +{ +} + +int P2POutputStream::puts(const char *str) +{ + return write(str,strlen(str)); +} + +int P2POutputStream::putchar(int c) +{ + int r; + + if ((r = write(&c,1)) < 0) return r; + return c & 0xff; +} + +int P2POutputStream::printf(const char *format,...) +{ + char linebuf[LINEBUFSIZE]; + va_list ap; + int r; + + va_start(ap,format); + r = vsnprintf(linebuf,LINEBUFSIZE,format,ap); + va_end(ap); + if (r > 0) { + if (puts(linebuf) < 0) { + return EOF; + } + } + return r; +} + +int P2POutputStream::write(const void *buf, int n) +{ + int r; + if (n <= 0) return 0; +#ifdef HAVE_LIBZ + char outputBuf[LINEBUFSIZE*2]; + + if (deflating) { + zstream.next_in = const_cast<Bytef *>(static_cast<const Bytef *>(buf)); + zstream.avail_in = n; + do { + int outputLen; + + zstream.next_out = reinterpret_cast<Bytef *>(outputBuf); + zstream.avail_out = LINEBUFSIZE*2; + if ((r = deflate(&zstream,0)) != Z_OK) { + error(-1,const_cast<char *>("ZLIB:deflate error")); + return r; + } + /* Z_OK */ + /* output data */ + outputLen = LINEBUFSIZE*2-zstream.avail_out; + if ((r = fwrite(outputBuf,1,outputLen,fp)) != outputLen) { + error(-1,const_cast<char *>("P2POutputStream: write error")); + break; + } + position += r; + } while (zstream.avail_in > 0); + return n; + } else { +#endif + if ((r = fwrite(buf,1,n,fp)) != n) { + error(-1,const_cast<char *>("P2POutputStream: write error")); + return r; + } + position += r; + return r; +#ifdef HAVE_LIBZ + } +#endif +} + +/* define alloc functions */ +namespace { + voidpf gmalloc_zalloc(voidpf opaque, uInt items, uInt size) + { + return gmalloc(items*size); + } + void gmalloc_zfree(voidpf opqaue, voidpf address) + { + gfree(address); + } +}; + +void P2POutputStream::startDeflate() +{ +#ifdef HAVE_LIBZ + zstream.zalloc = gmalloc_zalloc; + zstream.zfree = gmalloc_zfree; + zstream.opaque = 0; + + if (deflateInit(&zstream,Z_DEFAULT_COMPRESSION) != Z_OK) { + error(-1,const_cast<char *>("ZLIB:deflateInit error")); + return; + } + deflating = gTrue; +#endif +} + +void P2POutputStream::endDeflate() +{ +#ifdef HAVE_LIBZ + char outputBuf[LINEBUFSIZE*2]; + int r; + + if (!deflating) return; + do { + int n; + int outputLen; + + zstream.next_out = reinterpret_cast<Bytef *>(outputBuf); + zstream.avail_out = LINEBUFSIZE*2; + zstream.next_in = 0; + zstream.avail_in = 0; + if ((r = deflate(&zstream,Z_FINISH)) != Z_STREAM_END && r != Z_OK) { + error(-1,const_cast<char *>("ZLIB:deflate error")); + break; + } + /* Z_OK or Z_STREAM_END */ + /* output data */ + outputLen = LINEBUFSIZE*2-zstream.avail_out; + if ((n = fwrite(outputBuf,1,outputLen,fp)) != outputLen) { + error(-1,const_cast<char *>("P2POutputStream: write error")); + break; + } + position += n; + } while (r != Z_STREAM_END); + if (deflateEnd(&zstream) != Z_OK) { + error(-1,const_cast<char *>("ZLIB:deflateEnd error")); + } + deflating = gFalse; +#endif +} --- cups-1.3.8.orig/debian/local/filters/pdf-filters/pdftopdf/P2PPage.h +++ cups-1.3.8/debian/local/filters/pdf-filters/pdftopdf/P2PPage.h @@ -0,0 +1,116 @@ +/* + +Copyright (c) 2006-2007, BBR Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +/* + P2PPage.h + pdftopdf page +*/ +#ifndef _P2PPAGE_H_ +#define _P2PPAGE_H_ + +#include "Object.h" +#include "Page.h" +#include "P2PObject.h" +#include "Dict.h" +#include "P2POutputStream.h" +#include "XRef.h" +#include "P2PMatrix.h" +#include "P2PResources.h" +#include "P2PFont.h" + +class P2PPageTree; + +class P2PPage : public P2PObject { +public: + P2PPage(Page *orgPageA, XRef *xrefA); + /* Constructor for a empty page */ + P2PPage(PDFRectangle *mediaBoxA, XRef *xrefA); + /* Construct nup page */ + P2PPage(int n, P2PPage **pages, int len, PDFRectangle *box, + unsigned int borderFlagA, unsigned int layout, XRef *xrefA, + int xpos, int ypos); + virtual ~P2PPage(); + /* output self and resources */ + void output(P2POutputStream *str, P2PPageTree *tree, + P2PObject *copiedObj = 0); + int getNumOrgPages() { return numOrgPages; } + void fit(PDFRectangle *box, double zoom); + void mirror(); + void rotate(int orientation); + void position(PDFRectangle *box, int xpos, int ypos); + void scale(double zoom); + PDFRectangle *getMediaBox() { return &mediaBox; } +private: + struct OrgPage { + Page *page; + P2PResourceMap *mappingTable; /* resource name mapping table */ + P2PMatrix mat; /* translation matrix */ + GBool trans; /* translation enable */ + PDFRectangle frame; /* page frame */ + unsigned int borderFlag; /* border flag */ + GBool clipFrame; /* clipping by frame */ + /* fit contents to box */ + void fit(PDFRectangle *box, PDFRectangle *oldBox, double zoom, + PDFRectangle *rBox); + /* rotation */ + void rotate(PDFRectangle *box, int orientation, PDFRectangle *rBox); + void scale(PDFRectangle *box, double zoom, PDFRectangle *rBox); + void position(PDFRectangle *box, + PDFRectangle *oldBox, int xpos, int ypos); + OrgPage(); + ~OrgPage(); + }; + OrgPage *orgPages; + int numOrgPages; + + /* dummy object for contents*/ + /* only use this for cross reference etc. */ + P2PObject contents; + + PDFRectangle mediaBox; + PDFRectangle cropBox; + GBool haveCropBox; + PDFRectangle bleedBox; + PDFRectangle trimBox; + PDFRectangle artBox; + P2PResources *resources; + XRef *xref; + + void outputContents(P2POutputStream *str, P2PFontResource *fontResource); + void outputSelf(P2POutputStream *str, P2PPageTree *tree, + P2PObject *copiedObj, P2PFontResource *fontResource); + static void outputPDFRectangle(PDFRectangle *rect, P2POutputStream *str); + static void outputPDFRectangleForPath(PDFRectangle *rect, + P2POutputStream *str); + static void transPDFRectangle(PDFRectangle *rect, P2PMatrix *matA); + static GBool eqPDFRectangle(PDFRectangle *rect1, PDFRectangle *rect2) { + return rect1->x1 == rect2->x1 && rect1->y1 == rect2->y1 + && rect1->x2 == rect2->x2 && rect1->y2 == rect2->y2; + } + /* nup calculate layout */ + void nupCalcLayout(int n, unsigned int layout, PDFRectangle *box, + PDFRectangle *rects); +}; + +#endif --- cups-1.3.8.orig/debian/local/filters/pdf-filters/filter/test.sh +++ cups-1.3.8/debian/local/filters/pdf-filters/filter/test.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +# just for comparison +/usr/lib/cups/filter/texttops 1 hi_user there_title 1 "" Makefile > test1.ps + +# for the next to work, you'll have to make a subdirectory fonts/ here, containing the fonts +# and a subdirectory charsets/ with a file pdf.utf-8 +export CUPS_DATADIR=`pwd`/ + +./texttopdf 1 hi_user there_title 1 "" Makefile > test1.pdf +./texttopdf 1 hi_user there_title 1 "PrettyPrint=1" Makefile > test2.pdf +(export CONTENT_TYPE=application/x-csource; ./texttopdf 1 hi_user there_title 1 "PrettyPrint=1" test_pdf1.c > test3.pdf) +(export CHARSET=utf-8; ./texttopdf 1 hi_user there_title 1 "PrettyPrint=1" Makefile > test4.pdf) +(export CHARSET=utf-8; ./texttopdf 1 hi_user there_title 1 "" testin > test5.pdf) --- cups-1.3.8.orig/debian/local/filters/pdf-filters/filter/pdfutils.h +++ cups-1.3.8/debian/local/filters/pdf-filters/filter/pdfutils.h @@ -0,0 +1,80 @@ +/* + * PDF file output routines. + * + * Copyright 2008 by Tobias Hoffmann. + * + * This file is licensed as noted in "LICENSE.txt" + * which should have been included with this file. If this file is + * file is missing or damaged, see the license at "http://www.cups.org/". + * + */ +#include <time.h> + +struct keyval_t { + char *key,*value; +}; + +typedef struct { + long filepos; + + int pagessize,pagesalloc; + int *pages; + + int xrefsize,xrefalloc; + long *xref; + + int kvsize,kvalloc; + struct keyval_t *kv; +} pdfOut; + +/* allocates a new pdfOut structure + * returns NULL on error + */ +pdfOut *pdfOut_new(); +void pdfOut_free(pdfOut *pdf); + +/* start outputting a pdf + * returns false on error + */ +int pdfOut_begin_pdf(pdfOut *pdf); +void pdfOut_finish_pdf(pdfOut *pdf); + +/* General output routine for our pdf. + * Keeps track of characters actually written out + */ +void pdfOut_printf(pdfOut *pdf,const char *fmt,...); + +/* write out an escaped pdf string: e.g. (Text \(Test\)\n) + * >len==-1: use strlen(str) + */ +void pdfOut_putString(pdfOut *pdf,const char *str,int len); +void pdfOut_putHexString(pdfOut *pdf,const char *str,int len); + +/* Format the broken up timestamp according to + * pdf requirements for /CreationDate + * NOTE: uses statically allocated buffer + */ +const char *pdfOut_to_pdfdate(struct tm *curtm); + +/* begin a new object at current point of the + * output stream and add it to the xref table. + * returns the obj number. + */ +int pdfOut_add_xref(pdfOut *pdf); + +/* adds page dictionary >obj to the global Pages tree + * returns false on error + */ +int pdfOut_add_page(pdfOut *pdf,int obj); + +/* add a >key,>val pair to the document's Info dictionary + * returns false on error + */ +int pdfOut_add_kv(pdfOut *pdf,const char *key,const char *val); + +/* Writes the font >emb including descriptor to the pdf + * and returns the object number. + * On error 0 is returned. + */ +struct _EMB_PARAMS; +int pdfOut_write_font(pdfOut *pdf,struct _EMB_PARAMS *emb); --- cups-1.3.8.orig/debian/local/filters/pdf-filters/filter/pdfutils.c +++ cups-1.3.8/debian/local/filters/pdf-filters/filter/pdfutils.c @@ -0,0 +1,425 @@ +/* + * PDF file output routines. + * + * Copyright 2008 by Tobias Hoffmann. + * + * This file is licensed as noted in "LICENSE.txt" + * which should have been included with this file. If this file is + * file is missing or damaged, see the license at "http://www.cups.org/". + * + */ +#include <stdio.h> +#include <assert.h> +#include <stdarg.h> +#include <memory.h> +#include <stdlib.h> +#include "pdfutils.h" +#include "fontembed/embed.h" + +void pdfOut_printf(pdfOut *pdf,const char *fmt,...) // {{{ +{ + assert(pdf); + int len; + va_list ap; + + va_start(ap,fmt); + len=vprintf(fmt,ap); + va_end(ap); + pdf->filepos+=len; +} +// }}} + +void pdfOut_putString(pdfOut *pdf,const char *str,int len) // {{{ - >len==-1: strlen() +{ + assert(pdf); + assert(str); + if (len==-1) { + len=strlen(str); + } + putc('(',stdout); + // escape special chars: \0 \\ \) + int iA=0; + for (;len>0;iA++,len--) { + if ( (str[iA]<32)||(str[iA]>126) ) { + fwrite(str,1,iA,stdout); + fprintf(stdout,"\\%03o",str[iA]); + pdf->filepos+=iA+4; + str+=iA+1; + iA=-1; + } else if ( (str[iA]==')')||(str[iA]=='\\') ) { + fwrite(str,1,iA,stdout); + fprintf(stdout,"\\%c",str[iA]); + pdf->filepos+=iA+2; + str+=iA+1; + iA=-1; + } + } + pdf->filepos+=iA+2; + fwrite(str,1,iA,stdout); + putc(')',stdout); +} +// }}} + +void pdfOut_putHexString(pdfOut *pdf,const char *str,int len) // {{{ - >len==-1: strlen() +{ + assert(pdf); + assert(str); + if (len==-1) { + len=strlen(str); + } + pdf->filepos+=2*len+2; + putc('<',stdout); + for (;len>0;str++,len--) { + fprintf(stdout,"%02x",(unsigned char)*str); + } + putc('>',stdout); +} +// }}} + +pdfOut *pdfOut_new() // {{{ - NULL on error +{ + pdfOut *ret=malloc(sizeof(pdfOut)); + if (ret) { + memset(ret,0,sizeof(pdfOut)); + } + + return ret; +} +// }}} + +// NOTE: uses statically allocated buffer +const char *pdfOut_to_pdfdate(struct tm *curtm) // {{{ +{ + static char curdate[250]; + if (!curtm) { + time_t curtime; + curtime = time(NULL); + curtm = localtime(&curtime); + } + strftime(curdate, sizeof(curdate), "D:%Y%m%d%H%M%S%z", curtm); + curdate[23]=0; + curdate[22]='\''; + curdate[21]=curdate[18]; + curdate[20]=curdate[17]; + curdate[19]='\''; + return curdate; +} +// }}} + +int pdfOut_add_xref(pdfOut *pdf) // {{{ - returns obj_no +{ + assert(pdf); + assert(pdf->xrefsize<=pdf->xrefalloc); + + if (pdf->xrefsize==pdf->xrefalloc) { + long *tmp; + pdf->xrefalloc+=50; + tmp=realloc(pdf->xref,sizeof(long)*pdf->xrefalloc); + if (!tmp) { + pdf->xrefalloc=-1; + return -1; + } + pdf->xref=tmp; + } + pdf->xref[pdf->xrefsize++]=pdf->filepos; + return pdf->xrefsize; // xrefsize+1 +} +// }}} + +int pdfOut_add_page(pdfOut *pdf,int obj) // {{{ - returns false on error +{ + assert(pdf); + assert(obj>0); + assert(pdf->pagessize<=pdf->pagesalloc); + + if (pdf->pagessize==pdf->pagesalloc) { + int *tmp; + pdf->pagesalloc+=10; + tmp=realloc(pdf->pages,sizeof(int)*pdf->pagesalloc); + if (!tmp) { + pdf->pagesalloc=-1; + return 0; + } + pdf->pages=tmp; + } + pdf->pages[pdf->pagessize++]=obj; + return 1; +} +// }}} + +int pdfOut_add_kv(pdfOut *pdf,const char *key,const char *val) // {{{ - returns false on error +{ + assert(pdf); + assert(pdf->kvsize<=pdf->kvalloc); + + if (pdf->kvsize==pdf->kvalloc) { + struct keyval_t *tmp; + pdf->kvalloc+=10; + tmp=realloc(pdf->kv,sizeof(struct keyval_t)*pdf->kvalloc); + if (!tmp) { + pdf->kvalloc=-1; + return 0; + } + pdf->kv=tmp; + } + pdf->kv[pdf->kvsize].key=strdup(key); + pdf->kv[pdf->kvsize].value=strdup(val); + if ( (!pdf->kv[pdf->kvsize].key)||(!pdf->kv[pdf->kvsize].value) ) { + return 0; + } + pdf->kvsize++; + return 1; +} +// }}} + +int pdfOut_begin_pdf(pdfOut *pdf) // ,...output_device?...) // {{{ - false on error +{ + assert(pdf); + assert(pdf->kvsize==0); // otherwise: finish_pdf has not been called + int pages_obj; + + pdf->xrefsize=pdf->pagessize=0; + pdf->filepos=0; + pages_obj=pdfOut_add_xref(pdf); // fixed later + if (pages_obj!=1) { + return 0; + } + pdfOut_printf(pdf,"%%PDF-1.3\n"); + return 1; +} +// }}} + +void pdfOut_finish_pdf(pdfOut *pdf) // {{{ +{ + int iA; + int root_obj,info_obj=0,xref_start; + assert( (pdf)&&(pdf->filepos!=-1) ); + + // pages + const int pages_obj=1; + pdf->xref[0]=pdf->filepos; // now fix it + pdfOut_printf(pdf,"%d 0 obj\n" + "<</Type/Pages\n" + " /Count %d\n" + " /Kids [", + pages_obj,pdf->pagessize); + for (iA=0;iA<pdf->pagessize;iA++) { + pdfOut_printf(pdf,"%d 0 R ",pdf->pages[iA]); + } + pdfOut_printf(pdf,"]\n" + ">>\n" + "endobj\n"); + + // rootdict + root_obj=pdfOut_add_xref(pdf); + pdfOut_printf(pdf,"%d 0 obj\n" + "<</Type/Catalog\n" + " /Pages %d 0 R\n" + ">>\n" + "endobj\n", + root_obj,pages_obj); + + // info + if (pdf->kvsize) { + info_obj=pdfOut_add_xref(pdf); + pdfOut_printf(pdf,"%d 0 obj\n" + "<<\n", + info_obj); + for (iA=0;iA<pdf->kvsize;iA++) { + pdfOut_printf(pdf," /%s ",pdf->kv[iA].key); + pdfOut_putString(pdf,pdf->kv[iA].value,-1); + pdfOut_printf(pdf,"\n"); + } + pdfOut_printf(pdf,">>\n" + "endobj\n"); + } + // TODO: some return-value checking (??) + + // write xref + xref_start=pdf->filepos; + pdfOut_printf(pdf,"xref\n" + "%d %d\n" + "%010d 65535 f \n", + 0,pdf->xrefsize+1,0); + for (iA=0;iA<pdf->xrefsize;iA++) { + pdfOut_printf(pdf,"%010d 00000 n \n", + pdf->xref[iA]); + } + pdfOut_printf(pdf,"trailer\n" + "<<\n" + " /Size %d\n" + " /Root %d 0 R\n", + pdf->xrefsize+1, + root_obj); + if (info_obj) { + pdfOut_printf(pdf," /Info %d 0 R\n",info_obj); + } + pdfOut_printf(pdf,">>\n" + "startxref\n" + "%d\n" + "%%%%EOF\n", + xref_start); + + // set to done + pdf->filepos=-1; + for (iA=0;iA<pdf->kvsize;iA++) { + free(pdf->kv[iA].key); + free(pdf->kv[iA].value); + } + pdf->kvsize=0; +} +// }}} + +void pdfOut_free(pdfOut *pdf) // {{{ +{ + if (pdf) { + assert(pdf->kvsize==0); // otherwise: finish_pdf has not been called + free(pdf->kv); + free(pdf->pages); + free(pdf->xref); + free(pdf); + } +} +// }}} + +static void pdfOut_outfn(const char *buf,int len,void *context) // {{{ +{ + pdfOut *pdf=(pdfOut *)context; + + if (fwrite(buf,1,len,stdout)!=len) { + fprintf(stderr,"Short write: %m\n"); + assert(0); + return; + } + pdf->filepos+=len; +} +// }}} + +int pdfOut_write_font(pdfOut *pdf,EMB_PARAMS *emb) // {{{ +{ + assert(pdf); + assert(emb); + + EMB_PDF_FONTDESCR *fdes=emb_pdf_fontdescr(emb); + if (!fdes) { + if (emb->intype==EMB_INPUT_STDFONT) { // std-14 font + const int f_obj=pdfOut_add_xref(pdf); + char *res=emb_pdf_simple_stdfont(emb); + if (!res) { + return 0; + } + + pdfOut_printf(pdf,"%d 0 obj\n" + "%s" + "endobj\n" + ,f_obj,res); + free(res); + return f_obj; + } + return 0; + } + + const int ff_obj=pdfOut_add_xref(pdf); + pdfOut_printf(pdf,"%d 0 obj\n" + "<</Length %d 0 R\n" + " /Length1 %d 0 R\n" + ,ff_obj,ff_obj+1,ff_obj+2); + if (emb_pdf_get_fontfile_subtype(emb)) { + pdfOut_printf(pdf," /SubType /%s\n", + emb_pdf_get_fontfile_subtype(emb)); + } + if (emb->outtype&EMB_OUTPUT_T1) { // TODO + pdfOut_printf(pdf," /Length2 ?\n" + " /Length3 ?\n"); + } + pdfOut_printf(pdf,">>\n" + "stream\n"); + long streamsize=-pdf->filepos; + const int outlen=emb_embed(emb,pdfOut_outfn,pdf); + streamsize+=pdf->filepos; + pdfOut_printf(pdf,"\nendstream\n" + "endobj\n"); + + const int l0_obj=pdfOut_add_xref(pdf); + assert(l0_obj==ff_obj+1); + pdfOut_printf(pdf,"%d 0 obj\n" + "%d\n" + "endobj\n" + ,l0_obj,streamsize); + + const int l1_obj=pdfOut_add_xref(pdf); + assert(l1_obj==ff_obj+2); + pdfOut_printf(pdf,"%d 0 obj\n" + "%d\n" + "endobj\n" + ,l1_obj,outlen); + + const int fd_obj=pdfOut_add_xref(pdf); + char *res=emb_pdf_simple_fontdescr(emb,fdes,ff_obj); + if (!res) { + free(fdes); + return 0; + } + pdfOut_printf(pdf,"%d 0 obj\n" + "%s" + "endobj\n" + ,fd_obj,res); + free(res); + + EMB_PDF_FONTWIDTHS *fwid=emb_pdf_fontwidths(emb); + if (!fwid) { + free(fdes); + return 0; + } + const int f_obj=pdfOut_add_xref(pdf); + res=emb_pdf_simple_font(emb,fdes,fwid,fd_obj); + if (!res) { + free(fwid); + free(fdes); + return 0; + } + pdfOut_printf(pdf,"%d 0 obj\n" + "%s" + "endobj\n" + ,f_obj,res); + free(res); + free(fwid); + + if (emb->plan&EMB_A_MULTIBYTE) { + res=emb_pdf_simple_cidfont(emb,fdes->fontname,f_obj); + if (!res) { + free(fdes); + return 0; + } + const int cf_obj=pdfOut_add_xref(pdf); + pdfOut_printf(pdf,"%d 0 obj\n" + "%s" + "endobj\n" + ,cf_obj,res); + free(res); + free(fdes); + return cf_obj; + } + + free(fdes); + return f_obj; +} +// }}} + +#if 0 +one_page(...parent,resources,mediabox,contents); +{ +// " /Resources %d 0 R\n" + pdfOut_printf(pdf,"%d 0 obj\n" + "<</Type/Page\n" + " /Parent 1 0 R\n" + " /MediaBox [0 0 %d %d]\n" + " /Contents %d 0 R\n" + ">>\n" + "endobj\n" + ,,,PageWidth,PageLength // TODO: into pdf-> + ... +} + +... pfb_embedder ... pfa? +#endif --- cups-1.3.8.orig/debian/local/filters/pdf-filters/filter/pdftoijs.cxx +++ cups-1.3.8/debian/local/filters/pdf-filters/filter/pdftoijs.cxx @@ -0,0 +1,515 @@ +/* +Copyright (c) 2008, BBR Inc. All rights reserved. + (c) 2008 Tobias Hoffmann + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +/* + pdftoijs.cc + pdf to ijs filter +*/ + +#include <config.h> +#include <stdio.h> +#include <stdlib.h> +#include <goo/GooString.h> +#include <goo/gmem.h> +#include <Object.h> +#include <Stream.h> +#include <PDFDoc.h> +#include <SplashOutputDev.h> +#include <cups/cups.h> +#include <stdarg.h> +#include <Error.h> +#include <GlobalParams.h> +#include <splash/SplashTypes.h> +#include <splash/SplashBitmap.h> +extern "C" { +#include <ijs/ijs.h> +#include <ijs/ijs_client.h> +}; +#include <vector> +#include <string> + +#define MAX_CHECK_COMMENT_LINES 20 + +namespace { + int exitCode = 0; + char *outputfile = NULL; +// int deviceCopies = 1; +// bool deviceCollate = false; + const char *ijsserver = NULL; + int resolution[2] = {0,0}; + enum { NONE=-1, COL_RGB, COL_CMYK, COL_BLACK1, COL_WHITE1, COL_BLACK8, COL_WHITE8 } colspace=NONE; + const char *devManu=NULL, *devModel=NULL; + std::vector<std::pair<std::string,std::string> > params; + + ppd_file_t *ppd = 0; // holds the memory for the strings +}; + +void CDECL myErrorFun(int pos, char *msg, va_list args) +{ + if (pos >= 0) { + fprintf(stderr, "ERROR (%d): ", pos); + } else { + fprintf(stderr, "ERROR: "); + } + vfprintf(stderr, msg, args); + fprintf(stderr, "\n"); + fflush(stderr); +} + +/* parse "300 400" */ +void parse_resolution(const char *str) +{ + const char *tmp=strchr(str,' '); + if (tmp) { + resolution[0]=atoi(str); + resolution[1]=atoi(tmp+1); + } else { + resolution[0]=resolution[1]=atoi(str); + } +} + +/* parse "cmyk" "grey" "rgb" */ +void parse_colorspace(const char *str) +{ + if (strcasecmp(str,"rgb")==0) { + colspace=COL_RGB; + } else if (strcasecmp(str,"black1")==0) { + colspace=COL_BLACK1; + } else if (strcasecmp(str,"white1")==0) { + colspace=COL_WHITE1; + } else if (strcasecmp(str,"black8")==0) { + colspace=COL_BLACK8; + } else if (strcasecmp(str,"white8")==0) { + colspace=COL_WHITE8; +#ifdef SPLASH_CMYK + } else if (strcasecmp(str,"cmyk")==0) { + colspace=COL_CMYK; + } else { + error(-1,"Unknown colorspace; supported are 'rgb', 'cmyk', 'white1', 'black1', 'white8', 'black8'"); +#else + } else { + error(-1,"Unknown colorspace; supported are 'rgb', 'white1', 'black1', 'white8', 'black8'"); +#endif + exit(1); + } +} + +std::string str_trim(const char *str,int len) +{ + int start=strspn(str," \r\n\t"); + for (len--;len>=0;len--) { + if (!strchr(" \r\n\t",str[len])) { + break; + } + } + len++; + if (start>=len) { + return std::string(); + } + return std::string(str+start,len-start); +} + +/* parse key=value */ +void parse_param(const char *str) +{ + const char *eq=strchr(str,'='); + if (!eq) { + fprintf(stderr, "WARNING: ignored ijsParam without '='"); + return; + } + params.push_back(make_pair(str_trim(str,eq-str),str_trim(eq+1,strlen(eq+1)))); +} + +/* parse key1=value1,key2=value2,... */ +void parse_paramlist(const char *str) +{ + std::string tmp; + const char *cur=str; + while (*cur) { + tmp.clear(); + for (;*cur;++cur) { + if ( (*cur=='\\')&&(cur[1]) ) { + ++cur; + tmp.push_back(*cur); + } else if(*cur==',') { + ++cur; + break; + } else { + tmp.push_back(*cur); + } + } + parse_param(tmp.c_str()); + } +} + +void parseOpts(int argc, char **argv) +{ + int num_options = 0; + cups_option_t *options = 0; + + if (argc < 6 || argc > 7) { + error(-1,"%s job-id user title copies options [file]", + argv[0]); + exit(1); + } + + assert(!ppd); + ppd = ppdOpenFile(getenv("PPD")); + ppdMarkDefaults(ppd); + + // handle *ijsServer, *ijsManufacturer, *ijsModel, *ijsColorspace + ppd_attr_t *attr; + if ((attr = ppdFindAttr(ppd,"ijsServer",0)) != 0) { + ijsserver=attr->value; + } + if ((attr = ppdFindAttr(ppd,"ijsManufacturer",0)) != 0) { + devManu=attr->value; + } + if ((attr = ppdFindAttr(ppd,"ijsModel",0)) != 0) { + devModel=attr->value; + } + if ((attr = ppdFindAttr(ppd,"ijsColorspace",0)) != 0) { + parse_colorspace(attr->value); + } + if ( (!ijsserver)||(!devManu)||(!devModel)||(colspace==NONE) ) { + error(-1,"ijsServer, ijsManufacturer, ijsModel and ijsColorspace must be specified in the PPD"); + exit(1); + } + + options = NULL; + + num_options = cupsParseOptions(argv[5],0,&options); +// cupsMarkOptions(ppd,num_options,options); // TODO? returns 1 on conflict + // handle *ijsResolution, *ijsParam here + char spec[PPD_MAX_NAME]; + for (int iA=0;iA<num_options;iA++) { + snprintf(spec,PPD_MAX_NAME,"%s=%s",options[iA].name,options[iA].value); + if ((attr = ppdFindAttr(ppd,"ijsResolution",spec)) != 0) { + parse_resolution(attr->value); + } + if ((attr = ppdFindAttr(ppd,"ijsParams",spec)) != 0) { + parse_paramlist(attr->value); + } + if (strcmp(options[iA].name,"ijsOutputFile")==0) { + outputfile=strdup(options[iA].value); + } + } + if (!resolution[0]) { + error(-1,"ijsResolution must be specified"); + exit(1); + } + cupsFreeOptions(num_options,options); +} + +#if 0 +void parsePDFTOPDFComment(FILE *fp) +{ + char buf[4096]; + int i; + + /* skip until PDF start header */ + while (fgets(buf,sizeof(buf),fp) != 0) { + if (strncmp(buf,"%PDF",4) == 0) { + break; + } + } + for (i = 0;i < MAX_CHECK_COMMENT_LINES;i++) { + if (fgets(buf,sizeof(buf),fp) == 0) break; + if (strncmp(buf,"%%PDFTOPDFNumCopies",19) == 0) { + char *p; + + p = strchr(buf+19,':'); + deviceCopies = atoi(p+1); + } else if (strncmp(buf,"%%PDFTOPDFCollate",17) == 0) { + char *p; + + p = strchr(buf+17,':'); + while (*p == ' ' || *p == '\t') p++; + if (strncasecmp(p,"true",4) == 0) { + deviceCollate = true; + } else { + deviceCollate = false; + } + } + } +} +#endif + +int main(int argc, char *argv[]) { + PDFDoc *doc; + SplashOutputDev *out; + SplashColor paperColor; + int i; + int npages; + IjsClientCtx *ctx=NULL; + int job_id; + enum SplashColorMode cmode; + int rowpad; + GBool reverseVideo; + + setErrorFunction(::myErrorFun); +#ifdef GLOBALPARAMS_HAS_A_ARG + globalParams = new GlobalParams(0); +#else + globalParams = new GlobalParams(); +#endif + parseOpts(argc, argv); + + if (argc == 6) { + /* stdin */ + int fd; + Object obj; + BaseStream *str; + FILE *fp; + char buf[BUFSIZ]; + int n; + + fd = cupsTempFd(buf,sizeof(buf)); + if (fd < 0) { + error(-1,"Can't create temporary file"); + exit(1); + } + /* remove name */ + unlink(buf); + + /* copy stdin to the tmp file */ + while ((n = read(0,buf,BUFSIZ)) > 0) { + if (write(fd,buf,n) != n) { + error(-1,"Can't copy stdin to temporary file"); + close(fd); + exit(1); + } + } + if (lseek(fd,0,SEEK_SET) < 0) { + error(-1,"Can't rewind temporary file"); + close(fd); + exit(1); + } + + if ((fp = fdopen(fd,"rb")) == 0) { + error(-1,"Can't fdopen temporary file"); + close(fd); + exit(1); + } + + obj.initNull(); +// parsePDFTOPDFComment(fp); // TODO? + rewind(fp); + str = new FileStream(fp,0,gFalse,0,&obj); + doc = new PDFDoc(str); + } else { + GooString *fileName = new GooString(argv[6]); + /* argc == 7 filenmae is specified */ + FILE *fp; + + if ((fp = fopen(argv[6],"rb")) == 0) { + error(-1,"Can't open input file %s",argv[6]); + exit(1); + } +// parsePDFTOPDFComment(fp); // TODO? + fclose(fp); + doc = new PDFDoc(fileName,NULL,NULL); + } + + if (!doc->isOk()) { + exitCode = 1; + goto err1; + } + + char tmp[100]; + tmp[99]=0; + // ... OutputFD=stdout .. needs to be done before forking + int outfd; + outfd=dup(fileno(stdout)); + +#if 0 + /* fix NumCopies, Collate ccording to PDFTOPDFComments */ + header.NumCopies = deviceCopies; + header.Collate = deviceCollate ? CUPS_TRUE : CUPS_FALSE; + /* fixed other values that pdftopdf handles */ + header.MirrorPrint = CUPS_FALSE; + header.Orientation = CUPS_ORIENT_0; +#endif + + job_id=atoi(argv[1]); + ctx = ijs_invoke_server (ijsserver); + ijs_client_open (ctx); + ijs_client_begin_job (ctx,job_id); + if (outputfile) { + ijs_client_set_param(ctx,job_id,"OutputFile",outputfile,strlen(outputfile)); + } else { + snprintf(tmp,99,"%d",outfd); + ijs_client_set_param(ctx,job_id,"OutputFD",tmp,strlen(tmp)); + close(outfd); + } + ijs_client_set_param(ctx,job_id,"DeviceManufacturer",devManu,strlen(devManu)); + ijs_client_set_param(ctx,job_id,"DeviceModel",devModel,strlen(devModel)); + // TODO: get supported output-formats from ijs-server, overriding PPD + + /* set image's values */ + int numChan,bitsPerSample; + const char *devName; + reverseVideo = gFalse; + switch (colspace) { + case COL_RGB: + numChan=3; + bitsPerSample=8; + cmode = splashModeRGB8; + devName = "DeviceRGB"; + rowpad = 3; + /* set paper color white */ + paperColor[0] = 255; + paperColor[1] = 255; + paperColor[2] = 255; + break; + case COL_BLACK1: + reverseVideo = gTrue; + case COL_WHITE1: + numChan=1; + bitsPerSample=1; + cmode = splashModeMono1; + devName = "DeviceGray"; + /* set paper color white */ + paperColor[0] = 255; + rowpad = 1; + break; + case COL_BLACK8: + reverseVideo = gTrue; + case COL_WHITE8: + numChan=1; + bitsPerSample=8; + cmode = splashModeMono8; + devName = "DeviceGray"; + /* set paper color white */ + paperColor[0] = 255; + rowpad = 1; + break; +#ifdef SPLASH_CMYK + case COL_CMYK: + numChan=4; + bitsPerSample=8; + cmode = splashModeCMYK8; + devName = "DeviceCMYK"; + /* set paper color white */ + paperColor[0] = 0; + paperColor[1] = 0; + paperColor[2] = 0; + paperColor[3] = 0; + rowpad = 4; + break; +#endif + default: + error(-1,"Specified ColorSpace is not supported"); + exit(1); + break; + } + + out = new SplashOutputDev(cmode,rowpad/* row padding */, + reverseVideo,paperColor,gTrue,gFalse); + out->startDoc(doc->getXRef()); + + snprintf(tmp,99,"%d",numChan); + ijs_client_set_param(ctx,job_id,"NumChan",tmp,strlen(tmp)); + snprintf(tmp,99,"%d",bitsPerSample); + ijs_client_set_param(ctx,job_id,"BitsPerSample",tmp,strlen(tmp)); + ijs_client_set_param(ctx,job_id,"ColorSpace",devName,strlen(devName)); + snprintf(tmp,99,"%dx%d",resolution[0],resolution[1]); + ijs_client_set_param(ctx,job_id,"Dpi",tmp,strlen(tmp)); + + { // set the custom ijs parameters + const int plen=params.size(); + for (i=0;i<plen;i++) { + ijs_client_set_param(ctx,job_id,params[i].first.c_str(),params[i].second.c_str(),params[i].second.size()); + } + } + + npages = doc->getNumPages(); + for (i = 1;i <= npages;i++) { + SplashBitmap *bitmap; + unsigned int size; + + doc->displayPage(out,i,resolution[0],resolution[1],0,gFalse,gFalse,gFalse); + bitmap = out->getBitmap(); + + /* set page parameters */ + snprintf(tmp,99,"%d",bitmap->getWidth()); + ijs_client_set_param(ctx,job_id,"Width",tmp,strlen(tmp)); + snprintf(tmp,99,"%d",bitmap->getHeight()); + ijs_client_set_param(ctx,job_id,"Height",tmp,strlen(tmp)); + ijs_client_begin_page(ctx,job_id); + + /* write page image */ + size = bitmap->getRowSize()*bitmap->getHeight(); + int status=ijs_client_send_data_wait(ctx,job_id,(const char *)bitmap->getDataPtr(),size); + if (status) { + error(-1,"Can't write page %d image: %d",i,status); + exit(1); + } + + status=ijs_client_end_page(ctx,job_id); + if (status) { + error(-1,"Can't finish page %d: %d",i,status); + exit(1); + } + } + ijs_client_end_job (ctx, job_id); + ijs_client_close (ctx); + + ijs_client_begin_cmd (ctx, IJS_CMD_EXIT); + ijs_client_send_cmd_wait (ctx); + + delete out; +err1: + delete doc; + ppdClose(ppd); + free(outputfile); + + // Check for memory leaks + Object::memCheck(stderr); + gMemReport(stderr); + + return exitCode; +} + +/* replace memory allocation methods for memory check */ + +void * operator new(size_t size) +{ + return gmalloc(size); +} + +void operator delete(void *p) +{ + gfree(p); +} + +void * operator new[](size_t size) +{ + return gmalloc(size); +} + +void operator delete[](void *p) +{ + gfree(p); +} --- cups-1.3.8.orig/debian/local/filters/pdf-filters/filter/texttopdf.c +++ cups-1.3.8/debian/local/filters/pdf-filters/filter/texttopdf.c @@ -0,0 +1,1187 @@ +/* + * Text to PDF filter for the Common UNIX Printing System (CUPS). + * + * Copyright 2008 by Tobias Hoffmann. + * Copyright 2007 by Apple Inc. + * Copyright 1993-2007 by Easy Software Products. + * + * These coded instructions, statements, and computer programs are the + * property of Apple Inc. and are protected by Federal copyright + * law. Distribution and use rights are outlined in the file "LICENSE.txt" + * which should have been included with this file. If this file is + * file is missing or damaged, see the license at "http://www.cups.org/". + * + * This file is subject to the Apple OS-Developed Software exception. + * + * Contents: + * + * main() - Main entry for text to PDF filter. + * WriteEpilogue() - Write the PDF file epilogue. + * WritePage() - Write a page of text. + * WriteProlog() - Write the PDF file prolog with options. + * write_line() - Write a row of text. + * write_string() - Write a string of text. + */ + +/* + * Include necessary headers... + */ + +#include "textcommon.h" +#include <cups/i18n.h> +#include "pdfutils.h" +#include "fontembed/embed.h" +#include <assert.h> +#include "fontembed/sfnt.h" + +EMB_PARAMS *font_load(const char *datadir,const char *font); + +static int bits_used(BITSET bits,int len) // {{{ +{ + len=((len+31)&~31)/8; + while (len>0) { + if (*bits) { + return 1; + } + bits++; + len--; + } + return 0; +} +// }}} + +EMB_PARAMS *font_load(const char *datadir,const char *font) +{ + char filename[1024]; /* Glyph filenames */ + snprintf(filename, sizeof(filename), "%s/fonts/%s", datadir, font); + + OTF_FILE *otf=otf_load(filename); + if (!otf) { + // TODO: try /usr/share/fonts/*/*/%s.ttf + return NULL; + } + FONTFILE *ff=fontfile_open_sfnt(otf); + assert(ff); + EMB_PARAMS *emb=emb_new(ff, + EMB_DEST_PDF16, + EMB_C_FORCE_MULTIBYTE| + EMB_C_TAKE_FONTFILE); + assert(emb); + assert(emb->plan&EMB_A_MULTIBYTE); + return emb; +} + +EMB_PARAMS *font_std(const char *name) +{ + FONTFILE *ff=fontfile_open_std(name); + assert(ff); + EMB_PARAMS *emb=emb_new(ff, + EMB_DEST_PDF16, + EMB_C_TAKE_FONTFILE); + assert(emb); + return emb; +} + +/* + * Globals... + */ + +int NumFonts; /* Number of fonts to use */ +EMB_PARAMS *Fonts[256][4]; /* Fonts to use */ +unsigned short Chars[256]; /* Input char to unicode */ +unsigned char Codes[65536]; /* Unicode glyph mapping to font */ +int Widths[256]; /* Widths of each font */ +int Directions[256];/* Text directions for each font */ +pdfOut *pdf; +int FontResource; /* Object number of font resource dictionary */ +float FontScaleX,FontScaleY; /* The font matrix */ +lchar_t *Title,*Date; /* The title and date strings */ + +/* + * Local functions... + */ + +static void write_line(int row, lchar_t *line); +static void write_string(int col, int row, int len, lchar_t *s); +static lchar_t *make_wide(const char *buf); +static void write_font_str(float x,float y,int fontid, lchar_t *str, int len); +static void write_pretty_header(); + + +/* + * 'main()' - Main entry for text to PDF filter. + */ + +int /* O - Exit status */ +main(int argc, /* I - Number of command-line arguments */ + char *argv[]) /* I - Command-line arguments */ +{ + return (TextMain("texttopdf", argc, argv)); +} + + +/* + * 'WriteEpilogue()' - Write the PDF file epilogue. + */ + +void +WriteEpilogue(void) +{ + static char *names[] = /* Font names */ + { "FN","FB","FI" }; + int i,j; + + free(Page[0]); + free(Page); + + // embed fonts + for (i = PrettyPrint ? 2 : 1; i >= 0; i --) { + for (j = 0; j < NumFonts; j ++) + { + EMB_PARAMS *emb=Fonts[j][i]; + if (emb->font->fobj) { // already embedded + continue; + } + if ( (!emb->subset)||(bits_used(emb->subset,emb->font->sfnt->numGlyphs)) ) { + emb->font->fobj=pdfOut_write_font(pdf,emb); + assert(emb->font->fobj); + } + } + } + + /* + * Create the global fontdict + */ + + // now fix FontResource + pdf->xref[FontResource-1]=pdf->filepos; + pdfOut_printf(pdf,"%d 0 obj\n" + "<<\n", + FontResource); + + for (i = PrettyPrint ? 2 : 1; i >= 0; i --) { + for (j = 0; j < NumFonts; j ++) { + EMB_PARAMS *emb=Fonts[j][i]; + if (emb->font->fobj) { // used + pdfOut_printf(pdf," /%s%02x %d 0 R\n",names[i],j,emb->font->fobj); + } + } + } + + pdfOut_printf(pdf,">>\n" + "endobj\n"); + + pdfOut_finish_pdf(pdf); + + pdfOut_free(pdf); +} + +/* + * {{{ 'WritePage()' - Write a page of text. + */ + +void +WritePage(void) +{ + int line; /* Current line */ + + int content=pdfOut_add_xref(pdf); + pdfOut_printf(pdf,"%d 0 obj\n" + "<</Length %d 0 R\n" + ">>\n" + "stream\n" + "q\n" + ,content,content+1); + long size=-(pdf->filepos-2); + + NumPages ++; + if (PrettyPrint) + write_pretty_header(pdf); + + for (line = 0; line < SizeLines; line ++) + write_line(line, Page[line]); + + size+=pdf->filepos+2; + pdfOut_printf(pdf,"Q\n" + "endstream\n" + "endobj\n"); + + int len_obj=pdfOut_add_xref(pdf); + assert(len_obj==content+1); + pdfOut_printf(pdf,"%d 0 obj\n" + "%d\n" + "endobj\n", + len_obj,size); + + int obj=pdfOut_add_xref(pdf); + pdfOut_printf(pdf,"%d 0 obj\n" + "<</Type/Page\n" + " /Parent 1 0 R\n" + " /MediaBox [0 0 %.0f %.0f]\n" + " /Contents %d 0 R\n" + " /Resources << /Font %d 0 R >>\n" + ">>\n" + "endobj\n", + obj,PageWidth,PageLength,content,FontResource); + pdfOut_add_page(pdf,obj); + + memset(Page[0], 0, sizeof(lchar_t) * SizeColumns * SizeLines); +} +// }}} + +/* + * {{{'WriteProlog()' - Write the PDF file prolog with options. + */ + +void +WriteProlog(const char *title, /* I - Title of job */ + const char *user, /* I - Username */ + const char *classification, /* I - Classification */ + const char *label, /* I - Page label */ + ppd_file_t *ppd) /* I - PPD file info */ +{ + int i, j, k; /* Looping vars */ + char *charset; /* Character set string */ + char filename[1024]; /* Glyph filenames */ + FILE *fp; /* Glyph files */ + const char *datadir; /* CUPS_DATADIR environment variable */ + char line[1024], /* Line from file */ + *lineptr, /* Pointer into line */ + *valptr; /* Pointer to value in line */ + int ch, unicode; /* Character values */ + int start, end; /* Start and end values for range */ + time_t curtime; /* Current time */ + struct tm *curtm; /* Current date */ + char curdate[255]; /* Current date (text format) */ + int num_fonts=0; /* Number of unique fonts */ + EMB_PARAMS *fonts[1024]; /* Unique fonts */ + char *fontnames[1024]; /* Unique fonts */ +#if 0 + static char *names[] = /* Font names */ + { + "FN","FB","FI" + /* + "cupsNormal", + "cupsBold", + "cupsItalic" + */ + }; +#endif + + + /* + * Get the data directory... + */ + + if ((datadir = getenv("CUPS_DATADIR")) == NULL) + datadir = CUPS_DATADIR; + + /* + * Adjust margins as necessary... + */ + + if (classification || label) + { + /* + * Leave room for labels... + */ + + PageBottom += 36; + PageTop -= 36; + } + + /* + * Allocate memory for the page... + */ + + SizeColumns = (PageRight - PageLeft) / 72.0 * CharsPerInch; + SizeLines = (PageTop - PageBottom) / 72.0 * LinesPerInch; + + Page = calloc(sizeof(lchar_t *), SizeLines); + Page[0] = calloc(sizeof(lchar_t), SizeColumns * SizeLines); + for (i = 1; i < SizeLines; i ++) + Page[i] = Page[0] + i * SizeColumns; + + if (PageColumns > 1) + { + ColumnGutter = CharsPerInch / 2; + ColumnWidth = (SizeColumns - ColumnGutter * (PageColumns - 1)) / + PageColumns; + } + else + ColumnWidth = SizeColumns; + + /* + * {{{ Output the PDF header... + */ + + assert(!pdf); + pdf=pdfOut_new(); + assert(pdf); + + pdfOut_begin_pdf(pdf); + pdfOut_printf(pdf,"%%cupsRotation: %d\n", (Orientation & 3) * 90); // TODO? + + pdfOut_add_kv(pdf,"Creator","texttopdf/" CUPS_SVERSION); + + curtime = time(NULL); + curtm = localtime(&curtime); + strftime(curdate, sizeof(curdate), "%c", curtm); + + pdfOut_add_kv(pdf,"CreationDate",pdfOut_to_pdfdate(curtm)); + pdfOut_add_kv(pdf,"Title",title); + pdfOut_add_kv(pdf,"Author",user); // was(PostScript): /For + // }}} + + /* + * {{{ Initialize globals... + */ + + NumFonts = 0; + memset(Fonts, 0, sizeof(Fonts)); + memset(Chars, 0, sizeof(Chars)); + memset(Codes, 0, sizeof(Codes)); + // }}} + + /* + * Get the output character set... + */ + + charset = getenv("CHARSET"); + if (charset != NULL && strcmp(charset, "us-ascii") != 0) // {{{ + { + snprintf(filename, sizeof(filename), "%s/charsets/pdf.%s", datadir, charset); + + if ((fp = fopen(filename, "r")) == NULL) + { + /* + * Can't open charset file! + */ + + fprintf(stderr, _("ERROR: Unable to open %s: %s\n"), filename, + strerror(errno)); + exit(1); + } + + /* + * Opened charset file; now see if this is really a charset file... + */ + + if (fgets(line, sizeof(line), fp) == NULL) + { + /* + * Bad/empty charset file! + */ + + fclose(fp); + fprintf(stderr, _("ERROR: Bad charset file %s\n"), filename); + exit(1); + } + + if (strncmp(line, "charset", 7) != 0) + { + /* + * Bad format/not a charset file! + */ + + fclose(fp); + fprintf(stderr, _("ERROR: Bad charset file %s\n"), filename); + exit(1); + } + + /* + * See if this is an 8-bit or UTF-8 character set file... + */ + + line[strlen(line) - 1] = '\0'; /* Drop \n */ + for (lineptr = line + 7; isspace(*lineptr & 255); lineptr ++); /* Skip whitespace */ + + if (strcmp(lineptr, "8bit") == 0) // {{{ + { + /* + * 8-bit text... + */ + + UTF8 = 0; + NumFonts = 0; + + /* + * Read the font description(s)... + */ + + while (fgets(line, sizeof(line), fp) != NULL) + { + /* + * Skip comment and blank lines... + */ + + if (line[0] == '#' || line[0] == '\n') + continue; + + /* + * Read the font descriptions that should look like: + * + * first last direction width normal [bold italic bold-italic] + */ + + lineptr = line; + + start = strtol(lineptr, &lineptr, 16); + end = strtol(lineptr, &lineptr, 16); + + while (isspace(*lineptr & 255)) + lineptr ++; + + if (!*lineptr) + break; /* Must be a font mapping */ + + valptr = lineptr; + + while (!isspace(*lineptr & 255) && *lineptr) + lineptr ++; + + if (!*lineptr) + { + /* + * Can't have a font without all required values... + */ + + fprintf(stderr, _("ERROR: Bad font description line: %s\n"), valptr); + fclose(fp); + exit(1); + } + + *lineptr++ = '\0'; + + if (strcmp(valptr, "ltor") == 0) + Directions[NumFonts] = 1; + else if (strcmp(valptr, "rtol") == 0) + Directions[NumFonts] = -1; + else + { + fprintf(stderr, _("ERROR: Bad text direction %s\n"), valptr); + fclose(fp); + exit(1); + } + + /* + * Got the direction, now get the width... + */ + + while (isspace(*lineptr & 255)) + lineptr ++; + + valptr = lineptr; + + while (!isspace(*lineptr & 255) && *lineptr) + lineptr ++; + + if (!*lineptr) + { + /* + * Can't have a font without all required values... + */ + + fprintf(stderr, _("ERROR: Bad font description line: %s\n"), valptr); + fclose(fp); + exit(1); + } + + *lineptr++ = '\0'; + + if (strcmp(valptr, "single") == 0) + Widths[NumFonts] = 1; + else if (strcmp(valptr, "double") == 0) + Widths[NumFonts] = 2; + else + { + fprintf(stderr, _("ERROR: Bad text width %s\n"), valptr); + fclose(fp); + exit(1); + } + + /* + * Get the fonts... + */ + + for (i = 0; *lineptr && i < 4; i ++) + { + while (isspace(*lineptr & 255)) + lineptr ++; + + valptr = lineptr; + + while (!isspace(*lineptr & 255) && *lineptr) + lineptr ++; + + if (*lineptr) + *lineptr++ = '\0'; + + if (lineptr > valptr) { + // search for duplicates + for (k = 0; k < num_fonts; k ++) + if (strcmp(valptr, fontnames[k]) == 0) { + Fonts[NumFonts][i] = fonts[k]; + break; + } + + if (k==num_fonts) { // not found + fonts[num_fonts] = Fonts[NumFonts][i] = font_load(datadir,valptr); + if (!fonts[num_fonts]) { // font missing/corrupt, replace by first + fprintf(stderr,"WARNING: Ignored bad font \"%s\"\n",valptr); + break; + } + fontnames[num_fonts++] = strdup(valptr); + } + } + } + + /* ignore complete range, when the first font is not available */ + if (i==0) { + continue; + } + + /* + * Fill in remaining fonts as needed... + */ + + for (j = i; j < 4; j ++) + Fonts[NumFonts][j] = Fonts[NumFonts][0]; + + /* + * Define the character mappings... + */ + + for (i = start; i <= end; i ++) + Codes[i] = NumFonts; + + NumFonts ++; + } + + /* + * Read encoding lines... + */ + + do + { + /* + * Skip comment and blank lines... + */ + + if (line[0] == '#' || line[0] == '\n') + continue; + + /* + * Grab the character and unicode glyph number. + */ + + if (sscanf(line, "%x%x", &ch, &unicode) == 2 && ch < 256) + Chars[ch] = unicode; + } + while (fgets(line, sizeof(line), fp) != NULL); + + fclose(fp); + } // }}} + else if (strcmp(lineptr, "utf8") == 0) // {{{ + { + /* + * UTF-8 (Unicode) text... + */ + + UTF8 = 1; + + /* + * Read the font descriptions... + */ + + NumFonts = 0; + + while (fgets(line, sizeof(line), fp) != NULL) + { + /* + * Skip comment and blank lines... + */ + + if (line[0] == '#' || line[0] == '\n') + continue; + + /* + * Read the font descriptions that should look like: + * + * start end direction width normal [bold italic bold-italic] + */ + + lineptr = line; + + start = strtol(lineptr, &lineptr, 16); + end = strtol(lineptr, &lineptr, 16); + + while (isspace(*lineptr & 255)) + lineptr ++; + + valptr = lineptr; + + while (!isspace(*lineptr & 255) && *lineptr) + lineptr ++; + + if (!*lineptr) + { + /* + * Can't have a font without all required values... + */ + + fprintf(stderr, _("ERROR: Bad font description line: %s\n"), valptr); + fclose(fp); + exit(1); + } + + *lineptr++ = '\0'; + + if (strcmp(valptr, "ltor") == 0) + Directions[NumFonts] = 1; + else if (strcmp(valptr, "rtol") == 0) + Directions[NumFonts] = -1; + else + { + fprintf(stderr, _("ERROR: Bad text direction %s\n"), valptr); + fclose(fp); + exit(1); + } + + /* + * Got the direction, now get the width... + */ + + while (isspace(*lineptr & 255)) + lineptr ++; + + valptr = lineptr; + + while (!isspace(*lineptr & 255) && *lineptr) + lineptr ++; + + if (!*lineptr) + { + /* + * Can't have a font without all required values... + */ + + fprintf(stderr, _("ERROR: Bad font description line: %s\n"), valptr); + fclose(fp); + exit(1); + } + + *lineptr++ = '\0'; + + if (strcmp(valptr, "single") == 0) + Widths[NumFonts] = 1; + else if (strcmp(valptr, "double") == 0) + Widths[NumFonts] = 2; + else + { + fprintf(stderr, _("ERROR: Bad text width %s\n"), valptr); + fclose(fp); + exit(1); + } + + /* + * Get the fonts... + */ + + for (i = 0; *lineptr && i < 4; i ++) + { + while (isspace(*lineptr & 255)) + lineptr ++; + + valptr = lineptr; + + while (!isspace(*lineptr & 255) && *lineptr) + lineptr ++; + + if (*lineptr) + *lineptr++ = '\0'; + + if (lineptr > valptr) { + // search for duplicates + for (k = 0; k < num_fonts; k ++) + if (strcmp(valptr, fontnames[k]) == 0) { + Fonts[NumFonts][i] = fonts[k]; + break; + } + + if (k==num_fonts) { // not found + fonts[num_fonts] = Fonts[NumFonts][i] = font_load(datadir,valptr); + if (!fonts[num_fonts]) { // font missing/corrupt, replace by first + fprintf(stderr,"WARNING: Ignored bad font \"%s\"\n",valptr); + break; + } + fontnames[num_fonts++] = strdup(valptr); + } + } + } + + /* ignore complete range, when the first font is not available */ + if (i==0) { + continue; + } + + /* + * Fill in remaining fonts as needed... + */ + + for (j = i; j < 4; j ++) + Fonts[NumFonts][j] = Fonts[NumFonts][0]; + + /* + * Define the character mappings... + */ + + for (i = start; i <= end; i ++) + { + Codes[i] = NumFonts; + } + + /* + * Move to the next font, stopping if needed... + */ + + NumFonts ++; + if (NumFonts >= 256) + break; + } + + fclose(fp); + } // }}} + else // {{{ + { + fprintf(stderr, _("ERROR: Bad charset type %s\n"), lineptr); + fclose(fp); + exit(1); + } // }}} + } // }}} + else // {{{ Standard ASCII + { + /* + * Standard ASCII output just uses Courier, Courier-Bold, and + * possibly Courier-Oblique. + */ + + NumFonts = 1; + + Fonts[0][ATTR_NORMAL] = font_std("Courier"); + Fonts[0][ATTR_BOLD] = font_std("Courier-Bold"); + Fonts[0][ATTR_ITALIC] = font_std("Courier-Oblique"); + Fonts[0][ATTR_BOLDITALIC] = font_std("Courier-BoldOblique"); + + Widths[0] = 1; + Directions[0] = 1; + + /* + * Define US-ASCII characters... + */ + + for (i = 32; i < 127; i ++) + { + Chars[i] = i; + Codes[i] = NumFonts-1; + } + } + // }}} + + if (NumFonts==0) { + fprintf(stderr, _("ERROR: No usable font available\n")); + exit(1); + } + + FontScaleX=120.0 / CharsPerInch; + FontScaleY=68.0 / LinesPerInch; + + // allocate now, for pages to use. will be fixed in epilogue + FontResource=pdfOut_add_xref(pdf); + + if (PrettyPrint) + { + Date=make_wide(curdate); + Title=make_wide(title); + } +} +// }}} + +/* + * {{{ 'write_line()' - Write a row of text. + */ + +static void +write_line(int row, /* I - Row number (0 to N) */ + lchar_t *line) /* I - Line to print */ +{ + int i; /* Looping var */ + int col,xcol,xwid; /* Current column */ + int attr; /* Current attribute */ + int font, /* Font to use */ + lastfont, /* Last font */ + mono; /* Monospaced? */ + lchar_t *start; /* First character in sequence */ + + + xcol=0; + for (col = 0, start = line; col < SizeColumns;) + { + while (col < SizeColumns && (line->ch == ' ' || line->ch == 0)) + { + col ++; + xcol ++; + line ++; + } + + if (col >= SizeColumns) + break; + + if (NumFonts == 1) + { + /* + * All characters in a single font - assume monospaced and single width... + */ + + attr = line->attr; + start = line; + + while (col < SizeColumns && line->ch != 0 && attr == line->attr) + { + col ++; + line ++; + } + + write_string(col - (line - start), row, line - start, start); + } + else + { + /* + * Multiple fonts; break up based on the font... + */ + + attr = line->attr; + start = line; + xwid = 0; + if (UTF8) { + lastfont = Codes[line->ch]; + } else { + lastfont = Codes[Chars[line->ch]]; + } +// mono = strncmp(Fonts[lastfont][0], "Courier", 7) == 0; +mono=1; // TODO + + col ++; + xwid += Widths[lastfont]; + line ++; + + if (mono) + { + while (col < SizeColumns && line->ch != 0 && attr == line->attr) + { + if (UTF8) { + font = Codes[line->ch]; + } else { + font = Codes[Chars[line->ch]]; + } + if (/*strncmp(Fonts[font][0], "Courier", 7) != 0 ||*/ // TODO + font != lastfont) + break; + + col ++; + xwid += Widths[lastfont]; + line ++; + } + } + + if (Directions[lastfont] > 0) { + write_string(xcol, row, line - start, start); + xcol += xwid; + } + else + { + /* + * Do right-to-left text... ; assume no font change without direction change + */ + + while (col < SizeColumns && line->ch != 0 && attr == line->attr) + { + if (UTF8) { + font = Codes[line->ch]; + } else { + font = Codes[Chars[line->ch]]; + } + if (Directions[font] > 0 && + !ispunct(line->ch & 255) && !isspace(line->ch & 255)) + break; + + col ++; + xwid += Widths[lastfont]; + line ++; + } + + for (i = 1; start < line; i ++, start ++) + if (!isspace(start->ch & 255)) { + xwid-=Widths[lastfont]; + write_string(xcol + xwid, row, 1, start); + } else { + xwid--; + } + } + } + } +} +// }}} + +static lchar_t *make_wide(const char *buf) // {{{ - convert to lchar_t +{ + const unsigned char *utf8; /* UTF8 text */ + lchar_t *ret,*out; + + // this is enough, utf8 chars will only require less space + out=ret=malloc((strlen(buf)+1)*sizeof(lchar_t)); + + utf8 = (const unsigned char *)buf; + while (*utf8) + { + out->attr=0; + + if (*utf8 < 0xc0 || !UTF8) + out->ch = *utf8 ++; + else if ((*utf8 & 0xe0) == 0xc0) + { + /* + * Two byte character... + */ + + out->ch = ((utf8[0] & 0x1f) << 6) | (utf8[1] & 0x3f); + utf8 += 2; + } + else + { + /* + * Three byte character... + */ + + out->ch = ((((utf8[0] & 0x1f) << 6) | (utf8[1] & 0x3f)) << 6) | + (utf8[2] & 0x3f); + utf8 += 3; + } + + out++; + } + out->ch=out->attr=0; + return ret; +} +// }}} + +/* + * {{{ 'write_string()' - Write a string of text. + */ + +static void +write_string(int col, /* I - Start column */ + int row, /* I - Row */ + int len, /* I - Number of characters */ + lchar_t *s) /* I - String to print */ +{ + float x, y; /* Position of text */ + unsigned attr; /* Character attributes */ + + + /* + * Position the text and set the font... + */ + + if (Duplex && (NumPages & 1) == 0) + { + x = PageWidth - PageRight; + y = PageTop; + } + else + { + x = PageLeft; + y = PageTop; + } + + x += (float)col * 72.0f / (float)CharsPerInch; + y -= (float)(row + 0.843) * 72.0f / (float)LinesPerInch; + + attr = s->attr; + + if (attr & ATTR_RAISED) + y += 36.0 / (float)LinesPerInch; + else if (attr & ATTR_LOWERED) + y -= 36.0 / (float)LinesPerInch; + + if (attr & ATTR_UNDERLINE) + pdfOut_printf(pdf,"q 0.5 w 0 g %.3f %.3f m %.3f %.3f l S Q ", + x, y - 6.8 / LinesPerInch, + x + (float)len * 72.0 / (float)CharsPerInch, + y - 6.8 / LinesPerInch); + + if (PrettyPrint) + { + if (ColorDevice) { + if (attr & ATTR_RED) + pdfOut_printf(pdf,"0.5 0 0 rg\n"); + else if (attr & ATTR_GREEN) + pdfOut_printf(pdf,"0 0.5 0 rg\n"); + else if (attr & ATTR_BLUE) + pdfOut_printf(pdf,"0 0 0.5 rg\n"); + else + pdfOut_printf(pdf,"0 g\n"); + } else { + if ( (attr & ATTR_RED)||(attr & ATTR_GREEN)||(attr & ATTR_BLUE) ) + pdfOut_printf(pdf,"0.2 g\n"); + else + pdfOut_printf(pdf,"0 g\n"); + } + } + else + pdfOut_printf(pdf,"0 g\n"); + + write_font_str(x,y,attr & ATTR_FONT,s,len); +} +// }}} + +// {{{ show >len characters from >str, using the right font(s) at >x,>y +static void write_font_str(float x,float y,int fontid, lchar_t *str, int len) +{ + unsigned short ch; /* Current character */ + static char *names[] = /* Font names */ + { "FN","FB","FI" }; + + if (len==-1) { + for (len=0;str[len].ch;len++); + } + pdfOut_printf(pdf,"BT\n"); + + if (x == (int)x) + pdfOut_printf(pdf," %.0f ", x); + else + pdfOut_printf(pdf," %.3f ", x); + + if (y == (int)y) + pdfOut_printf(pdf,"%.0f Td\n", y); + else + pdfOut_printf(pdf,"%.3f Td\n", y); + + int lastfont,font; + + // split on font boundary + while (len > 0) + { + /* + * Write a hex string... + */ + if (UTF8) { + lastfont=Codes[str->ch]; + } else { + lastfont=Codes[Chars[str->ch]]; + } + EMB_PARAMS *emb=Fonts[lastfont][fontid]; + OTF_FILE *otf=emb->font->sfnt; + + if (otf) { // TODO? + pdfOut_printf(pdf," %.3f Tz\n", + FontScaleX*600.0/(otf_get_width(otf,0)*1000.0/otf->unitsPerEm)*100.0/FontScaleY); // TODO? + } else { + pdfOut_printf(pdf," %.3f Tz\n", + FontScaleX*100.0/FontScaleY); // TODO? + } + + pdfOut_printf(pdf," /%s%02x %.3f Tf <", + names[fontid],lastfont,FontScaleY); + + while (len > 0) + { + if (UTF8) { + ch=str->ch; + } else { + ch=Chars[str->ch]; + } + + font = Codes[ch]; + if (lastfont != font) { + assert(0); // should never happen; TODO + break; + } + if (otf) { // TODO + const unsigned short gid=otf_from_unicode(otf,ch); + pdfOut_printf(pdf,"%04x", gid); + + if (emb->subset) { + bit_set(emb->subset,gid); + } + } else { // std 14 font with 7-bit us-ascii uses single byte encoding, TODO + pdfOut_printf(pdf,"%02x",ch); + } + + len --; + str ++; + } + + pdfOut_printf(pdf,"> Tj\n"); + } + pdfOut_printf(pdf,"ET\n"); +} +// }}} + +static float stringwidth_x(lchar_t *str) +{ + int len; + + for (len=0;str[len].ch;len++); + + return (float)len * 72.0 / (float)CharsPerInch; +} + +static void write_pretty_header() // {{{ +{ + float x,y; + pdfOut_printf(pdf,"q\n" + "0.9 g\n"); + + if (Duplex && (NumPages & 1) == 0) { + x = PageWidth - PageRight; + y = PageTop + 72.0f / LinesPerInch; + } else { + x = PageLeft; + y = PageTop + 72.0f / LinesPerInch; + } + + pdfOut_printf(pdf,"1 0 0 1 %.3f %.3f cm\n",x,y); // translate + pdfOut_printf(pdf,"0 0 %.3f %.3f re f\n", + PageRight - PageLeft, 144.0f / LinesPerInch); + pdfOut_printf(pdf,"0 g 0 G\n"); + + if (Duplex && (NumPages & 1) == 0) { + x = PageRight - PageLeft - 36.0f / LinesPerInch - stringwidth_x(Title); + y = (0.5f + 0.157f) * 72.0f / LinesPerInch; + } else { + x = 36.0f / LinesPerInch; + y = (0.5f + 0.157f) * 72.0f / LinesPerInch; + } + write_font_str(x,y,ATTR_BOLD,Title,-1); + + x = (-stringwidth_x(Date) + PageRight - PageLeft) * 0.5; + write_font_str(x,y,ATTR_BOLD,Date,-1); + + // convert pagenumber to string + char tmp[20]; + tmp[19]=0; + snprintf(tmp,19,"%d",NumPages); + lchar_t *pagestr=make_wide(tmp); + + if (Duplex && (NumPages & 1) == 0) { + x = 36.0f / LinesPerInch; + } else { + x = PageRight - PageLeft - 36.0f / LinesPerInch - stringwidth_x(pagestr); + } + write_font_str(x,y,ATTR_BOLD,pagestr,-1); + + pdfOut_printf(pdf,"Q\n"); +} +// }}} + --- cups-1.3.8.orig/debian/local/filters/pdf-filters/filter/test_pdf2.c +++ cups-1.3.8/debian/local/filters/pdf-filters/filter/test_pdf2.c @@ -0,0 +1,107 @@ +#include "pdfutils.h" +#include <assert.h> +#include "fontembed/embed.h" +#include "fontembed/sfnt.h" + +#include <stdio.h> + +static inline void write_string(pdfOut *pdf,EMB_PARAMS *emb,const char *str) // {{{ +{ + assert(pdf); + assert(emb); + OTF_FILE *otf=emb->font->sfnt; + assert(otf); + int iA; + + if (emb->plan&EMB_A_MULTIBYTE) { + putc('<',stdout); + for (iA=0;str[iA];iA++) { + const unsigned short gid=otf_from_unicode(otf,(unsigned char)str[iA]); + fprintf(stdout,"%04x",gid); + if (emb->subset) { + bit_set(emb->subset,gid); + } + } + putc('>',stdout); + pdf->filepos+=4*iA+2; + } else { + if (emb->subset) { + for (iA=0;str[iA];iA++) { + bit_set(emb->subset,otf_from_unicode(otf,(unsigned char)str[iA])); // TODO: emb_set(...) encoding/unicode->gid // TODO: pdf: otf_from_pdf_default_encoding + } + } + pdfOut_putString(pdf,str,-1); + } +} +// }}} + +int main() +{ + pdfOut *pdf; + + pdf=pdfOut_new(); + assert(pdf); + + pdfOut_begin_pdf(pdf); + + // font, pt.1 + const char *fn="/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf"; +/* + if (argc==2) { + fn=argv[1]; + } +*/ + OTF_FILE *otf=otf_load(fn); + assert(otf); + FONTFILE *ff=fontfile_open_sfnt(otf); + EMB_PARAMS *emb=emb_new(ff, + EMB_DEST_PDF16, + EMB_C_FORCE_MULTIBYTE| + EMB_C_TAKE_FONTFILE); + + // test + const int PageWidth=595,PageLength=842; + const int cobj=pdfOut_add_xref(pdf); + pdfOut_printf(pdf,"%d 0 obj\n" + "<</Length %d 0 R\n" + ">>\n" + "stream\n" + ,cobj,cobj+1); + long streamlen=-pdf->filepos; + pdfOut_printf(pdf,"BT /a 10 Tf "); + write_string(pdf,emb,"Test"); + pdfOut_printf(pdf," Tj ET"); + + streamlen+=pdf->filepos; + pdfOut_printf(pdf,"\nendstream\n" + "endobj\n"); + const int clobj=pdfOut_add_xref(pdf); + assert(clobj==cobj+1); + pdfOut_printf(pdf,"%d 0 obj\n" + "%d\n" + "endobj\n" + ,clobj,streamlen); + + // font + int font_obj=pdfOut_write_font(pdf,emb); + assert(font_obj); + + int obj=pdfOut_add_xref(pdf); + pdfOut_printf(pdf,"%d 0 obj\n" + "<</Type/Page\n" + " /Parent 1 0 R\n" + " /MediaBox [0 0 %d %d]\n" + " /Contents %d 0 R\n" + " /Resources << /Font << /a %d 0 R >> >>\n" + ">>\n" + "endobj\n" + ,obj,PageWidth,PageLength,cobj,font_obj); // TODO: into pdf-> + pdfOut_add_page(pdf,obj); + pdfOut_finish_pdf(pdf); + + pdfOut_free(pdf); + + emb_close(emb); + + return 0; +} --- cups-1.3.8.orig/debian/local/filters/pdf-filters/filter/pdftoraster.cxx +++ cups-1.3.8/debian/local/filters/pdf-filters/filter/pdftoraster.cxx @@ -0,0 +1,337 @@ +/* +Copyright (c) 2008, BBR Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +/* + pdftoraster.cc + pdf to raster filter +*/ + +#include <config.h> +#include <stdio.h> +#include <stdlib.h> +#include "goo/GooString.h" +#include "goo/gmem.h" +#include "Object.h" +#include "Stream.h" +#include "PDFDoc.h" +#include "SplashOutputDev.h" +#include <cups/cups.h> +#include <stdarg.h> +#include "Error.h" +#include "GlobalParams.h" +#include "raster.h" +#include <splash/SplashTypes.h> +#include <splash/SplashBitmap.h> + +#define MAX_CHECK_COMMENT_LINES 20 + +namespace { + int exitCode = 0; + int deviceCopies = 1; + bool deviceCollate = false; + cups_page_header2_t header2; + cups_page_header_t header; +}; + +void CDECL myErrorFun(int pos, char *msg, va_list args) +{ + if (pos >= 0) { + fprintf(stderr, "ERROR (%d): ", pos); + } else { + fprintf(stderr, "ERROR: "); + } + vfprintf(stderr, msg, args); + fprintf(stderr, "\n"); + fflush(stderr); +} + +void parseOpts(int argc, char **argv) +{ + int num_options = 0; + cups_option_t *options = 0; + ppd_file_t *ppd = 0; + + if (argc < 6 || argc > 7) { + error(-1,"%s job-id user title copies options [file]", + argv[0]); + exit(1); + } + + ppd = ppdOpenFile(getenv("PPD")); + ppdMarkDefaults(ppd); + options = NULL; + num_options = cupsParseOptions(argv[5],0,&options); + cupsMarkOptions(ppd,num_options,options); + cupsRasterInterpretPPD(&header2,ppd,num_options,options,0); + memcpy(&header,&header2,sizeof(header)); +} + +void parsePDFTOPDFComment(FILE *fp) +{ + char buf[4096]; + int i; + + /* skip until PDF start header */ + while (fgets(buf,sizeof(buf),fp) != 0) { + if (strncmp(buf,"%PDF",4) == 0) { + break; + } + } + for (i = 0;i < MAX_CHECK_COMMENT_LINES;i++) { + if (fgets(buf,sizeof(buf),fp) == 0) break; + if (strncmp(buf,"%%PDFTOPDFNumCopies",19) == 0) { + char *p; + + p = strchr(buf+19,':'); + deviceCopies = atoi(p+1); + } else if (strncmp(buf,"%%PDFTOPDFCollate",17) == 0) { + char *p; + + p = strchr(buf+17,':'); + while (*p == ' ' || *p == '\t') p++; + if (strncasecmp(p,"true",4) == 0) { + deviceCollate = true; + } else { + deviceCollate = false; + } + } + } +} + +int main(int argc, char *argv[]) { + PDFDoc *doc; + SplashOutputDev *out; + SplashColor paperColor; + int i; + int npages; + cups_raster_t *raster; + enum SplashColorMode cmode; + int rowpad; + GBool reverseVideo; + + setErrorFunction(::myErrorFun); +#ifdef GLOBALPARAMS_HAS_A_ARG + globalParams = new GlobalParams(0); +#else + globalParams = new GlobalParams(); +#endif + parseOpts(argc, argv); + + if (argc == 6) { + /* stdin */ + int fd; + Object obj; + BaseStream *str; + FILE *fp; + char buf[BUFSIZ]; + int n; + + fd = cupsTempFd(buf,sizeof(buf)); + if (fd < 0) { + error(-1,"Can't create temporary file"); + exit(1); + } + /* remove name */ + unlink(buf); + + /* copy stdin to the tmp file */ + while ((n = read(0,buf,BUFSIZ)) > 0) { + if (write(fd,buf,n) != n) { + error(-1,"Can't copy stdin to temporary file"); + close(fd); + exit(1); + } + } + if (lseek(fd,0,SEEK_SET) < 0) { + error(-1,"Can't rewind temporary file"); + close(fd); + exit(1); + } + + if ((fp = fdopen(fd,"rb")) == 0) { + error(-1,"Can't fdopen temporary file"); + close(fd); + exit(1); + } + + obj.initNull(); + parsePDFTOPDFComment(fp); + rewind(fp); + str = new FileStream(fp,0,gFalse,0,&obj); + doc = new PDFDoc(str); + } else { + GooString *fileName = new GooString(argv[6]); + /* argc == 7 filenmae is specified */ + FILE *fp; + + if ((fp = fopen(argv[6],"rb")) == 0) { + error(-1,"Can't open input file %s",argv[6]); + exit(1); + } + parsePDFTOPDFComment(fp); + fclose(fp); + doc = new PDFDoc(fileName,NULL,NULL); + } + + if (!doc->isOk()) { + exitCode = 1; + goto err1; + } + + /* fix NumCopies, Collate ccording to PDFTOPDFComments */ + header.NumCopies = deviceCopies; + header.Collate = deviceCollate ? CUPS_TRUE : CUPS_FALSE; + /* fixed other values that pdftopdf handles */ + header.MirrorPrint = CUPS_FALSE; + header.Orientation = CUPS_ORIENT_0; + + /* set image's values */ + reverseVideo = gFalse; + switch (header.cupsColorSpace) { + case CUPS_CSPACE_RGB: + if (header.cupsColorOrder != CUPS_ORDER_CHUNKED + || header.cupsBitsPerColor != 8 + || header.cupsBitsPerPixel != 24) { + error(-1,"Specified color format is not supported"); + exit(1); + } + cmode = splashModeRGB8; + rowpad = 4; + /* set paper color white */ + paperColor[0] = 255; + paperColor[1] = 255; + paperColor[2] = 255; + break; + case CUPS_CSPACE_K: + reverseVideo = gTrue; + case CUPS_CSPACE_W: + if (header.cupsColorOrder != CUPS_ORDER_CHUNKED) { + error(-1,"Specified color format is not supported"); + exit(1); + } + if (header.cupsBitsPerColor == 1 + && header.cupsBitsPerPixel == 1) { + cmode = splashModeMono1; + } else if (header.cupsBitsPerColor == 8 + && header.cupsBitsPerPixel == 8) { + cmode = splashModeMono8; + } else { + error(-1,"Specified color format is not supported"); + exit(1); + } + /* set paper color white */ + paperColor[0] = 255; + rowpad = 1; + break; +#ifdef SPLASH_CMYK + case CUPS_CSPACE_CMYK: + if (header.cupsColorOrder != CUPS_ORDER_CHUNKED + || header.cupsBitsPerColor != 8 + || header.cupsBitsPerPixel != 32) { + error(-1,"Specified color format is not supported"); + exit(1); + } + cmode = splashModeCMYK8; + /* set paper color white */ + paperColor[0] = 0; + paperColor[1] = 0; + paperColor[2] = 0; + paperColor[3] = 0; + rowpad = 4; + break; +#endif + default: + error(-1,"Specified ColorSpace is not supported"); + exit(1); + break; + } + + + out = new SplashOutputDev(cmode,rowpad/* row padding */, + reverseVideo,paperColor,gTrue,gFalse); + out->startDoc(doc->getXRef()); + + if ((raster = cupsRasterOpen(1,CUPS_RASTER_WRITE)) == 0) { + error(-1,"Can't open raster stream"); + exit(1); + } + npages = doc->getNumPages(); + for (i = 1;i <= npages;i++) { + SplashBitmap *bitmap; + unsigned int size; + + doc->displayPage(out,i,header.HWResolution[0], + header.HWResolution[1],0,gFalse,gFalse,gFalse); + bitmap = out->getBitmap(); + + /* write page header */ + header.cupsWidth = bitmap->getWidth(); + header.cupsHeight = bitmap->getHeight(); + header.cupsBytesPerLine = bitmap->getRowSize(); + if (!cupsRasterWriteHeader(raster,&header)) { + error(-1,"Can't write page %d header",i); + exit(1); + } + + /* write page image */ + size = bitmap->getRowSize()*bitmap->getHeight(); + if (cupsRasterWritePixels(raster,(unsigned char *)(bitmap->getDataPtr()), + size) != size) { + error(-1,"Can't write page %d image",i); + exit(1); + } + } + cupsRasterClose(raster); + + delete out; +err1: + delete doc; + + // Check for memory leaks + Object::memCheck(stderr); + gMemReport(stderr); + + return exitCode; +} + +/* replace memory allocation methods for memory check */ + +void * operator new(size_t size) +{ + return gmalloc(size); +} + +void operator delete(void *p) +{ + gfree(p); +} + +void * operator new[](size_t size) +{ + return gmalloc(size); +} + +void operator delete[](void *p) +{ + gfree(p); +} --- cups-1.3.8.orig/debian/local/filters/pdf-filters/filter/imagetopdf.c +++ cups-1.3.8/debian/local/filters/pdf-filters/filter/imagetopdf.c @@ -0,0 +1,1703 @@ +/* + * Image file to PDF filter for the Common UNIX Printing System (CUPS). + * developped by BBR Inc. 2006-2007 + + * This is based on imagetops.c + * imagetops.c copyright notice is follows + + * "$Id: imagetops.c 5379 2006-04-07 13:48:37Z mike $" + * + * Image file to PostScript filter for the Common UNIX Printing System (CUPS). + * + * Copyright 1993-2006 by Easy Software Products. + * + * These coded instructions, statements, and computer programs are the + * property of Easy Software Products and are protected by Federal + * copyright law. Distribution and use rights are outlined in the file + * "LICENSE.txt" which should have been included with this file. If this + * file is missing or damaged please contact Easy Software Products + * at: + * + * Attn: CUPS Licensing Information + * Easy Software Products + * 44141 Airport View Drive, Suite 204 + * Hollywood, Maryland 20636 USA + * + * Voice: (301) 373-9600 + * EMail: cups-info@cups.org + * WWW: http://www.cups.org + * + * This file is subject to the Apple OS-Developed Software exception. + * + */ + +/* + * Include necessary headers... + */ + +#include "config.h" +#include "common.h" +#include "image.h" +#include <math.h> + +#if CUPS_VERSION_MAJOR < 1 \ + || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 2) +#ifndef CUPS_1_1 +#error Installed libs and specified source Version mismatch \ + Libs >= 1.2 && Source < 1.2 +#define CUPS_1_1 +#endif +#else +#ifdef CUPS_1_1 +#error Installed libs and specified source Version mismatch \ + Libs < 1.2 && Source >= 1.2 +#undef CUPS_1_1 +#endif +#endif + +#define USE_CONVERT_CMD +//#define OUT_AS_HEX +//#define OUT_AS_ASCII85 + +/* + * Globals... + */ + +int Flip = 0, /* Flip/mirror pages */ + XPosition = 0, /* Horizontal position on page */ + YPosition = 0, /* Vertical position on page */ + Collate = 0, /* Collate copies? */ + Copies = 1, /* Number of copies */ + Reverse = 0, /* Output order */ + EvenDuplex = 0; /* cupsEvenDuplex */ + +#ifdef CUPS_1_1 +#define cups_ib_t ib_t +#define cups_image_t image_t +#define CUPS_IMAGE_CMYK IMAGE_CMYK +#define CUPS_IMAGE_WHITE IMAGE_WHITE +#define CUPS_IMAGE_RGB IMAGE_RGB +#define CUPS_IMAGE_RGB_CMYK IMAGE_RGB_CMYK +#define cupsImageOpen ImageOpen +#define cupsImageClose ImageClose +#define cupsImageGetColorSpace(img) (img->colorspace) +#define cupsImageGetXPPI(img) (img->xppi) +#define cupsImageGetYPPI(img) (img->yppi) +#define cupsImageGetWidth(img) (img->xsize) +#define cupsImageGetHeight(img) (img->ysize) +#define cupsImageGetRow ImageGetRow +#endif + +/* + * Local functions... + */ + +#ifdef OUT_AS_HEX +static void out_hex(cups_ib_t *, int, int); +#else +#ifdef OUT_AS_ASCII85 +static void out_ascii85(cups_ib_t *, int, int); +#else +static void out_bin(cups_ib_t *, int, int); +#endif +#endif +static void outPdf(const char *str); +static void putcPdf(char c); +static int newObj(void); +static void freeAllObj(void); +static void outXref(void); +static void outTrailer(void); +static void outString(const char *s); +static void outPrologue(int nPages); +static void allocPageObjects(int noPages); +static void setOffset(int obj); +static void outPageObject(int pageObj, int contentsObj, int imgObj); +static void outPageContents(int contentsObj); +static void outImage(int imgObj); + +struct pdfObject { + int offset; +}; + +static struct pdfObject *objects = NULL; +static int currentObjectNo = 0; +static int allocatedObjectNum = 0; +static int currentOffset = 0; +static int xrefOffset; +static int *pageObjects = NULL; +static int catalogObj; +static int pagesObj; +static const char *title; +static int xpages, /* # x pages */ + ypages, /* # y pages */ + xpage, /* Current x page */ + ypage, /* Current y page */ + page; /* Current page number */ +static int xc0, yc0, /* Corners of the page in image coords */ + xc1, yc1; +static float left, top; /* Left and top of image */ +static float xprint, /* Printable area */ + yprint, + xinches, /* Total size in inches */ + yinches; +static float xsize, /* Total size in points */ + ysize, + xsize2, + ysize2; +static float aspect; /* Aspect ratio */ +static cups_image_t *img; /* Image to print */ +static int colorspace; /* Output colorspace */ +static cups_ib_t *row; /* Current row */ +static float gammaval = 1.0; /* Gamma correction value */ +static float brightness = 1.0; /* Gamma correction value */ +static ppd_file_t *ppd; /* PPD file */ + +#define N_OBJECT_ALLOC 100 +#define LINEBUFSIZE 1024 + +static char linebuf[LINEBUFSIZE]; + +void emitJCLOptions(FILE *fp, int copies) +{ + int section; + ppd_choice_t **choices; + int i; + char buf[1024]; + ppd_attr_t *attr; + int pdftoopvp = 0; + + if (ppd == 0) return; + if ((attr = ppdFindAttr(ppd,"pdftopdfJCLBegin",NULL)) != NULL) { + pdftoopvp = 1; + fputs(attr->value,fp); + } + + snprintf(buf,sizeof(buf),"%d",copies); + if (ppdFindOption(ppd,"Copies") != NULL) { + ppdMarkOption(ppd,"Copies",buf); + } else { + if ((attr = ppdFindAttr(ppd,"pdftopdfJCLCopies",buf)) != NULL) { + fputs(attr->value,fp); + } else if (pdftoopvp) { + fprintf(fp,"Copies=%d;",copies); + } + } + for (section = (int)PPD_ORDER_ANY; + section <= (int)PPD_ORDER_PROLOG;section++) { + int n; + + n = ppdCollect(ppd,(ppd_section_t)section,&choices); + for (i = 0;i < n;i++) { + snprintf(buf,sizeof(buf),"pdftopdfJCL%s", + ((ppd_option_t *)(choices[i]->option))->keyword); + if ((attr = ppdFindAttr(ppd,buf,choices[i]->choice)) != NULL) { + fputs(attr->value,fp); + } else if (pdftoopvp) { + fprintf(fp,"%s=%s;", + ((ppd_option_t *)(choices[i]->option))->keyword, + choices[i]->choice); + } + } + } + fputc('\n',fp); +} + + +static void setOffset(int obj) +{ + objects[obj].offset = currentOffset; +} + +static void allocPageObjects(int nPages) +{ + int i; + + if ((pageObjects = malloc(sizeof(int)*nPages)) == NULL) + { + fprintf(stderr,"ERROR: Can't allocate pageObjects\n"); + exit(2); + } + for (i = 0;i < nPages;i++) + { + pageObjects[i] = newObj(); + } +} + +static int newObj(void) +{ + if (objects == NULL) + { + if ((objects = malloc(sizeof(struct pdfObject)*N_OBJECT_ALLOC)) + == NULL) + { + fprintf(stderr,"ERROR: Can't allocate objects\n"); + exit(2); + } + allocatedObjectNum = N_OBJECT_ALLOC; + } + if (currentObjectNo >= allocatedObjectNum) + { + if ((objects = realloc(objects, + sizeof(struct pdfObject)*(allocatedObjectNum+N_OBJECT_ALLOC))) + == NULL) + { + fprintf(stderr,"ERROR: Can't allocate objects\n"); + exit(2); + } + allocatedObjectNum += N_OBJECT_ALLOC; + } + objects[currentObjectNo].offset = currentOffset; + return currentObjectNo++; +} + +static void freeAllObj(void) +{ + if (objects != NULL) + { + free(objects); + objects = NULL; + } +} + +static void putcPdf(char c) +{ + fputc(c,stdout); + currentOffset++; +} + +static void outPdf(const char *str) +{ + unsigned long len = strlen(str); + + fputs(str,stdout); + currentOffset += len; +} + +static void outXref(void) +{ + char buf[21]; + int i; + + xrefOffset = currentOffset; + outPdf("xref\n"); + snprintf(buf,21,"0 %d\n",currentObjectNo); + outPdf(buf); + outPdf("0000000000 65535 f \n"); + for (i = 1;i < currentObjectNo;i++) + { + snprintf(buf,21,"%010d 00000 n \n",objects[i].offset); + outPdf(buf); + } +} + +static void outString(const char *s) +{ + char c; + + putcPdf('('); + for (;(c = *s) != '\0';s++) { + if (c == '\\' || c == '(' || c == ')') { + putcPdf('\\'); + } + putcPdf(c); + } + putcPdf(')'); +} + +static void outTrailer(void) +{ + time_t curtime; + struct tm *curtm; + char curdate[255]; + + curtime = time(NULL); + curtm = localtime(&curtime); + strftime(curdate, sizeof(curdate),"D:%Y%m%d%H%M%S%z", curtm); + + outPdf("trailer\n"); + snprintf(linebuf, LINEBUFSIZE,"<</Size %d ",currentObjectNo); + outPdf(linebuf); + outPdf("/Root 1 0 R\n"); + outPdf("/Info << /Title "); + outString(title); + putcPdf(' '); + snprintf(linebuf,LINEBUFSIZE,"/CreationDate (%s) ",curdate); + outPdf(linebuf); + snprintf(linebuf,LINEBUFSIZE,"/ModDate (%s) ",curdate); + outPdf(linebuf); + outPdf("/Producer (imagetopdf) "); + outPdf("/Trapped /False >>\n"); + outPdf(">>\n"); + outPdf("startxref\n"); + snprintf(linebuf,LINEBUFSIZE,"%d\n",xrefOffset); + outPdf(linebuf); + outPdf("%%EOF\n"); +} + +static void outPrologue(int nPages) +{ + int i; + + /* out header */ + newObj(); /* dummy for no 0 object */ + outPdf("%PDF-1.3\n"); + /* out binary for transfer program */ + linebuf[0] = '%'; + linebuf[1] = 129; + linebuf[2] = 130; + linebuf[3] = 131; + linebuf[4] = 132; + linebuf[5] = '\n'; + linebuf[6] = 0; + outPdf(linebuf); + outPdf("% This file was generated by imagetopdf\n"); + + catalogObj = newObj(); + pagesObj = newObj(); + allocPageObjects(nPages); + + /* out catalog */ + snprintf(linebuf,LINEBUFSIZE, + "%d 0 obj <</Type/Catalog /Pages %d 0 R ",catalogObj,pagesObj); + outPdf(linebuf); + outPdf(">> endobj\n"); + + /* out Pages */ + setOffset(pagesObj); + snprintf(linebuf,LINEBUFSIZE, + "%d 0 obj <</Type/Pages /Kids [ ",pagesObj); + outPdf(linebuf); + if (Reverse) { + for (i = nPages-1;i >= 0;i--) + { + snprintf(linebuf,LINEBUFSIZE,"%d 0 R ",pageObjects[i]); + outPdf(linebuf); + } + } else { + for (i = 0;i < nPages;i++) + { + snprintf(linebuf,LINEBUFSIZE,"%d 0 R ",pageObjects[i]); + outPdf(linebuf); + } + } + outPdf("] "); + snprintf(linebuf,LINEBUFSIZE,"/Count %d >> endobj\n",nPages); + outPdf(linebuf); +} + +static void outPageObject(int pageObj, int contentsObj, int imgObj) +{ + int trfuncObj = newObj(); + int lengthObj = newObj(); + int startOffset; + int length; + int outTrfunc = (gammaval != 1.0 || brightness != 1.0); + + /* out Page Object */ + setOffset(pageObj); + snprintf(linebuf,LINEBUFSIZE, + "%d 0 obj <</Type/Page /Parent %d 0 R ", + pageObj,pagesObj); + outPdf(linebuf); + snprintf(linebuf,LINEBUFSIZE, + "/MediaBox [ 0 0 %f %f ] ",PageWidth,PageLength); + outPdf(linebuf); + snprintf(linebuf,LINEBUFSIZE, + "/TrimBox [ 0 0 %f %f ] ",PageWidth,PageLength); + outPdf(linebuf); + snprintf(linebuf,LINEBUFSIZE, + "/CropBox [ %f %f %f %f ] ", + PageLeft,PageBottom,PageRight,PageTop); + outPdf(linebuf); + if (contentsObj >= 0) { + snprintf(linebuf,LINEBUFSIZE, + "/Contents %d 0 R ",contentsObj); + outPdf(linebuf); + snprintf(linebuf,LINEBUFSIZE, + "/Resources <</ProcSet [/PDF] " + "/XObject << /Im %d 0 R >>\n",imgObj); + outPdf(linebuf); + } else { + /* empty page */ + snprintf(linebuf,LINEBUFSIZE, + "/Resources <</ProcSet [/PDF] \n"); + outPdf(linebuf); + } + if (outTrfunc) { + snprintf(linebuf,LINEBUFSIZE, + "/ExtGState << /GS1 << /TR %d 0 R >> >>\n",trfuncObj); + outPdf(linebuf); + } + outPdf(" >>\n>>\nendobj\n"); + + if (outTrfunc) { + /* out translate function */ + setOffset(trfuncObj); + snprintf(linebuf,LINEBUFSIZE, + "%d 0 obj <</FunctionType 4 /Domain [0 1.0]" + " /Range [0 1.0] /Length %d 0 R >>\n", + trfuncObj,lengthObj); + outPdf(linebuf); + outPdf("stream\n"); + startOffset = currentOffset; + snprintf(linebuf,LINEBUFSIZE, + "{ neg 1 add dup 0 lt { pop 1 } { %.3f exp neg 1 add } " + "ifelse %.3f mul }\n", gammaval, brightness); + outPdf(linebuf); + length = currentOffset - startOffset; + snprintf(linebuf,LINEBUFSIZE, + "endstream\nendobj\n"); + outPdf(linebuf); + + /* out length object */ + setOffset(lengthObj); + snprintf(linebuf,LINEBUFSIZE, + "%d 0 obj %d endobj\n",lengthObj,length); + outPdf(linebuf); + } +} + +static void outPageContents(int contentsObj) +{ + int startOffset; + int lengthObj; + int length; + + setOffset(contentsObj); + lengthObj = newObj(); + snprintf(linebuf,LINEBUFSIZE, + "%d 0 obj <</Length %d 0 R >> stream\n",contentsObj,lengthObj); + outPdf(linebuf); + startOffset = currentOffset; + + if (gammaval != 1.0 || brightness != 1.0) + outPdf("/GS1 gs\n"); + if (Flip) + { + snprintf(linebuf,LINEBUFSIZE, + "-1 0 0 1 %.0f 0 cm\n",PageWidth); + outPdf(linebuf); + } + + switch (Orientation) + { + case 1: + snprintf(linebuf,LINEBUFSIZE, + "0 1 -1 0 %.0f 0 cm\n",PageWidth); + outPdf(linebuf); + break; + case 2: + snprintf(linebuf,LINEBUFSIZE, + "-1 0 0 -1 %.0f %.0f cm\n",PageWidth, PageLength); + outPdf(linebuf); + break; + case 3: + snprintf(linebuf,LINEBUFSIZE, + "0 -1 1 0 0 %.0f cm\n",PageLength); + outPdf(linebuf); + break; + } + + xc0 = cupsImageGetWidth(img) * xpage / xpages; + xc1 = cupsImageGetWidth(img) * (xpage + 1) / xpages - 1; + yc0 = cupsImageGetHeight(img) * ypage / ypages; + yc1 = cupsImageGetHeight(img) * (ypage + 1) / ypages - 1; + + snprintf(linebuf,LINEBUFSIZE, + "1 0 0 1 %.1f %.1f cm\n",left,top); + outPdf(linebuf); + + snprintf(linebuf,LINEBUFSIZE, + "%.3f 0 0 %.3f 0 0 cm\n", + xprint * 72.0, yprint * 72.0); + outPdf(linebuf); + outPdf("/Im Do\n"); + length = currentOffset - startOffset - 1; + outPdf("endstream\nendobj\n"); + + /* out length object */ + setOffset(lengthObj); + snprintf(linebuf,LINEBUFSIZE, + "%d 0 obj %d endobj\n",lengthObj,length); + outPdf(linebuf); +} + +static void outImage(int imgObj) +{ + int y; /* Current Y coordinate in image */ +#ifdef OUT_AS_ASCII85 + int out_offset; /* Offset into output buffer */ +#endif + int out_length; /* Length of output buffer */ + int startOffset; + int lengthObj; + int length; + + setOffset(imgObj); + lengthObj = newObj(); + snprintf(linebuf,LINEBUFSIZE, + "%d 0 obj << /Length %d 0 R /Type /XObject " + "/Subtype /Image /Name /Im" +#ifdef OUT_AS_HEX + "/Filter /ASCIIHexDecode " +#else +#ifdef OUT_AS_ASCII85 + "/Filter /ASCII85Decode " +#endif +#endif + ,imgObj,lengthObj); + outPdf(linebuf); + snprintf(linebuf,LINEBUFSIZE, + "/Width %d /Height %d /BitsPerComponent 8 ", + xc1 - xc0 + 1, yc1 - yc0 + 1); + outPdf(linebuf); + + switch (colorspace) + { + case CUPS_IMAGE_WHITE : + outPdf("/ColorSpace /DeviceGray "); + outPdf("/Decode[0 1] "); + break; + case CUPS_IMAGE_RGB : + outPdf("/ColorSpace /DeviceRGB "); + outPdf("/Decode[0 1 0 1 0 1] "); + break; + case CUPS_IMAGE_CMYK : + outPdf("/ColorSpace /DeviceCMYK "); + outPdf("/Decode[0 1 0 1 0 1 0 1] "); + break; + } + if (((xc1 - xc0 + 1) / xprint) < 100.0) + outPdf("/Interpolate true "); + + outPdf(">>\n"); + outPdf("stream\n"); + startOffset = currentOffset; + +#ifdef OUT_AS_ASCII85 + /* out ascii85 needs multiple of 4bytes */ + for (y = yc0, out_offset = 0; y <= yc1; y ++) + { + cupsImageGetRow(img, xc0, y, xc1 - xc0 + 1, row + out_offset); + + out_length = (xc1 - xc0 + 1) * abs(colorspace) + out_offset; + out_offset = out_length & 3; + + out_ascii85(row, out_length, y == yc1); + + if (out_offset > 0) + memcpy(row, row + out_length - out_offset, out_offset); + } +#else + for (y = yc0; y <= yc1; y ++) + { + cupsImageGetRow(img, xc0, y, xc1 - xc0 + 1, row); + + out_length = (xc1 - xc0 + 1) * abs(colorspace); + +#ifdef OUT_AS_HEX + out_hex(row, out_length, y == yc1); +#else + out_bin(row, out_length, y == yc1); +#endif + } +#endif + length = currentOffset - startOffset; + outPdf("\nendstream\nendobj\n"); + + /* out length object */ + setOffset(lengthObj); + snprintf(linebuf,LINEBUFSIZE, + "%d 0 obj %d endobj\n",lengthObj,length); + outPdf(linebuf); +} + +/* + * 'main()' - Main entry... + */ + +int /* O - Exit status */ +main(int argc, /* I - Number of command-line arguments */ + char *argv[]) /* I - Command-line arguments */ +{ + ppd_choice_t *choice; /* PPD option choice */ + int num_options; /* Number of print options */ + cups_option_t *options; /* Print options */ + const char *val; /* Option value */ + float zoom; /* Zoom facter */ + int xppi, yppi; /* Pixels-per-inch */ + int hue, sat; /* Hue and saturation adjustment */ + int emit_jcl; + char filename[1024]; /* Name of file to print */ + int deviceCopies = 1; + int deviceCollate = 0; + int deviceReverse = 0; + ppd_attr_t *attr; + int pl,pr; + + /* + * Make sure status messages are not buffered... + */ + + setbuf(stderr, NULL); + + /* + * Check command-line... + */ + + if (argc < 6 || argc > 7) + { + fputs("ERROR: imagetopdf job-id user title copies options [file]\n", stderr); + return (1); + } + + title = argv[3]; +#ifdef DEBUG + fprintf(stderr, "INFO: %s %s %s %s %s %s %s\n", argv[0], argv[1], argv[2], + argv[3], argv[4], argv[5], argv[6] ? argv[6] : "(null)"); +#endif + + /* + * Copy stdin as needed... + */ + + if (argc == 6) + { + int fd; /* File to write to */ + char buffer[8192]; /* Buffer to read into */ + int bytes; /* # of bytes to read */ + + + if ((fd = cupsTempFd(filename, sizeof(filename))) < 0) + { + perror("ERROR: Unable to copy image file"); + return (1); + } + +#ifdef DEBUG + fprintf(stderr, "DEBUG: imagetopdf - copying to temp print file \"%s\"\n", + filename); +#endif + + while ((bytes = fread(buffer, 1, sizeof(buffer), stdin)) > 0) + write(fd, buffer, bytes); + + close(fd); + } + else + { + strncpy(filename, argv[6], sizeof(filename)); + } + + /* + * Process command-line options and write the prolog... + */ + + zoom = 0.0; + xppi = 0; + yppi = 0; + hue = 0; + sat = 100; + + Copies = atoi(argv[4]); + + options = NULL; + num_options = cupsParseOptions(argv[5], 0, &options); + + ppd = SetCommonOptions(num_options, options, 0); + + if (Copies == 1 + && (choice = ppdFindMarkedChoice(ppd,"Copies")) != NULL) { + Copies = atoi(choice->choice); + } + if (Copies == 0) Copies = 1; + if ((val = cupsGetOption("Duplex",num_options,options)) != 0 && + (!strcasecmp(val, "true") || !strcasecmp(val, "on") || + !strcasecmp(val, "yes"))) { + /* for compatiblity */ + if (ppdFindOption(ppd,"Duplex") != NULL) { + ppdMarkOption(ppd,"Duplex","True"); + ppdMarkOption(ppd,"Duplex","On"); + Duplex = 1; + } + } else if ((val = cupsGetOption("sides",num_options,options)) != 0 && + (!strcasecmp(val, "two-sided-long-edge") || + !strcasecmp(val, "two-sided-short-edge"))) { + /* for compatiblity */ + if (ppdFindOption(ppd,"Duplex") != NULL) { + ppdMarkOption(ppd,"Duplex","True"); + ppdMarkOption(ppd,"Duplex","On"); + Duplex = 1; + } + } + + + if ((val = cupsGetOption("OutputOrder",num_options,options)) != 0) { + if (!strcasecmp(val, "Reverse")) { + Reverse = 1; + } + } else if (ppd) { + /* + * Figure out the right default output order from the PPD file... + */ + + if ((choice = ppdFindMarkedChoice(ppd,"OutputOrder")) != 0) { + Reverse = !strcasecmp(choice->choice,"Reverse"); + } else if ((choice = ppdFindMarkedChoice(ppd,"OutputBin")) != 0 && + (attr = ppdFindAttr(ppd,"PageStackOrder",choice->choice)) != 0 && + attr->value) { + Reverse = !strcasecmp(attr->value,"Reverse"); + } else if ((attr = ppdFindAttr(ppd,"DefaultOutputOrder",0)) != 0 && + attr->value) { + Reverse = !strcasecmp(attr->value,"Reverse"); + } + } + + /* adujst to even page when duplex */ + if (((val = cupsGetOption("cupsEvenDuplex",num_options,options)) != 0 && + (!strcasecmp(val, "true") || !strcasecmp(val, "on") || + !strcasecmp(val, "yes"))) || + ((attr = ppdFindAttr(ppd,"cupsEvenDuplex",0)) != 0 && + (!strcasecmp(attr->value, "true") + || !strcasecmp(attr->value, "on") || + !strcasecmp(attr->value, "yes")))) { + EvenDuplex = 1; + } + + if ((val = cupsGetOption("multiple-document-handling", num_options, options)) != NULL) + { + /* + * This IPP attribute is unnecessarily complicated... + * + * single-document, separate-documents-collated-copies, and + * single-document-new-sheet all require collated copies. + * + * separate-documents-uncollated-copies allows for uncollated copies. + */ + + Collate = strcasecmp(val, "separate-documents-uncollated-copies") != 0; + } + + if ((val = cupsGetOption("Collate", num_options, options)) != NULL) { + if (strcasecmp(val, "True") == 0) { + Collate = 1; + } + } else { + if ((choice = ppdFindMarkedChoice(ppd,"Collate")) != NULL + && (!strcasecmp(choice->choice,"true") + || !strcasecmp(choice->choice, "on") + || !strcasecmp(choice->choice, "yes"))) { + Collate = 1; + } + } + + if ((val = cupsGetOption("gamma", num_options, options)) != NULL) + gammaval = atoi(val) * 0.001f; + + if ((val = cupsGetOption("brightness", num_options, options)) != NULL) + brightness = atoi(val) * 0.01f; + + if ((val = cupsGetOption("scaling", num_options, options)) != NULL) + zoom = atoi(val) * 0.01; + else if (cupsGetOption("fitplot", num_options, options)) + zoom = 1.0; + + if ((val = cupsGetOption("ppi", num_options, options)) != NULL) + if (sscanf(val, "%dx%d", &xppi, &yppi) < 2) + yppi = xppi; + + if ((val = cupsGetOption("position", num_options, options)) != NULL) + { + if (strcasecmp(val, "center") == 0) + { + XPosition = 0; + YPosition = 0; + } + else if (strcasecmp(val, "top") == 0) + { + XPosition = 0; + YPosition = 1; + } + else if (strcasecmp(val, "left") == 0) + { + XPosition = -1; + YPosition = 0; + } + else if (strcasecmp(val, "right") == 0) + { + XPosition = 1; + YPosition = 0; + } + else if (strcasecmp(val, "top-left") == 0) + { + XPosition = -1; + YPosition = 1; + } + else if (strcasecmp(val, "top-right") == 0) + { + XPosition = 1; + YPosition = 1; + } + else if (strcasecmp(val, "bottom") == 0) + { + XPosition = 0; + YPosition = -1; + } + else if (strcasecmp(val, "bottom-left") == 0) + { + XPosition = -1; + YPosition = -1; + } + else if (strcasecmp(val, "bottom-right") == 0) + { + XPosition = 1; + YPosition = -1; + } + } + + if ((val = cupsGetOption("saturation", num_options, options)) != NULL) + sat = atoi(val); + + if ((val = cupsGetOption("hue", num_options, options)) != NULL) + hue = atoi(val); + + if ((val = cupsGetOption("mirror", num_options, options)) != NULL && + strcasecmp(val, "True") == 0) + Flip = 1; + + if ((val = cupsGetOption("emit-jcl", num_options, options)) != NULL && + (!strcasecmp(val, "false") || !strcasecmp(val, "off") || + !strcasecmp(val, "no") || !strcmp(val, "0"))) + emit_jcl = 0; + else + emit_jcl = 1; + + + + /* + * Open the input image to print... + */ + + colorspace = ColorDevice ? CUPS_IMAGE_RGB_CMYK : CUPS_IMAGE_WHITE; + + img = cupsImageOpen(filename, colorspace, CUPS_IMAGE_WHITE, sat, hue, NULL); + +#if defined(USE_CONVERT_CMD) && defined(CONVERT_CMD) + if (img == NULL) { + char filename2[1024]; + int fd2; + + if ((fd2 = cupsTempFd(filename2, sizeof(filename2))) < 0) + { + perror("ERROR: Unable to copy image file"); + return (1); + } + close(fd2); + snprintf(linebuf,LINEBUFSIZE, + CONVERT_CMD + " %s png:%s",filename, filename2); + if (system(linebuf) != 0) { + unlink(filename2); + perror("ERROR: Unable to copy image file"); + return (1); + } + img = cupsImageOpen(filename2, colorspace, + CUPS_IMAGE_WHITE, sat, hue, NULL); + unlink(filename2); + } +#endif + if (argc == 6) + unlink(filename); + + if (img == NULL) + { + fputs("ERROR: Unable to open image file for printing!\n", stderr); + ppdClose(ppd); + return (1); + } + + colorspace = cupsImageGetColorSpace(img); + + /* + * Scale as necessary... + */ + + if (zoom == 0.0 && xppi == 0) + { + xppi = cupsImageGetXPPI(img); + yppi = cupsImageGetYPPI(img); + } + + if (yppi == 0) + yppi = xppi; + +#ifdef DEBUG + fprintf(stderr, "DEBUG: Before scaling: xppi=%d, yppi=%d, zoom=%.2f\n", + xppi, yppi, zoom); +#endif + + if (xppi > 0) + { + /* + * Scale the image as neccesary to match the desired pixels-per-inch. + */ + + if (Orientation & 1) + { + xprint = (PageTop - PageBottom) / 72.0; + yprint = (PageRight - PageLeft) / 72.0; + } + else + { + xprint = (PageRight - PageLeft) / 72.0; + yprint = (PageTop - PageBottom) / 72.0; + } + +#ifdef DEBUG + fprintf(stderr, "DEBUG: Before scaling: xprint=%.1f, yprint=%.1f\n", + xprint, yprint); +#endif + + xinches = (float)cupsImageGetWidth(img) / (float)xppi; + yinches = (float)cupsImageGetHeight(img) / (float)yppi; + +#ifdef DEBUG + fprintf(stderr, "DEBUG: Image size is %.1f x %.1f inches...\n", + xinches, yinches); +#endif + + if ((val = cupsGetOption("natural-scaling", num_options, options)) != NULL) + { + xinches = xinches * atoi(val) / 100; + yinches = yinches * atoi(val) / 100; + } + + if (cupsGetOption("orientation-requested", num_options, options) == NULL && + cupsGetOption("landscape", num_options, options) == NULL) + { + /* + * Rotate the image if it will fit landscape but not portrait... + */ + +#ifdef DEBUG + fputs("DEBUG: Auto orientation...\n", stderr); +#endif + + if ((xinches > xprint || yinches > yprint) && + xinches <= yprint && yinches <= xprint) + { + /* + * Rotate the image as needed... + */ + +#ifdef DEBUG + fputs("DEBUG: Using landscape orientation...\n", stderr); +#endif + + Orientation = (Orientation + 1) & 3; + xsize = yprint; + yprint = xprint; + xprint = xsize; + } + } + } + else + { + /* + * Scale percentage of page size... + */ + + xprint = (PageRight - PageLeft) / 72.0; + yprint = (PageTop - PageBottom) / 72.0; + aspect = (float)cupsImageGetYPPI(img) / (float)cupsImageGetXPPI(img); + +#ifdef DEBUG + fprintf(stderr, "DEBUG: Before scaling: xprint=%.1f, yprint=%.1f\n", + xprint, yprint); + + fprintf(stderr, "DEBUG: cupsImageGetXPPI(img) = %d, cupsImageGetYPPI(img) = %d, aspect = %f\n", + cupsImageGetXPPI(img), cupsImageGetYPPI(img), aspect); +#endif + + xsize = xprint * zoom; + ysize = xsize * cupsImageGetHeight(img) / cupsImageGetWidth(img) / aspect; + + if (ysize > (yprint * zoom)) + { + ysize = yprint * zoom; + xsize = ysize * cupsImageGetWidth(img) * aspect / cupsImageGetHeight(img); + } + + xsize2 = yprint * zoom; + ysize2 = xsize2 * cupsImageGetHeight(img) / cupsImageGetWidth(img) / aspect; + + if (ysize2 > (xprint * zoom)) + { + ysize2 = xprint * zoom; + xsize2 = ysize2 * cupsImageGetWidth(img) * aspect / cupsImageGetHeight(img); + } + +#ifdef DEBUG + fprintf(stderr, "DEBUG: Portrait size is %.2f x %.2f inches\n", xsize, ysize); + fprintf(stderr, "DEBUG: Landscape size is %.2f x %.2f inches\n", xsize2, ysize2); +#endif + + if (cupsGetOption("orientation-requested", num_options, options) == NULL && + cupsGetOption("landscape", num_options, options) == NULL) + { + /* + * Choose the rotation with the largest area, but prefer + * portrait if they are equal... + */ + +#ifdef DEBUG + fputs("DEBUG: Auto orientation...\n", stderr); +#endif + + if ((xsize * ysize) < (xsize2 * xsize2)) + { + /* + * Do landscape orientation... + */ + +#ifdef DEBUG + fputs("DEBUG: Using landscape orientation...\n", stderr); +#endif + + Orientation = 1; + xinches = xsize2; + yinches = ysize2; + xprint = (PageTop - PageBottom) / 72.0; + yprint = (PageRight - PageLeft) / 72.0; + } + else + { + /* + * Do portrait orientation... + */ + +#ifdef DEBUG + fputs("DEBUG: Using portrait orientation...\n", stderr); +#endif + + Orientation = 0; + xinches = xsize; + yinches = ysize; + } + } + else if (Orientation & 1) + { +#ifdef DEBUG + fputs("DEBUG: Using landscape orientation...\n", stderr); +#endif + + xinches = xsize2; + yinches = ysize2; + xprint = (PageTop - PageBottom) / 72.0; + yprint = (PageRight - PageLeft) / 72.0; + } + else + { +#ifdef DEBUG + fputs("DEBUG: Using portrait orientation...\n", stderr); +#endif + + xinches = xsize; + yinches = ysize; + xprint = (PageRight - PageLeft) / 72.0; + yprint = (PageTop - PageBottom) / 72.0; + } + } + + /* + * Compute the number of pages to print and the size of the image on each + * page... + */ + + if (zoom == 1.0) { + /* If fitplot is specified, make xpages, ypages 1 forcedly. + Because calculation error may be caused and + result of ceil function may be larger than 1. + */ + xpages = ypages = 1; + } else { + xpages = ceil(xinches / xprint); + ypages = ceil(yinches / yprint); + } + + xprint = xinches / xpages; + yprint = yinches / ypages; + +#ifdef DEBUG + fprintf(stderr, "DEBUG: xpages = %dx%.2fin, ypages = %dx%.2fin\n", + xpages, xprint, ypages, yprint); +#endif + + /* + * Update the page size for custom sizes... + */ + + if ((choice = ppdFindMarkedChoice(ppd, "PageSize")) != NULL && + strcasecmp(choice->choice, "Custom") == 0) + { + float width, /* New width in points */ + length; /* New length in points */ + char s[255]; /* New custom page size... */ + + + /* + * Use the correct width and length for the current orientation... + */ + + if (Orientation & 1) + { + width = yprint * 72.0; + length = xprint * 72.0; + } + else + { + width = xprint * 72.0; + length = yprint * 72.0; + } + + /* + * Add margins to page size... + */ + + width += ppd->custom_margins[0] + ppd->custom_margins[2]; + length += ppd->custom_margins[1] + ppd->custom_margins[3]; + + /* + * Enforce minimums... + */ + + if (width < ppd->custom_min[0]) + width = ppd->custom_min[0]; + + if (length < ppd->custom_min[1]) + length = ppd->custom_min[1]; + +#ifdef DEBUG + fprintf(stderr, "DEBUG: Updated custom page size to %.2f x %.2f inches...\n", + width / 72.0, length / 72.0); +#endif + + /* + * Set the new custom size... + */ + + sprintf(s, "Custom.%.0fx%.0f", width, length); + ppdMarkOption(ppd, "PageSize", s); + + /* + * Update page variables... + */ + + PageWidth = width; + PageLength = length; + PageLeft = ppd->custom_margins[0]; + PageRight = width - ppd->custom_margins[2]; + PageBottom = ppd->custom_margins[1]; + PageTop = length - ppd->custom_margins[3]; + } + + if (Copies == 1) { + /* collate is not needed */ + Collate = 0; + ppdMarkOption(ppd,"Collate","False"); + } + if (!Duplex) { + /* evenDuplex is not needed */ + EvenDuplex = 0; + } + + /* check collate device */ + if (Collate) { + if ((choice = ppdFindMarkedChoice(ppd,"Collate")) != NULL && + !strcasecmp(choice->choice,"true")) { + ppd_option_t *opt; + + if ((opt = ppdFindOption(ppd,"Collate")) != NULL && + !opt->conflicted) { + deviceCollate = 1; + } else { + ppdMarkOption(ppd,"Collate","False"); + } + } + } + /* check OutputOrder device */ + if (Reverse) { + if (ppdFindOption(ppd,"OutputOrder") != NULL) { + deviceReverse = 1; + } + } + if (ppd != NULL && + !ppd->manual_copies && Collate && !deviceCollate) { + /* Copying by device , software collate is impossible */ + /* Enable software copying */ + ppd->manual_copies = 1; + } + if (Copies > 1 && (ppd == NULL || ppd->manual_copies) + && Duplex) { + /* Enable software collate , or same pages are printed in both sides */ + Collate = 1; + if (deviceCollate) { + deviceCollate = 0; + ppdMarkOption(ppd,"Collate","False"); + } + } + if (Duplex && Collate && !deviceCollate) { + /* Enable evenDuplex or the first page may be printed other side of the + end of precedings */ + EvenDuplex = 1; + } + if (Duplex && Reverse && !deviceReverse) { + /* Enable evenDuplex or the first page may be empty. */ + EvenDuplex = 1; + } + /* change feature for software */ + if (deviceCollate) { + Collate = 0; + } + if (deviceReverse) { + Reverse = 0; + } + if (ppd != NULL) { + if (ppd->manual_copies) { + /* sure disable hardware copying */ + ppdMarkOption(ppd,"Copies","1"); + ppdMarkOption(ppd,"JCLCopies","1"); + } else { + /* change for hardware copying */ + deviceCopies = Copies; + Copies = 1; + } + } + + /* + * See if we need to collate, and if so how we need to do it... + */ + + if (xpages == 1 && ypages == 1 + && (Collate || deviceCollate) && !EvenDuplex) { + /* collate is not needed, disable it */ + deviceCollate = 0; + Collate = 0; + ppdMarkOption(ppd,"Collate","False"); + } + + if (((xpages*ypages) % 2) == 0) { + /* even pages, disable EvenDuplex */ + EvenDuplex = 0; + } + + /* + * Write any "exit server" options that have been selected... + */ + + ppdEmit(ppd, stdout, PPD_ORDER_EXIT); + + /* + * Write any JCL commands that are needed to print PostScript code... + */ + + if (emit_jcl) { + ppdEmitJCL(ppd, stdout, atoi(argv[1]), argv[2], argv[3]); + emitJCLOptions(stdout,deviceCopies); + } + + /* + * Start sending the document with any commands needed... + */ + + outPrologue(Copies*xpages*ypages+(EvenDuplex ? 1 : 0)); + + /* + * Output the pages... + */ + + row = malloc(cupsImageGetWidth(img) * abs(colorspace) + 3); + +#ifdef DEBUG + fprintf(stderr, "DEBUG: XPosition=%d, YPosition=%d, Orientation=%d\n", + XPosition, YPosition, Orientation); + fprintf(stderr, "DEBUG: xprint=%.0f, yprint=%.0f\n", xprint, yprint); + fprintf(stderr, "DEBUG: PageLeft=%.0f, PageRight=%.0f, PageWidth=%.0f\n", + PageLeft, PageRight, PageWidth); + fprintf(stderr, "DEBUG: PageBottom=%.0f, PageTop=%.0f, PageLength=%.0f\n", + PageBottom, PageTop, PageLength); +#endif + + if (Flip) { + pr = PageWidth - PageLeft; + pl = PageWidth - PageRight; + } else { + pr = PageRight; + pl = PageLeft; + } + + switch (Orientation) + { + default : + switch (XPosition) + { + case -1 : + left = pl; + break; + default : + left = (pr + pl - xprint * 72) / 2; + break; + case 1 : + left = pr - xprint * 72; + break; + } + + switch (YPosition) + { + case -1 : + top = PageBottom; + break; + default : + top = (PageTop + PageBottom - yprint * 72) / 2; + break; + case 1 : + top = PageTop - yprint * 72;; + break; + } + break; + + case 1 : + switch (XPosition) + { + case -1 : + left = PageBottom; + break; + default : + left = (PageTop + PageBottom - xprint * 72) / 2; + break; + case 1 : + left = PageTop - xprint * 72; + break; + } + + switch (YPosition) + { + case -1 : + top = pl; + break; + default : + top = (pr + pl - yprint * 72) / 2; + break; + case 1 : + top = pr - yprint * 72;; + break; + } + break; + + case 2 : + switch (XPosition) + { + case -1 : + left = pr - xprint * 72; + break; + default : + left = (pr + pl - xprint * 72) / 2; + break; + case 1 : + left = pl; + break; + } + + switch (YPosition) + { + case -1 : + top = PageTop - yprint * 72; + break; + default : + top = (PageTop + PageBottom - yprint * 72) / 2; + break; + case 1 : + top = PageBottom; + break; + } + break; + + case 3 : + switch (XPosition) + { + case -1 : + left = PageTop - xprint * 72; + break; + default : + left = (PageTop + PageBottom - xprint * 72) / 2; + break; + case 1 : + left = PageBottom; + break; + } + + switch (YPosition) + { + case -1 : + top = pr - yprint * 72;; + break; + default : + top = (pr + pl - yprint * 72) / 2; + break; + case 1 : + top = pl; + break; + } + break; + } + +#ifdef DEBUG + fprintf(stderr, "DEBUG: left=%.2f, top=%.2f\n", left, top); +#endif + + if (Collate) + { + int *contentsObjs; + int *imgObjs; + + if ((contentsObjs = malloc(sizeof(int)*xpages*ypages)) == NULL) + { + fprintf(stderr,"ERROR: Can't allocate contentsObjs\n"); + exit(2); + } + if ((imgObjs = malloc(sizeof(int)*xpages*ypages)) == NULL) + { + fprintf(stderr,"ERROR: Can't allocate imgObjs\n"); + exit(2); + } + for (xpage = 0; xpage < xpages; xpage ++) + for (ypage = 0; ypage < ypages; ypage ++) + { + int imgObj; + int contentsObj; + + contentsObj = contentsObjs[ypages*xpage+ypage] = newObj(); + imgObj = imgObjs[ypages*xpage+ypage] = newObj(); + + /* out contents object */ + outPageContents(contentsObj); + + /* out image object */ + outImage(imgObj); + } + for (page = 0; Copies > 0 ; Copies --) { + for (xpage = 0; xpage < xpages; xpage ++) + for (ypage = 0; ypage < ypages; ypage ++, page ++) + { + /* out Page Object */ + outPageObject(pageObjects[page], + contentsObjs[ypages*xpage+ypage], + imgObjs[ypages*xpage+ypage]); + } + if (EvenDuplex) { + /* out empty page */ + outPageObject(pageObjects[page],-1,-1); + } + } + free(contentsObjs); + free(imgObjs); + } + else { + for (page = 0, xpage = 0; xpage < xpages; xpage ++) + for (ypage = 0; ypage < ypages; ypage ++) + { + int imgObj; + int contentsObj; + int p; + + imgObj = newObj(); + contentsObj = newObj(); + + /* out contents object */ + outPageContents(contentsObj); + + /* out image object */ + outImage(imgObj); + + for (p = 0;p < Copies;p++, page++) + { + /* out Page Object */ + outPageObject(pageObjects[page],contentsObj,imgObj); + } + } + if (EvenDuplex) { + /* out empty pages */ + int p; + + for (p = 0;p < Copies;p++, page++) + { + outPageObject(pageObjects[page],-1,-1); + } + } + } + + outXref(); + outTrailer(); + freeAllObj(); + /* + * Close files... + */ + +#ifndef CUPS_1_1 + if (emit_jcl) + { + if (ppd && ppd->jcl_end) + ppdEmitJCLEnd(ppd, stdout); + } +#endif + + cupsImageClose(img); + ppdClose(ppd); + + return (0); +} + +#ifdef OUT_AS_HEX +/* + * 'out_hex()' - Print binary data as a series of hexadecimal numbers. + */ + +static void +out_hex(cups_ib_t *data, /* I - Data to print */ + int length, /* I - Number of bytes to print */ + int last_line) /* I - Last line of raster data? */ +{ + static int col = 0; /* Current column */ + static char *hex = "0123456789ABCDEF"; + /* Hex digits */ + + + while (length > 0) + { + /* + * Put the hex chars out to the file; note that we don't use printf() + * for speed reasons... + */ + + putcPdf(hex[*data >> 4]); + putcPdf(hex[*data & 15]); + + data ++; + length --; + + col += 2; + if (col > 78) + { + putcPdf('\n'); + col = 0; + } + } + + if (last_line && col) + { + putcPdf('\n'); + col = 0; + } +} +#else + +#ifdef OUT_AS_ASCII85 +/* + * 'out_ascii85()' - Print binary data as a series of base-85 numbers. + */ + +static void +out_ascii85(cups_ib_t *data, /* I - Data to print */ + int length, /* I - Number of bytes to print */ + int last_line) /* I - Last line of raster data? */ +{ + unsigned b; /* Binary data word */ + unsigned char c[6]; /* ASCII85 encoded chars */ + static int col = 0; /* Current column */ + + + c[5] = '\0'; /* end mark */ + while (length > 3) + { + b = (((((data[0] << 8) | data[1]) << 8) | data[2]) << 8) | data[3]; + + if (b == 0) + { + putcPdf('z'); + col ++; + } + else + { + c[4] = (b % 85) + '!'; + b /= 85; + c[3] = (b % 85) + '!'; + b /= 85; + c[2] = (b % 85) + '!'; + b /= 85; + c[1] = (b % 85) + '!'; + b /= 85; + c[0] = b + '!'; + + outPdf(c); + col += 5; + } + + data += 4; + length -= 4; + + if (col >= 75) + { + putcPdf('\n'); + col = 0; + } + } + + if (last_line) + { + if (length > 0) + { + memset(data + length, 0, 4 - length); + b = (((((data[0] << 8) | data[1]) << 8) | data[2]) << 8) | data[3]; + + c[4] = (b % 85) + '!'; + b /= 85; + c[3] = (b % 85) + '!'; + b /= 85; + c[2] = (b % 85) + '!'; + b /= 85; + c[1] = (b % 85) + '!'; + b /= 85; + c[0] = b + '!'; + + c[length+1] = '\0'; + outPdf(c); + } + + outPdf("~>"); + col = 0; + } +} +#else +/* + * 'out_bin()' - Print binary data as binary. + */ + +static void +out_bin(cups_ib_t *data, /* I - Data to print */ + int length, /* I - Number of bytes to print */ + int last_line) /* I - Last line of raster data? */ +{ + while (length > 0) + { + putcPdf(*data); + data ++; + length --; + } + + if (last_line) + { + putcPdf('\n'); + } +} +#endif +#endif --- cups-1.3.8.orig/debian/local/filters/pdf-filters/filter/test_pdf1.c +++ cups-1.3.8/debian/local/filters/pdf-filters/filter/test_pdf1.c @@ -0,0 +1,51 @@ +#include "pdfutils.h" +#include <assert.h> + +int main() +{ + pdfOut *pdf; + + pdf=pdfOut_new(); + assert(pdf); + + pdfOut_begin_pdf(pdf); + + // bad font + int font_obj=pdfOut_add_xref(pdf); + pdfOut_printf(pdf,"%d 0 obj\n" + "<</Type/Font\n" + " /Subtype /Type1\n" // /TrueType,/Type3 + " /BaseFont /%s\n" + ">>\n" + "endobj\n" + ,font_obj,"Courier"); + // test + const int PageWidth=595,PageLength=842; + int cobj=pdfOut_add_xref(pdf); + const char buf[]="BT /a 10 Tf (abc) Tj ET"; + pdfOut_printf(pdf,"%d 0 obj\n" + "<</Length %d\n" + ">>\n" + "stream\n" + "%s\n" + "endstream\n" + "endobj\n" + ,cobj,strlen(buf),buf); + + int obj=pdfOut_add_xref(pdf); + pdfOut_printf(pdf,"%d 0 obj\n" + "<</Type/Page\n" + " /Parent 1 0 R\n" + " /MediaBox [0 0 %d %d]\n" + " /Contents %d 0 R\n" + " /Resources << /Font << /a %d 0 R >> >>\n" + ">>\n" + "endobj\n" + ,obj,PageWidth,PageLength,cobj,font_obj); // TODO: into pdf-> + pdfOut_add_page(pdf,obj); + pdfOut_finish_pdf(pdf); + + pdfOut_free(pdf); + + return 0; +} --- cups-1.3.8.orig/debian/local/filters/pdf-filters/filter/fontembed/README +++ cups-1.3.8/debian/local/filters/pdf-filters/filter/fontembed/README @@ -0,0 +1,40 @@ +libfontembed - font embedding and subsetting library +---------------------------------------------------- + +This library implements all the stuff required to +embed and subset TrueType fonts, as for example +required in PDF files. It is completely self-contained, +although a FreeType binding might come sometime in the future. + +Currently only glyf-flavored TrueType is supported, +but OTF, i.e. CFF-flavored TrueType/OpenType is on the way. +Also reencoding and conversion of Type1 to CFF is planned. +PostScript embedding is another goal of the project. + +Usage +----- +(TODO)... see test_pdf.c ... + + +License (MIT) +------------- +Copyright (c) 2008 by Tobias Hoffmann. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --- cups-1.3.8.orig/debian/local/filters/pdf-filters/filter/fontembed/embed_sfnt.c +++ cups-1.3.8/debian/local/filters/pdf-filters/filter/fontembed/embed_sfnt.c @@ -0,0 +1,596 @@ +#include "embed.h" +#include "sfnt.h" +#include "sfnt_int.h" +#include <assert.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +// from embed.c +EMB_PDF_FONTWIDTHS *emb_pdf_fw_new(int datasize); + +EMB_RIGHT_TYPE emb_otf_get_rights(OTF_FILE *otf) // {{{ +{ + EMB_RIGHT_TYPE ret=EMB_RIGHT_FULL; + + int len; + char *os2=otf_get_table(otf,OTF_TAG('O','S','/','2'),&len); + if (os2) { + const unsigned short os2_version=get_USHORT(os2); + // check len + assert( (os2_version!=0x0000)||(len==78) ); + assert( (os2_version!=0x0001)||(len==86) ); + assert( (os2_version<0x0002)||(os2_version>0x0004)||(len==96) ); + if (os2_version<=0x0004) { + // get rights + unsigned short fsType=get_USHORT(os2+8); + ret=fsType&0x0200; + if ((fsType&0x0f)==0x0002) { + ret|=EMB_RIGHT_NONE; + } else if ((fsType&0x0f)==0x0004) { + ret|=EMB_RIGHT_READONLY; + } + } + free(os2); + } + return ret; +} +// }}} + +// NOTE: statically allocated buffer +const char *emb_otf_get_fontname(OTF_FILE *otf) // {{{ +{ + static char fontname[64]; + + int len; + const char *fname=otf_get_name(otf,3,1,0x409,6,&len); // microsoft + if (fname) { + int iA,iB=0; + for (iA=0;(iA<63)&&(iA*2<len);iA++) { + if ( (fname[2*iA]==0)&& + (fname[2*iA+1]>=33)&&(fname[2*iA+1]<=126)&& + (!strchr("[](){}<>/%",fname[iA*2+1])) ) { + fontname[iB++]=fname[iA*2+1]; + } + } + fontname[iB]=0; + } else if ((fname=otf_get_name(otf,1,0,0,6,&len))) { // mac + int iA,iB=0; + for (iA=0;(iA<63)&&(iA<len);iA++) { + if ( (fname[iA]>=33)&&(fname[iA]<=126)&& + (!strchr("[](){}<>/%",fname[iA])) ) { + fontname[iB++]=fname[iA]; + } + } + fontname[iB]=0; + } else { + fontname[0]=0; + } + if (!*fontname) { + // TODO construct a fontname, eg from */*/*/4 + fprintf(stderr,"WARNING: no fontName\n"); + } + return fontname; +} +// }}} + +void emb_otf_get_pdf_fontdescr(OTF_FILE *otf,EMB_PDF_FONTDESCR *ret) // {{{ +{ + int len; + +// TODO +// ... fill in struct + char *head=otf_get_table(otf,OTF_TAG('h','e','a','d'),&len); + assert(head); // version is 1.0 from otf_load + ret->bbxmin=get_SHORT(head+36)*1000/otf->unitsPerEm; + ret->bbymin=get_SHORT(head+38)*1000/otf->unitsPerEm; + ret->bbxmax=get_SHORT(head+40)*1000/otf->unitsPerEm; + ret->bbymax=get_SHORT(head+42)*1000/otf->unitsPerEm; + const int macStyle=get_USHORT(head+44); + free(head); + + char *post=otf_get_table(otf,OTF_TAG('p','o','s','t'),&len); + assert(post); + const unsigned int post_version=get_ULONG(post); + // check length + assert( (post_version!=0x00010000)||(len==32) ); + assert( (post_version!=0x00020000)||(len>=34+2*otf->numGlyphs) ); + assert( (post_version!=0x00025000)||(len==35+otf->numGlyphs) ); + assert( (post_version!=0x00030000)||(len==32) ); + assert( (post_version!=0x00020000)||(get_USHORT(post+32)==otf->numGlyphs) ); +// assert( (post_version==0x00030000)==(!!(otf->flags&OTF_F_FMT_CFF)) ); // ghostscript embedding does this.. + // TODO: v4 (apple) : uint16 reencoding[numGlyphs] + if ( (post_version==0x00010000)|| + (post_version==0x00020000)|| + (post_version==0x00025000)|| + (post_version==0x00030000) ) { + ret->italicAngle=get_LONG(post+4)>>16; + if (get_ULONG(post+12)>0) { // monospaced + ret->flags|=1; + } + } else { + fprintf(stderr,"WARNING: no italicAngle, no monospaced flag\n"); + } + free(post); + + char *os2=otf_get_table(otf,OTF_TAG('O','S','/','2'),&len); + if (os2) { + const unsigned short os2_version=get_USHORT(os2); + // check len + assert( (os2_version!=0x0000)||(len==78) ); + assert( (os2_version!=0x0001)||(len==86) ); + assert( (os2_version<0x0002)||(os2_version>0x0004)||(len==96) ); + if (os2_version<=0x0004) { + + // from PDF14Deltas.pdf, pg 113 + const int weightClass=get_USHORT(os2+4); + ret->stemV=50+weightClass*weightClass/(65*65); // TODO, really bad +//printf("a %d\n",weightClass); + + if (ret->supplement>=0) { // cid + ret->panose=ret->data; + memcpy(ret->panose,os2+30,12); // sFamilyClass + panose + } + const unsigned short fsSelection=get_USHORT(os2+62); + if (fsSelection&0x01) { // italic + ret->flags|=0x0040; + } + if ( (fsSelection&0x10)&&(weightClass>600) ) { // force bold + ret->flags|=0x0400; + } + const unsigned char family_class=get_USHORT(os2+30)>>8; + if (family_class==10) { // script + ret->flags|=0x0008; + } + if (family_class!=8) { // not sans-serif + ret->flags|=0x0002; + } + + ret->avgWidth=get_SHORT(os2+2); + ret->ascend=get_SHORT(os2+68)*1000/otf->unitsPerEm; + ret->descend=get_SHORT(os2+70)*1000/otf->unitsPerEm; + if (os2_version>=0x0002) { + ret->xHeight=get_SHORT(os2+86)*1000/otf->unitsPerEm; + ret->capHeight=get_SHORT(os2+88)*1000/otf->unitsPerEm; + } // else capHeight fixed later + } else { + free(os2); + os2=NULL; + } + } else { + fprintf(stderr,"WARNING: no OS/2 table\n"); + // e.g. subsetted font from ghostscript // e.g. CFF + } + if (os2) { + free(os2); + } else { // TODO (if(CFF)) + fprintf(stderr,"WARNING: no ascend/descend, capHeight, stemV, flags\n"); + if (macStyle&0x01) { // force bold - just do it on bold + ret->flags|=0x0400; + } + if (macStyle&0x02) { // italic + ret->flags|=0x0004; + } + // ... flags TODO? (Serif, Script, Italic, AllCap,SmallCap, ForceBold) + } + +// ? maybe get ascend,descend,capHeight,xHeight,stemV directly from cff + // Fallbacks + if ( (!ret->ascend)||(!ret->descend) ) { + char *hhea=otf_get_table(otf,OTF_TAG('h','h','e','a'),&len); + if (hhea) { + ret->ascend=get_SHORT(hhea+4)*1000/otf->unitsPerEm; + ret->descend=get_SHORT(hhea+6)*1000/otf->unitsPerEm; + } + free(hhea); + } + if (!ret->stemV) { // TODO? use name + const unsigned short d_gid=otf_from_unicode(otf,'.'); + if (d_gid) { // stemV=bbox['.'].width; + len=otf_get_glyph(otf,d_gid); + assert(len>=10); + ret->stemV=(get_SHORT(otf->gly+6)-get_SHORT(otf->gly+2))*1000/otf->unitsPerEm; + } else { + if (macStyle&1) { // bold + ret->stemV=165; + } else { + ret->stemV=109; // TODO... unserious values... + } + } + } + if (!ret->capHeight) { // TODO? only reqd. for fonts with latin... + ret->capHeight=ret->ascend; + } + if (0) { // TODO? uses only adobe latin standard? ?? e.g. Type1 + ret->flags|=0x0020; + } else { + ret->flags|=0x0004; + } + // TODO SmallCap by font name(?) + +// TODO ; ? cid ? +} +// }}} + +EMB_PDF_FONTWIDTHS *emb_otf_get_pdf_widths(OTF_FILE *otf,const unsigned short *encoding,int len,const BITSET glyphs) // {{{ glyphs==NULL -> all from 0 to len +{ + assert(otf); + + int first=len,last=0; + int iA; + + if (glyphs) { + for (iA=0;iA<len;iA++) { + const int gid=(encoding)?encoding[iA]:otf_from_unicode(otf,iA); // TODO + if (bit_check(glyphs,gid)) { + if (first>iA) { + first=iA; + } + if (last<iA) { + last=iA; + } + } + } + } else { + first=0; + last=len; + } + if (last<first) { + // empty + fprintf(stderr,"WARNING: empty embedding range\n"); + return NULL; + } + + // ensure hmtx is there + if (!otf->hmtx) { + if (otf_load_more(otf)!=0) { + assert(0); + return NULL; + } + } + + // now create the array + EMB_PDF_FONTWIDTHS *ret=emb_pdf_fw_new(last-first+1); + if (!ret) { + return NULL; + } + ret->first=first; + ret->last=last; + ret->widths=ret->data; + for (iA=0;first<=last;iA++,first++) { + const int gid=(encoding)?encoding[first]:otf_from_unicode(otf,first); // TODO + if (gid>=otf->numGlyphs) { + fprintf(stderr,"Bad glyphid\n"); + assert(0); + free(ret); + return NULL; + } + if ( (!glyphs)||(bit_check(glyphs,gid)) ) { + ret->widths[iA]=get_width_fast(otf,gid)*1000/otf->unitsPerEm; + } // else 0 from calloc + } + + return ret; +} +// }}} + +// TODO: split into general part and otf specific part +EMB_PDF_FONTWIDTHS *emb_otf_get_pdf_cidwidths(OTF_FILE *otf,const BITSET glyphs) // {{{ // glyphs==NULL -> output all +{ + assert(otf); + + int iA,b,c; + int dw=otf_get_width(otf,0)*1000/otf->unitsPerEm,size=0; // also ensures otf->hmtx + assert(dw>=0); + // TODO? dw from hmtx(otf->numberOfHMetrics); + + int in_array=0; // current number of elements in array mode + + // first pass + for (iA=0,b=0,c=1;iA<otf->numGlyphs;iA++,c<<=1) { + if (!c) { + b++; + c=1; + } + if ( (!glyphs)||(glyphs[b]&c) ) { + if (in_array) { + in_array++; + } else { + size+=2; // len c + in_array=1; + } + } else { + size+=in_array; + in_array=0; + } + } + size+=in_array; + + // now create the array + EMB_PDF_FONTWIDTHS *ret=emb_pdf_fw_new(size+1); + if (!ret) { + return NULL; + } + ret->default_width=dw; + ret->warray=ret->data; + + // second pass + in_array=0; + size=0; + for (iA=0,b=0,c=1;iA<otf->numGlyphs;iA++,c<<=1) { + if (!c) { + b++; + c=1; + } + if ( (!glyphs)||(glyphs[b]&c) ) { + const int w=get_width_fast(otf,iA)*1000/otf->unitsPerEm; + if ( (in_array<0)&&(ret->warray[size-1]==w) ) { + in_array--; // just add + ret->warray[size-3]=in_array; // fix len; + continue; + } + if (in_array>0) { + if ( (w==dw)&&(ret->warray[size-1]==dw) ) { // omit this and prev + size--; + in_array--; // !=0, as it does not start with >dw + ret->warray[size-in_array-2]=in_array; // fix len + } else if ( (in_array>=2)&& + (ret->warray[size-1]==w)&& + (ret->warray[size-2]==w) ) { + // three in a row. c1 c2 w is equally short + if (in_array==2) { // completely replace + size-=4; + } else { + size-=2; + ret->warray[size-in_array-2]=in_array; // fix len + in_array=-2; + } + in_array=-2; + ret->warray[size++]=in_array; + ret->warray[size++]=iA-2; + ret->warray[size++]=w; + } else { // just add + in_array++; + ret->warray[size++]=w; + ret->warray[size-in_array-2]=in_array; // fix len + } + } else if (w!=dw) { + in_array=1; + ret->warray[size++]=in_array; // len + ret->warray[size++]=iA; // c + ret->warray[size++]=w; + } else { // especially for in_array<0 + in_array=0; + } + } else { + in_array=0; + } + } + ret->warray[size]=0; // terminator + return ret; +} +// }}} + +/*** PS stuff ***/ + +#include "dynstring.h" + +// NOTE: statically allocated string +const char *get_glyphname(const char *post,unsigned short *to_unicode,unsigned short gid) +{ + if (gid==0) { + return ".notdef"; + } + /* + ... TODO: consult post table, if there. + ... otherwise consult fallback table + ... otherwise generate "uni...". + ... otherwise unique name c01... + */ + static char ret[255]; + snprintf(ret,250,"c%d",gid); + return ret; +} + +struct OUTFILTER_PS { + OUTPUT_FN out; + void *ctx; + int len; +}; + +static void outfilter_ascii_ps(const char *buf,int len,void *context) // {{{ +{ + struct OUTFILTER_PS *of=context; + OUTPUT_FN out=of->out; + int iA; + + if ((of->len/64000)!=(len*2+of->len)/64000) { + (*out)("00>\n",4,of->ctx); + (*out)("<",1,of->ctx); + of->len+=5; + } + char tmp[256]; + while (len>0) { + for (iA=0;(iA<40)&&(len>0);iA++,len--) { + sprintf(tmp+2*iA,"%02x",(unsigned char)buf[iA]); + } + tmp[2*iA]='\n'; + (*out)(tmp,iA*2+1,of->ctx); + of->len+=iA*2+1; + buf+=iA; + } +} +// }}} + +static void outfilter_binary_ps(const char *buf,int len,void *context) // {{{ +{ + struct OUTFILTER_PS *of=context; + OUTPUT_FN out=of->out; + + char tmp[100]; + const int l=sprintf(tmp,"%d RD ",len); + + (*out)(tmp,l,of->ctx); + of->len+=l; + + (*out)(buf,len,of->ctx); + (*out)("\n",1,of->ctx); + of->len+=len+1; +} +// }}} + +/* + encoding: character-code -> glyph id ["required", NULL: identity(?)[or: from_unicode()]] // TODO: respect subsetting + to_unicode: character-code -> unicode [NULL: no char names] +*/ +int emb_otf_ps(OTF_FILE *otf,unsigned short *encoding,int len,unsigned short *to_unicode,OUTPUT_FN output,void *context) // {{{ +{ + const int binary=0; // binary format? // TODO + if (len>256) { + fprintf(stderr,"Encoding too big(%d) for Type42\n",len); + return -1; + } + int iA,ret=0; + + DYN_STRING ds; + if (dyn_init(&ds,1024)==-1) { + return -1; + } + + int rlen=0; + char *head=otf_get_table(otf,OTF_TAG('h','e','a','d'),&rlen); + if (!head) { + free(ds.buf); + return -1; + } + dyn_printf(&ds,"%!PS-TrueTypeFont-%d-%d\n", + otf->version,get_ULONG(head+4)); + const int bbxmin=get_SHORT(head+36)*1000/otf->unitsPerEm, + bbymin=get_SHORT(head+38)*1000/otf->unitsPerEm, + bbxmax=get_SHORT(head+40)*1000/otf->unitsPerEm, + bbymax=get_SHORT(head+42)*1000/otf->unitsPerEm; + free(head); + + char *post=otf_get_table(otf,OTF_TAG('p','o','s','t'),&rlen); + if ( (!post)&&(rlen!=-1) ) { // other error than "not found" + free(ds.buf); + return -1; + } + if (post) { + const unsigned int minMem=get_ULONG(post+16),maxMem=get_ULONG(post+20); + if (minMem) { + dyn_printf(&ds,"%%VMusage: %d %d\n",minMem,maxMem); + } + } + + dyn_printf(&ds,"11 dict begin\n" + "/FontName /%s def\n" + "/Encoding 256 array\n" + "0 1 255 { 1 index exch /.notdef put } for\n", + emb_otf_get_fontname(otf)); + for (iA=0;iA<len;iA++) { + const int gid=(encoding)?encoding[iA]:iA; + dyn_printf(&ds,"dup %d /%s put\n", + iA,get_glyphname(post,to_unicode,gid)); + } + dyn_printf(&ds,"readonly def\n"); + + dyn_printf(&ds,"/PaintType 0 def\n" + "/FontMatrix [1 0 0 1 0 0] def\n" + "/FontBBox [%d %d %d %d] def\n" + "/FontType 42 def\n", +// "/XUID\n" // TODO?!? + bbxmin,bbymin,bbxmax,bbymax); + if (post) { + dyn_printf(&ds,"/FontInfo 4 dict dup begin\n" + " /ItalicAngle %d def\n" + " /isFixedPitch %d def\n" + " /UnderlinePosition %d def\n" + " /UnderlineThickness %d def\n" + "end readonly def\n", + get_LONG(post+4)>>16, + get_ULONG(post+12), + (get_SHORT(post+8)-get_SHORT(post+10)/2)*1000/otf->unitsPerEm, + get_SHORT(post+10)*1000/otf->unitsPerEm); + } + if (binary) { + dyn_printf(&ds,"/RD { string currentfile exch readstring pop } executeonly def\n"); + dyn_printf(&ds,"/sfnts["); + } else { + dyn_printf(&ds,"/sfnts[<"); + } + + if (ds.len<0) { + free(post); + free(ds.buf); + return -1; + } + (*output)(ds.buf,ds.len,context); + ret+=ds.len; + ds.len=0; + + // {{{ copy tables verbatim + struct _OTF_WRITE *otw; + otw=malloc(sizeof(struct _OTF_WRITE)*otf->numTables); + if (!otw) { + fprintf(stderr,"Bad alloc: %m\n"); + free(post); + free(ds.buf); + return -1; + } + // just copy everything + for (iA=0;iA<otf->numTables;iA++) { + otw[iA].tag=otf->tables[iA].tag; + otw[iA].action=otf_action_copy; + otw[iA].param=otf; + otw[iA].length=iA; + } + + struct OUTFILTER_PS of; + of.out=output; + of.ctx=context; + of.len=0; + if (binary) { + iA=otf_write_sfnt(otw,otf->version,otf->numTables,outfilter_binary_ps,&of); + } else { + iA=otf_write_sfnt(otw,otf->version,otf->numTables,outfilter_ascii_ps,&of); + } + free(otw); + if (iA==-1) { + free(post); + free(ds.buf); + return -1; + } + ret+=of.len; + + if (binary) { + dyn_printf(&ds,"] def\n"); + } else { + dyn_printf(&ds,">] def\n"); + } + // }}} done copying + + const int num_chars=1; + dyn_printf(&ds,"/CharStrings %d dict dup begin\n",num_chars); + for (iA=0;iA<num_chars;iA++) { + const int gid=(encoding)?encoding[iA]:iA; + dyn_printf(&ds,"/%s %d def\n",get_glyphname(post,to_unicode,gid),gid); +// ... from cmap [respecting subsetting...] + } + dyn_printf(&ds,"end readonly def\n"); + dyn_printf(&ds,"FontName currentdict end definefont pop\n"); + free(post); + + if (ds.len<0) { + free(ds.buf); + return -1; + } + (*output)(ds.buf,ds.len,context); + ret+=ds.len; + ds.len=0; + + free(ds.buf); + return ret; +} +// }}} + --- cups-1.3.8.orig/debian/local/filters/pdf-filters/filter/fontembed/sfnt.c +++ cups-1.3.8/debian/local/filters/pdf-filters/filter/fontembed/sfnt.c @@ -0,0 +1,1317 @@ +#include "sfnt.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <assert.h> +#include "sfnt_int.h" + +// TODO? +// get_SHORT(head+48) // fontDirectionHint +/* reqd. Tables: cmap, head, hhea, hmtx, maxp, name, OS/2, post . + OTF: glyf,loca [cvt,fpgm,prep] + */ + +static void otf_bsearch_params(int num, // {{{ + int recordSize, + int *searchRange, + int *entrySelector, + int *rangeShift) +{ + assert(num>0); + assert(searchRange); + assert(entrySelector); + assert(rangeShift); + + int iA,iB; + for (iA=1,iB=0;iA<=num;iA<<=1,iB++) {} + + *searchRange=iA*recordSize/2; + *entrySelector=iB-1; + *rangeShift=num*recordSize-*searchRange; +} +// }}} + +static char *otf_bsearch(char *table, // {{{ + const char *target,int len, + int searchRange, + int entrySelector, + int rangeShift, + int lower_bound) // return lower_bound, if !=0 +{ + char *ret=table+rangeShift; + if (memcmp(target,ret,len)<0) { + ret=table; + } + + for (;entrySelector>0;entrySelector--) { + searchRange>>=1; + ret+=searchRange; + if (memcmp(target,ret,len)<0) { + ret-=searchRange; + } + } + const int result=memcmp(target,ret,len); + if (result==0) { + return ret; + } else if (lower_bound) { + if (result>0) { + return ret+searchRange; + } + return ret; + } + return NULL; // not found; +} +// }}} + +static OTF_FILE *otf_new(FILE *f) // {{{ +{ + assert(f); + + OTF_FILE *ret; + ret=calloc(1,sizeof(OTF_FILE)); + if (ret) { + ret->f=f; + } + ret->version=0x00010000; + + return ret; +} +// }}} + +static char *otf_read(OTF_FILE *otf,char *buf,long pos,int length) // {{{ - will alloc, if >buf ==NULL, returns >buf, or NULL on error +{ + char *ours=NULL; + + if (length==0) { + return buf; + } else if (length<0) { + assert(0); + return NULL; + } + + int res=fseek(otf->f,pos,SEEK_SET); + if (res==-1) { + fprintf(stderr,"Seek failed: %m\n"); + return NULL; + } + + // (+3)&~3 for checksum... + const int pad_len=(length+3)&~3; + if (!buf) { + ours=buf=malloc(sizeof(char)*pad_len); + if (!buf) { + fprintf(stderr,"Bad alloc: %m\n"); + return NULL; + } + } + + res=fread(buf,1,pad_len,otf->f); + if (res!=pad_len) { + if (res==length) { // file size not multiple of 4, pad with zero + memset(buf+res,0,pad_len-length); + } else { + fprintf(stderr,"Short read\n"); + free(ours); + return NULL; + } + } + + return buf; +} +// }}} + +static unsigned int otf_checksum(const char *buf, unsigned int len) // {{{ +{ + unsigned int ret=0; + + for (len=(len+3)/4;len>0;len--,buf+=4) { + ret+=get_ULONG(buf); + } + + return ret; +} +// }}} + + +static int otf_get_ttc_start(OTF_FILE *otf,int use_ttc) // {{{ +{ + char buf[4]; + + if (!otf->numTTC) { // >0 if TTC... + return 0; + } + + int pos=0; + if ( (use_ttc<0)||(use_ttc>=otf->numTTC)|| + (!otf_read(otf,buf,pos+12+4*use_ttc,4)) ) { + fprintf(stderr,"Bad TTC subfont number\n"); + return -1; + } + return get_ULONG(buf); +} +// }}} + +OTF_FILE *otf_do_load(OTF_FILE *otf,int pos) // {{{ +{ + int iA; + char buf[16]; + + // {{{ read offset table + if (otf_read(otf,buf,pos,12)) { + otf->version=get_ULONG(buf); + if (otf->version==0x00010000) { // 1.0 truetype + } else if (otf->version==OTF_TAG('O','T','T','O')) { // OTF(CFF) + otf->flags|=OTF_F_FMT_CFF; + } else if (otf->version==OTF_TAG('t','r','u','e')) { // (old mac) + } else if (otf->version==OTF_TAG('t','y','p','1')) { // sfnt wrapped type1 + // TODO: unsupported + } else { + otf_close(otf); + otf=NULL; + } + pos+=12; + } else { + otf_close(otf); + otf=NULL; + } + if (!otf) { + fprintf(stderr,"Not a ttf font\n"); + return NULL; + } + otf->numTables=get_USHORT(buf+4); + // }}} + + // {{{ read directory + otf->tables=malloc(sizeof(OTF_DIRENT)*otf->numTables); + if (!otf->tables) { + fprintf(stderr,"Bad alloc: %m\n"); + otf_close(otf); + return NULL; + } + for (iA=0;iA<otf->numTables;iA++) { + if (!otf_read(otf,buf,pos,16)) { + otf_close(otf); + return NULL; + } + otf->tables[iA].tag=get_ULONG(buf); + otf->tables[iA].checkSum=get_ULONG(buf+4); + otf->tables[iA].offset=get_ULONG(buf+8); + otf->tables[iA].length=get_ULONG(buf+12); + if ( (otf->tables[iA].tag==OTF_TAG('C','F','F',' '))&& + ((otf->flags&OTF_F_FMT_CFF)==0) ) { + fprintf(stderr,"Wrong magic\n"); + otf_close(otf); + return NULL; + } else if ( (otf->tables[iA].tag==OTF_TAG('g','l','y','p'))&& + (otf->flags&OTF_F_FMT_CFF) ) { + fprintf(stderr,"Wrong magic\n"); + otf_close(otf); + return NULL; + } + pos+=16; + } + // }}} + +// otf->flags|=OTF_F_DO_CHECKSUM; + // {{{ check head table + int len=0; + char *head=otf_get_table(otf,OTF_TAG('h','e','a','d'),&len); + if ( (!head)|| + (get_ULONG(head+0)!=0x00010000)|| // version + (len!=54)|| + (get_ULONG(head+12)!=0x5F0F3CF5)|| // magic + (get_SHORT(head+52)!=0x0000) ) { // glyphDataFormat + fprintf(stderr,"Unsupported OTF font / head table \n"); + free(head); + otf_close(otf); + return NULL; + } + // }}} + otf->unitsPerEm=get_USHORT(head+18); + otf->indexToLocFormat=get_SHORT(head+50); + + // {{{ checksum whole file + if (otf->flags&OTF_F_DO_CHECKSUM) { + unsigned int csum=0; + char tmp[1024]; + rewind(otf->f); + while (!feof(otf->f)) { + len=fread(tmp,1,1024,otf->f); + if (len&3) { // zero padding reqd. + memset(tmp+len,0,4-(len&3)); + } + csum+=otf_checksum(tmp,len); + } + if (csum!=0xb1b0afba) { + fprintf(stderr,"Wrong global checksum\n"); + free(head); + otf_close(otf); + return NULL; + } + } + // }}} + free(head); + + // {{{ read maxp table / numGlyphs + char *maxp=otf_get_table(otf,OTF_TAG('m','a','x','p'),&len); + if (maxp) { + const unsigned int maxp_version=get_ULONG(maxp); + if ( (maxp_version==0x00005000)&&(len==6) ) { // version 0.5 + otf->numGlyphs=get_USHORT(maxp+4); + if ( (otf->flags&OTF_F_FMT_CFF)==0) { // only CFF + free(maxp); + maxp=NULL; + } + } else if ( (maxp_version==0x00010000)&&(len==32) ) { // version 1.0 + otf->numGlyphs=get_USHORT(maxp+4); + if (otf->flags&OTF_F_FMT_CFF) { // only TTF + free(maxp); + maxp=NULL; + } + } else { + free(maxp); + maxp=NULL; + } + } + if (!maxp) { + fprintf(stderr,"Unsupported OTF font / maxp table \n"); + free(maxp); + otf_close(otf); + return NULL; + } + free(maxp); + // }}} + + return otf; +} +// }}} + +OTF_FILE *otf_load(const char *file) // {{{ +{ + FILE *f; + OTF_FILE *otf; + + int use_ttc=-1; + if ((f=fopen(file,"rb"))==NULL) { + // check for TTC + char *tmp=strrchr(file,'/'),*end; + if (tmp) { + use_ttc=strtoul(tmp+1,&end,10); + if (!*end) { + end=malloc((tmp-file+1)*sizeof(char)); + if (!end) { + fprintf(stderr,"Bad alloc: %m\n"); + return NULL; + } + strncpy(end,file,tmp-file); + end[tmp-file]=0; + f=fopen(end,"rb"); + free(end); + } + } + if (!f) { + fprintf(stderr,"Could not open \"%s\": %m\n",file); + return NULL; + } + } + otf=otf_new(f); + if (!otf) { + fprintf(stderr,"Bad alloc: %m\n"); + fclose(f); + return NULL; + } + + char buf[12]; + int pos=0; + // {{{ check for TTC + if (otf_read(otf,buf,pos,12)) { + const unsigned int version=get_ULONG(buf); + if (version==OTF_TAG('t','t','c','f')) { + const unsigned int ttc_version=get_ULONG(buf+4); + if ( (ttc_version!=0x00010000)&&(ttc_version!=0x00020000) ) { + fprintf(stderr,"Unsupported TTC version\n"); + otf_close(otf); + return NULL; + } + otf->numTTC=get_ULONG(buf+8); + otf->useTTC=use_ttc; + pos=otf_get_ttc_start(otf,use_ttc); + if (pos==-1) { + otf_close(otf); + return NULL; + } + } + } else { + fprintf(stderr,"Not a ttf font\n"); + otf_close(otf); + return NULL; + } + // }}} + + return otf_do_load(otf,pos); +} +// }}} + +void otf_close(OTF_FILE *otf) // {{{ +{ + assert(otf); + if (otf) { + free(otf->gly); + free(otf->cmap); + free(otf->name); + free(otf->hmtx); + free(otf->glyphOffsets); + fclose(otf->f); + free(otf->tables); + free(otf); + } +} +// }}} + +static int otf_find_table(OTF_FILE *otf,unsigned int tag) // {{{ -1 on error +{ +#if 0 + // binary search would require raw table + int pos=0; + char buf[12]; + if (!otf_read(otf,buf,pos,12)) { + return -1; + } + pos=12; + const unsigned int numTables=get_USHORT(buf+4); + char *tables=malloc(16*numTables); + if (!tables) { + return -1; + } + if (!otf_read(otf,tables,pos,16*numTables)) { + free(tables); + return -1; + } + char target[]={(tag>>24),(tag>>16),(tag>>8),tag}; + // assert(get_USHORT(buf+6)+get_USHORT(buf+10)==16*numTables); + char *result=otf_bsearch(tables,target,4, + get_USHORT(buf+6), + get_USHORT(buf+8), + get_USHORT(buf+10),0); + free(tables); + if (result) { + return (result-tables)/16; + } +#else + int iA; + for (iA=0;iA<otf->numTables;iA++) { + if (otf->tables[iA].tag==tag) { + return iA; + } + } +#endif + return -1; +} +// }}} + +char *otf_get_table(OTF_FILE *otf,unsigned int tag,int *ret_len) // {{{ +{ + assert(otf); + assert(ret_len); + + const int idx=otf_find_table(otf,tag); + if (idx==-1) { + *ret_len=-1; + return NULL; + } + const OTF_DIRENT *table=otf->tables+idx; + + char *ret=otf_read(otf,NULL,table->offset,table->length); + if (!ret) { + return NULL; + } + if (otf->flags&OTF_F_DO_CHECKSUM) { + unsigned int csum=otf_checksum(ret,table->length); + if (tag==OTF_TAG('h','e','a','d')) { // special case + csum-=get_ULONG(ret+8); + } + if (csum!=table->checkSum) { + fprintf(stderr,"Wrong checksum for %c%c%c%c\n",OTF_UNTAG(tag)); + free(ret); + return NULL; + } + } + *ret_len=table->length; + return ret; +} +// }}} + +int otf_load_glyf(OTF_FILE *otf) // {{{ - 0 on success +{ + assert((otf->flags&OTF_F_FMT_CFF)==0); // not for CFF + int iA,len; + // {{{ find glyf table + iA=otf_find_table(otf,OTF_TAG('g','l','y','f')); + if (iA==-1) { + fprintf(stderr,"Unsupported OTF font / glyf table \n"); + return -1; + } + otf->glyfTable=otf->tables+iA; + // }}} + + // {{{ read loca table + char *loca=otf_get_table(otf,OTF_TAG('l','o','c','a'),&len); + if ( (!loca)|| + (otf->indexToLocFormat>=2)|| + (((len+3)&~3)!=((((otf->numGlyphs+1)*(otf->indexToLocFormat+1)*2)+3)&~3)) ) { + fprintf(stderr,"Unsupported OTF font / loca table \n"); + return -1; + } + if (otf->glyphOffsets) { + free(otf->glyphOffsets); + assert(0); + } + otf->glyphOffsets=malloc((otf->numGlyphs+1)*sizeof(unsigned int)); + if (!otf->glyphOffsets) { + fprintf(stderr,"Bad alloc: %m\n"); + return -1; + } + if (otf->indexToLocFormat==0) { + for (iA=0;iA<=otf->numGlyphs;iA++) { + otf->glyphOffsets[iA]=get_USHORT(loca+iA*2)*2; + } + } else { // indexToLocFormat==1 + for (iA=0;iA<=otf->numGlyphs;iA++) { + otf->glyphOffsets[iA]=get_ULONG(loca+iA*4); + } + } + free(loca); + if (otf->glyphOffsets[otf->numGlyphs]>otf->glyfTable->length) { + fprintf(stderr,"Bad loca table \n"); + return -1; + } + // }}} + + // {{{ allocate otf->gly slot + int maxGlyfLen=0; // no single glyf takes more space + for (iA=1;iA<=otf->numGlyphs;iA++) { + const int glyfLen=otf->glyphOffsets[iA]-otf->glyphOffsets[iA-1]; + if (glyfLen<0) { + fprintf(stderr,"Bad loca table: glyph len %d\n",glyfLen); + return -1; + } + if (maxGlyfLen<glyfLen) { + maxGlyfLen=glyfLen; + } + } + if (otf->gly) { + free(otf->gly); + assert(0); + } + otf->gly=malloc(maxGlyfLen*sizeof(char)); + if (!otf->gly) { + fprintf(stderr,"Bad alloc: %m\n"); + return -1; + } + // }}} + + return 0; +} +// }}} + +int otf_load_more(OTF_FILE *otf) // {{{ - 0 on success +{ + int iA; + + int len; + if ((otf->flags&OTF_F_FMT_CFF)==0) { // not for CFF + if (otf_load_glyf(otf)==-1) { + return -1; + } + } + + // {{{ read hhea table + char *hhea=otf_get_table(otf,OTF_TAG('h','h','e','a'),&len); + if ( (!hhea)|| + (get_ULONG(hhea)!=0x00010000)|| // version + (len!=36)|| + (get_SHORT(hhea+32)!=0) ) { // metric format + fprintf(stderr,"Unsupported OTF font / hhea table \n"); + return -1; + } + otf->numberOfHMetrics=get_USHORT(hhea+34); + free(hhea); + // }}} + + // {{{ read hmtx table + char *hmtx=otf_get_table(otf,OTF_TAG('h','m','t','x'),&len); + if ( (!hmtx)|| + (len!=otf->numberOfHMetrics*2+otf->numGlyphs*2) ) { + fprintf(stderr,"Unsupported OTF font / hmtx table \n"); + return -1; + } + if (otf->hmtx) { + free(otf->hmtx); + assert(0); + } + otf->hmtx=hmtx; + // }}} + + // {{{ read name table + char *name=otf_get_table(otf,OTF_TAG('n','a','m','e'),&len); + if ( (!name)|| + (get_USHORT(name)!=0x0000)|| // version + (len<get_USHORT(name+2)*12+6)|| + (len<=get_USHORT(name+4)) ) { + fprintf(stderr,"Unsupported OTF font / name table \n"); + return -1; + } + // check bounds + int name_count=get_USHORT(name+2); + const char *nstore=name+get_USHORT(name+4); + for (iA=0;iA<name_count;iA++) { + const char *nrec=name+6+12*iA; + if (nstore-name+get_USHORT(nrec+10)+get_USHORT(nrec+8)>len) { + fprintf(stderr,"Bad name table \n"); + free(name); + return -1; + } + } + if (otf->name) { + free(otf->name); + assert(0); + } + otf->name=name; + // }}} + + return 0; +} +// }}} + +int otf_load_cmap(OTF_FILE *otf) // {{{ - 0 on success +{ + int iA; + int len; + + char *cmap=otf_get_table(otf,OTF_TAG('c','m','a','p'),&len); + if ( (!cmap)|| + (get_USHORT(cmap)!=0x0000)|| // version + (len<get_USHORT(cmap+2)*8+4) ) { + fprintf(stderr,"Unsupported OTF font / cmap table \n"); + assert(0); + return -1; + } + // check bounds, find (3,0) or (3,1) [TODO?] + const int numTables=get_USHORT(cmap+2); + for (iA=0;iA<numTables;iA++) { + const char *nrec=cmap+4+8*iA; + const unsigned int offset=get_ULONG(nrec+4); + const char *ndata=cmap+offset; + if ( (ndata<cmap+4+8*numTables)|| + (offset>=len)|| + (offset+get_USHORT(ndata+2)>len) ) { + fprintf(stderr,"Bad cmap table \n"); + free(cmap); + assert(0); + return -1; + } + if ( (get_USHORT(nrec)==3)&& + (get_USHORT(nrec+2)<=1)&& + (get_USHORT(ndata)==4)&& + (get_USHORT(ndata+4)==0) ) { + otf->unimap=ndata; + } + } + if (otf->cmap) { + free(otf->cmap); + assert(0); + } + otf->cmap=cmap; + + return 0; +} +// }}} + +int otf_get_width(OTF_FILE *otf,unsigned short gid) // {{{ -1 on error +{ + assert(otf); + + if (gid>=otf->numGlyphs) { + return -1; + } + + // ensure hmtx is there + if (!otf->hmtx) { + if (otf_load_more(otf)!=0) { + assert(0); + return -1; + } + } + + return get_width_fast(otf,gid); +#if 0 + if (gid>=otf->numberOfHMetrics) { + return get_USHORT(otf->hmtx+(otf->numberOfHMetrics-1)*2); + // TODO? lsb=get_SHORT(otf->hmtx+otf->numberOfHMetrics*2+gid*2); + } + return get_USHORT(otf->hmtx+gid*4); + // TODO? lsb=get_SHORT(otf->hmtx+gid*4+2); +#endif +} +// }}} + +static int otf_name_compare(const void *a,const void *b) // {{{ +{ + return memcmp(a,b,8); +} +// }}} + +const char *otf_get_name(OTF_FILE *otf,int platformID,int encodingID,int languageID,int nameID,int *ret_len) // {{{ +{ + assert(otf); + assert(ret_len); + + // ensure name is there + if (!otf->name) { + if (otf_load_more(otf)!=0) { + *ret_len=-1; + assert(0); + return NULL; + } + } + + char key[8]; + set_USHORT(key,platformID); + set_USHORT(key+2,encodingID); + set_USHORT(key+4,languageID); + set_USHORT(key+6,nameID); + + char *res=bsearch(key,otf->name+6,get_USHORT(otf->name+2),12,otf_name_compare); + if (res) { + *ret_len=get_USHORT(res+8); + int npos=get_USHORT(res+10); + const char *nstore=otf->name+get_USHORT(otf->name+4); + return nstore+npos; + } + *ret_len=0; + return NULL; +} +// }}} + +int otf_get_glyph(OTF_FILE *otf,unsigned short gid) // {{{ result in >otf->gly, returns length, -1 on error +{ + assert(otf); + assert((otf->flags&OTF_F_FMT_CFF)==0); // not for CFF + + if (gid>=otf->numGlyphs) { + return -1; + } + + // ensure >glyphOffsets and >gly is there + if ( (!otf->gly)||(!otf->glyphOffsets) ) { + if (otf_load_more(otf)!=0) { + assert(0); + return -1; + } + } + + const int len=otf->glyphOffsets[gid+1]-otf->glyphOffsets[gid]; + if (len==0) { + return 0; + } + + assert(otf->glyfTable->length>=otf->glyphOffsets[gid+1]); + if (!otf_read(otf,otf->gly, + otf->glyfTable->offset+otf->glyphOffsets[gid],len)) { + return -1; + } + + return len; +} +// }}} + +unsigned short otf_from_unicode(OTF_FILE *otf,int unicode) // {{{ 0 = missing +{ + assert(otf); + assert( (unicode>=0)&&(unicode<65536) ); +// assert((otf->flags&OTF_F_FMT_CFF)==0); // not for CFF, other method! + + // ensure >cmap and >unimap is there + if (!otf->cmap) { + if (otf_load_cmap(otf)!=0) { + assert(0); + return 0; // TODO? + } + } + if (!otf->unimap) { + fprintf(stderr,"Unicode (3,1) cmap in format 4 not found\n"); + return 0; + } + +#if 0 + // linear search is cache friendly and should be quite fast +#else + const unsigned short segCountX2=get_USHORT(otf->unimap+6); + char target[]={unicode>>8,unicode}; // set_USHORT(target,unicode); + char *result=otf_bsearch((char *)otf->unimap+14,target,2, + get_USHORT(otf->unimap+8), + get_USHORT(otf->unimap+10), + get_USHORT(otf->unimap+12),1); + if (result>=otf->unimap+14+segCountX2) { + assert(0); // bad font, no 0xffff + return 0; + } + + result+=2+segCountX2; + const unsigned short startCode=get_USHORT(result); + if (startCode>unicode) { + return 0; + } + result+=2*segCountX2; + const unsigned short rangeOffset=get_USHORT(result); + if (rangeOffset) { + return get_USHORT(result+rangeOffset+2*(unicode-startCode)); + } else { + const short delta=get_SHORT(result-segCountX2); + return (delta+unicode)&0xffff; + } +#endif +} +// }}} + +#include "bitset.h" + +static int otf_subset_glyf(OTF_FILE *otf,int gid,BITSET glyphs) // {{{ include components of compund glyphs, returns additional space requirements +{ + int ret=0; + if (get_SHORT(otf->gly)>=0) { // not composite + return ret; // done + } + + char *cur=otf->gly+10; + + unsigned short flags; + do { + flags=get_USHORT(cur); + const unsigned short sub_gid=get_USHORT(cur+2); + assert(sub_gid<otf->numGlyphs); + if (!bit_check(glyphs,sub_gid)) { + // bad: temporarily load sub glyph + const int len=otf_get_glyph(otf,sub_gid); + assert(len>0); + bit_set(glyphs,sub_gid); + if (sub_gid<gid) { + ret+=len; + ret+=otf_subset_glyf(otf,sub_gid,glyphs); // composite of composites?, e.g. in DejaVu + } + const int res=otf_get_glyph(otf,gid); // reload current glyph + assert(res); + } + + // skip parameters + cur+=6; + if (flags&0x01) { + cur+=2; + } + if (flags&0x08) { + cur+=2; + } else if (flags&0x40) { + cur+=4; + } else if (flags&0x80) { + cur+=8; + } + } while (flags&0x20); // more components + + return ret; +} +// }}} + +int otf_subset2(OTF_FILE *otf,BITSET glyphs,OUTPUT_FN output,void *context) // {{{ - returns number of bytes written +{ + assert(otf); + assert(glyphs); + assert(output); + + int iA,b,c; + int ret=0; + + // first pass + bit_set(glyphs,0); // .notdef always required + int glyfSize=0; + for (iA=0,b=0,c=1;iA<otf->numGlyphs;iA++,c<<=1) { + if (!c) { + b++; + c=1; + } + if (glyphs[b]&c) { + int len=otf_get_glyph(otf,iA); + if (len<0) { + assert(0); + return -1; + } else if (len>0) { + glyfSize+=len; + len=otf_subset_glyf(otf,iA,glyphs); + if (len<0) { + assert(0); + return -1; + } + glyfSize+=len; + } + } + } + + int locaSize=((otf->numGlyphs+1)*(otf->indexToLocFormat+1)*2+3)&~3; + glyfSize=(glyfSize+3)&~3; + // second pass + char *new_loca=malloc(locaSize); + char *new_glyf=malloc(glyfSize); + if ( (!new_loca)||(!new_glyf) ) { + fprintf(stderr,"Bad alloc: %m\n"); + assert(0); + free(new_loca); + free(new_glyf); + return -1; + } + + int offset=0; + for (iA=0,b=0,c=1;iA<otf->numGlyphs;iA++,c<<=1) { + if (!c) { + b++; + c=1; + } + + assert(offset%2==0); + // TODO? change format? if glyfSize<0x20000 + if (otf->indexToLocFormat==0) { + set_USHORT(new_loca+iA*2,offset/2); + } else { // ==1 + set_ULONG(new_loca+iA*4,offset); + } + + if (glyphs[b]&c) { + const int len=otf_get_glyph(otf,iA); + assert(len>=0); + memcpy(new_glyf+offset,otf->gly,len); + offset+=len; + } + } + // last entry + if (otf->indexToLocFormat==0) { + set_USHORT(new_loca+otf->numGlyphs*2,offset/2); + } else { // ==1 + set_ULONG(new_loca+otf->numGlyphs*4,offset); + } + // zero padding + assert(glyfSize-offset<4); + for (iA=offset;iA<glyfSize;iA++) { + new_glyf[iA]=0; + } + assert(offset<=glyfSize); +//assert(offset==glyfSize); // else TODO 0 padding + + // copy some tables +#define MAX_TABLES 11 + int iB,new_numTables=MAX_TABLES; + OTF_DIRENT new_tables[MAX_TABLES]={ + {OTF_TAG('c','m','a','p'),}, + {OTF_TAG('c','v','t',' '),}, + {OTF_TAG('f','p','g','m'),}, + {OTF_TAG('g','l','y','f'),}, + {OTF_TAG('h','e','a','d'),}, + {OTF_TAG('h','h','e','a'),}, + {OTF_TAG('h','m','t','x'),}, + {OTF_TAG('l','o','c','a'),}, + {OTF_TAG('m','a','x','p'),}, + {OTF_TAG('n','a','m','e'),}, + {OTF_TAG('p','r','e','p'),}}; + for (iA=0,iB=0;(iA<otf->numTables)&&(iB<MAX_TABLES);) { + if (otf->tables[iA].tag==new_tables[iB].tag) { + new_tables[iB].checkSum=otf->tables[iA].checkSum; + new_tables[iB].offset=iA; + new_tables[iB].length=otf->tables[iA].length; + iA++; + iB++; + } else if (otf->tables[iA].tag<new_tables[iB].tag) { + iA++; + } else { + new_tables[iB].tag=0; // don't output + iB++; + new_numTables--; + } + } + + // now we have to know all the checksums and lengths + //TODO ? reduce cmap [to (1,0) ;-)] + // glyf + new_tables[3].checkSum=otf_checksum(new_glyf,glyfSize); + new_tables[3].length=offset; + // loca + new_tables[7].checkSum=otf_checksum(new_loca,locaSize); + new_tables[7].length=(otf->numGlyphs+1)*(otf->indexToLocFormat+1)*2; + + // offset table + directory + char new_start[12+MAX_TABLES*16]; + set_ULONG(new_start,0x00010000); // TODO ? true / original value + set_USHORT(new_start+4,new_numTables); + otf_bsearch_params(new_numTables,16,&iA,&iB,&c); + set_USHORT(new_start+6,iA); + set_USHORT(new_start+8,iB); + set_USHORT(new_start+10,c); + + unsigned int csum=0; + offset=12+16*new_numTables; + iB=12; + for (iA=0;iA<MAX_TABLES;iA++) { + if (!new_tables[iA].tag) { + continue; + } + set_ULONG(new_start+iB,new_tables[iA].tag); + set_ULONG(new_start+iB+4,new_tables[iA].checkSum); + set_ULONG(new_start+iB+8,offset); + set_ULONG(new_start+iB+12,new_tables[iA].length); + iB+=16; + offset+=(new_tables[iA].length+3)&~3; + csum+=new_tables[iA].checkSum; + } + assert(iB==12+16*new_numTables); + (*output)(new_start,iB,context); + ret+=iB; + csum+=otf_checksum(new_start,iB); + + // now output the tables / copy them + iB=12+8; + for (iA=0;iA<MAX_TABLES;iA++) { + if (!new_tables[iA].tag) { + continue; + } + if (iA==3) { // glyf + (*output)(new_glyf,glyfSize,context); + ret+=glyfSize; + } else if (iA==7) { // loca + (*output)(new_loca,locaSize,context); + ret+=locaSize; + } else { // just copy + const OTF_DIRENT *table=otf->tables+new_tables[iA].offset; + char *data=otf_read(otf,NULL,table->offset,table->length); + assert(data); + if (iA==4) { // head. fix global checksum + set_ULONG(data+8,0xb1b0afba-csum); + } + assert(ret==get_ULONG(new_start+iB)); + (*output)(data,(table->length+3)&~3,context); + ret+=(table->length+3)&~3; + free(data); + } + iB+=16; + } + + // TODO? suggested ordering + // head, hhea, maxp, hmtx, cmap, fpgm, prep, cvt, loca, glyf, name + + // copy some tables [cvt,fpgm,(glyf),head!,hhea,hmtx,(loca),maxp,name(?),prep] + + //TODO (cmap for non-cid) + + free(new_loca); + free(new_glyf); + return ret; +#undef MAX_TABLES +} +// }}} + +int otf_action_copy(void *param,int table_no,OUTPUT_FN output,void *context) // {{{ +{ + OTF_FILE *otf=param; + const OTF_DIRENT *table=otf->tables+table_no; + + if (!output) { // get checksum and unpadded length + *(unsigned int *)context=table->checkSum; + return table->length; + } + + char *data=otf_read(otf,NULL,table->offset,table->length); + if (!data) { + return -1; + } + int ret=(table->length+3)&~3; + (*output)(data,ret,context); + free(data); + return ret; // padded length +} +// }}} + +// TODO? >modified time-stamp? +int otf_action_copy_head(void *param,int csum,OUTPUT_FN output,void *context) // {{{ +{ + OTF_FILE *otf=param; + const int table_no=otf_find_table(otf,OTF_TAG('h','e','a','d')); + assert(table_no!=-1); + const OTF_DIRENT *table=otf->tables+table_no; + + if (!output) { // get checksum and unpadded length + *(unsigned int *)context=table->checkSum; + return table->length; + } + + char *data=otf_read(otf,NULL,table->offset,table->length); + if (!data) { + return -1; + } + set_ULONG(data+8,0xb1b0afba-csum); // head. fix global checksum + int ret=(table->length+3)&~3; + (*output)(data,ret,context); + free(data); + return ret; // padded length +} +// }}} + +int otf_action_replace(void *param,int length,OUTPUT_FN output,void *context) // {{{ +{ + char *data=param; + char pad[4]={0,0,0,0}; + + int ret=(length+3)&~3; + if (!output) { // get checksum and unpadded length + if (ret!=length) { + unsigned int csum=otf_checksum(data,ret-4); + memcpy(pad,data+ret-4,ret-length); + csum+=get_ULONG(pad); + *(unsigned int *)context=csum; + } else { + *(unsigned int *)context=otf_checksum(data,length); + } + return length; + } + + (*output)(data,length,context); + if (ret!=length) { + (*output)(pad,ret-length,context); + } + + return ret; // padded length +} +// }}} + +int otf_write_sfnt(struct _OTF_WRITE *otw,unsigned int version,int numTables,OUTPUT_FN output,void *context) // {{{ +{ + int iA; + int ret; + + // find head + int headAt=-1; + for (iA=0;iA<numTables;iA++) { + if ( (otw[iA].tag==OTF_TAG('h','e','a','d'))&& + (otw[iA].action==otf_action_copy) ) { + // only this supported for now + headAt=iA; + } + } + + // TODO? sort tables + + char *start=malloc(12+16*numTables); + if (!start) { + fprintf(stderr,"Bad alloc: %m\n"); + return -1; + } + + // the header + set_ULONG(start,version); + set_USHORT(start+4,numTables); + int a,b,c; + otf_bsearch_params(numTables,16,&a,&b,&c); + set_USHORT(start+6,a); + set_USHORT(start+8,b); + set_USHORT(start+10,c); + + // first pass: calculate table directory / offsets and checksums + unsigned int globalSum=0,csum; + int pos,res; + int offset=12+16*numTables; + pos=12; + for (iA=0;iA<numTables;iA++) { + set_ULONG(start+pos,otw[iA].tag); + res=(*otw[iA].action)(otw[iA].param,otw[iA].length,NULL,&csum); + assert(res>=0); + set_ULONG(start+pos+4,csum); + set_ULONG(start+pos+8,offset); + set_ULONG(start+pos+12,res); + pos+=16; + offset+=(res+3)&~3; // padding + globalSum+=csum; + } + + // second pass: write actual data + // write header + directory + (*output)(start,pos,context); + ret=pos; + globalSum+=otf_checksum(start,pos); + if (headAt!=-1) { + otw[headAt].action=otf_action_copy_head; + otw[headAt].length=globalSum; + } + + // write tables + for (iA=0;iA<numTables;iA++) { + assert(ret==get_ULONG(start+12+16*iA+8)); // table directory correct? + res=(*otw[iA].action)(otw[iA].param,otw[iA].length,output,context); + if (res<0) { + free(start); + return -1; + } + assert(((res+3)&~3)==res); // correctly padded? + ret+=(res+3)&~3; + } + assert(offset==ret); + free(start); + + return ret; +} +// }}} + +int otf_ttc_extract(OTF_FILE *otf,OUTPUT_FN output,void *context) // {{{ +{ + assert(otf); + assert(output); + assert(otf->numTTC); + int iA; + + struct _OTF_WRITE *otw; + otw=malloc(sizeof(struct _OTF_WRITE)*otf->numTables); + if (!otw) { + fprintf(stderr,"Bad alloc: %m\n"); + return -1; + } + + // just copy everything + for (iA=0;iA<otf->numTables;iA++) { + otw[iA].tag=otf->tables[iA].tag; + otw[iA].action=otf_action_copy; + otw[iA].param=otf; + otw[iA].length=iA; + } + iA=otf_write_sfnt(otw,otf->version,otf->numTables,output,context); + free(otw); + + return iA; +} +// }}} + +int otf_subset(OTF_FILE *otf,BITSET glyphs,OUTPUT_FN output,void *context) // {{{ - returns number of bytes written +{ + assert(otf); + assert(glyphs); + assert(output); + + int iA,iB,b,c; + int ret=0; + + // first pass: include all required glyphs + bit_set(glyphs,0); // .notdef always required + int glyfSize=0; + for (iA=0,b=0,c=1;iA<otf->numGlyphs;iA++,c<<=1) { + if (!c) { + b++; + c=1; + } + if (glyphs[b]&c) { + int len=otf_get_glyph(otf,iA); + if (len<0) { + assert(0); + return -1; + } else if (len>0) { + glyfSize+=len; + len=otf_subset_glyf(otf,iA,glyphs); + if (len<0) { + assert(0); + return -1; + } + glyfSize+=len; + } + } + } + + // second pass: calculate new glyf and loca + int locaSize=(otf->numGlyphs+1)*(otf->indexToLocFormat+1)*2; + + char *new_loca=malloc(locaSize); + char *new_glyf=malloc(glyfSize); + if ( (!new_loca)||(!new_glyf) ) { + fprintf(stderr,"Bad alloc: %m\n"); + assert(0); + free(new_loca); + free(new_glyf); + return -1; + } + + int offset=0; + for (iA=0,b=0,c=1;iA<otf->numGlyphs;iA++,c<<=1) { + if (!c) { + b++; + c=1; + } + + assert(offset%2==0); + // TODO? change format? if glyfSize<0x20000 + if (otf->indexToLocFormat==0) { + set_USHORT(new_loca+iA*2,offset/2); + } else { // ==1 + set_ULONG(new_loca+iA*4,offset); + } + + if (glyphs[b]&c) { + const int len=otf_get_glyph(otf,iA); + assert(len>=0); + memcpy(new_glyf+offset,otf->gly,len); + offset+=len; + } + } + // last entry + if (otf->indexToLocFormat==0) { + set_USHORT(new_loca+otf->numGlyphs*2,offset/2); + } else { // ==1 + set_ULONG(new_loca+otf->numGlyphs*4,offset); + } + assert(offset==glyfSize); + + // determine new tables. +#define MAX_TABLES 12 + int numTables=0; + struct _OTF_WRITE otw[MAX_TABLES]={ + {OTF_TAG('c','m','a','p'),otf_action_copy,otf,}, + {OTF_TAG('c','v','t',' '),otf_action_copy,otf,}, + {OTF_TAG('f','p','g','m'),otf_action_copy,otf,}, + {OTF_TAG('g','l','y','f'),otf_action_replace,new_glyf,glyfSize}, + {OTF_TAG('h','e','a','d'),otf_action_copy,otf,}, // _copy_head + {OTF_TAG('h','h','e','a'),otf_action_copy,otf,}, + {OTF_TAG('h','m','t','x'),otf_action_copy,otf,}, + {OTF_TAG('l','o','c','a'),otf_action_replace,new_loca,locaSize}, + {OTF_TAG('m','a','x','p'),otf_action_copy,otf,}, + {OTF_TAG('n','a','m','e'),otf_action_copy,otf,}, + {OTF_TAG('p','r','e','p'),otf_action_copy,otf,}, + {0,0,0,0}}; + + for (iA=0;(iA<otf->numTables)&&(otw[numTables].tag);) { + if (otf->tables[iA].tag==otw[numTables].tag) { + if (otw[numTables].param==otf) { + otw[numTables].length=iA; + } + iA++; + numTables++; + } else if (otf->tables[iA].tag<otw[numTables].tag) { + iA++; + } else { + memmove(otw+numTables,otw+numTables+1,sizeof(struct _OTF_WRITE)*(MAX_TABLES-numTables-1)); // don't output + } + } + // write them + ret=otf_write_sfnt(otw,otf->version,numTables,output,context); + + free(new_loca); + free(new_glyf); + return ret; + + // TODO? suggested ordering + // head, hhea, maxp, hmtx, cmap, fpgm, prep, cvt, loca, glyf, name + // copy some tables [cvt,fpgm,(glyf),head!,hhea,hmtx,(loca),maxp,name(?),prep] + + //TODO ? reduce cmap [to (1,0) ;-)] + //TODO (cmap for non-cid) +} +// }}} + --- cups-1.3.8.orig/debian/local/filters/pdf-filters/filter/fontembed/main.c +++ cups-1.3.8/debian/local/filters/pdf-filters/filter/fontembed/main.c @@ -0,0 +1,169 @@ +#include "sfnt.h" +#include <stdio.h> +#include <stdlib.h> +#include <assert.h> + +#include "embed.h" + +#if 0 +enum { TTF_OTF, TYPE1 } inputFile; +if (TTF_OTF) { + assert(!TTC); + if (CFF/OTF) { + // or EMB_PDF_FONTFILE3_OTF [unstripped] + if (CIDfont) { + asset(multiBYTE); + strip_sfnt() // "CIDFontType0" EMB_PDF_FONTFILE3_CID0C + } else { + ... strip_sfnt(); + } + } else { + ... + } +} else if (TYPE1) { + assert(!MMType1); + assert(!OCF); + assert(!WrappedCID_CFF); + ... convert_to_cff() +} +// not supported: MMType1 Type3 +#endif + +#include <string.h> + +static void example_outfn(const char *buf,int len,void *context) // {{{ +{ + FILE *f=(FILE *)context; + if (fwrite(buf,1,len,f)!=len) { + fprintf(stderr,"Short write: %m\n"); + assert(0); + return; + } +} +// }}} + +void example_write_fontdescr(OTF_FILE *otf,const char *outfile) // {{{ +{ + FONTFILE *ff=fontfile_open_sfnt(otf); + EMB_PARAMS *emb=emb_new(ff, + EMB_DEST_PDF16, +// EMB_C_KEEP_T1 + EMB_C_FORCE_MULTIBYTE + + ); + EMB_PDF_FONTDESCR *fdes=emb_pdf_fontdescr(emb); + assert(fdes); + assert(emb->subset); + + bit_set(emb->subset,otf_from_unicode(otf,'a')); + bit_set(emb->subset,otf_from_unicode(otf,0x400)); + + EMB_PDF_FONTWIDTHS *fwid=emb_pdf_fontwidths(emb); + assert(fwid); + + printf("0 0 obj\n"); + char *res=emb_pdf_simple_fontdescr(emb,fdes,1); + assert(res); + fputs(res,stdout); + free(res); + printf("endobj\n"); + + printf("1 0 obj\n" + "<<\n"); + if (emb_pdf_get_fontfile_subtype(emb)) { + printf(" /SubType /%s\n", + emb_pdf_get_fontfile_subtype(emb)); + } + if (emb->outtype&EMB_OUTPUT_T1) { + printf(" /Length1 ?\n" + " /Length2 ?\n" + " /Length3 ?\n"); + } else { + printf(" /Length1 2 0 R\n"); + } + printf(" /Length 2 0 R\n" // maybe compress it... + ">>\n" + "stream\n"); + int outlen=0; // TODO +// TODO + if (outfile) { + FILE *f=fopen(outfile,"w"); + if (!f) { + fprintf(stderr,"Opening \"%s\" for writing failed: %m\n",outfile); + assert(0); + emb_close(emb); + return; + } + outlen=emb_embed(emb,example_outfn,f); +// outlen=otf_ttc_extract(emb->font->sfnt,example_outfn,f); + fclose(f); + } +puts("..."); + printf("endstream\n" + "endobj\n"); + printf("2 0 obj\n" + "%d\n" + "endobj\n", + outlen + ); + + printf("3 0 obj\n"); + res=emb_pdf_simple_font(emb,fdes,fwid,0); + assert(res); + fputs(res,stdout); + free(res); + printf("endobj\n"); + + if (emb->plan&EMB_A_MULTIBYTE) { + printf("4 0 obj\n"); + res=emb_pdf_simple_cidfont(emb,fdes->fontname,3); + assert(res); + fputs(res,stdout); + free(res); + printf("endobj\n"); + } + + free(fdes); + free(fwid); + emb_close(emb); +#if 1 + free(ff); // TODO +#else + ff->sfnt=NULL; // TODO + fontfile_close(ff); +#endif +} +// }}} + +// TODO? reencode? +int main(int argc,char **argv) +{ + const char *fn="/usr/share/fonts/truetype/microsoft/ARIALN.TTF"; + if (argc==2) { + fn=argv[1]; + } + OTF_FILE *otf=otf_load(fn); + assert(otf); + printf("width(4): %d\n",otf_get_width(otf,4)); + + + if (strcmp(fn,"test.ttf")!=0) { + example_write_fontdescr(otf,"test.ttf"); + } else { + example_write_fontdescr(otf,NULL); + } + + // show_post(otf); + + // show_name(otf); + + // show_cmap(otf); + // printf("%d %d\n",otf_from_unicode(otf,'A'),0); + + // ... name 6 -> FontName /20(cid) + // ? StemV Flags(?) from FontName + + otf_close(otf); + + return 0; +} --- cups-1.3.8.orig/debian/local/filters/pdf-filters/filter/fontembed/sfnt_int.h +++ cups-1.3.8/debian/local/filters/pdf-filters/filter/fontembed/sfnt_int.h @@ -0,0 +1,79 @@ +#ifndef _SFNT_INT_H +#define _SFNT_INT_H + +static inline unsigned short get_USHORT(const char *buf) // {{{ +{ + return ((unsigned char)buf[0]<<8)|((unsigned char)buf[1]); +} +// }}} +static inline short get_SHORT(const char *buf) // {{{ +{ + return (buf[0]<<8)|((unsigned char)buf[1]); +} +// }}} +static inline unsigned int get_UINT24(const char *buf) // {{{ +{ + return ((unsigned char)buf[0]<<16)| + ((unsigned char)buf[1]<<8)| + ((unsigned char)buf[2]); +} +// }}} +static inline unsigned int get_ULONG(const char *buf) // {{{ +{ + return ((unsigned char)buf[0]<<24)| + ((unsigned char)buf[1]<<16)| + ((unsigned char)buf[2]<<8)| + ((unsigned char)buf[3]); +} +// }}} +static inline int get_LONG(const char *buf) // {{{ +{ + return (buf[0]<<24)| + ((unsigned char)buf[1]<<16)| + ((unsigned char)buf[2]<<8)| + ((unsigned char)buf[3]); +} +// }}} + +static inline void set_USHORT(char *buf,unsigned short val) // {{{ +{ + buf[0]=val>>8; + buf[1]=val&0xff; +} +// }}} +static inline void set_ULONG(char *buf,unsigned int val) // {{{ +{ + buf[0]=val>>24; + buf[1]=(val>>16)&0xff; + buf[2]=(val>>8)&0xff; + buf[3]=val&0xff; +} +// }}} + +static inline int get_width_fast(OTF_FILE *otf,int gid) // {{{ +{ + if (gid>=otf->numberOfHMetrics) { + return get_USHORT(otf->hmtx+(otf->numberOfHMetrics-1)*4); + } else { + return get_USHORT(otf->hmtx+gid*4); + } +} +// }}} + +int otf_load_glyf(OTF_FILE *otf); // - 0 on success +int otf_load_more(OTF_FILE *otf); // - 0 on success + +int otf_action_copy(void *param,int csum,OUTPUT_FN output,void *context); +int otf_action_copy_head(void *param,int csum,OUTPUT_FN output,void *context); +int otf_action_replace(void *param,int csum,OUTPUT_FN output,void *context); + +struct _OTF_WRITE { + unsigned long tag; + int (*action)(void *param,int length,OUTPUT_FN output,void *context); // -1 on error, num_bytes_written on success; if >output==NULL return checksum in (unsigned int *)context instead. + void *param; + int length; +}; + +int otf_write_sfnt(struct _OTF_WRITE *otw,unsigned int version,int numTables,OUTPUT_FN output,void *context); + +#endif --- cups-1.3.8.orig/debian/local/filters/pdf-filters/filter/fontembed/embed.c +++ cups-1.3.8/debian/local/filters/pdf-filters/filter/fontembed/embed.c @@ -0,0 +1,652 @@ +#include "embed.h" +#include <assert.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> +#include "dynstring.h" + +#include "sfnt.h" + +// from embed_sfnt.c +EMB_RIGHT_TYPE emb_otf_get_rights(OTF_FILE *otf); +const char *emb_otf_get_fontname(OTF_FILE *otf); +EMB_PDF_FONTWIDTHS *emb_otf_get_pdf_widths(OTF_FILE *otf,const unsigned short *encoding,int len,const BITSET glyphs); +EMB_PDF_FONTWIDTHS *emb_otf_get_pdf_cidwidths(OTF_FILE *otf,const BITSET glyph); +int emb_otf_ps(OTF_FILE *otf,unsigned short *encoding,int len,unsigned short *to_unicode,OUTPUT_FN output,void *context); + +void emb_otf_get_pdf_fontdescr(OTF_FILE *otf,EMB_PDF_FONTDESCR *ret); + +static inline int copy_file(FILE *f,OUTPUT_FN output,void *context) // {{{ +{ + assert(f); + assert(output); + + char buf[4096]; + int iA,ret=0; + + ret=0; + rewind(f); + do { + iA=fread(buf,1,4096,f); + (*output)(buf,iA,context); + ret+=iA; + } while (iA>0); + return ret; +} +// }}} + +EMB_PARAMS *emb_new(FONTFILE *font,EMB_DESTINATION dest,EMB_CONSTRAINTS mode) // {{{ +{ + assert(font); + + EMB_PARAMS *ret=calloc(1,sizeof(EMB_PARAMS)); + if (!ret) { + fprintf(stderr,"Bad alloc: %m\n"); + if (mode&EMB_C_TAKE_FONTFILE) { + fontfile_close(font); + } + return NULL; + } + ret->dest=dest; + ret->font=font; + if (mode&EMB_C_TAKE_FONTFILE) { + ret->plan|=EMB_A_CLOSE_FONTFILE; + } + + // check parameters + if ( (mode&EMB_C_KEEP_T1)&&(mode&EMB_C_FORCE_MULTIBYTE) ) { + fprintf(stderr,"Incompatible mode: KEEP_T1 and FORCE_MULTIBYTE\n"); + emb_close(ret); + return NULL; + } + if ((mode&0x07)>5) { + fprintf(stderr,"Bad subset specification\n"); + emb_close(ret); + return NULL; + } + + // determine intype + int numGlyphs=0; + if (font->sfnt) { + ret->intype=EMB_INPUT_TTF; // for now + ret->rights=emb_otf_get_rights(ret->font->sfnt); + numGlyphs=ret->font->sfnt->numGlyphs; // TODO + } else if (font->stdname) { + ret->intype=EMB_INPUT_STDFONT; + ret->rights=EMB_RIGHT_NONE; + } else { + assert(0); + } +/* + if ( (ret->intype==EMB_INPUT_CFF)&& + (ret->cffFont.is_cid()) ) { + ret->plan|=EMB_A_MULTIBYTE; + } +*/ + + // determine outtype + if ( (ret->intype==EMB_INPUT_T1)&&(mode&EMB_C_KEEP_T1) ) { + ret->outtype=EMB_OUTPUT_T1; + } else if (ret->intype==EMB_INPUT_TTF) { + if (mode&EMB_C_PDF_OT) { + ret->outtype=EMB_OUTPUT_SFNT; + } else { + ret->outtype=EMB_OUTPUT_TTF; + } + } else if (ret->intype==EMB_INPUT_STDFONT) { + // the stdfonts are treated as Type1 for now + ret->outtype=EMB_OUTPUT_T1; + if (mode&EMB_C_FORCE_MULTIBYTE) { + fprintf(stderr,"Multibyte stdfonts are not possible\n"); + emb_close(ret); + return NULL; + } + return ret; // never subset + } else { // T1, OTF, CFF + if (ret->intype==EMB_INPUT_T1) { + ret->plan|=EMB_A_CONVERT_CFF; + } + if (mode&EMB_C_PDF_OT) { + ret->outtype=EMB_OUTPUT_SFNT; + ret->plan|=EMB_A_WRAP_SFNT; + } else { + ret->outtype=EMB_OUTPUT_CFF; + } + } + + if (mode&EMB_C_FORCE_MULTIBYTE) { + ret->plan|=EMB_A_MULTIBYTE; + } + + // check rights + if ( (ret->rights&EMB_RIGHT_NONE)|| + (ret->rights&EMB_RIGHT_BITMAPONLY)|| + ( (ret->rights&EMB_RIGHT_READONLY)&&(mode&EMB_C_EDITABLE_SUBSET) )|| + ( (ret->rights&EMB_RIGHT_NO_SUBSET)&&(mode&EMB_C_MUST_SUBSET) ) ) { + fprintf(stderr,"The font does not permit the requested embedding\n"); + emb_close(ret); + return NULL; + } else if ( (!(ret->rights&EMB_RIGHT_NO_SUBSET))&& + (!(mode&EMB_C_NEVER_SUBSET)) ) { + ret->plan|=EMB_A_SUBSET; + } + + // alloc subset + if (ret->plan&EMB_A_SUBSET) { + ret->subset=bitset_new(numGlyphs); + if (!ret->subset) { + fprintf(stderr,"Bad alloc: %m\n"); + emb_close(ret); + return NULL; + } + } + + return ret; +} +// }}} + +int emb_embed(EMB_PARAMS *emb,OUTPUT_FN output,void *context) // {{{ +{ + assert(emb); + + if (emb->dest==EMB_DEST_PS) { + int ret=0; + const char *fontname=emb_otf_get_fontname(emb->font->sfnt); // TODO!! + (*output)("%%BeginFont: ",13,context); + (*output)(fontname,strlen(fontname),context); + (*output)("\n",1,context); + if (emb->intype==EMB_INPUT_TTF) { + // do Type42 + ret=emb_otf_ps(emb->font->sfnt,NULL,4,NULL,output,context); // TODO? + } else { + assert(0); + ret=-1; + } + (*output)("%%EndFont\n",10,context); + return ret; + } + + if (emb->intype==EMB_INPUT_TTF) { + assert(emb->font->sfnt); + if (emb->plan&EMB_A_SUBSET) { + return otf_subset(emb->font->sfnt,emb->subset,output,context); + } else if (emb->font->sfnt->numTTC) { // + return otf_ttc_extract(emb->font->sfnt,output,context); + } else { + // copy verbatim + return copy_file(emb->font->sfnt->f,output,context); + } + } else { + fprintf(stderr,"NOT IMPLEMENTED\n"); + assert(0); + return -1; + } +} +// }}} + +void emb_close(EMB_PARAMS *emb) // {{{ +{ + if (emb) { + free(emb->subset); + if (emb->plan&EMB_A_CLOSE_FONTFILE) { + fontfile_close(emb->font); + } + free(emb); + } +} +// }}} + +/*** PDF out stuff ***/ +static const int emb_pdf_font_format[]={0,1,0,0}; // {{{ (input_format) }}} + +static const char *emb_pdf_font_subtype[][2]={ // {{{ (format,multibyte) + {"Type1","CIDFontType0"}, + {"TrueType","CIDFontType2"}}; +// }}} + +static const char *emb_pdf_fontfile_key[]={ // {{{ (output_format) + "FontFile1","FontFile2","FontFile3","Fontfile3"}; +// }}} + +static const char *emb_pdf_fontfile_subtype[][2]={ // {{{ (output_format,multibyte) + {NULL,NULL}, + {NULL,NULL}, + {"Type1C","CIDFontType0C"}, + {"OpenType","OpenType"}}; +// }}} + +static inline int emb_multibyte(EMB_PARAMS *emb) // {{{ +{ + return (emb->plan&EMB_A_MULTIBYTE)?1:0; +} +// }}} + +static const char *emb_pdf_escape_name(const char *name,int len) // {{{ // - statically allocated buffer +{ + assert(name); + if (len==-1) { + len=strlen(name); + } + assert(len<=127); // pdf implementation limit + + static char buf[128*3]; + int iA,iB; + const char hex[]="0123456789abcdef"; + + for (iA=0,iB=0;iA<len;iA++,iB++) { + if ( ((unsigned char)name[iA]<33)||((unsigned char)name[iA]>126)|| + (strchr("#()<>[]{}/%",name[iA])) ) { + buf[iB]='#'; + buf[++iB]=hex[(name[iA]>>4)&0x0f]; + buf[++iB]=hex[name[iA]&0xf]; + } else { + buf[iB]=name[iA]; + } + } + buf[iB]=0; + return buf; +} +// }}} + +const char *emb_pdf_get_font_subtype(EMB_PARAMS *emb) // {{{ +{ + assert(emb); + return emb_pdf_font_subtype[emb_pdf_font_format[emb->intype]][emb_multibyte(emb)]; +} +// }}} + +const char *emb_pdf_get_fontfile_key(EMB_PARAMS *emb) // {{{ +{ + assert(emb); + return emb_pdf_fontfile_key[emb->outtype]; +} +// }}} + +const char *emb_pdf_get_fontfile_subtype(EMB_PARAMS *emb) // {{{ +{ + assert(emb); + return emb_pdf_fontfile_subtype[emb->outtype][emb_multibyte(emb)]; +} +// }}} + +// {{{ EMB_PDF_FONTDESCR *emb_pdf_fd_new(fontname,subset_tag,cid_registry,cid_ordering,cid_supplement,panose) +EMB_PDF_FONTDESCR *emb_pdf_fd_new(const char *fontname, + const char *subset_tag, + const char *cid_registry, // or supplement==-1 + const char *cid_ordering, // or supplement==-1 + int cid_supplement) // -1 for non-cid +{ + assert(fontname); + EMB_PDF_FONTDESCR *ret; + + int len=sizeof(EMB_PDF_FONTDESCR); + if (subset_tag) { + assert(strlen(subset_tag)==6); + len+=7; + } + len+=strlen(fontname)+1; + if (cid_supplement>=0) { // cid font + len+=12; // space for panose + assert(cid_registry); + assert(cid_ordering); + len+=strlen(cid_registry)+1; + len+=strlen(cid_ordering)+1; + } + ret=calloc(1,len); + if (!ret) { + fprintf(stderr,"Bad alloc: %m\n"); + assert(0); + return NULL; + } + + // now fill the struct + len=0; + if (cid_supplement>=0) { // free space for panose is at beginning + len+=12; + } + ret->fontname=ret->data+len; + len+=strlen(fontname)+1; + if (subset_tag) { + strncpy(ret->fontname,subset_tag,6); + ret->fontname[6]='+'; + strcpy(ret->fontname+7,fontname); + len+=7; + } else { + strcpy(ret->fontname,fontname); + } + ret->italicAngle=90; + if (cid_supplement>=0) { + ret->registry=ret->data+len; + strcpy(ret->registry,cid_registry); + len+=strlen(cid_registry)+1; + + ret->ordering=ret->data+len; + strcpy(ret->ordering,cid_ordering); + len+=strlen(cid_registry)+1; + } + ret->supplement=cid_supplement; + + return ret; +} +// }}} + +EMB_PDF_FONTDESCR *emb_pdf_fontdescr(EMB_PARAMS *emb) // {{{ - to be freed by user +{ + assert(emb); + + const char *subset_tag=NULL; + // {{{ generate pdf subtag + static unsigned int rands=0; + if (!rands) { + rands=time(NULL); + } + + char subtag[7]; + subtag[6]=0; + if (emb->plan&EMB_A_SUBSET) { + int iA; + for (iA=0;iA<6;iA++) { + const int x=(int)(26.0*(rand_r(&rands)/(RAND_MAX+1.0))); + subtag[iA]='A'+x; + } + subset_tag=subtag; + } + // }}} + + const char *fontname=NULL; + if (emb->intype==EMB_INPUT_TTF) { + assert(emb->font->sfnt); + fontname=emb_otf_get_fontname(emb->font->sfnt); + } else if (emb->intype==EMB_INPUT_STDFONT) { + return NULL; + } else { + fprintf(stderr,"NOT IMPLEMENTED\n"); + assert(0); + return NULL; + } + + EMB_PDF_FONTDESCR *ret; + if (emb->plan&EMB_A_MULTIBYTE) { // multibyte + ret=emb_pdf_fd_new(fontname,subset_tag,"Adobe","Identity",0); // TODO /ROS + } else { + ret=emb_pdf_fd_new(fontname,subset_tag,NULL,NULL,-1); + } + if (!ret) { + return NULL; + } + + if (emb->intype==EMB_INPUT_TTF) { + emb_otf_get_pdf_fontdescr(emb->font->sfnt,ret); + } else { + assert(0); + } + return ret; +} +// }}} + +// TODO: encoding into EMB_PARAMS +EMB_PDF_FONTWIDTHS *emb_pdf_fw_new(int datasize); + +EMB_PDF_FONTWIDTHS *emb_pdf_fw_new(int datasize) // {{{ +{ + assert(datasize>=0); + EMB_PDF_FONTWIDTHS *ret=calloc(1,sizeof(EMB_PDF_FONTWIDTHS)+datasize*sizeof(int)); + if (!ret) { + fprintf(stderr,"Bad alloc: %m\n"); + assert(0); + return NULL; + } + return ret; +} +// }}} + +EMB_PDF_FONTWIDTHS *emb_pdf_fontwidths(EMB_PARAMS *emb) // {{{ +{ + assert(emb); + + if (emb->intype==EMB_INPUT_TTF) { + assert(emb->font->sfnt); + if (emb->plan&EMB_A_MULTIBYTE) { + return emb_otf_get_pdf_cidwidths(emb->font->sfnt,emb->subset); + } else { + return emb_otf_get_pdf_widths(emb->font->sfnt,NULL,emb->font->sfnt->numGlyphs,emb->subset); // TODO: encoding + } + } else { + fprintf(stderr,"NOT IMPLEMENTED\n"); + assert(0); + return NULL; + } +} +// }}} + +#define NEXT /* {{{ */ \ + if ( (len<0)||(len>=size) ) { \ + assert(0); \ + free(ret); \ + return NULL; \ + } \ + pos+=len; \ + size-=len; /* }}} */ + +char *emb_pdf_simple_fontdescr(EMB_PARAMS *emb,EMB_PDF_FONTDESCR *fdes,int fontfile_obj_ref) // {{{ - to be freed by user +{ + assert(emb); + assert(fdes); + + char *ret=NULL,*pos; + int len,size; + + size=300; + pos=ret=malloc(size); + if (!ret) { + fprintf(stderr,"Bad alloc: %m\n"); + return NULL; + } + + len=snprintf(pos,size, + "<</Type /FontDescriptor\n" + " /FontName /%s\n" // TODO? handle quoting in struct? + " /Flags %d\n" + " /ItalicAngle %d\n", + emb_pdf_escape_name(fdes->fontname,-1), + fdes->flags, + fdes->italicAngle); + NEXT; + + if (1) { // TODO type!=EMB_PDF_TYPE3 + len=snprintf(pos,size, + " /FontBBox [%d %d %d %d]\n" + " /Ascend %d\n" + " /Descend %d\n" + " /CapHeight %d\n" // if font has Latin chars + " /StemV %d\n", + fdes->bbxmin,fdes->bbymin,fdes->bbxmax,fdes->bbymax, + fdes->ascend, + fdes->descend, + fdes->capHeight, + fdes->stemV); + NEXT; + } + if (fdes->xHeight) { + len=snprintf(pos,size," /XHeight %d\n",fdes->xHeight); + NEXT; + } + if (fdes->avgWidth) { + len=snprintf(pos,size," /AvgWidth %d\n",fdes->avgWidth); + NEXT; + } + if (fdes->panose) { + int iA; + len=snprintf(pos,size," /Style << /Panose <"); + NEXT; + if (size<30) { + assert(0); + free(ret); + return NULL; + } + for (iA=0;iA<12;iA++) { + snprintf(pos+iA*2,size-iA*2,"%02x",fdes->panose[iA]); + } + size-=24; + pos+=24; + len=snprintf(pos,size,"> >>\n"); + NEXT; + } + len=snprintf(pos,size, + " /%s %d 0 R\n" + ">>\n", + emb_pdf_get_fontfile_key(emb), + fontfile_obj_ref); + NEXT; + + return ret; +} +// }}} + +char *emb_pdf_simple_font(EMB_PARAMS *emb,EMB_PDF_FONTDESCR *fdes,EMB_PDF_FONTWIDTHS *fwid,int fontdescr_obj_ref) // {{{ - to be freed by user +{ + assert(emb); + assert(fdes); + assert(fwid); + + int iA,iB; + DYN_STRING ret; + + if (dyn_init(&ret,500)==-1) { + return NULL; + } + + dyn_printf(&ret,"<</Type /Font\n" + " /Subtype /%s\n" + " /BaseFont /%s\n" + " /FontDescriptor %d 0 R\n", + emb_pdf_get_font_subtype(emb), + emb_pdf_escape_name(fdes->fontname,-1), + fontdescr_obj_ref); + + if (emb->plan&EMB_A_MULTIBYTE) { // multibyte + assert(fwid->warray); + dyn_printf(&ret," /CIDSystemInfo <<\n" + " /Registry (%s)\n" + " /Ordering (%s)\n" + " /Supplement %d\n" + " >>\n" + " /DW %d\n", +// " /CIDToGIDMap /Id...\n" // TrueType only, default /Identity + fdes->registry, + fdes->ordering, + fdes->supplement, + fwid->default_width); + + if (fwid->warray[0]) { + dyn_printf(&ret," /W ["); + for (iA=0;fwid->warray[iA];) { + if (fwid->warray[iA]<0) { // c1 (c1-len) w + dyn_printf(&ret," %d %d %d", + fwid->warray[iA+1], + fwid->warray[iA+1]-fwid->warray[iA], + fwid->warray[iA+2]); + iA+=3; + } else { // c [w ... w] + iB=fwid->warray[iA++]; // len + dyn_printf(&ret," %d [",fwid->warray[iA++]); // c + for (;iB>0;iB--) { + dyn_printf(&ret," %d",fwid->warray[iA++]); + } + dyn_printf(&ret,"]"); + } + } + dyn_printf(&ret,"]\n"); + } + } else { // "not std14" + assert(fwid->widths); + dyn_printf(&ret, + " /Encoding /MacRomanEncoding\n" // optional; TODO!!!!! +// " /ToUnicode ?\n" // optional + " /FirstChar %d\n" + " /LastChar %d\n" + " /Widths [", + fwid->first, + fwid->last); + for (iA=0,iB=fwid->first;iB<=fwid->last;iA++,iB++) { + dyn_printf(&ret," %d",fwid->widths[iA]); + } + dyn_printf(&ret,"]\n"); + } + dyn_printf(&ret,">>\n"); + if (ret.len==-1) { + dyn_free(&ret); + assert(0); + return NULL; + } + + return ret.buf; +} +// }}} + +char *emb_pdf_simple_cidfont(EMB_PARAMS *emb,const char *fontname,int descendant_obj_ref) // {{{ - to be freed by user +{ + assert(emb); + assert(fontname); + + char *ret=NULL,*pos; + int len,size; + + size=200; + pos=ret=malloc(size); + if (!ret) { + fprintf(stderr,"Bad alloc: %m\n"); + return NULL; + } + + len=snprintf(pos,size, + "<</Type /Font\n" + " /Subtype /Type0\n" + " /BaseFont /%s\n" // TODO? "-CMap-name"(/Encoding) for CidType0 + " /Encoding /Identity-H\n" + // for CFF: one of: + // UniGB-UCS2-H, UniCNS-UCS2-H, UniJIS-UCS2-H, UniKS-UCS2-H + " /DescendantFonts [%d 0 R]\n", +// " /ToUnicode ?\n" // TODO + emb_pdf_escape_name(fontname,-1), + descendant_obj_ref); + NEXT; + + len=snprintf(pos,size,">>\n"); + NEXT; + + return ret; +} +// }}} + +char *emb_pdf_simple_stdfont(EMB_PARAMS *emb) // {{{ - to be freed by user +{ + assert(emb); + assert(emb->font->stdname); + + char *ret=NULL,*pos; + int len,size; + + size=300; + pos=ret=malloc(size); + if (!ret) { + fprintf(stderr,"Bad alloc: %m\n"); + return NULL; + } + + len=snprintf(pos,size, + "<</Type/Font\n" + " /Subtype /Type1\n" + " /BaseFont /%s\n" + ">>\n", + emb->font->stdname); + NEXT; + + return ret; +} +// }}} +#undef NEXT + +//... + --- cups-1.3.8.orig/debian/local/filters/pdf-filters/filter/fontembed/test_ps.c +++ cups-1.3.8/debian/local/filters/pdf-filters/filter/fontembed/test_ps.c @@ -0,0 +1,92 @@ +#include "embed.h" +#include "sfnt.h" +#include <assert.h> +#include <stdio.h> +#include <stdlib.h> + +const char *emb_otf_get_fontname(OTF_FILE *otf); // TODO + +static void example_outfn(const char *buf,int len,void *context) // {{{ +{ + FILE *f=(FILE *)context; + if (fwrite(buf,1,len,f)!=len) { + fprintf(stderr,"Short write: %m\n"); + assert(0); + return; + } +} +// }}} + +static inline void write_string(FILE *f,EMB_PARAMS *emb,const char *str) // {{{ +{ + assert(f); + assert(emb); + OTF_FILE *otf=emb->font->sfnt; + assert(otf); + int iA; + + if (emb->plan&EMB_A_MULTIBYTE) { + putc('<',f); + for (iA=0;str[iA];iA++) { + const unsigned short gid=otf_from_unicode(otf,(unsigned char)str[iA]); + fprintf(f,"%04x",gid); + bit_set(emb->subset,gid); + } + putc('>',f); + } else { + putc('(',f); + for (iA=0;str[iA];iA++) { + bit_set(emb->subset,otf_from_unicode(otf,(unsigned char)str[iA])); // TODO: emb_set(...) encoding/unicode->gid + } + fprintf(f,"%s",str); // TODO + putc(')',f); + } +} +// }}} + +int main(int argc,char **argv) +{ + const char *fn="/usr/share/fonts/truetype/microsoft/ARIALN.TTF"; + if (argc==2) { + fn=argv[1]; + } + OTF_FILE *otf=otf_load(fn); + assert(otf); + FONTFILE *ff=fontfile_open_sfnt(otf); + EMB_PARAMS *emb=emb_new(ff, + EMB_DEST_PS, + EMB_C_FORCE_MULTIBYTE| + EMB_C_TAKE_FONTFILE); + + FILE *f=fopen("test.ps","w"); + assert(f); + + assert(emb->subset); + + fprintf(f,"%%!PS-Adobe-2.0\n"); + + char *str="Hallo"; + + bit_set(emb->subset,otf_from_unicode(otf,'a')); + + int iA; + for (iA=0;str[iA];iA++) { + bit_set(emb->subset,otf_from_unicode(otf,(unsigned char)str[iA])); + } + + emb_embed(emb,example_outfn,f); + + // content + fprintf(f," 100 100 moveto\n" // content + " /%s findfont 10 scalefont setfont\n",emb_otf_get_fontname(emb->font->sfnt)); + write_string(f,emb,"Hallo"); + fprintf(f," show\n" + "showpage\n"); + + fprintf(f,"%%%%EOF\n"); + fclose(f); + + emb_close(emb); + + return 0; +} --- cups-1.3.8.orig/debian/local/filters/pdf-filters/filter/fontembed/test_analyze.c +++ cups-1.3.8/debian/local/filters/pdf-filters/filter/fontembed/test_analyze.c @@ -0,0 +1,205 @@ +#include "sfnt.h" +#include "sfnt_int.h" +#include <assert.h> +#include <stdio.h> +#include <stdlib.h> + +enum { WEIGHT_THIN=100, + WEIGHT_EXTRALIGHT=200, WEIGHT_ULTRALIGHT=200, + WEIGHT_LIGHT=300, + WEIGHT_NORMAL=400, WEIGHT_REGULAR=400, + WEIGHT_MEDIUM=500, + WEIGHT_SEMIBOLD=600, // DEMI + WEIGHT_BOLD=700, + WEIGHT_EXTRABOLD=800, WEIGHT_ULTRABOLD=800, + WEIGHT_BLACK=900, WEIGHT_HEAVY=900 }; + +void show_post(OTF_FILE *otf) // {{{ +{ + assert(otf); + int len=0; + char *buf; + + buf=otf_get_table(otf,OTF_TAG('p','o','s','t'),&len); + if (!buf) { + assert(len==-1); + printf("No post table\n"); + return; + } + // TODO: check len + printf("POST: (%d bytes)\n" + " version: %08x\n" + " italicAngle: %d.%d\n" + " underlinePosition: %d\n" + " underlineThickness: %d\n" + " isFixedPitch: %d\n" + " vmType42: %d %d\n" + " vmType1: %d %d\n",len, + get_ULONG(buf), + get_LONG(buf+4)>>16,get_ULONG(buf+4)&0xffff, + get_SHORT(buf+8), + get_SHORT(buf+10), + get_ULONG(buf+12), + get_ULONG(buf+16),get_ULONG(buf+20), + get_ULONG(buf+24),get_ULONG(buf+38)); + free(buf); +} +// }}} + +void show_name(OTF_FILE *otf) // {{{ +{ + assert(otf); + int iA,len=0; + char *buf; + + buf=otf_get_table(otf,OTF_TAG('n','a','m','e'),&len); + if (!buf) { + assert(len==-1); + printf("No name table\n"); + return; + } + printf("NAME:\n"); + int name_count=get_USHORT(buf+2); + const char *nstore=buf+get_USHORT(buf+4); + for (iA=0;iA<name_count;iA++) { + const char *nrec=buf+6+12*iA; + printf(" { platformID/encodingID/languageID/nameID: %d/%d/%d/%d\n" + " length: %d, offset: %d, data :", + get_USHORT(nrec), + get_USHORT(nrec+2), + get_USHORT(nrec+4), + get_USHORT(nrec+6), + get_USHORT(nrec+8), + get_USHORT(nrec+10)); + if ( (get_USHORT(nrec)==0)|| + ( (get_USHORT(nrec)==3) ) ) { // WCHAR + int nlen=get_USHORT(nrec+8); + int npos=get_USHORT(nrec+10); + for (;nlen>0;nlen-=2,npos+=2) { + if (nstore[npos]!=0x00) { + printf("?"); + } else { + printf("%c",nstore[npos+1]); + } + } + printf(" }\n"); + } else { + printf("%.*s }\n", + get_USHORT(nrec+8),nstore+get_USHORT(nrec+10)); + } + } + free(buf); +} +// }}} + +void show_cmap(OTF_FILE *otf) // {{{ +{ + assert(otf); + int iA,len=0; + + char *cmap=otf_get_table(otf,OTF_TAG('c','m','a','p'),&len); + if (!cmap) { + assert(len==-1); + printf("No cmap table\n"); + return; + } + printf("cmap:\n"); + assert(get_USHORT(cmap)==0x0000); // version + const int numTables=get_USHORT(cmap+2); + printf(" numTables: %d\n",numTables); + for (iA=0;iA<numTables;iA++) { + const char *nrec=cmap+4+8*iA; + const char *ndata=cmap+get_ULONG(nrec+4); + assert(ndata>=cmap+4+8*numTables); + printf(" platformID/encodingID: %d/%d\n" + " offset: %d data (format: %d, length: %d, language: %d);\n", + get_USHORT(nrec),get_USHORT(nrec+2), + get_ULONG(nrec+4), + get_USHORT(ndata),get_USHORT(ndata+2),get_USHORT(ndata+4)); + } + free(cmap); +} +// }}} + +void show_glyf(OTF_FILE *otf,int full) // {{{ +{ + assert(otf); + + // ensure >glyphOffsets and >gly is there + if ( (!otf->gly)||(!otf->glyphOffsets) ) { + if (otf_load_glyf(otf)!=0) { + assert(0); + return; + } + } + + int iA; + int compGlyf=0,zeroGlyf=0; + + // {{{ glyf + assert(otf->gly); + for (iA=0;iA<otf->numGlyphs;iA++) { + int len=otf_get_glyph(otf,iA); + if (len==0) { + zeroGlyf++; + } else if (get_SHORT(otf->gly)==-1) { + compGlyf++; + } + if (full) { + printf("%d(%d) ",get_SHORT(otf->gly),len); + } + } + if (full) { + printf("\n"); + } + printf("numGlyf(nonnull): %d(%d), composites: %d\n",otf->numGlyphs,otf->numGlyphs-zeroGlyf,compGlyf); + // }}} +} +// }}} + +int main(int argc,char **argv) +{ + const char *fn="/usr/share/fonts/truetype/microsoft/ARIALN.TTF"; + if (argc==2) { + fn=argv[1]; + } + OTF_FILE *otf=otf_load(fn); + assert(otf); + if (otf->numTTC) { + printf("TTC has %d fonts, using %d\n",otf->numTTC,otf->useTTC); + } + if (otf->version==0x00010000) { + printf("Got TTF 1.0\n"); + } else if (otf->version==OTF_TAG('O','T','T','O')) { + printf("Got OTF(CFF)\n"); + } else if (otf->version==OTF_TAG('t','r','u','e')) { + printf("Got TTF (true)\n"); + } else if (otf->version==OTF_TAG('t','y','p','1')) { + printf("Got SFNT(Type1)\n"); + } + + printf("Has %d tables\n",otf->numTables); + + int iA; + for (iA=0;iA<otf->numTables;iA++) { + printf("%c%c%c%c %d\n",OTF_UNTAG(otf->tables[iA].tag),otf->tables[iA].length); + } + printf("unitsPerEm: %d, indexToLocFormat: %d\n", + otf->unitsPerEm,otf->indexToLocFormat); + printf("num glyphs: %d\n",otf->numGlyphs); + otf_get_width(otf,0); // load table. + printf("numberOfHMetrics: %d\n",otf->numberOfHMetrics); + + show_post(otf); + + show_name(otf); + + show_cmap(otf); + // printf("%d %d\n",otf_from_unicode(otf,'A'),0); + + show_glyf(otf,1); + + otf_close(otf); + + return 0; +} --- cups-1.3.8.orig/debian/local/filters/pdf-filters/filter/fontembed/dynstring.c +++ cups-1.3.8/debian/local/filters/pdf-filters/filter/fontembed/dynstring.c @@ -0,0 +1,104 @@ +#include "dynstring.h" +#include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <assert.h> + +int dyn_init(DYN_STRING *ds,int reserve_size) // {{{ +{ + assert(ds); + assert(reserve_size>0); + + ds->len=0; + ds->alloc=reserve_size; + ds->buf=malloc(ds->alloc+1); + if (!ds->buf) { + fprintf(stderr,"Bad alloc: %m\n"); + assert(0); + ds->len=-1; + return -1; + } + return 0; +} +// }}} + +void dyn_free(DYN_STRING *ds) // {{{ +{ + assert(ds); + + ds->len=-1; + ds->alloc=0; + free(ds->buf); + ds->buf=NULL; +} +// }}} + +int dyn_ensure(DYN_STRING *ds,int free_space) // {{{ +{ + assert(ds); + assert(free_space); + + if (ds->len<0) { + return -1; + } + if (ds->alloc - ds->len >= free_space) { + return 0; // done + } + ds->alloc+=free_space; + char *tmp=realloc(ds->buf,ds->alloc+1); + if (!tmp) { + ds->len=-1; + fprintf(stderr,"Bad alloc: %m\n"); + assert(0); + return -1; + } + ds->buf=tmp; + return 0; +} +// }}} + +inline int dyn_vprintf(DYN_STRING *ds,const char *fmt,va_list ap) // {{{ +{ + assert(ds); + + int need,len=strlen(fmt)+100; + va_list va; + + if (dyn_ensure(ds,len)==-1) { + return -1; + } + + while (1) { + va_copy(va,ap); + need=vsnprintf(ds->buf+ds->len,ds->alloc-ds->len+1,fmt,va); + va_end(va); + if (need==-1) { + len+=100; + } else if (need>=len) { + len=need; + } else { + ds->len+=need; + break; + } + if (dyn_ensure(ds,len)==-1) { + return -1; + } + } + return 0; +} +// }}} + +int dyn_printf(DYN_STRING *ds,const char *fmt,...) // {{{ +{ + va_list va; + int ret; + + va_start(va,fmt); + ret=dyn_vprintf(ds,fmt,va); + va_end(va); + + return ret; +} +// }}} + --- cups-1.3.8.orig/debian/local/filters/pdf-filters/filter/fontembed/fontfile.h +++ cups-1.3.8/debian/local/filters/pdf-filters/filter/fontembed/fontfile.h @@ -0,0 +1,22 @@ +#ifndef _FONTFILE_H +#define _FONTFILE_H + +#include "sfnt.h" + +struct _FONTFILE { + OTF_FILE *sfnt; + // ??? *cff; + char *stdname; + union { + int fobj; + void *user; + }; +}; + +typedef struct _FONTFILE FONTFILE; + +FONTFILE *fontfile_open_sfnt(OTF_FILE *otf); +FONTFILE *fontfile_open_std(const char *name); +void fontfile_close(FONTFILE *ff); + +#endif --- cups-1.3.8.orig/debian/local/filters/pdf-filters/filter/fontembed/fontfile.c +++ cups-1.3.8/debian/local/filters/pdf-filters/filter/fontembed/fontfile.c @@ -0,0 +1,50 @@ +#include "fontfile.h" +#include <assert.h> +#include <string.h> + +//FONTFILE *fontfile_open(const char *filename); + +/* +FONTFILE *fontfile_open(const char *filename) +{ + // TODO? check magic + if (...) { + } +} +*/ + +FONTFILE *fontfile_open_sfnt(OTF_FILE *otf) // {{{ +{ + if (!otf) { + assert(0); + return NULL; + } + FONTFILE *ret=calloc(1,sizeof(FONTFILE)); + + ret->sfnt=otf; + + return ret; +} +// }}} + +FONTFILE *fontfile_open_std(const char *name) // {{{ +{ + assert(name); + FONTFILE *ret=calloc(1,sizeof(FONTFILE)); + + ret->stdname=strdup(name); + + return ret; +} +// }}} + +void fontfile_close(FONTFILE *ff) // {{{ +{ + if (ff) { + otf_close(ff->sfnt); + // ??? cff_close(ff->cff); + free(ff->stdname); + free(ff); + } +} +// }}} --- cups-1.3.8.orig/debian/local/filters/pdf-filters/filter/fontembed/test_pdf.c +++ cups-1.3.8/debian/local/filters/pdf-filters/filter/fontembed/test_pdf.c @@ -0,0 +1,217 @@ +#include "embed.h" +#include "sfnt.h" +#include <assert.h> +#include <stdio.h> +#include <stdlib.h> + +static void example_outfn(const char *buf,int len,void *context) // {{{ +{ + FILE *f=(FILE *)context; + if (fwrite(buf,1,len,f)!=len) { + fprintf(stderr,"Short write: %m\n"); + assert(0); + return; + } +} +// }}} + +#define OBJ \ + xref[xrefpos++]=ftell(f); \ + fprintf(f,"%d 0 obj\n",xrefpos); + +#define ENDOBJ \ + fprintf(f,"endobj\n"); + +#define STREAMDICT \ + OBJ; \ + fprintf(f,"<<\n" \ + " /Length %d 0 R\n",xrefpos+1); + +#define STREAMDATA \ + fprintf(f,">>\n" \ + "stream\n"); \ + stream_len=-ftell(f); + +#define STREAM \ + STREAMDICT \ + STREAMDATA + +#define ENDSTREAM \ + stream_len+=ftell(f); \ + fprintf(f,"endstream\n" \ + "endobj\n"); \ + OBJ; \ + fprintf(f,"%d\n",stream_len); \ + ENDOBJ; + +static inline void write_string(FILE *f,EMB_PARAMS *emb,const char *str) // {{{ +{ + assert(f); + assert(emb); + OTF_FILE *otf=emb->font->sfnt; + assert(otf); + int iA; + + if (emb->plan&EMB_A_MULTIBYTE) { + putc('<',f); + for (iA=0;str[iA];iA++) { + const unsigned short gid=otf_from_unicode(otf,(unsigned char)str[iA]); + fprintf(f,"%04x",gid); + bit_set(emb->subset,gid); + } + putc('>',f); + } else { + putc('(',f); + for (iA=0;str[iA];iA++) { + bit_set(emb->subset,otf_from_unicode(otf,(unsigned char)str[iA])); // TODO: emb_set(...) encoding/unicode->gid + } + fprintf(f,"%s",str); // TODO + putc(')',f); + } +} +// }}} + +int main(int argc,char **argv) +{ + const char *fn="/usr/share/fonts/truetype/microsoft/ARIALN.TTF"; + if (argc==2) { + fn=argv[1]; + } + OTF_FILE *otf=otf_load(fn); + assert(otf); + FONTFILE *ff=fontfile_open_sfnt(otf); + EMB_PARAMS *emb=emb_new(ff, + EMB_DEST_PDF16, + EMB_C_FORCE_MULTIBYTE| + EMB_C_TAKE_FONTFILE); + + FILE *f=fopen("test.pdf","w"); + assert(f); + int xref[100],xrefpos=3; + int stream_len; + + assert(emb->subset); + + fprintf(f,"%%PDF-1.3\n"); + // content + STREAM; + fprintf(f,"BT\n" // content + " 100 100 Td\n" + " /F1 10 Tf\n"); + write_string(f,emb,"Hallo"); + fprintf(f," Tj\n" + "ET\n"); + ENDSTREAM; + + bit_set(emb->subset,otf_from_unicode(otf,'a')); + + // {{{ do font + EMB_PDF_FONTDESCR *fdes=emb_pdf_fontdescr(emb); + assert(fdes); + EMB_PDF_FONTWIDTHS *fwid=emb_pdf_fontwidths(emb); + assert(fwid); + + STREAMDICT; + int ff_ref=xrefpos; + if (emb_pdf_get_fontfile_subtype(emb)) { + fprintf(f," /SubType /%s\n", + emb_pdf_get_fontfile_subtype(emb)); + } + if (emb->outtype&EMB_OUTPUT_T1) { + fprintf(f," /Length1 ?\n" + " /Length2 ?\n" + " /Length3 ?\n"); + } else { + fprintf(f," /Length1 %d 0 R\n",xrefpos+2); + } + STREAMDATA; + const int outlen=emb_embed(emb,example_outfn,f); + ENDSTREAM; + OBJ; + fprintf(f,"%d\n",outlen); + ENDOBJ; + + OBJ; + const int fd_ref=xrefpos; + char *res=emb_pdf_simple_fontdescr(emb,fdes,ff_ref); + assert(res); + fputs(res,f); + free(res); + ENDOBJ; + + OBJ; + int f_ref=xrefpos; + res=emb_pdf_simple_font(emb,fdes,fwid,fd_ref); + assert(res); + fputs(res,f); + free(res); + ENDOBJ; + + if (emb->plan&EMB_A_MULTIBYTE) { + OBJ; + res=emb_pdf_simple_cidfont(emb,fdes->fontname,f_ref); + f_ref=xrefpos; + assert(res); + fputs(res,f); + free(res); + ENDOBJ; + } + + free(fdes); + free(fwid); + // }}} + + int iA; + + xref[2]=ftell(f); + fprintf(f,"3 0 obj\n" + "<</Type/Page\n" + " /Parent 2 0 R\n" + " /MediaBox [0 0 595 842]\n" + " /Contents 4 0 R\n" + " /Resources <<\n" + " /Font <<\n" + " /F1 %d 0 R\n" + " >>\n" + " >>\n" + ">>\n" + "endobj\n", + f_ref); + xref[1]=ftell(f); + fprintf(f,"2 0 obj\n" + "<</Type/Pages\n" + " /Count 1\n" + " /Kids [3 0 R]" + ">>\n" + "endobj\n"); + xref[0]=ftell(f); + fprintf(f,"1 0 obj\n" + "<</Type/Catalog\n" + " /Pages 2 0 R\n" + ">>\n" + "endobj\n"); + // {{{ pdf trailer + int xref_start=ftell(f); + fprintf(f,"xref\n" + "0 %d\n" + "%010d 65535 f \n", + xrefpos+1,0); + for (iA=0;iA<xrefpos;iA++) { + fprintf(f,"%010d 00000 n \n",xref[iA]); + } + fprintf(f,"trailer\n" + "<<\n" + " /Size %d\n" + " /Root 1 0 R\n" + ">>\n" + "startxref\n" + "%d\n" + "%%%%EOF\n", + xrefpos+1,xref_start); + // }}} + fclose(f); + + emb_close(emb); + + return 0; +} --- cups-1.3.8.orig/debian/local/filters/pdf-filters/filter/fontembed/iofn.h +++ cups-1.3.8/debian/local/filters/pdf-filters/filter/fontembed/iofn.h @@ -0,0 +1,6 @@ +#ifndef _IOFN_H +#define _IOFN_H + +typedef void (*OUTPUT_FN)(const char *buf,int len,void *context); + +#endif --- cups-1.3.8.orig/debian/local/filters/pdf-filters/filter/fontembed/Makefile +++ cups-1.3.8/debian/local/filters/pdf-filters/filter/fontembed/Makefile @@ -0,0 +1,50 @@ +SOURCES=main.c sfnt.c embed.c embed_sfnt.c test_analyse.c dynstring.c test_pdf.c fontfile.c +LIBOBJ=sfnt.o embed.o embed_sfnt.o dynstring.o fontfile.o +EXEC=ttfread test_analyze test_pdf test_ps +LIB=libfontembed.a + +#CPPFLAGS=-O3 -funroll-all-loops -finline-functions -Wall -g +CPPFLAGS=-Wall -g +LDFLAGS= + +OBJECTS=$(patsubst %.c,$(PREFIX)%$(SUFFIX).o,\ + $(patsubst %.cpp,$(PREFIX)%$(SUFFIX).o,\ +$(SOURCES))) +DEPENDS=$(patsubst %.c,$(PREFIX)%$(SUFFIX).d,\ + $(patsubst %.cpp,$(PREFIX)%$(SUFFIX).d,\ + $(filter-out %.o,""\ +$(SOURCES)))) + +all: $(LIB) +test: $(EXEC) +ifneq "$(MAKECMDGOALS)" "clean" + -include $(DEPENDS) +endif + +clean: + rm -f $(EXEC) $(LIB) $(OBJECTS) $(DEPENDS) + +%.d: %.c + @$(SHELL) -ec '$(CXX) -MM $(CPPFLAGS) $< \ + | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@;\ + [ -s $@ ] || rm -f $@' + +%.d: %.cpp + @$(SHELL) -ec '$(CXX) -MM $(CPPFLAGS) $< \ + | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@;\ + [ -s $@ ] || rm -f $@' + +$(LIB): $(LIBOBJ) + $(AR) rcu $@ $^ + +ttfread: main.o $(LIB) + $(CXX) -o $@ $^ $(LDFLAGS) + +test_analyze: test_analyze.o $(LIB) + $(CXX) -o $@ $^ $(LDFLAGS) + +test_pdf: test_pdf.o $(LIB) + $(CXX) -o $@ $^ $(LDFLAGS) + +test_ps: test_ps.o $(LIB) + $(CXX) -o $@ $^ $(LDFLAGS) --- cups-1.3.8.orig/debian/local/filters/pdf-filters/filter/fontembed/dynstring.h +++ cups-1.3.8/debian/local/filters/pdf-filters/filter/fontembed/dynstring.h @@ -0,0 +1,15 @@ +#ifndef _DYNSTRING_H +#define _DYNSTRING_H + +typedef struct { + int len,alloc; + char *buf; +} DYN_STRING; + +int dyn_init(DYN_STRING *ds,int reserve_size); // -1 on error +void dyn_free(DYN_STRING *ds); +int dyn_ensure(DYN_STRING *ds,int free_space); +int dyn_printf(DYN_STRING *ds,const char *fmt,...); // appends + +#endif + --- cups-1.3.8.orig/debian/local/filters/pdf-filters/filter/fontembed/embed.h +++ cups-1.3.8/debian/local/filters/pdf-filters/filter/fontembed/embed.h @@ -0,0 +1,117 @@ +#ifndef EMBED_H +#define EMBED_H + +#include "bitset.h" +#include "fontfile.h" +#include "iofn.h" + +typedef enum { EMB_INPUT_T1, // type1-lib, with AFM/PFM,PFA/PFB + EMB_INPUT_TTF, // sfnt-lib, for TTF(glyf) + EMB_INPUT_OTF, // sfnt-lib + cff-lib, for OTF + EMB_INPUT_CFF, // cff-lib, for raw CFF + EMB_INPUT_STDFONT // don't embed (already present) + } EMB_INPUT_FORMAT; +typedef enum { EMB_OUTPUT_T1, // original type1 + EMB_OUTPUT_TTF, // ttf(glyf) + EMB_OUTPUT_CFF, // raw cff + EMB_OUTPUT_SFNT // OpenType (cff or glyf) + } EMB_OUTPUT_FORMAT; +typedef enum { EMB_DEST_NATIVE, // just subsetting/conversion + EMB_DEST_PS, + EMB_DEST_PDF16 // TODO? PDF13 + } EMB_DESTINATION; + +typedef enum { EMB_RIGHT_FULL=0, EMB_RIGHT_NONE=0x02, + EMB_RIGHT_READONLY=0x04, + EMB_RIGHT_NO_SUBSET=0x0100, + EMB_RIGHT_BITMAPONLY=0x0200 } EMB_RIGHT_TYPE; + +typedef enum { EMB_A_MULTIBYTE=0x01, // embedd as multibyte font? + EMB_A_SUBSET=0x02, // do subsetting? + EMB_A_CONVERT_CFF=0x04, // convert Type1 to CFF? + EMB_A_WRAP_SFNT=0x08, // wrap in sfnt? (OTF) + + EMB_A_CLOSE_FONTFILE=0x8000 + } EMB_ACTIONS; + +typedef struct _EMB_PARAMS { + EMB_INPUT_FORMAT intype; + EMB_OUTPUT_FORMAT outtype; + EMB_DESTINATION dest; + + EMB_ACTIONS plan; + + // font infos + FONTFILE *font; + EMB_RIGHT_TYPE rights; +// public: + BITSET subset; + +} EMB_PARAMS; + +typedef enum { EMB_C_MUST_SUBSET=0x01, // (fail, when not possible) + EMB_C_EDITABLE_SUBSET=0x02, // (...) + EMB_C_NEVER_SUBSET=0x04, // (...) + + EMB_C_FORCE_MULTIBYTE=0x08, // always use multibyte fonts + + EMB_C_PDF_OT=0x10, // output CFF and even TTF as OpenType (for PDF) + EMB_C_KEEP_T1=0x20, // don't convert T1 to CFF + + EMB_C_TAKE_FONTFILE=0x8000 // take ownership of fontfile + } EMB_CONSTRAINTS; + +EMB_PARAMS *emb_new(FONTFILE *font,EMB_DESTINATION dest,EMB_CONSTRAINTS mode); +int emb_embed(EMB_PARAMS *emb,OUTPUT_FN output,void *context); // returns number of bytes written +void emb_close(EMB_PARAMS *emb); + +/*** PDF out stuff ***/ +// all the necessary information for pdf font embedding +typedef struct { + char *fontname; + unsigned int flags; + + // for the following: 0=not set/invalid + int bbxmin,bbymin,bbxmax,bbymax; + int italicAngle; // >=90: not set/invalid + int ascend; + int descend; + int capHeight; + int stemV; + // optional, default=0: + int xHeight; + int avgWidth; + + // CID-additions: + char *panose; // 12 bytes + char *registry,*ordering; + int supplement; + + char data[]; // used for storing e.g. >fontname +} EMB_PDF_FONTDESCR; + +typedef struct { + // normal font + int first,last; + int *widths; + + // multibyte font + int default_width; + int *warray; // format: len c w ... w if (len<0) { c1 (c2=c1+(-len)) w } else { c w[len] }, terminated by len==0 + + int data[]; +} EMB_PDF_FONTWIDTHS; + +const char *emb_pdf_get_font_subtype(EMB_PARAMS *emb); +const char *emb_pdf_get_fontfile_key(EMB_PARAMS *emb); +const char *emb_pdf_get_fontfile_subtype(EMB_PARAMS *emb); + +EMB_PDF_FONTDESCR *emb_pdf_fontdescr(EMB_PARAMS *emb); +EMB_PDF_FONTWIDTHS *emb_pdf_fontwidths(EMB_PARAMS *emb); + +char *emb_pdf_simple_fontdescr(EMB_PARAMS *emb,EMB_PDF_FONTDESCR *fdes,int fontfile_obj_ref); +char *emb_pdf_simple_font(EMB_PARAMS *emb,EMB_PDF_FONTDESCR *fdes,EMB_PDF_FONTWIDTHS *fwid,int fontdescr_obj_ref); +char *emb_pdf_simple_cidfont(EMB_PARAMS *emb,const char *fontname,int descendant_obj_ref); +char *emb_pdf_simple_stdfont(EMB_PARAMS *emb); + +#endif --- cups-1.3.8.orig/debian/local/filters/pdf-filters/filter/fontembed/sfnt.h +++ cups-1.3.8/debian/local/filters/pdf-filters/filter/fontembed/sfnt.h @@ -0,0 +1,62 @@ +#ifndef _SFNT_H +#define _SFNT_H + +#include <stdio.h> +#include "bitset.h" + +typedef struct { + unsigned int tag; + unsigned int checkSum; + unsigned int offset; + unsigned int length; +} OTF_DIRENT; + +typedef struct { + FILE *f; + unsigned int numTTC,useTTC; + unsigned int version; + + unsigned short numTables; + OTF_DIRENT *tables; + + int flags; + unsigned short unitsPerEm; + unsigned short indexToLocFormat; // 0=short, 1=long + unsigned short numGlyphs; + + // optionally loaded data + unsigned int *glyphOffsets; + unsigned short numberOfHMetrics; + char *hmtx,*name,*cmap; + const char *unimap; // ptr to (3,1) or (3,0) cmap start + + // single glyf buffer, allocated large enough by otf_load_more() + char *gly; + OTF_DIRENT *glyfTable; + +} OTF_FILE; +#define OTF_F_FMT_CFF 0x10000 +#define OTF_F_DO_CHECKSUM 0x40000 + +// to load TTC collections: append e.g. "/3" for the third font in the file. +OTF_FILE *otf_load(const char *file); +void otf_close(OTF_FILE *otf); + +#define OTF_TAG(a,b,c,d) (unsigned int)( ((a)<<24)|((b)<<16)|((c)<<8)|(d) ) +#define OTF_UNTAG(a) (((unsigned int)(a)>>24)&0xff),(((unsigned int)(a)>>16)&0xff),\ + (((unsigned int)(a)>>8)&0xff),(((unsigned int)(a))&0xff) + +char *otf_get_table(OTF_FILE *otf,unsigned int tag,int *ret_len); + +int otf_get_width(OTF_FILE *otf,unsigned short gid); +const char *otf_get_name(OTF_FILE *otf,int platformID,int encodingID,int languageID,int nameID,int *ret_len); +int otf_get_glyph(OTF_FILE *otf,unsigned short gid); +unsigned short otf_from_unicode(OTF_FILE *otf,int unicode); + + +#include "iofn.h" + +int otf_subset(OTF_FILE *otf,BITSET glyphs,OUTPUT_FN output,void *context); +int otf_ttc_extract(OTF_FILE *otf,OUTPUT_FN output,void *context); + +#endif --- cups-1.3.8.orig/debian/local/filters/pdf-filters/filter/fontembed/bitset.h +++ cups-1.3.8/debian/local/filters/pdf-filters/filter/fontembed/bitset.h @@ -0,0 +1,24 @@ +#ifndef _BITSET_H +#define _BITSET_H + +#include <stdlib.h> + +typedef int * BITSET; + +static inline void bit_set(BITSET bs,int num) +{ + bs[num/(8*sizeof(int))]|=1<<(num%(8*sizeof(int))); +} + +static inline int bit_check(BITSET bs,int num) +{ + return bs[num/(8*sizeof(int))]&1<<(num%(8*sizeof(int))); +} + +// use free() when done. returns NULL on bad_alloc +static inline BITSET bitset_new(int size) +{ + return (BITSET)calloc(1,((size+31)&~31)/8); +} + +#endif --- cups-1.3.8.orig/debian/local/filters/pdf-filters/conf/pdf.types +++ cups-1.3.8/debian/local/filters/pdf-filters/conf/pdf.types @@ -0,0 +1 @@ +application/vnd.cups-pdf --- cups-1.3.8.orig/debian/local/filters/pdf-filters/conf/imagetopdf.types +++ cups-1.3.8/debian/local/filters/pdf-filters/conf/imagetopdf.types @@ -0,0 +1,3 @@ +image/x-xbitmap xbm string(0,"#define"); +image/x-xpixmap xpm string(3,"XPM") +image/x-xwindowdump xwd string(4,<00000007>) --- cups-1.3.8.orig/debian/local/filters/pdf-filters/conf/pdftopdf.convs +++ cups-1.3.8/debian/local/filters/pdf-filters/conf/pdftopdf.convs @@ -0,0 +1,6 @@ +######################################################################## +# +# PDF filters +# + +application/pdf application/vnd.cups-pdf 22 pdftopdf --- cups-1.3.8.orig/debian/local/filters/pdf-filters/conf/texttopdf.convs +++ cups-1.3.8/debian/local/filters/pdf-filters/conf/texttopdf.convs @@ -0,0 +1,6 @@ +application/x-cshell application/pdf 0 texttopdf +application/x-csource application/pdf 0 texttopdf +application/x-perl application/pdf 0 texttopdf +application/x-shell application/pdf 0 texttopdf +text/plain application/pdf 0 texttopdf +text/html application/pdf 0 texttopdf --- cups-1.3.8.orig/debian/local/filters/pdf-filters/conf/HP-PhotoSmart_Pro_B8300-hpijs-pdftoijs.ppd +++ cups-1.3.8/debian/local/filters/pdf-filters/conf/HP-PhotoSmart_Pro_B8300-hpijs-pdftoijs.ppd @@ -0,0 +1,542 @@ +*PPD-Adobe: "4.3" +*% +*% For information on using this, and to obtain the required backend +*% script, consult http://www.openprinting.org/ +*% +*% This file is published under the GNU General Public License +*% +*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with +*% all programs and environments which use PPD files for dealing with +*% printer capability information. The printer must be configured with the +*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This +*% file and "foomatic-rip" work together to support PPD-controlled printer +*% driver option access with arbitrary free software printer drivers and +*% printing spoolers. +*% +*% To save this file on your disk, wait until the download has completed +*% (the animation of the browser logo must stop) and then use the +*% "Save as..." command in the "File" menu of your browser or in the +*% pop-up manu when you click on this document with the right mouse button. +*% DO NOT cut and paste this file into an editor with your mouse. This can +*% introduce additional line breaks which lead to unexpected results. +*% +*% You may save this file as 'HP-PhotoSmart_Pro_B8300-hpijs.ppd' +*% +*% +*FormatVersion: "4.3" +*FileVersion: "1.1" +*LanguageVersion: English +*LanguageEncoding: ISOLatin1 +*PCFileName: "HPIJS.PPD" +*Manufacturer: "HP" +*Product: "(PhotoSmart Pro B8300)" +*cupsVersion: 1.0 +*cupsManualCopies: True +*cupsModelNumber: 2 +*%cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip" +*cupsFilter: "application/vnd.cups-pdf 0 pdftoijs" +*%pprRIP: foomatic-rip other +*ModelName: "HP PhotoSmart Pro B8300" +*ShortNickName: "HP PhotoSmart Pro B8300 hpijs" +*NickName: "HP PhotoSmart Pro B8300 Foomatic/hpijs (recommended)" +*PSVersion: "(3010.000) 550" +*PSVersion: "(3010.000) 651" +*PSVersion: "(3010.000) 652" +*PSVersion: "(3010.000) 653" +*PSVersion: "(3010.000) 704" +*PSVersion: "(3010.000) 705" +*PSVersion: "(3010.000) 800" +*LanguageLevel: "3" +*ColorDevice: True +*DefaultColorSpace: RGB +*FileSystem: False +*Throughput: "1" +*LandscapeOrientation: Plus90 +*TTRasterizer: Type42 +*1284DeviceID: "DRV:Dhpijs,R1,M1,F1,Sv,TI,X1200,Y1200,C1,t90,l90,g100,p100,s70;" + +*driverName hpijs/hpijs - HP's IJS driver for most of their non-PostScript printers: "" +*driverType I/IJS: "" +*driverUrl: "http://hplip.sourceforge.net/" +*driverObsolete: False +*driverSupplier: "Hewlett-Packard" +*driverManufacturerSupplied: True +*driverLicense: "BSD" +*driverFreeSoftware: True +*driverSupportContactVoluntary: "https://launchpad.net/hplip HPLIP support and bug tracking system" +*driverMaxResolution: 1200 1200 +*driverColor: True +*driverTextSupport: 90 +*driverLineartSupport: 90 +*driverGraphicsSupport: 100 +*driverPhotoSupport: 100 +*driverRenderingSpeed: 70 + +*DefaultResolution: 1200dpi + + + +*HWMargins: 18 36 18 9 +*VariablePaperSize: True +*MaxMediaWidth: 100000 +*MaxMediaHeight: 100000 +*NonUIOrderDependency: 105 AnySetup *CustomPageSize +*CustomPageSize True: "pop pop pop pop pop +%% FoomaticRIPOptionSetting: PageSize=Custom" +*End +*FoomaticRIPOptionSetting PageSize=Custom: " -dDEVICEWIDTHPOINTS=0 -dD&& +EVICEHEIGHTPOINTS=0" +*End +*ParamCustomPageSize Width: 1 points 36 100000 +*ParamCustomPageSize Height: 2 points 36 100000 +*ParamCustomPageSize Orientation: 3 int 0 0 +*ParamCustomPageSize WidthOffset: 4 points 0 0 +*ParamCustomPageSize HeightOffset: 5 points 0 0 + +*FoomaticIDs: HP-PhotoSmart_Pro_B8300 hpijs +*FoomaticRIPCommandLine: "gs -q -dBATCH -dPARANOIDSAFER -dQUIET -dNOPA&& +USE -sDEVICE=ijs -sIjsServer=hpijs%A%B%C -dIjsUseOutputFD%Z -sOutputFi&& +le=- -" +*End + +*FoomaticRIPOption Model: enum CmdLine A 100 +*FoomaticRIPOptionSetting Model=HP-PhotoSmart_Pro_B8300: " -sDeviceMan&& +ufacturer="HEWLETT-PACKARD" -sDeviceModel="deskjet 5600&& +"" +*End + +*ijsServer: "hpijs" +*ijsManufacturer: "HP" +*ijsModel: "deskjet 5600" +*ijsColorSpace: "rgb" + +*OpenGroup: General/General + +*OpenUI *Quality/Resolution, Quality, Ink Type, Media Type: PickOne +*FoomaticRIPOption Quality: enum CmdLine B +*OrderDependency: 100 AnySetup *Quality +*DefaultQuality: 600ColorCMYK + +*Quality 300ColorCMYK/300 dpi, Color, Black + Color Cartr.: "%% FoomaticRIPOptionSetting: Quality=300ColorCMYK" +*FoomaticRIPOptionSetting Quality=300ColorCMYK: " -r300 -sIjsParams=Qu&& +ality:Quality=0,Quality:ColorMode=2,Quality:MediaType=0,Quality:PenSet&& +=2" +*End +*ijsParams Quality=300ColorCMYK: "Quality:Quality=0,Quality:ColorMode=2,Quality:MediaType=0,Quality:PenSet=2" +*ijsResolution Quality=300ColorCMYK: "300 300" + +*Quality 300ColorCMYKFullBleed/300 dpi, Color, Full Bleed, Black + Color Cartr.: "%% FoomaticRIPOptionSetting: Quality=300ColorCMYKFullBleed" +*FoomaticRIPOptionSetting Quality=300ColorCMYKFullBleed: " -r300 -sIjs&& +Params=Quality:Quality=0,Quality:ColorMode=2,Quality:MediaType=0,Quali&& +ty:PenSet=2,Quality:FullBleed=1" +*End +*ijsParams Quality=300ColorCMYKFullbleed: "Quality:Quality=0,Quality:ColorMode=2,Quality:MediaType=0,Quality:PenSet=2,Quality:FullBleed=1" +*ijsResolution Quality=300ColorCMYKFullbleed: "300 300" + +*Quality 300DraftColorCMYK/300 dpi, Draft, Color, Black + Color Cartr.: "%% FoomaticRIPOptionSetting: Quality=300DraftColorCMYK" +*FoomaticRIPOptionSetting Quality=300DraftColorCMYK: " -r300 -sIjsPara&& +ms=Quality:Quality=1,Quality:ColorMode=2,Quality:MediaType=0,Quality:P&& +enSet=2" +*End +*ijsParams Quality=300DraftColorCMYK: "Quality:Quality=1,Quality:ColorMode=2,Quality:MediaType=0,Quality:PenSet=2" +*ijsResolution Quality=300DraftColorCMYK: "300 300" + +*Quality 300DraftGrayscaleCMYK/300 dpi, Draft, Grayscale, Black + Color Cartr.: "%% FoomaticRIPOptionSetting: Quality=300DraftGrayscaleCMYK" +*FoomaticRIPOptionSetting Quality=300DraftGrayscaleCMYK: " -r300 -sIjs&& +Params=Quality:Quality=1,Quality:ColorMode=0,Quality:MediaType=0,Quali&& +ty:PenSet=2" +*End +*ijsParams Quality=300DraftGrayscaleCMYK: "Quality:Quality=1,Quality:ColorMode=0,Quality:MediaType=0,Quality:PenSet=2" +*ijsResolution Quality=300DraftGrayscaleCMYK: "300 300" + +*Quality 300FastDraftColorCMYK/300 dpi, FastDraft, Color, Black + Color Cartr.: "%% FoomaticRIPOptionSetting: Quality=300FastDraftColorCMYK" +*FoomaticRIPOptionSetting Quality=300FastDraftColorCMYK: " -r300 -sIjs&& +Params=Quality:Quality=4,Quality:ColorMode=2,Quality:MediaType=0,Quali&& +ty:PenSet=2" +*End +*ijsParams Quality=300FastDraftColorCMYK: "Quality:Quality=4,Quality:ColorMode=2,Quality:MediaType=0,Quality:PenSet=2" +*ijsResolution 300FastDraftColorCMYK: "300 300" + +*Quality 300FastDraftGrayscaleCMYK/300 dpi, FastDraft, Grayscale, Black + Color Cartr.: "%% FoomaticRIPOptionSetting: Quality=300FastDraftGrayscaleCMYK" +*FoomaticRIPOptionSetting Quality=300FastDraftGrayscaleCMYK: " -r300 -&& +sIjsParams=Quality:Quality=4,Quality:ColorMode=0,Quality:MediaType=0,Q&& +uality:PenSet=2" +*End +*ijsParams Quality=300FastDraftGrayscaleCMYK: "Quality:Quality=4,Quality:ColorMode=0,Quality:MediaType=0,Quality:PenSet=2" +*ijsResolution Quality=300FastDraftGrayscaleCMYK: "300 300" + +*Quality 300GrayscaleCMYK/300 dpi, Grayscale, Black + Color Cartr.: "%% FoomaticRIPOptionSetting: Quality=300GrayscaleCMYK" +*FoomaticRIPOptionSetting Quality=300GrayscaleCMYK: " -r300 -sIjsParam&& +s=Quality:Quality=0,Quality:ColorMode=0,Quality:MediaType=0,Quality:Pe&& +nSet=2" +*End +*ijsParams Quality=300GrayscaleCMYK: "Quality:Quality=0,Quality:ColorMode=0,Quality:MediaType=0,Quality:PenSet=2" +*ijsResolution Quality=300GrayscaleCMYK: "300 300" + +*Quality 600ColorCMYK/600 dpi, Color, Black + Color Cartr.: "%% FoomaticRIPOptionSetting: Quality=600ColorCMYK" +*FoomaticRIPOptionSetting Quality=600ColorCMYK: " -r600 -sIjsParams=Qu&& +ality:Quality=0,Quality:ColorMode=2,Quality:MediaType=0,Quality:PenSet&& +=2" +*End +*ijsParams Quality=600ColorCMYK: "Quality:Quality=0,Quality:ColorMode=2,Quality:MediaType=0,Quality:PenSet=2" +*ijsResolution Quality=600ColorCMYK: "600 600" + +*Quality 600ColorCMYKFullBleed/600 dpi, Color, Full Bleed, Black + Color Cartr.: "%% FoomaticRIPOptionSetting: Quality=600ColorCMYKFullBleed" +*FoomaticRIPOptionSetting Quality=600ColorCMYKFullBleed: " -r600 -sIjs&& +Params=Quality:Quality=0,Quality:ColorMode=2,Quality:MediaType=0,Quali&& +ty:PenSet=2,Quality:FullBleed=1" +*End +*ijsParams Quality=600ColorCMYKFullbleed: "Quality:Quality=0,Quality:ColorMode=2,Quality:MediaType=0,Quality:PenSet=2,Quality:FullBleed=1" +*ijsResolution Quality=600ColorCMYKFullbleed: "600 600" + +*Quality 600GrayscaleCMYK/600 dpi, Grayscale, Black + Color Cartr.: "%% FoomaticRIPOptionSetting: Quality=600GrayscaleCMYK" +*FoomaticRIPOptionSetting Quality=600GrayscaleCMYK: " -r600 -sIjsParam&& +s=Quality:Quality=0,Quality:ColorMode=0,Quality:MediaType=0,Quality:Pe&& +nSet=2" +*End +*ijsParams Quality=600GrayscaleCMYK: "Quality:Quality=0,Quality:ColorMode=0,Quality:MediaType=0,Quality:PenSet=2" +*ijsResolution Quality=600GrayscaleCMYK: "600 600" + +*Quality 1200PhotoCMYK/1200 dpi, Photo, Black + Color Cartr., Photo Paper: "%% FoomaticRIPOptionSetting: Quality=1200PhotoCMYK" +*FoomaticRIPOptionSetting Quality=1200PhotoCMYK: " -r1200 -sIjsParams=&& +Quality:Quality=3,Quality:ColorMode=2,Quality:MediaType=2,Quality:PenS&& +et=2" +*End +*ijsParams Quality=1200PhotoCMYK: "Quality:Quality=3,Quality:ColorMode=2,Quality:MediaType=2,Quality:PenSet=2" +*ijsResolution Quality=1200PhotoCMYK: "1200 1200" + +*Quality 1200PhotoCMYKFullBleed/1200 dpi, Photo, Full Bleed, Black + Color Cartr., Photo Paper: "%% FoomaticRIPOptionSetting: Quality=1200PhotoCMYKFullBleed" +*FoomaticRIPOptionSetting Quality=1200PhotoCMYKFullBleed: " -r1200 -sI&& +jsParams=Quality:Quality=3,Quality:ColorMode=2,Quality:MediaType=2,Qua&& +lity:PenSet=2,Quality:FullBleed=1" +*End +*ijsParams Quality=1200PhotoCMYKFullBleed: "Quality:Quality=3,Quality:ColorMode=2,Quality:MediaType=3,Quality:PenSet=2,Quality:FullBleed=1" +*ijsResolution Quality=1200PhotoCMYKFullBleed: "1200 1200" + +*CloseUI: *Quality + +*OpenUI *InputSlot/Media Source: PickOne +*FoomaticRIPOption InputSlot: enum CmdLine C +*OrderDependency: 100 AnySetup *InputSlot +*DefaultInputSlot: Default +*InputSlot Default/Printer default: "%% FoomaticRIPOptionSetting: InputSlot=Default" +*FoomaticRIPOptionSetting InputSlot=Default: ",PS:MediaPosition=7" +*ijsParams InputSlot=Default: "PS:MediaPosition=7" +*InputSlot PhotoTray/Photo Tray: "%% FoomaticRIPOptionSetting: InputSlot=PhotoTray" +*FoomaticRIPOptionSetting InputSlot=PhotoTray: ",PS:MediaPosition=6" +*ijsParams InputSlot=PhotoTray: "PS:MediaPosition=6" +*InputSlot Upper/Upper Tray: "%% FoomaticRIPOptionSetting: InputSlot=Upper" +*FoomaticRIPOptionSetting InputSlot=Upper: ",PS:MediaPosition=1" +*ijsParams InputSlot=Upper: "PS:MediaPosition=1" +*InputSlot Lower/Lower Tray: "%% FoomaticRIPOptionSetting: InputSlot=Lower" +*FoomaticRIPOptionSetting InputSlot=Lower: ",PS:MediaPosition=4" +*ijsParams InputSlot=Lower: "PS:MediaPosition=4" +*InputSlot CDDVDTray/CD or DVD Tray: "%% FoomaticRIPOptionSetting: InputSlot=CDDVDTray" +*FoomaticRIPOptionSetting InputSlot=CDDVDTray: ",PS:MediaPosition=14" +*ijsParams InputSlot=CDDVDTray: "PS:MediaPosition=14" +*InputSlot Envelope/Envelope Feeder: "%% FoomaticRIPOptionSetting: InputSlot=Envelope" +*FoomaticRIPOptionSetting InputSlot=Envelope: ",PS:MediaPosition=3" +*ijsParams InputSlot=Envelope: "PS:MediaPosition=3" +*InputSlot LargeCapacity/Large Capacity Tray: "%% FoomaticRIPOptionSetting: InputSlot=LargeCapacity" +*FoomaticRIPOptionSetting InputSlot=LargeCapacity: ",PS:MediaPosition=&& +5" +*End +*ijsParams InputSlot=LargeCapacity: "PS:MediaPosition=5" +*InputSlot Manual/Manual Feeder: "%% FoomaticRIPOptionSetting: InputSlot=Manual" +*FoomaticRIPOptionSetting InputSlot=Manual: ",PS:MediaPosition=2" +*ijsParams InputSlot=Manual: "PS:MediaPosition=2" +*InputSlot MPTray/Multi Purpose Tray: "%% FoomaticRIPOptionSetting: InputSlot=MPTray" +*FoomaticRIPOptionSetting InputSlot=MPTray: ",PS:MediaPosition=8" +*ijsParams InputSlot=MPTray: "PS:MediaPosition=8" +*CloseUI: *InputSlot + +*OpenUI *PageSize/Page Size: PickOne +*FoomaticRIPOption PageSize: enum CmdLine A +*OrderDependency: 105 AnySetup *PageSize +*DefaultPageSize: Letter +*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter" +*FoomaticRIPOptionSetting PageSize=Letter: " -dDEVICEWIDTHPOINTS=612 -&& +dDEVICEHEIGHTPOINTS=792" +*End +*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4" +*FoomaticRIPOptionSetting PageSize=A4: " -dDEVICEWIDTHPOINTS=595 -dDEV&& +ICEHEIGHTPOINTS=842" +*End +*PageSize Photo/Photo or 4x6 inch index card: "%% FoomaticRIPOptionSetting: PageSize=Photo" +*FoomaticRIPOptionSetting PageSize=Photo: " -dDEVICEWIDTHPOINTS=288 -d&& +DEVICEHEIGHTPOINTS=432" +*End +*PageSize Photo5x7/Photo or 5x7 inch index card: "%% FoomaticRIPOptionSetting: PageSize=Photo5x7" +*FoomaticRIPOptionSetting PageSize=Photo5x7: " -dDEVICEWIDTHPOINTS=360&& + -dDEVICEHEIGHTPOINTS=504" +*End +*PageSize PhotoTearOff/Photo with tear-off tab: "%% FoomaticRIPOptionSetting: PageSize=PhotoTearOff" +*FoomaticRIPOptionSetting PageSize=PhotoTearOff: " -dDEVICEWIDTHPOINTS&& +=288 -dDEVICEHEIGHTPOINTS=432" +*End +*PageSize 3x5/3x5 inch index card: "%% FoomaticRIPOptionSetting: PageSize=3x5" +*FoomaticRIPOptionSetting PageSize=3x5: " -dDEVICEWIDTHPOINTS=216 -dDE&& +VICEHEIGHTPOINTS=360" +*End +*PageSize 5x8/5x8 inch index card: "%% FoomaticRIPOptionSetting: PageSize=5x8" +*FoomaticRIPOptionSetting PageSize=5x8: " -dDEVICEWIDTHPOINTS=360 -dDE&& +VICEHEIGHTPOINTS=576" +*End +*PageSize A3/A3: "%% FoomaticRIPOptionSetting: PageSize=A3" +*FoomaticRIPOptionSetting PageSize=A3: " -dDEVICEWIDTHPOINTS=842 -dDEV&& +ICEHEIGHTPOINTS=1190" +*End +*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5" +*FoomaticRIPOptionSetting PageSize=A5: " -dDEVICEWIDTHPOINTS=420 -dDEV&& +ICEHEIGHTPOINTS=595" +*End +*PageSize A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6" +*FoomaticRIPOptionSetting PageSize=A6: " -dDEVICEWIDTHPOINTS=297 -dDEV&& +ICEHEIGHTPOINTS=420" +*End +*PageSize A6TearOff/A6 with tear-off tab: "%% FoomaticRIPOptionSetting: PageSize=A6TearOff" +*FoomaticRIPOptionSetting PageSize=A6TearOff: " -dDEVICEWIDTHPOINTS=29&& +7 -dDEVICEHEIGHTPOINTS=420" +*End +*PageSize B4JIS/B4 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B4JIS" +*FoomaticRIPOptionSetting PageSize=B4JIS: " -dDEVICEWIDTHPOINTS=729 -d&& +DEVICEHEIGHTPOINTS=1033" +*End +*PageSize B5JIS/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5JIS" +*FoomaticRIPOptionSetting PageSize=B5JIS: " -dDEVICEWIDTHPOINTS=516 -d&& +DEVICEHEIGHTPOINTS=729" +*End +*PageSize CDDVD80/CD or DVD 80 mm: "%% FoomaticRIPOptionSetting: PageSize=CDDVD80" +*FoomaticRIPOptionSetting PageSize=CDDVD80: " -dDEVICEWIDTHPOINTS=237 && +-dDEVICEHEIGHTPOINTS=237" +*End +*PageSize CDDVD120/CD or DVD 120 mm: "%% FoomaticRIPOptionSetting: PageSize=CDDVD120" +*FoomaticRIPOptionSetting PageSize=CDDVD120: " -dDEVICEWIDTHPOINTS=360&& + -dDEVICEHEIGHTPOINTS=360" +*End +*PageSize Env10/Envelope #10: "%% FoomaticRIPOptionSetting: PageSize=Env10" +*FoomaticRIPOptionSetting PageSize=Env10: " -dDEVICEWIDTHPOINTS=297 -d&& +DEVICEHEIGHTPOINTS=684" +*End +*PageSize EnvC5/Envelope C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5" +*FoomaticRIPOptionSetting PageSize=EnvC5: " -dDEVICEWIDTHPOINTS=459 -d&& +DEVICEHEIGHTPOINTS=649" +*End +*PageSize EnvC6/Envelope C6: "%% FoomaticRIPOptionSetting: PageSize=EnvC6" +*FoomaticRIPOptionSetting PageSize=EnvC6: " -dDEVICEWIDTHPOINTS=323 -d&& +DEVICEHEIGHTPOINTS=459" +*End +*PageSize EnvDL/Envelope DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL" +*FoomaticRIPOptionSetting PageSize=EnvDL: " -dDEVICEWIDTHPOINTS=312 -d&& +DEVICEHEIGHTPOINTS=624" +*End +*PageSize EnvISOB5/Envelope B5: "%% FoomaticRIPOptionSetting: PageSize=EnvISOB5" +*FoomaticRIPOptionSetting PageSize=EnvISOB5: " -dDEVICEWIDTHPOINTS=499&& + -dDEVICEHEIGHTPOINTS=709" +*End +*PageSize EnvMonarch/Envelope Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch" +*FoomaticRIPOptionSetting PageSize=EnvMonarch: " -dDEVICEWIDTHPOINTS=2&& +79 -dDEVICEHEIGHTPOINTS=540" +*End +*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive" +*FoomaticRIPOptionSetting PageSize=Executive: " -dDEVICEWIDTHPOINTS=52&& +2 -dDEVICEHEIGHTPOINTS=756" +*End +*PageSize FLSA/American Foolscap: "%% FoomaticRIPOptionSetting: PageSize=FLSA" +*FoomaticRIPOptionSetting PageSize=FLSA: " -dDEVICEWIDTHPOINTS=612 -dD&& +EVICEHEIGHTPOINTS=936" +*End +*PageSize Hagaki/Hagaki: "%% FoomaticRIPOptionSetting: PageSize=Hagaki" +*FoomaticRIPOptionSetting PageSize=Hagaki: " -dDEVICEWIDTHPOINTS=283 -&& +dDEVICEHEIGHTPOINTS=420" +*End +*PageSize Ledger/Ledger: "%% FoomaticRIPOptionSetting: PageSize=Ledger" +*FoomaticRIPOptionSetting PageSize=Ledger: " -dDEVICEWIDTHPOINTS=792 -&& +dDEVICEHEIGHTPOINTS=1224" +*End +*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal" +*FoomaticRIPOptionSetting PageSize=Legal: " -dDEVICEWIDTHPOINTS=612 -d&& +DEVICEHEIGHTPOINTS=1008" +*End +*PageSize Oufuku/Oufuku-Hagaki: "%% FoomaticRIPOptionSetting: PageSize=Oufuku" +*FoomaticRIPOptionSetting PageSize=Oufuku: " -dDEVICEWIDTHPOINTS=420 -&& +dDEVICEHEIGHTPOINTS=567" +*End +*PageSize SuperB/Super B: "%% FoomaticRIPOptionSetting: PageSize=SuperB" +*FoomaticRIPOptionSetting PageSize=SuperB: " -dDEVICEWIDTHPOINTS=936 -&& +dDEVICEHEIGHTPOINTS=1368" +*End +*PageSize w558h774/16K: "%% FoomaticRIPOptionSetting: PageSize=w558h774" +*FoomaticRIPOptionSetting PageSize=w558h774: " -dDEVICEWIDTHPOINTS=558&& + -dDEVICEHEIGHTPOINTS=774" +*End +*PageSize w612h935/Executive (JIS): "%% FoomaticRIPOptionSetting: PageSize=w612h935" +*FoomaticRIPOptionSetting PageSize=w612h935: " -dDEVICEWIDTHPOINTS=612&& + -dDEVICEHEIGHTPOINTS=935" +*End +*PageSize w774h1116/8K: "%% FoomaticRIPOptionSetting: PageSize=w774h1116" +*FoomaticRIPOptionSetting PageSize=w774h1116: " -dDEVICEWIDTHPOINTS=77&& +4 -dDEVICEHEIGHTPOINTS=1116" +*End +*CloseUI: *PageSize + +*OpenUI *PageRegion: PickOne +*OrderDependency: 105 AnySetup *PageRegion +*DefaultPageRegion: Letter +*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter" +*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4" +*PageRegion Photo/Photo or 4x6 inch index card: "%% FoomaticRIPOptionSetting: PageSize=Photo" +*PageRegion Photo5x7/Photo or 5x7 inch index card: "%% FoomaticRIPOptionSetting: PageSize=Photo5x7" +*PageRegion PhotoTearOff/Photo with tear-off tab: "%% FoomaticRIPOptionSetting: PageSize=PhotoTearOff" +*PageRegion 3x5/3x5 inch index card: "%% FoomaticRIPOptionSetting: PageSize=3x5" +*PageRegion 5x8/5x8 inch index card: "%% FoomaticRIPOptionSetting: PageSize=5x8" +*PageRegion A3/A3: "%% FoomaticRIPOptionSetting: PageSize=A3" +*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5" +*PageRegion A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6" +*PageRegion A6TearOff/A6 with tear-off tab: "%% FoomaticRIPOptionSetting: PageSize=A6TearOff" +*PageRegion B4JIS/B4 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B4JIS" +*PageRegion B5JIS/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5JIS" +*PageRegion CDDVD80/CD or DVD 80 mm: "%% FoomaticRIPOptionSetting: PageSize=CDDVD80" +*PageRegion CDDVD120/CD or DVD 120 mm: "%% FoomaticRIPOptionSetting: PageSize=CDDVD120" +*PageRegion Env10/Envelope #10: "%% FoomaticRIPOptionSetting: PageSize=Env10" +*PageRegion EnvC5/Envelope C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5" +*PageRegion EnvC6/Envelope C6: "%% FoomaticRIPOptionSetting: PageSize=EnvC6" +*PageRegion EnvDL/Envelope DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL" +*PageRegion EnvISOB5/Envelope B5: "%% FoomaticRIPOptionSetting: PageSize=EnvISOB5" +*PageRegion EnvMonarch/Envelope Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch" +*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive" +*PageRegion FLSA/American Foolscap: "%% FoomaticRIPOptionSetting: PageSize=FLSA" +*PageRegion Hagaki/Hagaki: "%% FoomaticRIPOptionSetting: PageSize=Hagaki" +*PageRegion Ledger/Ledger: "%% FoomaticRIPOptionSetting: PageSize=Ledger" +*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal" +*PageRegion Oufuku/Oufuku-Hagaki: "%% FoomaticRIPOptionSetting: PageSize=Oufuku" +*PageRegion SuperB/Super B: "%% FoomaticRIPOptionSetting: PageSize=SuperB" +*PageRegion w558h774/16K: "%% FoomaticRIPOptionSetting: PageSize=w558h774" +*PageRegion w612h935/Executive (JIS): "%% FoomaticRIPOptionSetting: PageSize=w612h935" +*PageRegion w774h1116/8K: "%% FoomaticRIPOptionSetting: PageSize=w774h1116" +*CloseUI: *PageRegion + +*DefaultImageableArea: Letter +*ImageableArea Letter/Letter: "18 36 594 783" +*ImageableArea A4/A4: "9.72 36 585.28 833" +*ImageableArea Photo/Photo or 4x6 inch index card: "0 36 288 432" +*ImageableArea Photo5x7/Photo or 5x7 inch index card: "0 36 360 504" +*ImageableArea PhotoTearOff/Photo with tear-off tab: "0 0 288 432" +*ImageableArea 3x5/3x5 inch index card: "0 36 216 360" +*ImageableArea 5x8/5x8 inch index card: "0 36 360 576" +*ImageableArea A3/A3: "14.40 36.00 827.60 1181" +*ImageableArea A5/A5: "9 36 411 586" +*ImageableArea A6/A6: "0 36 297 420" +*ImageableArea A6TearOff/A6 with tear-off tab: "0 0 297 420" +*ImageableArea B4JIS/B4 (JIS): "18 36 711 1024" +*ImageableArea B5JIS/B5 (JIS): "18 36 498 720" +*ImageableArea CDDVD80/CD or DVD 80 mm: "0 36 237 237" +*ImageableArea CDDVD120/CD or DVD 120 mm: "0 36 360 360" +*ImageableArea Env10/Envelope #10: "0 36 297 684" +*ImageableArea EnvC5/Envelope C5: "18 36 441 640" +*ImageableArea EnvC6/Envelope C6: "0 36 323 459" +*ImageableArea EnvDL/Envelope DL: "0 36 312 624" +*ImageableArea EnvISOB5/Envelope B5: "18 36 481 700" +*ImageableArea EnvMonarch/Envelope Monarch: "0 36 279 540" +*ImageableArea Executive/Executive: "18 36 504 747" +*ImageableArea FLSA/American Foolscap: "18 36 594 927" +*ImageableArea Hagaki/Hagaki: "0 36 283 420" +*ImageableArea Ledger/Ledger: "14.40 36 777.60 1215" +*ImageableArea Legal/Legal: "18 36 594 999" +*ImageableArea Oufuku/Oufuku-Hagaki: "0 36 420 567" +*ImageableArea SuperB/Super B: "14.40 36 921.60 1359" +*ImageableArea w558h774/16K: "18 36 540 765" +*ImageableArea w612h935/Executive (JIS): "18 36 594 926" +*ImageableArea w774h1116/8K: "18 36 756 1107" + +*DefaultPaperDimension: Letter +*PaperDimension Letter/Letter: "612 792" +*PaperDimension A4/A4: "595 842" +*PaperDimension Photo/Photo or 4x6 inch index card: "288 432" +*PaperDimension Photo5x7/Photo or 5x7 inch index card: "360 504" +*PaperDimension PhotoTearOff/Photo with tear-off tab: "288 432" +*PaperDimension 3x5/3x5 inch index card: "216 360" +*PaperDimension 5x8/5x8 inch index card: "360 576" +*PaperDimension A3/A3: "842 1190" +*PaperDimension A5/A5: "420 595" +*PaperDimension A6/A6: "297 420" +*PaperDimension A6TearOff/A6 with tear-off tab: "297 420" +*PaperDimension B4JIS/B4 (JIS): "729 1033" +*PaperDimension B5JIS/B5 (JIS): "516 729" +*PaperDimension CDDVD80/CD or DVD 80 mm: "237 237" +*PaperDimension CDDVD120/CD or DVD 120 mm: "360 360" +*PaperDimension Env10/Envelope #10: "297 684" +*PaperDimension EnvC5/Envelope C5: "459 649" +*PaperDimension EnvC6/Envelope C6: "323 459" +*PaperDimension EnvDL/Envelope DL: "312 624" +*PaperDimension EnvISOB5/Envelope B5: "499 709" +*PaperDimension EnvMonarch/Envelope Monarch: "279 540" +*PaperDimension Executive/Executive: "522 756" +*PaperDimension FLSA/American Foolscap: "612 936" +*PaperDimension Hagaki/Hagaki: "283 420" +*PaperDimension Ledger/Ledger: "792 1224" +*PaperDimension Legal/Legal: "612 1008" +*PaperDimension Oufuku/Oufuku-Hagaki: "420 567" +*PaperDimension SuperB/Super B: "936 1368" +*PaperDimension w558h774/16K: "558 774" +*PaperDimension w612h935/Executive (JIS): "612 935" +*PaperDimension w774h1116/8K: "774 1116" + +*OpenUI *Duplex/Double-Sided Printing: PickOne +*FoomaticRIPOption Duplex: enum CmdLine A +*OrderDependency: 120 AnySetup *Duplex +*DefaultDuplex: None +*Duplex DuplexNoTumble/Long Edge (Standard): "%% FoomaticRIPOptionSetting: Duplex=DuplexNoTumble" +*FoomaticRIPOptionSetting Duplex=DuplexNoTumble: " -dDuplex=true -dTum&& +ble=false" +*End +*Duplex DuplexTumble/Short Edge (Flip): "%% FoomaticRIPOptionSetting: Duplex=DuplexTumble" +*FoomaticRIPOptionSetting Duplex=DuplexTumble: " -dDuplex=true -dTumbl&& +e=true" +*End +*Duplex None/Off: "%% FoomaticRIPOptionSetting: Duplex=None" +*FoomaticRIPOptionSetting Duplex=None: " -dDuplex=false" +*CloseUI: *Duplex + +*CloseGroup: General + + +*% Generic boilerplate PPD stuff as standard PostScript fonts and so on + +*DefaultFont: Courier +*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM +*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM +*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM +*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM +*Font Bookman-Demi: Standard "(001.004S)" Standard ROM +*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM +*Font Bookman-Light: Standard "(001.004S)" Standard ROM +*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM +*Font Courier: Standard "(002.004S)" Standard ROM +*Font Courier-Bold: Standard "(002.004S)" Standard ROM +*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM +*Font Courier-Oblique: Standard "(002.004S)" Standard ROM +*Font Helvetica: Standard "(001.006S)" Standard ROM +*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM +*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM +*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM +*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM +*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM +*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM +*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM +*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM +*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM +*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM +*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM +*Font Palatino-Bold: Standard "(001.005S)" Standard ROM +*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM +*Font Palatino-Italic: Standard "(001.005S)" Standard ROM +*Font Palatino-Roman: Standard "(001.005S)" Standard ROM +*Font Symbol: Special "(001.007S)" Special ROM +*Font Times-Bold: Standard "(001.007S)" Standard ROM +*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM +*Font Times-Italic: Standard "(001.007S)" Standard ROM +*Font Times-Roman: Standard "(001.007S)" Standard ROM +*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM +*Font ZapfDingbats: Special "(001.004S)" Standard ROM + --- cups-1.3.8.orig/debian/local/filters/pdf-filters/conf/imagetopdf.convs +++ cups-1.3.8/debian/local/filters/pdf-filters/conf/imagetopdf.convs @@ -0,0 +1,20 @@ +######################################################################## +# +# PDF filters +# + +image/gif application/vnd.cups-pdf 33 imagetopdf +image/png application/vnd.cups-pdf 33 imagetopdf +image/jpeg application/vnd.cups-pdf 33 imagetopdf +image/tiff application/vnd.cups-pdf 33 imagetopdf +image/x-bitmap application/vnd.cups-pdf 33 imagetopdf +image/x-photocd application/vnd.cups-pdf 33 imagetopdf +image/x-portable-anymap application/vnd.cups-pdf 33 imagetopdf +image/x-portable-bitmap application/vnd.cups-pdf 33 imagetopdf +image/x-portable-graymap application/vnd.cups-pdf 33 imagetopdf +image/x-portable-pixmap application/vnd.cups-pdf 33 imagetopdf +image/x-sgi-rgb application/vnd.cups-pdf 33 imagetopdf +image/x-xbitmap application/vnd.cups-pdf 33 imagetopdf +image/x-xpixmap application/vnd.cups-pdf 33 imagetopdf +image/x-xwindowdump application/vnd.cups-pdf 33 imagetopdf +image/x-sun-raster application/vnd.cups-pdf 33 imagetopdf --- cups-1.3.8.orig/debian/local/filters/pdf-filters/conf/pdftoraster.convs +++ cups-1.3.8/debian/local/filters/pdf-filters/conf/pdftoraster.convs @@ -0,0 +1,6 @@ +######################################################################## +# +# PDF filters +# + +application/vnd.cups-pdf application/vnd.cups-raster 100 pdftoraster --- cups-1.3.8.orig/debian/local/filters/pdf-filters/data/pdf.utf-8.heavy +++ cups-1.3.8/debian/local/filters/pdf-filters/data/pdf.utf-8.heavy @@ -0,0 +1,40 @@ +charset utf8 + +# +# This file defines the font mappings used for Unicode/UTF-8 text printing +# through PDF. +# +# Each line consists of: +# +# first last direction width normal bold italic bold-italic +# +# First and last are the first and last glyphs in the font mapping +# that correspond to that font; contrary to PostScript printing +# they only select the font. To find the glyph the complete unicode +# character will be looked up in the (3,1) resp. (3,0) cmap of the +# TrueType font. The glyph values are hexadecimal. +# +# Direction is the string "ltor" or "rtol", indicating left-to-right or +# right-to-left text. +# +# Width is the string "single" or "double"; double means that the glyphs +# are twice as wide as ASCII characters in the Courier typeface. +# +# "Normal", "bold", "italic", and "bold-italic" are the typefaces to use +# for each presentation. If characters are only available in a single +# style then only one typeface should be listed (e.g. "Symbol") +# +# Each font that is listed will be used (and downloaded if needed) when +# printing. +# + +0000 00FF ltor single COUR.TTF COURBD.TTF COURI.TTF COURBI.TTF +0100 02FF ltor single DejaVuSansMono.ttf DejaVuSansMono-Bold.ttf DejaVuSansMono-Oblique.ttf DejaVuSansMono-BoldOblique.ttf +0300 03FF ltor single DejaVuSansMono.ttf +0400 04FF ltor single DejaVuSansMono.ttf DejaVuSansMono-Bold.ttf DejaVuSansMono-Oblique.ttf DejaVuSansMono-BoldOblique.ttf +0500 05FF rtol single FreeMono.ttf +1E00 1EFF ltor single COUR.TTF COURBD.TTF COURI.TTF COURBI.TTF +2000 21FF ltor single DejaVuSansMono.ttf DejaVuSansMono-Bold.ttf DejaVuSansMono-Oblique.ttf DejaVuSansMono-BoldOblique.ttf +2200 23FF ltor single SYMBOL.TTF +3000 9FFF ltor double uming.ttc/0 +#0400 04FF ltor single FreeMono.ttf FreeMonoBold.ttf FreeMonoOblique.ttf FreeMonoBoldOblique.ttf --- cups-1.3.8.orig/debian/local/filters/pdf-filters/data/pdf.utf-8.simple +++ cups-1.3.8/debian/local/filters/pdf-filters/data/pdf.utf-8.simple @@ -0,0 +1,32 @@ +charset utf8 + +# +# This file defines the font mappings used for Unicode/UTF-8 text printing +# through PDF. +# +# Each line consists of: +# +# first last direction width normal bold italic bold-italic +# +# First and last are the first and last glyphs in the font mapping +# that correspond to that font; contrary to PostScript printing +# they only select the font. To find the glyph the complete unicode +# character will be looked up in the (3,1) resp. (3,0) cmap of the +# TrueType font. The glyph values are hexadecimal. +# +# Direction is the string "ltor" or "rtol", indicating left-to-right or +# right-to-left text. +# +# Width is the string "single" or "double"; double means that the glyphs +# are twice as wide as ASCII characters in the Courier typeface. +# +# "Normal", "bold", "italic", and "bold-italic" are the typefaces to use +# for each presentation. If characters are only available in a single +# style then only one typeface should be listed (e.g. "Symbol") +# +# Each font that is listed will be used (and downloaded if needed) when +# printing. +# + +0000 04FF ltor single FreeMono.ttf FreeMonoBold.ttf FreeMonoOblique.ttf FreeMonoBoldOblique.ttf +0500 05FF rtol single FreeMono.ttf --- cups-1.3.8.orig/debian/local/filters/pdf-filters/config-scripts/cups-pdf-filters.m4 +++ cups-1.3.8/debian/local/filters/pdf-filters/config-scripts/cups-pdf-filters.m4 @@ -0,0 +1,67 @@ +dnl General checks + +AC_HEADER_DIRENT +AC_CHECK_HEADERS([zlib.h]) + +dnl Needed for pdftopdf filter compilation + +CXXFLAGS="-DPDFTOPDF $CXXFLAGS" + +dnl poppler source dir + +AC_ARG_WITH([poppler-source],[ --with-poppler-source=PATH poppler source directory path], + [POPPLER_SRCDIR=$withval], + [POPPLER_SRCDIR=`eval echo $includedir`]) +AC_SUBST(POPPLER_SRCDIR) + +dnl Switch over to C++. +AC_LANG(C++) + +dnl check poppler +AC_CHECK_LIB(poppler,main, + [ POPPLER_LIBS=-lpoppler], + [ echo "*** poppler library not found. ***";exit ] +) +AC_SUBST(POPPLER_LIBS) + +dnl check if GlobalParams::GlobalParams has a argument +if grep "GlobalParams(char \*cfgFileName)" $POPPLER_SRCDIR/poppler/GlobalParams.h >/dev/null ;then + AC_DEFINE([GLOBALPARAMS_HAS_A_ARG],,[GlobalParams::GlobalParams has a argument.]) +fi + +dnl check if Parser:Parser has two arguments +if grep "Parser(XRef \*xrefA, Lexer \*lexerA)" $POPPLER_SRCDIR/poppler/Parser.h >/dev/null ;then + AC_DEFINE([PARSER_HAS_2_ARGS],,[Parser::Parser has two arguments.]) +fi + +dnl check font type enumeration +if grep "fontType1COT" $POPPLER_SRCDIR/poppler/GfxFont.h >/dev/null ;then + AC_DEFINE([FONTTYPE_ENUM2],,[New font type enumeration]) +fi + +dnl check Stream::getUndecodedStream +if grep "getUndecodedStream" $POPPLER_SRCDIR/poppler/Stream.h >/dev/null ;then + AC_DEFINE([HAVE_GETUNDECODEDSTREAM],,[Have Stream::getUndecodedStream]) +fi + +dnl check UGooString.h +CPPFLAGS="$CPPFLAGS -I$POPPLER_SRCDIR/poppler" +AC_CHECK_HEADER(UGooString.h, + AC_DEFINE([HAVE_UGOOSTRING_H],,[Have UGooString.h]) +,) + +dnl check CharCodeToUnicode::mapToUnicode interface +CPPFLAGS="$CPPFLAGS -I$POPPLER_SRCDIR/poppler" +if grep "mapToUnicode(.*Unicode[ ][ ]*\*u" $POPPLER_SRCDIR/poppler/CharCodeToUnicode.h >/dev/null ;then + AC_DEFINE([OLD_MAPTOUNICODE],,[Old CharCodeToUnicode::mapToUnicode]) +fi + +dnl Switch back to C. +AC_LANG(C) + +dnl check ijs +AC_CHECK_LIB(ijs,main, + [ IJS_LIBS=-lijs], + [ echo "*** ijs library not found. ***";exit ] +) +AC_SUBST(IJS_LIBS) --- cups-1.3.8.orig/debian/filters/dvipipetops.convs +++ cups-1.3.8/debian/filters/dvipipetops.convs @@ -0,0 +1,4 @@ +# If you'd like to use dvi filter, install tetex-bin or dvipsk-ja package. +# You can setup dvips options with /etc/default/cups. + +application/x-dvi application/postscript 33 dvipipetops --- cups-1.3.8.orig/debian/filters/dvipipetops.types +++ cups-1.3.8/debian/filters/dvipipetops.types @@ -0,0 +1 @@ +application/x-dvi dvi string(0,<F7><02>) --- cups-1.3.8.orig/debian/filters/dvipipetops.INSTALL +++ cups-1.3.8/debian/filters/dvipipetops.INSTALL @@ -0,0 +1,7 @@ +To use the dvipipetops filter: +- create an /etc/cups/local.convs file and add the contents of + dvipipetops.convs to it +- add the contents of dvipipetops.types to /etc/cups/mime.types +- uncompress dvipipetops, give it exec permissions and put it in + /usr/lib/cups/filter +- restart cups with /etc/init.d/cups restart --- cups-1.3.8.orig/debian/filters/samba-to-ps +++ cups-1.3.8/debian/filters/samba-to-ps @@ -0,0 +1,56 @@ +#!/bin/sh + +# CUPS (Common Unix Printing System) filter to fix certain "broken" PostScript files + +# The files generated by Hewlett-Packard's Windows drivers for the "LaserJet +# 5P/5MP PostScript" printer include a PJL header (that switches that printer +# to PostScript) before the actual PostScript file, and some weird additional +# comments within the PostScript. If you are sending these files (via Samba) +# to a plain LaserJet 5P (i.e., without PostScript), you need to remove the +# header and the weird additional comments before sending the file to +# ghostscript. Though it is a reasonable guess that the same situation applies +# to other pairs of HP printers with and without native PostScript +# capabilities, I have tested this script only with the LaserJet 5P. + +# The garbage we are trimming at top and bottom of the file is fixed-length, so +# we could use something simpler than awk to trim it, but we have to use awk +# anyway to skip those weird comment lines (3d line of the program below), so +# let's just use awk for the whole thing. + +# I wrote this awk script in the mid-1990s when I bought this printer, and it +# still serves me well today, with the latest versions of Windows, Debian, and +# Samba, and with CUPS instead of old BSD lpd and magicfilter. I adapted it +# for CUPS in April 2004. I put this code into the public domain. I am not +# putting my name on it because I do not want to receive emails with questions +# about things I do not know much about. + +# TODO +# does the code here involve gawk extensions? + +# on error, exit with this status. +CUPS_SAMBAPS_ERREXIT=2 + +prog=$(basename "$0") +# This statement needs bash I think. +echo "DEBUG: $prog: \"$0\" has been called with these arguments:" >&2 +count=1 +for x; do + echo "DEBUG: $prog: arg $((count++)): \"$x\"" >&2 +done + +if ! shift 5; then + echo "ERROR: $prog: expected 5 or 6 arguments and received <5" >&2 + exit $CUPS_SAMBAPS_ERREXIT +elif [ $# -gt 1 ]; then + echo "ERROR: $prog: expected 5 or 6 arguments and received >6" >&2 + exit $CUPS_SAMBAPS_ERREXIT +fi + +# variable `printme' starts as 0 +/usr/bin/awk \ + '/^%\!PS-Adobe-/ {printme = 1} + /^%%EOF/ {print; printme = 0} + /\(%%\[ ?(ProductName:|Page:|LastPage ?)/ {next} + { if (printme) print; else next }' \ + ${1--} +exit --- cups-1.3.8.orig/debian/filters/dvipipetops +++ cups-1.3.8/debian/filters/dvipipetops @@ -0,0 +1,190 @@ +#!/bin/sh + +# CUPS (Common Unix Printing System) filter for DVI files + +## Copyright (C) 2004 Matthew Swift <swift@alum.mit.edu> +## +## This program is free software; you can redistribute it and/or +## modify it under the terms of the GNU General Public License +## as published by the Free Software Foundation; either version 2 +## of the License, or (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License along +## with this program; if not, write to the Free Software Foundation, Inc., +## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +## Documentation +# +# This script has several advantages (some involving security and privacy) over +# the script of the same name by Decklin Foster dated 2002 and (on the present +# date) distributed with the Debian cups package in +# /usr/share/doc/cups/examples/filters/dvipipetops. +# +# This script... +# +# - works with Debian cups version 1.1.20final+cvs20040330-1. +# - uses the -R option to dvips for greater security. +# - creates a temporary file only when necessary. +# - is more aggressive about cleaning up its temporary file. +# - uses an absolute pathname for dvips, for greater security. +# - avoids a security problem when $TMPDIR contains a space. +# - is better documented. +# - gives better diagnostic output to CUPS. +# +# See http://localhost:631/spm.html#WRITING_FILTERS for information. +# Note that the documentation as of this date is conflicting and misleading on +# the subject of arguments passed to filters. + +## History +# initial version: 1.0 [28 April 2004] + +# TODO +# add/remove trapped signals; are they portable? +# are there bashisms? if so, should they be removed, or should bash be invoked explicitly? +# should we heed the "copies" argument? my interpretation of the spec quoted +# below is that we should not. +# something interesting to do with page accounting? +# is including $prog in the diagnostic output redundant? + +## Variables you may want to tweak. + +# on error, exit with this status. +CUPS_DVIPS_ERREXIT=2 +# absolute pathname to dvips executable +CUPS_DVIPS=/usr/bin/dvips + +# If you want to give options to dvips that should not go into the normal +# config.ps, include them here. A good method would be to include, e.g., +# "-Pcups" and put all your configuration into cups.ps in the right place for +# your dvips (e.g., /etc/texmf/dvips for a standard Debian TeX installation). +# Note that CUPS passes information in the environment and the command line +# that can be used here to determine the options, if you wanted. +## +# additional options to give to dvips +CUPS_DVIPS_OPTS="" + +# Load configuration from default file. +. /etc/default/cups + +## I do not expect you to want to change anything below here, +## except possibly to (dis)include the debugging statements. +############################################################# + +prog=$(basename "$0") +# This statement needs bash I think. +echo "DEBUG: $prog: \"$0\" has been called with these arguments:" >&2 +count=1 +for x; do + echo "DEBUG: $prog: arg $((count++)): \"$x\"" >&2 +done +echo "DEBUG: $prog: \$CUPS_DVIPS_OPTIONS=$CUPS_DVIPS_OPTIONS" >&2 + +#### echo " $prog: test debug without prefix" >&2 +#### echo "DEBUG: $prog: test debug with prefix" >&2 +#### echo "INFO: $prog: test info" >&2 +#### echo "WARNING: $prog: test warning" >&2 +#### echo "ERROR: $prog: test error" >&2 +#### echo "PAGE: $prog: test page" >&2 + +# Get rid of the irrelevant command line arguments. +if ! shift 5; then + echo "ERROR: $prog: expected 5 or 6 arguments and received <5" >&2 + exit $CUPS_DVIPS_ERREXIT +elif [ $# -gt 1 ]; then + echo "ERROR: $prog: expected 5 or 6 arguments and received >6" >&2 + exit $CUPS_DVIPS_ERREXIT +elif [ $# -eq 1 ]; then + file=$1 +else + # Dvips needs seekable input, so if input is on stdin, we need to save it + # to a temporary file. + + # tempfile(1) is in the debianutils Debian package (28 April 2004) and is + # recommended over mktemp(1). + if ! file=$(/bin/tempfile); then + echo "ERROR: $prog: invocation of /bin/tempfile failed" >&2 + exit $CUPS_DVIPS_ERREXIT + fi + # 1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL + # 5) SIGTRAP 6) SIGABRT 7) SIGBUS 8) SIGFPE + # 9) SIGKILL 10) SIGUSR1 11) SIGSEGV 12) SIGUSR2 + # 13) SIGPIPE 14) SIGALRM 15) SIGTERM 17) SIGCHLD + # etc. + trap "rm -f \"$file\" 2>/dev/null" EXIT 1 2 3 9 15 + # Be sure that no prior commands use up the script's stdin. Duplicate stdin if necessary. + cat - >"$file" +fi +# Dvips options: +# -q be quiet (not used: output is always sent to CUPS; +# CUPS variables LogLevel etc. control what +# is actually logged and where.) +# -R run securely (recommended) +# -f run as a filter (necessary) +## + +# If the INFO: level output is not actually going to be logged, we are wasting +# a time generating it. While in this script, the wasted time is negligible, +# it does to me a very reasonable wish that CUPS provide the LogLevel to +# filters via an environment variable. For example, we could choose whether to +# give debugging options to dvips or not. +## +# Make the shell's fd3 point to the shell's stdout. +exec 3>&1 +# Make the error text of dvips go to the command's stdout and thus through the +# pipe to the {}-subshell; make the normal text of dvips go to the shell's +# stdout (fd3); make the {}-subshell's normal output go to the shell's +# stderr (fd2 as usual). I think it's good form to close fd3 for the dvips and +# {}-subshell commands, but this may be unnecessary. +"$CUPS_DVIPS" -R -f $CUPS_DVIPS_OPTS <"$file" 2>&1 1>&3- | \ + { while read -r -a line; do echo "INFO: $prog: ${line[*]}" >&2; done 3>&-; } +# Close fd3 for the shell. +exec 3>&- + +exit + +####### +#NOTES# +####### + +# MSS as of this date, arguments passed to filters seem to be, starting with $1: +# +# job user title copies options [filename] +# +# Remainder from official documentation: +# +# job The numeric job ID for the job being printed +# user The string from the originating-user-name attribute +# title The string from the job-name attribute +# copies The numeric value from the number-copies attribute +# options String representations of the job template attributes, separated by +# spaces. Boolean attributes are provided as "name" for true values and +# "noname" for false values. All other attributes are provided as +# "name=value" for single-valued attributes and +# "name=value1,value2,...,valueN" for set attributes +# filename The request file + +# The filename argument is provided to only the first filter in the chain. + +# The copies argument specifies the number of copies to produce of the input +# file. In general, you should only generate copies if the filename argument is +# supplied. The only exception to this are filters that produce +# device-independent PostScript output (without any printer commands from the +# printer's PPD file), since the PostScript filter pstops is responsible for +# copy generation. + +# The type of message is determined by an initial prefix sent on each line: +# DEBUG: - a debug message +# INFO: - an informational message +# WARNING: - a warning message +# ERROR: - an error message +# PAGE: - a page accounting message + +# If the line of text does not begin with any of the above prefixes, it is +# treated as a debug message. Text following the prefix is copied to the +# printer-state-message attribute for the printer, and also added to the +# error_log unless it is an informational or page accounting message. --- cups-1.3.8.orig/debian/filters/samba-postscript.types +++ cups-1.3.8/debian/filters/samba-postscript.types @@ -0,0 +1,14 @@ +# This evil type, which I have made up, catches files coming in via Samba, when +# the Windows client is configured to print to the PostScript counterpart to +# your non-PostScript printer (in my case, I have a Hewlett-Packard LaserJet 5P +# and configure Windows to use the "HP LaserJet 5P/5MP PostScript" driver so +# that it will send PostScript straight on rather than convert it to PCL before +# sending it -- useful to print to files and so on.). I do not know what +# combinations produce the finest output. See the conversion script +# samba-ps-to-ps for more information. + +# The MIME type used here must sort alphbetically before application/postscript +# (CUPS has a dozen manuals, and this information seemed available only in a +# comment in mime.types!). If this were a real MIME type, I think it would be +# non-conformant. +application/a-x-postscript-with-pjl-header string(78,"%!PS-Adobe-") --- cups-1.3.8.orig/debian/filters/samba-postscript.convs +++ cups-1.3.8/debian/filters/samba-postscript.convs @@ -0,0 +1 @@ +application/a-x-postscript-with-pjl-header application/postscript 10 samba-ps-to-ps --- cups-1.3.8.orig/debian/filters/pdf.ppd +++ cups-1.3.8/debian/filters/pdf.ppd @@ -0,0 +1,136 @@ +*PPD-Adobe: "4.3" +*% +*% "$Id: pdf.ppd,v 1.3 2003/01/02 23:32:42 gurubert Exp $" +*% +*% Printer description for a printer that uses the pstopdf filter +*% +*% This file is based on the laserjet.ppd that comes with CUPS. +*% +*FormatVersion: "4.3" +*FileVersion: "1.1" +*LanguageVersion: English +*LanguageEncoding: ISOLatin1 +*PCFileName: "PDF.PPD" +*Manufacturer: "Robert Sander <robert.sander@epigenomics.com>" +*Product: "(CUPS v1.1)" +*cupsVersion: 1.1 +*cupsManualCopies: False +*cupsFilter: "application/vnd.cups-postscript 33 pstopdf" +*ModelName: "PDF Converter" +*ShortNickName: "PDF Converter" +*NickName: "PDF Converter CUPS v1.1" +*PSVersion: "(3010.000) 550" +*LanguageLevel: "3" +*ColorDevice: True +*DefaultColorSpace: RGB +*FileSystem: False +*Throughput: "8" +*LandscapeOrientation: Plus90 +*VariablePaperSize: False +*TTRasterizer: Type42 + +*OpenUI *PageSize/Media Size: PickOne +*OrderDependency: 10 AnySetup *PageSize +*DefaultPageSize: A4 +*PageSize Letter/US Letter: "<</PageSize[612 792]/ImagingBBox null>>setpagedevice" +*PageSize Legal/US Legal: "<</PageSize[612 1008]/ImagingBBox null>>setpagedevice" +*PageSize Executive/US Executive: "<</PageSize[522 756]/ImagingBBox null>>setpagedevice" +*PageSize Tabloid/US Tabloid: "<</PageSize[792 1224]/ImagingBBox null>>setpagedevice" +*PageSize A3/A3: "<</PageSize[842 1191]/ImagingBBox null>>setpagedevice" +*PageSize A4/A4: "<</PageSize[595 842]/ImagingBBox null>>setpagedevice" +*PageSize A5/A5: "<</PageSize[421 595]/ImagingBBox null>>setpagedevice" +*PageSize B5/B5 (JIS): "<</PageSize[516 729]/ImagingBBox null>>setpagedevice" +*PageSize EnvISOB5/Envelope B5: "<</PageSize[499 709]/ImagingBBox null>>setpagedevice" +*PageSize Env10/Envelope #10: "<</PageSize[297 684]/ImagingBBox null>>setpagedevice" +*PageSize EnvC5/Envelope C5: "<</PageSize[459 649]/ImagingBBox null>>setpagedevice" +*PageSize EnvDL/Envelope DL: "<</PageSize[312 624]/ImagingBBox null>>setpagedevice" +*PageSize EnvMonarch/Envelope Monarch: "<</PageSize[279 540]/ImagingBBox null>>setpagedevice" +*CloseUI: *PageSize + +*OpenUI *PageRegion: PickOne +*OrderDependency: 10 AnySetup *PageRegion +*DefaultPageRegion: A4 +*PageRegion Letter/US Letter: "<</PageSize[612 792]/ImagingBBox null>>setpagedevice" +*PageRegion Legal/US Legal: "<</PageSize[612 1008]/ImagingBBox null>>setpagedevice" +*PageRegion Executive/US Executive: "<</PageSize[522 756]/ImagingBBox null>>setpagedevice" +*PageRegion Tabloid/US Tabloid: "<</PageSize[792 1224]/ImagingBBox null>>setpagedevice" +*PageRegion A3/A3: "<</PageSize[842 1191]/ImagingBBox null>>setpagedevice" +*PageRegion A4/A4: "<</PageSize[595 842]/ImagingBBox null>>setpagedevice" +*PageRegion A5/A5: "<</PageSize[421 595]/ImagingBBox null>>setpagedevice" +*PageRegion B5/B5 (JIS): "<</PageSize[516 729]/ImagingBBox null>>setpagedevice" +*PageRegion EnvISOB5/Envelope B5: "<</PageSize[499 709]/ImagingBBox null>>setpagedevice" +*PageRegion Env10/Envelope #10: "<</PageSize[297 684]/ImagingBBox null>>setpagedevice" +*PageRegion EnvC5/Envelope C5: "<</PageSize[459 649]/ImagingBBox null>>setpagedevice" +*PageRegion EnvDL/Envelope DL: "<</PageSize[312 624]/ImagingBBox null>>setpagedevice" +*PageRegion EnvMonarch/Envelope Monarch: "<</PageSize[279 540]/ImagingBBox null>>setpagedevice" +*CloseUI: *PageRegion + +*DefaultImageableArea: A4 +*ImageableArea Letter/US Letter: "18 36 594 756" +*ImageableArea Legal/US Legal: "18 36 594 972" +*ImageableArea Executive/US Executive: "18 36 504 684" +*ImageableArea Tabloid/US Tabloid: "18 36 774 1188" +*ImageableArea A3/A3: "18 36 824 1155" +*ImageableArea A4/A4: "18 36 577 806" +*ImageableArea A5/A5: "18 36 403 559" +*ImageableArea B5/JIS B5: "18 36 498 693" +*ImageableArea EnvISOB5/B5 (ISO): "18 36 463 673" +*ImageableArea Env10/Com-10: "18 36 279 648" +*ImageableArea EnvC5/EnvC5: "18 36 441 613" +*ImageableArea EnvDL/EnvDL: "18 36 294 588" +*ImageableArea EnvMonarch/Envelope Monarch: "18 36 261 504" + +*DefaultPaperDimension: A4 +*PaperDimension Letter/US Letter: "612 792" +*PaperDimension Legal/US Legal: "612 1008" +*PaperDimension Executive/US Executive: "522 756" +*PaperDimension Tabloid/US Tabloid: "792 1224" +*PaperDimension A3/A3: "842 1191" +*PaperDimension A4/A4: "595 842" +*PaperDimension A5/A5: "421 595" +*PaperDimension B5/B5 (JIS): "516 729" +*PaperDimension EnvISOB5/Envelope B5: "499 709" +*PaperDimension Env10/Envelope #10: "297 684" +*PaperDimension EnvC5/Envelope C5: "459 649" +*PaperDimension EnvDL/Envelope DL: "312 624" +*PaperDimension EnvMonarch/Envelope Monarch: "279 540" + +*DefaultFont: Courier +*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM +*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM +*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM +*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM +*Font Bookman-Demi: Standard "(001.004S)" Standard ROM +*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM +*Font Bookman-Light: Standard "(001.004S)" Standard ROM +*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM +*Font Courier: Standard "(002.004S)" Standard ROM +*Font Courier-Bold: Standard "(002.004S)" Standard ROM +*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM +*Font Courier-Oblique: Standard "(002.004S)" Standard ROM +*Font Helvetica: Standard "(001.006S)" Standard ROM +*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM +*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM +*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM +*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM +*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM +*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM +*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM +*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM +*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM +*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM +*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM +*Font Palatino-Bold: Standard "(001.005S)" Standard ROM +*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM +*Font Palatino-Italic: Standard "(001.005S)" Standard ROM +*Font Palatino-Roman: Standard "(001.005S)" Standard ROM +*Font Symbol: Special "(001.007S)" Special ROM +*Font Times-Bold: Standard "(001.007S)" Standard ROM +*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM +*Font Times-Italic: Standard "(001.007S)" Standard ROM +*Font Times-Roman: Standard "(001.007S)" Standard ROM +*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM +*Font ZapfDingbats: Special "(001.004S)" Standard ROM +*% +*% End of "$Id: pdf.ppd,v 1.3 2003/01/02 23:32:42 gurubert Exp $". +*% --- cups-1.3.8.orig/debian/filters/mailto +++ cups-1.3.8/debian/filters/mailto @@ -0,0 +1,161 @@ +#!/usr/bin/python + +# +# $Id: mailto,v 1.3 2003/01/02 17:59:19 gurubert Exp $ +# + +# +# This is a mailto backend for CUPS (www.cups.org) +# +# (C) 2002 Robert Sander <robert.sander@epigenomics.com> +# +# Released under GPL +# +# NO WARRANTY AT ALL +# + +import sys, os, tempfile, MimeWriter, mimetools, mimetypes + +log = "\nLog:\n" + +def guess_type(file): + global log + + type, enc = mimetypes.guess_type(file) + if (not type) or (type == 'application/octet-stream'): + enc = None + try: + type = os.popen("/usr/bin/file -bi %s 2> /dev/null" % file).read().rstrip() + if type == "" or type == "data": + type = "application/octet-stream" + except: + type = "application/octet-stream" + if log: + log = "%stype is %s\n" % (log, type) + return (type, enc) + +def guess_extension(mimetype): + return(mimetypes.guess_extension(mimetype)) + +argc = len(sys.argv) + +if argc == 1: + print "network mailto \"Unknown\" \"SMTP\"" + sys.exit(0) + +sys.stderr.write("INFO: mailto argv[%s] =" % argc) +if log: + log = "%smailto argv[%s] =" % (log, argc) +for arg in sys.argv[1:]: + sys.stderr.write(" '%s'" % arg) + if log: + log = "%s '%s'" % (log, arg) +sys.stderr.write("\n") +if log: + log = "%s\n" % log + +if argc < 6 or argc > 7: + sys.stderr.write("ERROR: %s job-id user title copies options [file]\n" % sys.argv[0]) + sys.exit(1) + +jobid = sys.argv[1] +user = sys.argv[2] +title = sys.argv[3] +opts = sys.argv[5].split(" ") + +if argc == 7: + sys.stderr.write("INFO: file is %s\n" % sys.argv[6]) + if log: + log = "%sfile is %s\n" % (log, sys.argv[6]) + infilename = sys.argv[6] +else: + infilename = tempfile.mktemp(".mailto") + try: + infile = open(infilename, "w") + except: + sys.stderr.write("ERROR: unable to create tmp file %s\n" % infilename) + sys.exit(1) + sys.stderr.write("INFO: file is stdin\n") + try: + infile.write(sys.stdin.read()) + except: + sys.stderr.write("ERROR: unable to copy into tmpfile\n") + sys.exit(1) + infile.close() + if log: + log = "%scopied stdin to %s\n" % (log, infilename) + +infile = open(infilename, "r") + +sys.stderr.write("INFO: creating tmp mail file\n") + +try: + mimemailfile = tempfile.TemporaryFile() + mimemail = MimeWriter.MimeWriter(mimemailfile) +except: + sys.stderr.write("ERROR: unable to create tmp file for MIME_MAIL\n") + sys.exit(1) + +mailto = None +mailfrom = None +for opt in opts: + if log: + log = "%sopt = '%s'\n" % (log, opt) + if opt[:7] == "mailto=": + mailto = opt[7:] + if log: + log = "%smailto = '%s'\n" % (log, mailfrom) + if opt[:9] == "mailfrom=": + mailfrom = opt[9:] + if log: + log = "%smailfrom = '%s'\n" % (log, mailfrom) +if not mailto: + if user: + mailto = user + else: + mailto = mailfrom +else: + if not mailfrom: + if user: + mailfrom = user +if not mailfrom: + mailfrom = "lp" + +# Essential lines to put into the header of a MIME mail. +mimemail.addheader("From", mailfrom) +mimemail.addheader("To", mailto) +mimemail.addheader("Subject", title) +mimemail.addheader("MIME-Version", "1.0") +if mailto != user and mailfrom != user: + mimemail.addheader("X-CUPS-mailto-started-by", user) + +mimemail.startmultipartbody("mixed") + +body = mimemail.nextpart() + +body.addheader("Content-Transfer-Encoding", "8bit") + +body.startbody("text/plain").write("You printed %s with jobid %s\n%s" % (title, jobid, log)) + +attachment = mimemail.nextpart() +type, enc = guess_type(infilename) +ext = guess_extension(type) +if not ext: + ext = "" +attachment.addheader("Content-Transfer-Encoding", "base64") +att = attachment.startbody('%s; name="%s%s"' % (type, os.path.basename(title), ext)) +mimetools.encode(infile, att, "base64") +mimemail.lastpart() + +mimemailfile.seek(0) + +os.popen("/usr/sbin/sendmail -t -f%s" % mailfrom, "w").write(mimemailfile.read()) + +att.close() +infile.close() +mimemailfile.close() + +if argc == 6: + os.unlink(infilename) + +sys.exit(0) --- cups-1.3.8.orig/debian/filters/pstopdf +++ cups-1.3.8/debian/filters/pstopdf @@ -0,0 +1,129 @@ +#!/bin/sh + +# $Id: pstopdf,v 1.3 2003/02/15 15:21:00 gurubert Exp $ +# +# This is a Postscript to PDF filter for CUPS +# +# (C) 2003 Robert Sander <robert.sander@epigenomics.com> +# +# Released under GPL +# +# NO WARRANTY AT ALL +# + +set -e + +PSTOPS=/usr/bin/ps2ps +PSTOPDF=/usr/bin/ps2pdf13 +PSTOPS_OPTIONS="-dAutoRotatePages=/None -dAutoFilterColorImages=false + -dNOPLATFONTS -dPARANOIDSAFER -sstdout=%stderr" +PSTOPDF_OPTIONS="$PSTOPS_OPTIONS -dColorImageFilter=/FlateEncode" + +echo "INFO: pstopdf argv[$#] = $@" >&2 + +if [ $# -lt 5 -o $# -gt 6 ]; then + + echo "ERROR: $0 job-id user title copies options [file]" >&2 + exit 1 + +fi + +# Read from given file. +if [ -n "$6" ]; then + exec <"$6" +fi + +tempfiles= +trap 'rm -f $tempfiles' 0 1 2 13 15 + +infile=$(mktemp -t pstopdf.XXXXXX) +tempfiles="$tempfiles $infile" + +cat >"$infile" + +# Apply PPD settings. + +resolution= +eval "$(printf "%s" "$5" | sed -nre 's/.*(^|\s)Resolution=([0-9.]+(x[0-9.]+)?).*/resolution="${resolution:-\2}"/p')" +if test -e "$PPD"; then + eval "$(sed -nre 's/^\*DefaultResolution:\s+([0-9.]+(x[0-9.]+)?).*/resolution="${resolution:-\1}"/p' "$PPD")" +fi + +pagesize= +eval "$(printf "%s" "$5" | sed -nre 's/.*(^|\s)(media|PageSize)=(\S+).*/pagesize="${pagesize:-\3}"/p')" +if test -e "$PPD"; then + eval "$(sed -nre 's/^\*DefaultPageSize:\s+(.+)$/pagesize="${pagesize:-\1}"/p' "$PPD")" +fi + +width= +height= +tl_x= +tl_y= +br_x= +br_y= +if test -n "$pagesize" && test -e "$PPD"; then + eval "$(sed -nre 's|^\*PaperDimension\s+'"$pagesize"'/[^"]+:\s+"(\S+)\s+(\S+)"$|width="\1"; height="\2"|p' "$PPD")" + + eval "$(sed -nre 's|^\*ImageableArea\s+'"$pagesize"'/[^"]+:\s+"(\S+)\s+(\S+)\s+(\S+)\s+(\S+)"$|tl_x="\1"; tl_y="\2"; br_x="\3"; br_y="\4"|p' "$PPD")" +fi + +margin_l= +margin_b= +margin_r= +margin_t= +if test -n "$width" && test -n "$height" && \ + test -n "$tl_x" && test -n "$tl_y" && \ + test -n "$br_x" && test -n "$br_y"; then + margin_l="$tl_x" + margin_b="$(printf "scale=8; (%s)-(%s)\n" "$height" "$br_y" | bc)" + margin_r="$(printf "scale=8; (%s)-(%s)\n" "$width" "$br_x" | bc)" + margin_t="$tl_y" +fi + +inject_ps= +if test -n "$margin_l" && test -n "$margin_b" && \ + test -n "$margin_r" && test -n "$margin_t"; then + inject_ps="<</.HWMargins[$margin_l $margin_b $margin_r $margin_t] /Margins[0 0]>>setpagedevice" +fi + +ppd_opts= +if test -n "$resolution"; then + ppd_opts="${ppd_opts:+$ppd_opts }-r$resolution" +fi +if test -n "$width"; then + ppd_opts="${ppd_opts:+$ppd_opts }-dDEVICEWIDTHPOINTS=$width" +fi +if test -n "$height"; then + ppd_opts="${ppd_opts:+$ppd_opts }-dDEVICEHEIGHTPOINTS=$height" +fi + +# Injection +if test -n "$inject_ps"; then + echo "DEBUG: Injecting PostScript: $inject_ps" >&2 + + orig_infile="$infile" + + infile=$(mktemp -t pstopdf.XXXXXX) + tempfiles="$tempfiles $infile" + + sed -re "/^%!/ a $inject_ps" "$orig_infile" >"$infile" +fi + +# DRM + +DRM_MATCH='^%.*Removing the following.*lines is illegal.*Digital Copyright Act' +if egrep -q "$DRM_MATCH" "$infile"; then + # This PS is DRM-infested. Normalize it with ps2ps first. + echo "INFO: Normalizing Adobe Reader PostScript with ps2ps" >&2 + + orig_infile="$infile" + + infile=$(mktemp -t pstopdf.XXXXXX) + tempfiles="$tempfiles $infile" + + $PSTOPS $PSTOPS_OPTIONS $ppd_opts "$orig_infile" "$infile" + ppd_opts= +fi + +$PSTOPDF $PSTOPDF_OPTIONS $ppd_opts -sOUTPUTFILE=%stdout "$infile" +