IT Place
IT, Programming, Life
среда, 29 июня 2011 г.
Установка виртуального принтера под Linux (Ubuntu)
Однажды, заказывая билеты на поезд через интернет, я столкнулся с непреодолимой глючностью интерфейса, пытавшегося сохранить электронный билет в файл. Да, можно было бы сразу распечатать, но я, как и многие другие, предпочитаю печатать на работе. Так и тонер/краску покупать не надо, да и чаще всего с бумагой тоже проблем нет. (шучу)
Вобщем, понадобилась такая штука, как виртуальный принтер. И получить ее очень и очень просто:
Проверяем, что принтер есть:
Если у вас активирован Unity, то просто жмем клавишу «super»(win) и пишем Printing |
Если нет виртуального принтера, жмем «Add», далее выбираем «Generic CUPS-PDF» и forward, forward, forward. |
На выходе мы получаем отличный виртуальный принтер. Все распечатанное попадает в »
6 комментариев:
Полезная информация! 🙂 Теперь я стану лучше понимать компьютер 🙂
Виртуальный PDF-Printer на CUPS-PDF
Автор: Илья Балдуев
Дата записи
Что делать, если необходимо распечатать документ, а принтера нет? В решении этого вопроса частично поможет сохранение документа в формате PDF, который в последствии можно распечатать в том месте, где есть настоящий принтер. Впрочем, возможно и виртуального принтера вам будет достаточно.
На личном опыте, я сталкивался с такими ситуациями, когда информацию отображаемую на дисплее не удаётся сохранить либо без потери вида, либо вообще, можно только распечатать. В такие моменты, данное решение становится «палочкой выручалочкой».
Для реализации виртуального принтера, нужна Linux машина, в нашем случае на Debian или Ubuntu. Сперва проверьте наличие подсистемы печати CUPS — без «капса» никуда. У него кстати есть веб-интерфейс: http://localhost:631/ где можно произвести некоторые настройки.
А теперь, устанавливаем пакет «cups-pdf»:
Перезагружаем подсистему печати:
Проверяем список принтеров и что установлено по умолчанию:
В большинстве случаев, это всё, готово. Теперь можно отправлять на печать любые документы и не только.
По необходимости можно указывать параметры:
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.
Linux Mint Forums
Welcome to the Linux Mint forums!
Print PDF
Print PDF
Post by minimus80 » Mon Mar 21, 2016 5:10 pm
I would like to print into PDF.
I installed governance java aplication for taxes . all works fine but have problem to save/print the output into PDF.
The aplication itself dont have posibility to print to pdf or save to pdf. I can save to xml or print.
When I do print . it automaticaly open me file in gedit . which is useless for me.
I want to print to pdf and then in work I can print pdf to real printer.
I checked the web . installed cups-pdf . I can see Pdf printer ..but the gov. java aplication instead of print . opens the file in gedit.
I found also this link . but somehow the the «cp» dont work for me . probably doing something wrong
viewtopic.php?t=172796
what you advise me to force or make the default PDF printer ?
Re: Print PDF
Post by jimallyn » Mon Mar 21, 2016 9:10 pm
“If the government were coming for your TVs and cars, then you’d be upset. But, as it is, they’re only coming for your sons.” — Daniel Berrigan
Re: Print PDF
Post by golf4fun » Mon Mar 21, 2016 10:25 pm
Re: Print PDF
Post by phd21 » Tue Mar 22, 2016 1:40 am
I just read your post and the good replies to it. Here are my thoughts on this as well.
With «cups-pdf» installed, you should be able to print to a PDF file easily, and in Linux Mint by default you can also print to «file» which is also PDF. There are also numerous «print to PDF» and or «save to PDF» add-ons, plug-ins, or extensions for all Internet browsers as well, just search for «PDF» in the add-ons, plug-ins, and or extensions. «Fireshot» is a really good browser add-on that can also do this.
If you select print from any program or browser, you should be given an option to select or change the printer, where you can then select «PDF» as the printer. or print to «File», which will create a PDF file.
Re: Print PDF
Post by minimus80 » Tue Mar 22, 2016 4:16 am
Thanks guys ..your replies seems to be logical ..but problem is . that the aplication dont allow me to choose printer or save as etc
I can only . save xml file ( to save my work in order to open it in future)
And then there is button Print.
so this is probably not best aplication
And when I press button print . the gedit is open and file ..which should be printed is open in the gedit
so instead of printer . the document is sent to gedit
the file looks to be with .fdf . so maybe thats the problem . that system dont recognize it as print document . and thatswhy open it in gedit
any idea how can I push the system to open the .fdf file in print ? Or do I need some kind of version of Adobe PDF installed ?
Re: Print PDF
Post by Moem » Tue Mar 22, 2016 4:23 am
If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!
Re: Print PDF
Post by minimus80 » Tue Mar 22, 2016 4:25 am
yes . but once the .fdf is open in gedit . its like xml file opened in txt editor
so its not in a form of paper document layout ..its text . and when I save it as pdf . its still text
Re: Print PDF
Post by Moem » Tue Mar 22, 2016 4:27 am
Okay, so you do indeed lose too much formatting. I was thinking that might be the case.
Thinking further. since it’s sent to Gedit, the system sees it as text. Could you set LibreOffice as the default preferred application for text files, and then save as PDF from there? Not sure it will work, but it seems like it’s worth a try.
By now, it would be handy if we knew which desktop environment you are using.
If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!
Re: Print PDF
Post by minimus80 » Tue Mar 22, 2016 4:36 am
Re: Print PDF
Post by phd21 » Tue Mar 22, 2016 12:16 pm
It would help to know more about your system setup. If you run «inxi -Fxzd» from the console terminal prompt, highlight the results, copy and paste them back here, that should provide enough information.
If you could provide one or more screen shots, that would help too. One with the original document open, and another when you try to print, etc. If you know how to create a desktop screen recording (screencast), you could record your desktop and the processes you are doing, then upload that to YouTube, or some other video hosting website like that, then we could see exactly what you are doing, and hopefully what is going on. I personally think that «Simple Screen Recorder (SSR)» is the best desktop recorder, and there are others.
SimpleScreenRecorder
To install this using the PPA method, open a console terminal, type in, or copy & paste, each line below one by one:
sudo add-apt-repository ppa:maarten-baert/simplescreenrecorder
sudo apt-get update
sudo apt-get install simplescreenrecorder simplescreenrecorder-lib
# if you want to record 32-bit OpenGL applications on a 64-bit system:
sudo apt-get install simplescreenrecorder-lib:i386
Printing or saving this document to a PDF file should be a simple thing to do. But, you can always save the document as «.xml», and then use one of the many free online converter websites to convert the «xml» document to PDF, see link below.
convert xml to pdf online
https://www.google.com/#q=convert+xml+to+pdf+online
Re: Print PDF
Post by DrHu » Tue Mar 22, 2016 1:54 pm
You don’t say exactly which java application (windows) you are using
—governance means to me: simply government rules for taxes
If we knew which java application you were using, we may have a better idea of alternatives
And of course there are always direct XML editors available, if you need to pull out some specific data; but not directly software-to-software (your java app to a Linux app that can import that data)
—without having any additional info in reference to the exact program you use..
http://stackoverflow.com/questions/3429 . g-in-linux
http://xml-copy-editor.sourceforge.net/ . age=ubuntu
http://jedit.org/
—or any program editor, Gnome version or otherwise as in this one (Jedit, java based editor)
I dnoticed the above but didn’t check any cone\version programs; however one of the comprehensive publishing programs (for books etc ) is latex
http://www.elml.org/website/en/html/output_latex.html
—that’s a big package and takes time to understand but no doubt it could handle any text transcription task
—Latex is a markup language as xml is.
OpenOffice also has some xml writer/parser filters: again it would take work, and may not directly support the specific (??governance taxes) document you have as an XML file
Re: Print PDF
Post by phd21 » Tue Mar 22, 2016 3:43 pm
As was just pointed out, there are «xml» programs you can install in your Linux Mint system from the Software Manager or Synaptic Package Manager (SPM) and from other sources, and then bring up the document, and print it, or Print to PDF. In fact, if you use your file manager and right click the «.xml» file, and then «open», there might be programs already in there for viewing the document properly, where you can then print it, or print to PDF.
«xml» programs, and a couple others, I recommend to have installed
«evince» document viewer
«Okular» document viewer
BaseX
scribus
xml-core
xmlcopyeditor
libxml2*
libxml1*
html-xml-utils
ubuntu-restricted-extras
eclispe editor with eclipse-wtp-xmltools
FYI: I remember other people having problems with online government documents, but that was the unique «XFA» PDF format, not the «.xml» format. So, just in case that might also be an issue, the wonderful «Master PDF Editor3» is a great program, and a great program to have installed anyway.
Here is a wonderful free PDF program
Free Master PDF Editor for Linux — Master PDF Editor a convenient and smart PDF editor for Linux.
Has Dynamic XFA form support.
From the link below, just select the «.deb» file for your system 32-bit or 64-bit, download it somewhere, then double click the file to install it.
Re: Print PDF
Post by minimus80 » Fri Mar 25, 2016 9:46 am
Thanks for all your effort,
this is what I am doing in the java governance aplication
I tried to speak into the recording but it dont save sound, sorry.
So you can see that the aplication has a form . and then I can enter or upload previously saved data into it .. but once I press print (Vytlacit). the .fdf file is open in gedit. Or Libre office
you can see that I have PDF printer as default.
on the web is said I should have Adobe Reader 9 or higher and java 6 and higher.
I installed also Master PDF3, not sure which java I have and dont know how to update it to newest version.
Can you advise how you would continue ?
Re: Print PDF
Post by phd21 » Fri Mar 25, 2016 2:18 pm
I am guessing this is in the «Slovak» language, which I do not understand. If you could do that in English , that would be better for me.
Since you have the «xml» document file saved on your system, bring up your file manager («Files» in your system tray), and right click it, select «Open With» and pick «Okular», «Evince», LibreOffice Writer, or one of the other recommended programs, and see if it will open and view the document properly. If it can, then you can just print to PDF, or print it. When you open the document and you see it in «xml» code, or «PDF»‘s raw text code, it will obviously not print correctly. You can also try Master PDF. I do not know what the «.FDF» format is, nor have I ever seen that; maybe it is a mistake, and you can rename it to «.pdf» to see if that will also work. Your system is confused with the «.fdf» format, and so it is bringing up the default «Text» Editor «Gedit».
What are the other options available when you save the document besides «xml»? What happens when you select «Print» from your browser, not from the website’s webpage print function? And, If the website’s webpage has its own print button, what are its options?
What do you think of «SimpleScreenRecord (SSR)»? I think it is awesome, and the best programs there is for recording your desktop.
Re: Print PDF
Post by minimus80 » Fri Mar 25, 2016 3:51 pm
yes its Slovak
the SSR is cool program. but not sure why my voice was not recorded. but anyway handy program
ok . first . I finaly made the aplication running on my work PC, had to play a lot with Java security but made it working and also was able to print from the application fully. That saves my ass cause till 31/3 I had to send the form to Local Taxes .
And now what I found out.
On WIN7 . when I press print . it dont went to printer or PDF creator . But the Adobe Reader 9 was open . then it asked me if I trust and it looks to me that Adobe program «read the fdf and convert it to pdf» automaticaly . so after it was PDF.
So at my Linux . I think what is missing is fact that I dont have Adobe . basicaly also on the web was said that Adobe 6 or higher is needed.
So the Adobe has function that the .fdf is correctly read and then automaticaly converted to PDF which can be printed or saved as simple PDF