- Приемы работы в Ubuntu. Глава 2: Рабочий стол Linux
- Совет # 26: Создаем свои собственные файлы PDF
- Установка CUPS-PDF
- Конфигурирование CUPS для PDF принтера
- Cups-pdf
- Материал из Пингвиньи радостей
- Содержание
- Установка
- Печать в Linux
- Печать в Windows
- Cups in linux pdf
- Contents
- Installation
- Socket activation
- Print steps
- Connection interfaces
- Parallel port
- Network
- Printer drivers
- OpenPrinting CUPS filters
- Foomatic
- Gutenprint
- Manufacturer-specific drivers
- Printer URI
- Parallel port
- Network
- Usage
- CLI tools
- Web interface
- GUI applications
- Configuration
- Permissions
- Default paper size
- Log files
- cups-browsed
- Print servers and remote administration
- Allowing admin authentication through PolicyKit
- Without a local CUPS server
Приемы работы в Ubuntu.
Глава 2: Рабочий стол Linux
Совет # 26: Создаем свои собственные файлы PDF
Вы привыкли использовать функцию «Print to PDF» («Печать в PDF»), которая есть в Adobe Acrobat? Далее рассказывается, как вы можете создавать свой собственные файлы PDF, используя аналогичную технику.
Очень удобная функция, которая есть в операционной системе Mac OS X, является возможность «печати» из любого приложения в файл PDF. В Windows это также можно делать с помощью Adobe Acrobat. Однако, добавив один пакет и немного поколдовав, вы можете бесплатно получить в Ubuntu Linux те же самые возможности.
Установка CUPS-PDF
Ключом к получению возможности печати в PDF, является пакет cups-pdf, который имеется в репозитарии universe [Совет # 60]. Используйте команду apt-get в окне терминала для того, чтобы установить пакет apt-get:
После того, как установка пакета cups-pdf будет завершена, потребуется небольшое редактирование конфигурационного файла CUPS для того, чтобы можно было печатать в файл PDF. В окне терминала выполните следующую команду:
Найдите строку, где указано RunAsUser Yes и измените ее на RunAsUser No , а затем сохраните файл и выйдите из gedit. После этого вам нужно будет перезапустить CUPS для того, чтобы изменения, сделанные в конфигурационном файле, вступили в силу:
Конфигурирование CUPS для PDF принтера
Теперь вы должны сообщить CUPS, что нужно использовать вновь установленный пакет cups-pdf. Щелкните по меню System (Система), выберите Administration (Администрирование), а затем — Printing (Печать). Дважды щелкните по изображению New Printer (Новый принтер) для запуска мастера добавления нового принтера «Add a Printer». Убедитесь, что в части, определяющей тип принтера, выбран локальный принтер и что выбран вариант «Use a Detected Printer» («Использовать обнаруженный принтер»), и в списке, приведенном ниже, выделен PDF принтер (см. рис. 2-38). Нажмите кнопку Forward (Далее) для того, чтобы продолжить.
Рис.2-28. Добавляем PDF принтер
На следующем экране в поле Manufacturer (Изготовитель) выберите Generic (Обобщенный) — см. рис.2-39. Переместитесь по выпадающему меню Model (Модель) и выберите пункт «postscript color printer» («Цветной принтер PostScript»). Нажмите кнопку Apply (Применить) для того, чтобы применить сделанные изменения.
Источник
Cups-pdf
Материал из Пингвиньи радостей
Содержание
Cups-pdf пакет создающий виртуальный PDF-принтер для системы печати CUPS
Cups-pdf позволяет осуществлять печать в файл pdf-формата с любых приложений операционной среды и рабочих станций локальной сети.
Установка
Пакет есть в дистрибутиве поставки (хранилище) debian.
Для установки пакета:
- в командной строке выполняем # apt-get install cups-pdf
- или используем графическое средство synaptic
Печать в Linux
Для осуществления вывода формы для печати в pdf-файл из приложения linux выбираем принтер PDF и осуществляем печать. По умолчанию файл сохраняется в домашний каталог пользователя
/PDF. Для указания иного пути необходимо отредактировать файл /etc/cups/cups-pdf.conf.
Печать в Windows
Предположим в локальной сети есть linux-сервер с установленной программой cups-pdf и печать в linux настроена.
Для осуществления вывода формы для печати в pdf-файл из приложения windows через сетевой принтер PDF
- запускаем мастер установки принтера windows и осуществляем установку принтера как обычно для сетевых принтеров
- выбираем драйвер принтера Generic/MS Publisher Color Printer
- для осуществления печати выбираем принтер PDF и осуществляем печать
Файл сохраняется в домашний каталог
/PDF пользователя под чьим именем осуществляется samba-регистрация на рабочей станции с установленной программой cups-pdf.
Источник
Cups in linux pdf
This article or section is out of date.
CUPS is the standards-based, open source printing system currently developed by Apple Inc. for macOS® and other UNIX®-like operating systems.
Contents
Installation
Optionally, install the cups-pdf package if you intend to «print» into a PDF document. By default, PDF files are stored in /var/spool/cups-pdf/username/ . The location can be changed in /etc/cups/cups-pdf.conf .
Then enable and start cups.service or alternatively use socket activation to only start CUPS when a program wants to use the service.
Socket activation
cups provides a cups.socket unit. If cups.socket is enabled (and cups.service is disabled), systemd will not start CUPS immediately; it will just listen to the appropriate sockets. Then, whenever a program attempts to connect to one of these CUPS sockets, systemd will start cups.service and transparently hand over control of these ports to the CUPS process.
Print steps
It is important to know how CUPS works if wanting to solve related issues:
- An application sends a PDF file to CUPS when ‘print’ has been selected (in case the application sends another format, it is converted to PDF first).
- CUPS then looks at the printer’s PPD file (printer description file) and figures out what filters it needs to use to convert the PDF file to a language that the printer understands (like PJL, PCL, bitmap or native PDF).
- The filter converts the PDF file to a format understood by the printer.
- Then it is sent to the back-end. For example, if the printer is connected to a USB port, it uses the USB back-end.
Connection interfaces
Additional steps for printer detection are listed below for various connection interfaces.
To see if your USB printer is detected, make sure you have the usbutils package installed, then:
Parallel port
To use a parallel port printer, the lp , parport and parport_pc kernel modules are required.
Network
To discover, make use of discovered or share printers using DNS-SD/mDNS, setup .local hostname resolution with Avahi and restart cups.service .
To share printers with Samba, e.g. if the system is to be a print server for Windows clients, the samba package will be required.
Printer drivers
This article or section needs expansion.
The drivers for a printer may come from any of the sources shown below. See CUPS/Printer-specific problems for an incomplete list of drivers that others have managed to get working.
To drive a printer, CUPS needs a PPD file and, for most printers, some filters. For details on how CUPS uses PPDs and filters, see [1].
The OpenPrinting Printer List provides driver recommendations for many printers. It also supplies PPD files for each printer, but most are available through foomatic or the recommended driver package.
When a PPD file is provided to CUPS, the CUPS server will regenerate the PPD files and save them in /etc/cups/ppd/ .
CUPS includes support for AirPrint and IPP Everywhere printers.
OpenPrinting CUPS filters
The Linux Foundation’s OpenPrinting workgroup provides cups-filters. Those are backends, filters, and other binaries that were once part of CUPS but are no longer maintained by Apple. They are available in the cups-filters package that is a dependency of cups .
Non-PDF printers require ghostscript to be installed. For PostScript printers, gsfonts may also be required.
Foomatic
The Linux Foundation’s OpenPrinting workgroup’s foomatic provides PPDs for many printer drivers, both free and non-free. For more information about what foomatic does, see Foomatic from the Developer’s View.
To use foomatic, install foomatic-db-engine and at least one of:
- foomatic-db — a collection of XML files used by foomatic-db-engine to generate PPD files.
- foomatic-db-ppds — prebuilt PPD files.
- foomatic-db-nonfree — a collection of XML files from printer manufacturers under non-free licenses used by foomatic-db-engine to generate PPD files.
- foomatic-db-nonfree-ppds — prebuilt PPD files under non-free licenses.
The foomatic PPDs may require additional filters, such as min12xxw AUR .
Gutenprint
The Gutenprint project provides drivers for Canon, Epson, Lexmark, Sony, Olympus, and PCL printers for use with CUPS and GIMP.
Manufacturer-specific drivers
Many printer manufacturers supply their own Linux drivers. These are often available in the official Arch repositories or in the AUR.
Some of those drivers are described in more detail in CUPS/Printer-specific problems.
Printer URI
Listed below are additional steps to manually generate the URI if required. Some printers or drivers may need a special URI as described in CUPS/Printer-specific problems.
CUPS should be able to automatically generate a URI for USB printers, for example usb://HP/DESKJET%20940C?serial=CN16E6C364BH .
If it does not, see CUPS/Troubleshooting#USB printers for troubleshooting steps.
Parallel port
The URI should be of the form parallel:device . For instance, if the printer is connected on /dev/lp0 , use parallel:/dev/lp0 . If you are using a USB to parallel port adapter, use parallel:/dev/usb/lp0 as the printer URI.
Network
If you have set up Avahi as in #Network, CUPS should detect the printer URI. You can also use avahi-discover to find the name of your printer and its address (for instance, BRN30055C6B4C7A.local/10.10.0.155:631 ).
The URI can also be generated manually, without using Avahi. A list of the available URI schemes for networked printers is available in the CUPS documentation. As exact details of the URIs differ between printers, check either the manual of the printer or CUPS/Printer-specific problems.
The URI for printers on SMB shares is described in the smbspool(8) man page.
For example, smb://BEN-DESKTOP/HP Color LaserJet CP1510 series PCL6 becomes smb://BEN-DESKTOP/HP%20Color%20LaserJet%20CP1510%20series%20PCL6 .
This result string can be obtained by running the following command:
Remote CUPS print servers can be accessed through a URI of the form ipp://hostname:631/printers/queue_name . See CUPS/Printer sharing#Printer sharing for details on setting up the remote print server.
See CUPS/Troubleshooting#Networking issues for additional issues and solutions.
Usage
CUPS can be fully controlled using the lp* and cups* CLI tools. Alternatively, the #Web interface or one of several #GUI applications can be used.
- The queue name is a short but descriptive name used on the system to identify the queue. This name should not contain spaces or any special characters. For instance, a print queue corresponding to a HP LaserJet 5P could be named «hpljet5p». More than one queue can be associated with each physical printer.
- The location is a description of the printer’s physical location (for instance «bedroom», or «kitchen»). This is to aid in maintaining several printers.
- The description is a full description of the print queue. A common use is a full printer name (like «HP LaserJet 5P»).
CLI tools
See CUPS local documentation for more tips on the command-line tools.
This article or section needs language, wiki syntax or style improvements. See Help:Style for reference.
The queue_name is up to you. Examples:
Check the status Deactivate a printer Activate a printer Set the printer to accept jobs Remove a printer.
First set it to reject all incoming entries:
Then disable it:
Finally remove it:
Print a test page Print a file Check the queue Clear the queue View ink levels
Add your user to the lp user group:
Log out and log in again.
For usage information, use:
Web interface
The CUPS server can be fully administered through the web interface, available on http://localhost:631/.
To perform administrative tasks from the web interface, authentication is required; see #Permissions.
Go to the Administration page.
Modify existing queues
Go to the Printers page, and select a queue to modify.
Go to the Printers page, and select a queue.
GUI applications
If your user does not have sufficient privileges to administer CUPS, the applications will request the root password when they start. To give users administrative privileges without needing root access, see #Configuration.
Configuration
The CUPS server configuration is located in /etc/cups/cupsd.conf and /etc/cups/cups-files.conf (see cupsd.conf(5) and cups-files.conf(5) ). After editing either file, restart cups.service to apply any changes. The default configuration is sufficient for most users.
Permissions
User groups with printer administration privileges are defined in SystemGroup in the /etc/cups/cups-files.conf . The sys and root and wheel groups are used by default.
CUPS helper programs are run as the cups user and group. This allows the helper programs to access printer devices and read configuration files in /etc/cups/ , which are owned by the cups group.
Default paper size
cups is built with libpaper support and libpaper defaults to the Letter paper size (called PageSize in lpoptions ). To avoid having to change the paper size for each print queue you add, edit /etc/papersize and set your system default paper size. See papersize(5) .
Log files
By default, all logs are sent to files in /var/log/cups/ . By changing the values of the AccessLog , ErrorLog , and PageLog directives in /etc/cups/cups-files.conf to syslog , CUPS can be made to log to the systemd journal instead. See Fedora:Changes/CupsJournalLogging for information on the original proposed change.
cups-browsed
This article or section is out of date.
CUPS can use Avahi browsing to discover unknown shared printers in your network. This can be useful in large setups where the server is unknown. To use this feature, set up .local hostname resolution, and start both avahi-daemon.service and cups-browsed.service . Jobs are sent directly to the printer without any processing so the created queues may not work, however driverless printers such as those supporting IPP Everywhere or AirPrint should work out of the box.
Print servers and remote administration
Allowing admin authentication through PolicyKit
PolicyKit can be configured to allow users to configure printers using a GUI without the admin password.
Here is an example that allows members of the wheel user group to administer printers without a password:
Without a local CUPS server
CUPS can be configured to directly connect to remote printer servers instead of running a local print server. This requires installation of the libcups package. Some applications will still require the cups package for printing.
Источник