Printing/es

Este documento cubre la instalación y mantenimiento de impresoras mediante CUPS y Samba. Cubre la instalación local y la instalación en red y contiene instrucciones acerca de cómo usar impresoras compartidas desde otros sistemas operativos.

Utilizar las herramientas adecuadas
Linux ofrece buen soporte para las impresoras. La herramienta adecuada para este trabajo es CUPS (Common Unix Printing System). Desde el comienzo de este proyecto allá por 1999, la instalación y el mantenimiento de CUPS ha mejorado sustancialmente.

En este documento mostraremos como usar CUPS para configurar una impresora local o en red. No se entrará en mucho detalle ya que el proyecto dispone de un magnífica documentación para un uso avanzado.

Introducción
Cuando un usuario quiere instalar una impresora en un sistema, el primer paso es saber cómo se conecta la impresora al sistema. ¿Lo hace a través de un puerto local como LPT o USB, o está en red?. En este último caso, ¿Utiliza el protocolo de impresión de Internet (IPP) o el protocolo CIFS de Microsoft Windows (Compartir recursos en Microsoft Windows)?

La siguientes secciones indican la configuración mínima de núcleo que se necesita para conectar una impresora en Gentoo. Por supuesto, esto depende de cómo se va a conectar la impresora al sistema, por lo que para mayor comodidad se han separado las indicaciones.

Vaya a y lance make menuconfig para entrar en la configuración del núcleo. Si se ha utilizado genkernel para configurar el núcleo, entonces se deberían realizar estos pasos para asegurarse de que se no ha olvidado nada. No se puede confiar únicamente en  para configurar todo dentro del sistema de forma automática. La impresión es un área en la que es complicado ajustar todo de forma automática.

En los siguientes ejemplos de configuración se ha añadido el soporte necesario en el núcleo, no como módulos. No es obligatorio construir el núcleo de esta forma. Si se desea soporte modular, simplemente ¡No olvide que después se deben cargar los módulos apropiados!.

Ahora vaya a la sección apropiada para configurar (o comprobar) el núcleo.

Impresora conectada localmente (LPT)
El puerto LPT se usa normalmente para identificar el puerto paralelo de la impresora. Es necesario activar previamente el soporte para el puerto paralelo, exactamente "PC-style parallel port support" (a menos que se esté utilizan un sistema SPARC), después de ésto, habilitaremos el soporte para una impresora a través del puerto paralelo.

Eso es todo. Salga de la configuración del núcleo y reconstrúyalo con la siguiente orden:

No olvide copiar la nueva imagen compilada del núcleo a la localización. Si es necesario, se debe montar, así como actualizar la configuración del cargador de arranque antes de reiniciar su sistema. Por ejemplo, si utiliza GRUB2 estos pasos se pueden realizar lanzando las siguientes órdenes:

Ahora continúe con CUPS.

Impresora conectada localmente (USB)
Para imprimir a través de USB, el soporte para USB debe estar habilitado en el núcleo:

Abandone la configuración del núcleo y reconstrúyalo. No hay que olvidar copiar la imagen del núcleo a la localización (si es necesario, monte la partición  antes de copiar el núcleo) y actualice el cargador de arranque antes de reiniciar el sistema. Observe las órdenes que se deben lanzar como root listadas en el paso Impresora conectada localmente (LPT) para saber cómo realizar estos pasos.

Ahora continúe con CUPS.

Impresora remota (IPP)
Para poder conectar a una impresora remota a través del protocolo de impresión de Internet (Internet Printing Protocol) el núcleo solo necesita soporte de red. Asumiendo que el núcleo ya lo tiene, continúe con CUPS.

Impresora conectada en remoto (CIFS)
El núcleo debe ofrecer soporte para CIFS:

Una vez se ha completado la configuración para CIPS, salga de la configuración del núcleo y reconstrúyalo. No hay que olvidar copiar la imagen del núcleo a la localización (y no olvidar montar  si es necesario) y actualizar la configuración del cargador de arranque antes de reiniciar el sistema. Observe las órdenes que se deben lanzar como root en el paso Impresora conectada localmente (LPT) de arriba para sbar cómo realizar estos pasos.

Ahora continúe con CUPS.

Instalación
Instalar CUPS con Gentoo es muy sencillo. CUPS dispone de algunas características opcionales que pueden se de su interés. Para activar o desactivar estas características, usaremos los ajustes USE asociados a las mismas.

Compruebe los ajustes USE actuales. Para desviarse de los ajustes actuales solo para CUPS, añáda los deseados al fichero.

Cuando esté satisfecho con el resultado, haga que portage instale CUPS.

Para habilitar el soporte para SAMBA, se necesita instalar con soporte para CUPS. Actualice el fichero o directorio para habilitar el ajuste USE  :

A continuación (re)instale Samba:

If the printer is attached to the system locally, and the printer needs to be available every boot, the CUPS daemon will need to load automatically on start-up. Make sure the printer is attached and powered on before the CUPS daemon is started.

Configuración
The default CUPS server configuration located in is sufficient for most users. However, some users might need to make changes to the CUPS configuration.

En las siguientes secciones se cubren algunos cambios que se necesitan a menudo:


 * Allow other systems to use the printer attached to this Linux workstation.
 * Grant access to the CUPS administration from remote systems.
 * Configure CUPS to support Windows PCL drivers. This is advised for Windows systems to be able to use a SAMBA-shared printer since most Windows drivers are PCL drivers.
 * Configure this system to use a printer attached to another system (not Windows share).

Acceso a impresoras remotas
For other systems to use the printer through IPP, explicit access to the printer must be granted in the file. To share the printer using SAMBA, this change is not needed.

Open up in a favorite text editor and add in an   line for the system(s) that should be able to reach to the printer. In the next example, access is granted to the printer from localhost and from any system whose IP address starts with.

This line broadcasts browsing information to the clients on the network; it will let network users know when the printer is available:

The port CUPS listens to will also need to be specified so that it will respond to printing requests from other machines on the network:

Administración remota de CUPS
If remote administration is needed, then access to the CUPS administration will need to be granted from more systems than the localhost. Edit the file and have explicit access granted to each system that requires access. For instance, to grant access to a system with an IP address of 192.168.0.3:

Do not forget to restart the CUPS daemon after making changes to by issuing the /etc/init.d/cupsd restart command.

Habilitar soporte para los controladores PCL de Windows
PCL drivers send raw data to the print server. To enable raw printing on CUPS, edit and uncomment the   line if it is not already uncommented. Then edit and do the same, if it is not already uncommented.

No olvide reiniciar el demonio de CUPS después de aplicar estos cambios. Para ello, lance /etc/init.d/cupsd restart.

Configurar una impresora remota
If the printers are attached to a remote CUPS-powered server the system can be easily configured to use the remote printer by modifying the file.

Assuming the printer is attached to a system called, open up  with a favorite text editor and set the   directive:

The remote system will have a default printer setting which will be used. To change the default printer, use the lpoptions command.

En primer lugar, liste las impresoras disponibles:

Defina la impresora HP LaserJet 5P como impresora por defecto:

Introducción
If the printer to be configured is remotely available through a different print server (running CUPS) then the following instructions are not needed. Instead, read Setting Up a Remote Printer.

Detectar la impresora
If a USB printer or parallel port printer was powered on when the Linux system booted, it might be possible to retrieve information from the kernel stating successful detection of the printer. This is merely an indication of print detection and not a requirement.

Para una impresora USB:

Instalar la impresora
To have the printer installed on the system, fire up a browser and point it to http://localhost:631. The CUPS web interface should be displayed from which all administrative tasks can be performed.

Go to and enter the root login and password information of the box. Then, when the administrative interface has been reached, click on. A new screen will be displayed allowing the following information to be entered:


 * The spooler name, a short but descriptive name used on the system to identify the printer. This name should not contain spaces or any special characters. For instance, for the HP LaserJet 5P could be titled.
 * The location, a description where the printer is physically located (for instance "bedroom", or "in the kitchen right next to the dish washer", etc.). This is to aid in maintaining several printers.
 * The description should contain a full description of the printer. A common use is the full printer name (like "HP LaserJet 5P").

The next screen requests the device the printer listens to. The choice of several devices will be presented. The next table covers a few possible devices, but the list is not exhaustive.

Si se está instalando una impresora remota, se le pedirá la URL de la impresora:


 * An LPD printer server requires a  syntax.
 * An HP JetDirect printer requires a  syntax.
 * An IPP printer requires a  or   syntax.

Next, select the printer manufacturer in the adjoining screen along with the model type and number in the subsequent screen. For many printers multiple drivers will be available. Select one now or search on OpenPrinting Printer List for a good driver. Drivers are easily able to be changed later.

