LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-25-2017, 09:28 AM   #1
Howling-Wolf
LQ Newbie
 
Registered: Oct 2016
Posts: 5

Rep: Reputation: Disabled
Open PDF file in viewer automatically after creating by PDF printer.


Hi all,

Is there any possibility to use any kind of pdf printer which has an option to open the file in a default viewer after creating. Just like in Windows there are plenty of pdf printers (both commercial and free) with this function as default.

Now I use cups-pdf. No problem with it, just I have to open the PDF directory and find the created file and then click on it to open.

Looking for any solution to print-to-pdf-and-view-at-once. Any suggestion welcome.

Mike
 
Old 10-25-2017, 10:05 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,681

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
One fairly easy solution would be to use inotify/incrond. In a nutshell it watches the PDF directory for newly created files and then have it run a script to open the file via your pdf viewer.

https://www.cyberciti.biz/faq/linux-...e-directories/

The exact commands to start incrond would depend on your distribution/version particularly if it is using systemd.
 
1 members found this post helpful.
Old 10-25-2017, 02:13 PM   #3
Howling-Wolf
LQ Newbie
 
Registered: Oct 2016
Posts: 5

Original Poster
Rep: Reputation: Disabled
Smile

Thank you for quick reply. I will give it a go and come back later. Maybe will need a little bit help to fine tune it...
BTW I use Linux Mint 18.2 Cinnamon 64bit.
 
Old 10-25-2017, 06:01 PM   #4
Howling-Wolf
LQ Newbie
 
Registered: Oct 2016
Posts: 5

Original Poster
Rep: Reputation: Disabled
Question

Sorry but this solution doesn't work: for me (and some other users) doesn't fire any command however the logfile shows that the command has been initiated. Another users reported that it fires randomly.
So still no solution. Any other idea...?
 
Old 10-25-2017, 06:32 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,681

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
Might be that you have to add a display prior to running the script/command.

export display=:0 && evince ...

I don't have time to research more at the moment.
 
Old 10-25-2017, 08:47 PM   #6
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748
Take a look at the PostProcessing option in your cups-pdf.conf. As an example https://ubuntuforums.org/showthread.php?t=1382024
 
Old 10-26-2017, 01:06 AM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by allend View Post
Take a look at the PostProcessing option in your cups-pdf.conf. As an example https://ubuntuforums.org/showthread.php?t=1382024
nice!
what a little web search can come up with...
 
Old 10-26-2017, 02:37 AM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,681

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
Definitely, completely forgot about postprocessing.
 
Old 11-03-2017, 02:44 PM   #9
Howling-Wolf
LQ Newbie
 
Registered: Oct 2016
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thumbs up

Quote:
Originally Posted by allend View Post
Take a look at the PostProcessing option in your cups-pdf.conf. As an example https://ubuntuforums.org/showthread.php?t=1382024
Thank you for suggestion, it really works, but strictly with no apparmor/SElinux enabled to cups.
Thread solved. Good luck for everybody!

Last edited by Howling-Wolf; 11-06-2017 at 03:04 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PDF Reader that will open PDF's created with lastest versions of Adobe? enine Slackware 22 08-09-2016 07:49 PM
[SOLVED] Best image viewer,djvu viewer pdf viewer cd/dvd writer for debian 7 rubankumars Debian 2 05-15-2013 08:23 AM
[SOLVED] Is there a decent PDF viewer/printer for Ubuntu? taylorkh Linux - Software 7 03-02-2012 02:38 PM
My cups-pdf pdf printer is not working. sgsawant Linux - Software 1 03-16-2010 02:35 AM
Foxit PDF Reader 1.3: A Nice PDF Viewer Cinematography Linux - Software 6 05-03-2005 04:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration