个人工具

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

来自Ubuntu中文

跳转至: 导航, 搜索
 
(未显示同一用户的2个中间版本)
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/PDFPrinting}}
 
{{From|https://help.ubuntu.com/community/PDFPrinting}}
 
{{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''.
+
===  PDFPrinting ===
=== Instructions for Ubuntu 6.06 LTS, 6.10 and 7.04 ===
+
==== Creating .pdf documents from any application ====
<ol><li>Install the <code><nowiki>cups-pdf</nowiki></code> package.
+
If you find that you need to create .pdf documents from an application that does not natively provide .pdf output, and/or are migrating from Windows and have used and liked PDFCreator or a similar application, then you need to install the cups-pdf package. This is assuming, of course, that you are already set up to print (at least 9.04 and 9.10 have all the other required packages already installed with a standard installation.) To do this, simply go to Synaptic (in 9.04/GNOME, that's System - Administration - Synaptic Package Manager) and mark the package "cups-pdf" for installation, then hit "apply."  Presumably if you do this and you do not have CUPS already installed, Synaptic will identify and prompt you to mark all the required packages.
</li><li>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:</li></ol>
+
This will install the package and also create a "printer" on your machine called "PDF." To create a .pdf of any document, simply format it as you like and then print as you would normally, selecting "PDF" instead of your usual printer. The output will be placed into a folder in your home directory called "PDF" - that is, /home/your_user_name/PDF.  Any text in the resulting .pdf file will be selectable and searchable.
 
+
I have done the above procedure on two machines; one running Ubuntu 9.10 i386 and one running Ubuntu 9.04 64-bit.  After doing the above the "printer" worked correctly with no additional steps on the 9.10 machine, however, on the 9.04 machine I had to create the /home/your_user_name/PDF folder manually for each user on that machine to allow the PDF "printer" to work.  Before I did so, when opening the "Printer Properties" window for the PDF "printer" I saw the following:
<pre><nowiki>
+
<code><nowiki>Printer State: Idle - /usr/libs/cups/backend/cups-pdf failed</nowiki></code>
sudo chmod +s /usr/lib/cups/backend/cups-pdf</nowiki></pre>
+
So if you can't find your output and see the above status, make sure that the PDF folder exists in the home directory of the current user.
You may skip this step if you are using version 6.10, or higher, of Ubuntu.
+
As installed, the PDF "printer" defaults to a 8.5"x11" page and 300 DPI, but these settings can be changed. Go to System - Administration - Printing and double-click on "PDF" in the resulting window to access these settings.
<ol><li>From the menu, select '''System -> Administration -> Printing'''.  Via the "Printers" dialog, opt to add a '''New Printer'''.
+
</li><li>There should now be a "PDF Printer" under the list of ''detected printers''.  Select the "PDF Printer" and press "Forward".
+
</li><li>Select ''Generic'' as the manufacturer and the ''postscript color printer'' (this name may vary slightly) as the model; then press "Forward".
+
</li><li>Give the printer a name such as "PDF-Printer" (the name should not have any spaces).</li></ol>
+
 
+
You can now create PDF files by using the Print option from your programs. To print a test page, try:
+
<ol><li>Right click on the newly created printer, and select Properties
+
</li><li>Click "Print a Test Page"</li></ol>
+
 
+
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'''
+
<pre><nowiki>
+
sudo apt-get install cups-pdf
+
sudo /etc/init.d/cupsys restart
+
</nowiki></pre>
+
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:
+
<pre><nowiki>
+
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
+
</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.
+
'''Create the pdf-printer in your gnome-printer-setup'''
+
<pre><nowiki>
+
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
+
</nowiki></pre>
+
'''Test it out'''
+
<pre><nowiki>
+
Open any app and print using the new "postscript-color-printer".  
+
PDFs are created in your home folder in a PDF subfolder (~/PDF/)
+
</nowiki></pre>
+
'''Rename the printer'''
+
<pre><nowiki>
+
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
+
</nowiki></pre>
+
Name can be anything that doesn't have spaces, #, or /
+
-----
+
=== Comments ===
+
At one point, this page was updated based on a [[UbuntuHelp:HowTo|HowTo]] posted in the forums: http://ubuntuforums.org/showthread.php?t=140815
+
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2010年5月19日 (三) 23:51的最新版本


PDFPrinting

Creating .pdf documents from any application

If you find that you need to create .pdf documents from an application that does not natively provide .pdf output, and/or are migrating from Windows and have used and liked PDFCreator or a similar application, then you need to install the cups-pdf package. This is assuming, of course, that you are already set up to print (at least 9.04 and 9.10 have all the other required packages already installed with a standard installation.) To do this, simply go to Synaptic (in 9.04/GNOME, that's System - Administration - Synaptic Package Manager) and mark the package "cups-pdf" for installation, then hit "apply." Presumably if you do this and you do not have CUPS already installed, Synaptic will identify and prompt you to mark all the required packages. This will install the package and also create a "printer" on your machine called "PDF." To create a .pdf of any document, simply format it as you like and then print as you would normally, selecting "PDF" instead of your usual printer. The output will be placed into a folder in your home directory called "PDF" - that is, /home/your_user_name/PDF. Any text in the resulting .pdf file will be selectable and searchable. I have done the above procedure on two machines; one running Ubuntu 9.10 i386 and one running Ubuntu 9.04 64-bit. After doing the above the "printer" worked correctly with no additional steps on the 9.10 machine, however, on the 9.04 machine I had to create the /home/your_user_name/PDF folder manually for each user on that machine to allow the PDF "printer" to work. Before I did so, when opening the "Printer Properties" window for the PDF "printer" I saw the following: Printer State: Idle - /usr/libs/cups/backend/cups-pdf failed So if you can't find your output and see the above status, make sure that the PDF folder exists in the home directory of the current user. As installed, the PDF "printer" defaults to a 8.5"x11" page and 300 DPI, but these settings can be changed. Go to System - Administration - Printing and double-click on "PDF" in the resulting window to access these settings.