Once the driver is selected, CUPS will inform that the printer has been added successfully to the system. Navigate to the printer management page on the administration interface and select to change the printer's settings (resolution, page format, ...).

Probar y reconfigurar la impresora
To verify if the printer is working correctly, go to the printer administration page, select the printer and click on.

If the printer does not seem to work correctly, click on to reconfigure the printer. The same screens as during the first installation will appear but the defaults will now be the current configuration.

If the printer does not function, clues may be found by looking at the CUPS error log located at In the next example a permission error is discovered, probably due to a wrong  setting in the  file.

Instalar el mejor controlador
Many printer drivers exist; to find out which one has the best performance the job, visit the OpenPrinting Printer List. Select the brand and type/model of the printer to find out what driver the site recommends. For instance, for the HP LaserJet 5P, the site recommends the  driver.

Download the PPD file from the site and place it in then run /etc/init.d/cupsd restart as root. This will make the driver available through the CUPS web interface. Now reconfigure the printer as described above.

Introducción
Some printers require specific drivers or provide additional features that are not enabled through the regular configuration process (described above). This chapter will discuss a selection of printers and how they are made to work with Gentoo Linux.

Controlador Gutenprint
The gutenprint drivers are high-quality, open source printer drivers for various Canon, Epson, HP, Lexmark, Sony, Olympus and PCL printers supporting CUPS. They also support ghostscript, The Gimp, and other applications.

Gentoo's Portage tree contains an ebuild for the gutenprint drivers. Run emerge gutenprint to install them. Note the ebuild requests to quite a few USE flags. At minimum  and   must enabled for gutenprint drivers to work properly.

Cuando el proceso de emerge haya finalizado, los controladores gutenprint estarán disponibles a través de la interfaz web de CUPS.

Controlador HPLIP
Lea el artículo sobre el Controlador HPLIP

Controlador PNM2PPA
PPA is an HP technology that focuses on sending low-level processing to the system instead of the printer which makes the printer cheaper but more resource consuming.

If the OpenPrinting site informs the pnm2ppa driver is the best option, then the  filter will need to be installed on the system:

Once installed, download the PPD file for the printer OpenPrinting and put it in the folder. Then configure the printer using the steps explained above.

Configurar un cliente Windows para IPP
Microsoft Windows supports IPP (Windows 9x and ME users need to install it separately). To install a printer on Windows that is attached to a Linux box, fire up the wizard and select. When asked for the URI, use the  syntax.

Configurar un cliente Windows para una impresora compartida a través de Samba
To share the printer on the CIFS network SAMBA must be installed and configured correctly. Doing this is beyond the scope of this article, however a quick configuration of SAMBA for shared printers will be covered.

Open with a favorite text editor and add a   section to it:

Navigate to the top of the file until inside the   section. Locate the  and   settings and set each of them to   (see the example below):

Make sure to enable windows pcl support in CUPS. Then, restart the smb service to have the changes take effect.

Configurar un cliente Linux para un servidor de impresión Windows
First make sure the printer is shared on Windows systems and that  has been emerged with the   USE flag enabled (as instructed above).

To find the desired printer's URI, run the following command, substituting  with the computer that is to probe for samba-shared printers:

In the CUPS web interface, configure the printer as previously described. Notice CUPS has added another driver called. Select it and use the  or   syntax for the URI.

Introducción
Many tools exist to help configure a printer, use additional printing filters, add features to printing capabilities, etc. This chapter will list a few of them. Be aware the list is not exhaustive and not meant to discuss each tool in great detail.

Gtk-LP. Una herramienta de configuración de impresión basada en Gtk
With Gtk-LP installation, modification and configuration of a printer can be performed from a stand-alone Gtk application. It uses CUPS and provides all standard CUPS capabilities. It is definitely worth checking out if the CUPS Web interface is disliked or if a stand-alone application for day-to-day printing routines is desired.

Para instalarlo, haga emerge de gtklp:

Error: Unable to convert file 0 to printable format
Si tiene problemas al imprimir y se muestra el siguiente mensaje en :

Re-emerge with the   USE flag. You can either add  to the system USE flags in  or enable it only for ghostscript-gpl as shown:

A continuación haga lance emerge app-text/ghostscript-gpl. Cuando haya terminado la compilación, asegúrese de reiniciar  a continuación: