个人工具

“UbuntuHelp:PDFPrinting”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(新页面: {{From|https://help.ubuntu.com/community/PDFPrinting}} {{Languages|UbuntuHelp:PDFPrinting}} Most Gnome applications and OpenOffice.org can generate PDF documents without adding anything s...)
 
第2行: 第2行:
 
{{Languages|UbuntuHelp:PDFPrinting}}
 
{{Languages|UbuntuHelp:PDFPrinting}}
 
Most Gnome applications and OpenOffice.org can generate PDF documents without adding anything special. However, if you wish to create PDF files from any application that can print, you need to install <code><nowiki>cups-pdf</nowiki></code> and create a ''virtual PDF printer''.
 
Most Gnome applications and OpenOffice.org can generate PDF documents without adding anything special. However, if you wish to create PDF files from any application that can print, you need to install <code><nowiki>cups-pdf</nowiki></code> and create a ''virtual PDF printer''.
 
 
=== Instructions for Ubuntu 6.06 LTS, 6.10 and 7.04 ===
 
=== Instructions for Ubuntu 6.06 LTS, 6.10 and 7.04 ===
 
+
# Install the <code><nowiki>cups-pdf</nowiki></code> package.
* Install the <code><nowiki>cups-pdf</nowiki></code> package.
+
# If you are using Ubuntu 6.06 (due to [https://launchpad.net/distros/ubuntu/+source/cups-pdf/+bug/42147 bug 42147]) it is necessary to manually change one file in order to add the PDF printer:
* If you are using Ubuntu 6.06 (due to [https://launchpad.net/distros/ubuntu/+source/cups-pdf/+bug/42147 bug 42147]) it is necessary to manually change one file in order to add the PDF printer:
+
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo chmod +s /usr/lib/cups/backend/cups-pdf</nowiki></pre>
 
sudo chmod +s /usr/lib/cups/backend/cups-pdf</nowiki></pre>
 
You may skip this step if you are using version 6.10, or higher, of Ubuntu.
 
You may skip this step if you are using version 6.10, or higher, of Ubuntu.
 
+
# From the menu, select '''System -> Administration -> Printing'''.  Via the "Printers" dialog, opt to add a '''New Printer'''.
* From the menu, select '''System -> Administration -> Printing'''.  Via the "Printers" dialog, opt to add a '''New Printer'''.
+
# There should now be a "PDF Printer" under the list of ''detected printers''.  Select the "PDF Printer" and press "Forward".
* There should now be a "PDF Printer" under the list of ''detected printers''.  Select the "PDF Printer" and press "Forward".
+
# Select ''Generic'' as the manufacturer and the ''postscript color printer'' (this name may vary slightly) as the model; then press "Forward".
* Select ''Generic'' as the manufacturer and the ''postscript color printer'' (this name may vary slightly) as the model; then press "Forward".
+
# Give the printer a name such as "PDF-Printer" (the name should not have any spaces).
* Give the printer a name such as "PDF-Printer" (the name should not have any spaces).
+
 
+
 
You can now create PDF files by using the Print option from your programs. To print a test page, try:
 
You can now create PDF files by using the Print option from your programs. To print a test page, try:
 
+
# Right click on the newly created printer, and select Properties
* Right click on the newly created printer, and select Properties
+
# Click "Print a Test Page"
* Click "Print a Test Page"
+
 
+
 
The printer sends PDF files to your Home folder, under the PDF folder.
 
The printer sends PDF files to your Home folder, under the PDF folder.
 
 
=== Instructions for Ubuntu 5.10 ===
 
=== Instructions for Ubuntu 5.10 ===
 
 
'''Install the cups-pdf package from universe and restart cups'''
 
'''Install the cups-pdf package from universe and restart cups'''
 
<pre><nowiki>
 
<pre><nowiki>
第30行: 第22行:
 
sudo /etc/init.d/cupsys restart
 
sudo /etc/init.d/cupsys restart
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Cups-PDF should be working for Gedit and abiword and a few other apps. If you need more general PDF creation, continue.   
 
Cups-PDF should be working for Gedit and abiword and a few other apps. If you need more general PDF creation, continue.   
 
 
'''Update Cupsd.conf'''
 
'''Update Cupsd.conf'''
 
Cups requires changing permissions to get Cups-PDF to work for other applications:
 
Cups requires changing permissions to get Cups-PDF to work for other applications:
 
 
Quote Leszek Tarkowski:
 
Quote Leszek Tarkowski:
 
<pre><nowiki>
 
<pre><nowiki>
第43行: 第32行:
 
sudo /etc/init.d/cupsys restart
 
sudo /etc/init.d/cupsys restart
 
</nowiki></pre>
 
</nowiki></pre>
 
 
This will cause cups to run as root, rather than as a user. This is necessary for Cups-PDF, but could be a security risk if a hackable bug is found in cups. Use your judgement and stay on top of Ubuntu Security updates.
 
This will cause cups to run as root, rather than as a user. This is necessary for Cups-PDF, but could be a security risk if a hackable bug is found in cups. Use your judgement and stay on top of Ubuntu Security updates.
 
 
'''Create the pdf-printer in your gnome-printer-setup'''
 
'''Create the pdf-printer in your gnome-printer-setup'''
 
<pre><nowiki>
 
<pre><nowiki>
第56行: 第43行:
 
Apply
 
Apply
 
</nowiki></pre>
 
</nowiki></pre>
 
 
'''Test it out'''
 
'''Test it out'''
 
<pre><nowiki>
 
<pre><nowiki>
第62行: 第48行:
 
PDFs are created in your home folder in a PDF subfolder (~/PDF/)
 
PDFs are created in your home folder in a PDF subfolder (~/PDF/)
 
</nowiki></pre>
 
</nowiki></pre>
 
 
'''Rename the printer'''
 
'''Rename the printer'''
 
<pre><nowiki>
 
<pre><nowiki>
第71行: 第56行:
 
</nowiki></pre>
 
</nowiki></pre>
 
Name can be anything that doesn't have spaces, #, or /
 
Name can be anything that doesn't have spaces, #, or /
 
 
-----
 
-----
 
=== Comments ===
 
=== Comments ===
 
 
At one point, this page was updated based on a HowTo posted in the forums: http://ubuntuforums.org/showthread.php?t=140815
 
At one point, this page was updated based on a HowTo posted in the forums: http://ubuntuforums.org/showthread.php?t=140815
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2007年11月30日 (五) 20:59的版本


Most Gnome applications and OpenOffice.org can generate PDF documents without adding anything special. However, if you wish to create PDF files from any application that can print, you need to install cups-pdf and create a virtual PDF printer.

Instructions for Ubuntu 6.06 LTS, 6.10 and 7.04

  1. Install the cups-pdf package.
  2. If you are using Ubuntu 6.06 (due to bug 42147) it is necessary to manually change one file in order to add the PDF printer:
sudo chmod +s /usr/lib/cups/backend/cups-pdf

You may skip this step if you are using version 6.10, or higher, of Ubuntu.

  1. From the menu, select System -> Administration -> Printing. Via the "Printers" dialog, opt to add a New Printer.
  2. There should now be a "PDF Printer" under the list of detected printers. Select the "PDF Printer" and press "Forward".
  3. Select Generic as the manufacturer and the postscript color printer (this name may vary slightly) as the model; then press "Forward".
  4. Give the printer a name such as "PDF-Printer" (the name should not have any spaces).

You can now create PDF files by using the Print option from your programs. To print a test page, try:

  1. Right click on the newly created printer, and select Properties
  2. Click "Print a Test Page"

The printer sends PDF files to your Home folder, under the PDF folder.

Instructions for Ubuntu 5.10

Install the cups-pdf package from universe and restart cups

sudo apt-get install cups-pdf
sudo /etc/init.d/cupsys restart

Cups-PDF should be working for Gedit and abiword and a few other apps. If you need more general PDF creation, continue. Update Cupsd.conf Cups requires changing permissions to get Cups-PDF to work for other applications: Quote Leszek Tarkowski:

You have to edit /etc/cups/cupsd.conf
sudo nano /etc/cups/cupsd.conf
change RunAsUser from Yes to No.
sudo /etc/init.d/cupsys restart

This will cause cups to run as root, rather than as a user. This is necessary for Cups-PDF, but could be a security risk if a hackable bug is found in cups. Use your judgement and stay on top of Ubuntu Security updates. Create the pdf-printer in your gnome-printer-setup

System--> Administration--> Printing
Add printer
Select "Local Printer" and use a "detected printer--> PDF printer".
Manufacturer--> Generic,
Model-->PostScript Color Printer,
Driver-->Should come preselected with a green dot (rev3a)
Apply

Test it out

Open any app and print using the new "postscript-color-printer". 
PDFs are created in your home folder in a PDF subfolder (~/PDF/)

Rename the printer

If you want a name better than "postscript-color-printer"
sudo nano /etc/cups/printers.conf
Change <Printer postscript-color-printer> to <Printer PDF-Printer>
sudo /etc/init.d/cupsys restart

Name can be anything that doesn't have spaces, #, or /


Comments

At one point, this page was updated based on a HowTo posted in the forums: http://ubuntuforums.org/showthread.php?t=140815