Linux pdf print to file

More Print to file settings?

The settings in print to file option in Ubuntu is limiting and dangerous. All the applications apart from Mozilla print to a file ~/output.pdf, this is dangerous as you can overwrite a previous print. Edit: I have been informed you are asked whether you wish to overwrite, unlike in cups-pdf Why can’t applications use the title of the document, the filename or the page title of the web page? What package and where are the settings of this print to file held. I would prefer it printing to the desktop if it cannot intuitively chose a filename, as when it arrives on the desktop it would be a visual reminder for me to change the filename. Previously I did not use the print to file feature, as the cups-pdf didn’t have these short comings. But the latest releases including 12.04 of cups-pdf has been botched and all text are converted to images before embedding them in the pdf. Making the PDFs useless as it prevents the selecting of text and the sharpness of the text is lost too. The bug has been reported for sometime now, https://bugs.launchpad.net/ubuntu/+source/cups-pdf/+bug/820820 and as usual been labelled as a wish list feature.

So my question is where in the system is the ~/output.pdf set?

3 Answers 3

There is currently a GnomeGoal dedicated to change this: https://live.gnome.org/GnomeGoals/PrintToFile

However as it looks now, not many Gnome Applications implement this yet.

In general, I’m unable to confirm the premise of your question. When I use firefox or gedit, I’m able to set both the directory and the filename where the output of print to file is saved. I wonder if the problem you are seeing is specific to a particular application. I have never noticed the program behavior you mention.

If it is a general problem, then I’d suggest that there is something wrong and it may be appropriate to file a bug. How do I report a bug? may be helpful.

Читайте также:  Windows rdp from linux

Nevertheless, to get to your question in bold. Each application can manage its print menu. The Libre suite seems to go for exporting a .pdf file over printing to a file. For gedit the answer is: ~/.config/gedit/gedit-print-settings. For a gnome application that prints to files ~/.config/application-name would be the first place I would look.

gruber@gruber-precise-laptop:~$ cat ~/.config/gedit/gedit-print-settings [Print Settings] number-up=1 reverse=false print-pages=all output-uri=file:///home/gruber/Documents/xyzzy.pdf output-file-format=pdf collate=false printer=Print to File page-set=all scale=100 

Источник

You can choose to print a document to a file instead of sending it to print from a printer. Printing to file will create a PDF , a PostScript or a SVG file that contains the document. This can be useful if you want to transfer the document to another machine or to share it with someone.

To print to file:

  1. Open the print dialog by pressing Ctrl + P .
  2. Select Print to File under Printer in the General tab.
  3. To change the default filename and where the file is saved to, click the filename below the printer selection. Click Select once you have finished choosing.
  4. PDF is the default file type for the document. If you want to use a different Output format , select either PostScript or SVG .
  5. Choose your other page preferences.
  6. Press Print to save the file.

More Information

  • Printing — Set up local and network printers. Learn about different printing options like collation and multi-sided printing.

You can choose the displayed language by adding a language suffix to the web address so it ends with e.g. .html.en or .html.de.
If the web address has no language suffix, the preferred language specified in your web browser’s settings is used. For your convenience:
[ Change to English Language | Change to Browser’s Preferred Language ]

The material in this document is available under a free license, see Legal for details.
For information on contributing see the Ubuntu Documentation Team wiki page. To report errors in this documentation, file a bug.

Источник

Bash-script printing a pdf to a pdf in Linux

The question probably sounds a little odd, but the actual task is relatively simple, I swear! I’m automatically generating some PDFs from a webform, using PDFCreator to merge a generated FDF into a preexisting PDF. I created the preexisting PDF in NitroPDF. This setup works great — almost. The problem is that when you view the generated PDFs in Adobe Reader 9 (the most common reader) a subset of the fields are just blank. The information is still there; using previous versions of Adobe Reader or a different reader like Foxit Reader shows the entire PDF. No clue what’s going on, and Adobe tech support was useless since I didn’t create the PDF with Adobe software. (If you’d like to help fix this problem instead of the following, feel free to email me.) However, if I take the resultant PDF and print it to a fresh PDF using a PDF printer driver, it works great everywhere. This is time-consuming and annoying for our sales department to do themselves, so I want to perform this step automagically upon creating the first PDF. I’m in ubuntu, and have command-line root access to the server. The program is written in PHP, and can easily make system calls. I’m just having trouble figuring out how to tie things together properly so that I can automatically print a known file using a specific printer driver to another known file.

Читайте также:  Oracle linux server настройка сети

1 Answer 1

You could try putting your PDF files through Ghostscript. I have found that this is enough to fix many problematic PDFs.

gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=output.pdf input.pdf 

(The same command can also be used to merge several PDF files into one, just specify multiple input files.)

Источник

How do I print a PDF file?

I installed Ubuntu 11.10 on my Inspiron 9100 a week ago. I have a HP Laser Jet 1100 connected to it. I can print a file from LibreOffice Write. So the printer is working. Now, the question is, How do I print a pdf file (or few pages of a pdf file)? When I click the pdf file, some package opens the file. I can view the file, but it does not provide any option to print the file. What am I missing? Thanks in advance.

3 Answers 3

The PDF file should be opening in the Evince document viewer. You need to hover the mouse over the top panel to reveal the menu (AKA global menu).

Global menu location

Under «File» you will find the «Print. » option. Alternatively, press Ctrl + P to access the print dialogue.

I opened LibreOffice Writer and then opened the .pdf document in there. Clicked Print and Voila!

I had to do it this way in Ubuntu 16.04.1. Just stopped printing PDFs opened in Document Viewer one day, don’t know why. Choose «open with» and select ‘/usr/bin/libreoffice’.

2012

You can use LibreOffice Draw to open, edit and print PDF files.

In Ubuntu install LibreOffice Extension for Importing PDF Files from the Software Center.

When you go to open the PDF, use Draw, go to file, open, select the PDF you want to open, click All files, (lower right), scroll down to PDF, Click it, then hit open.

Читайте также:  Загрузчик windows как linux

(Windows version edits PDF’s right out of the box, I think the Linux version defaults to viewing the code).

2023

Things have changed from 11 years ago. Current Ubuntu LibreOffice Draw versions open, edit and print vector PDF files right out of the box.

Text on Raster PDF’s is not editable but LOD can print them okay.

Источник

Currently I open the file in document viewer and select print etc. Is it not possible to right click the file and «send to» the printer?

2 Answers 2

Use lpr to print PDF files directly from the command-line

I don’t think you can do that directly, no. However, there’s a command line program called lpr which sends pdf files directly to the printer. So if you have doc.pdf , you should be able to print it with lpr doc.pdf (assuming you’re in the right folder on the command line).

You can also view the printer queue with lpq — besides the queue, this shows which is the default printer, and what its status is.

Add lpr to the right-click menu

I didn’t know about ‘lpr’ that Steve mentioned about, but I know how to add it to your right click menu, using the Nautilus Scripts function of Nautilus.

Just copy and paste the below text to Gedit:

#!/bin/bash IFS_BAK=$IFS IFS=" " for line in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS; do if [[ "$line" = "" || "$line" = " " ]]; then exit fi lpr "$line" sleep 1; done IFS=$IFS_BAK IFS_BAK= 

Save the file as ‘Send to Printer’ and then, right click on it->Properties->Permissions->Tick «Allow executing file as program»

Finally, move the file under ~/.gnome2/nautilus-scripts

Now, in every .pdf file you want, you can right click on it and choose Scripts->’Send to Printer’. The command ‘lpr’ that Steve mentioned about will execute to the file you have selected.

Источник

Оцените статью
Adblock
detector