Sponsored Content
Top Forums Programming Linux C - how to open a pdf file with default reader Post 302406060 by JohnGraham on Sunday 21st of March 2010 07:18:46 PM
Old 03-21-2010
I know Gnome has a utility program, gnome-open, which will take the file you pass to it and open that with the default application, whatever that is - presumably there's something similar for KDE and other popular desktop environments?

If you want it to be fairly portable, you could:

1) Check for the presence of, e.g. gnome-open with system("gnome-open --version"), and so on for other programs until you find one,

2) If that doesn't work, go down a similar list of raw pdf viewers (system("evince --version"), etc), and

3) If you still can't find one, prompt the user for the name of a program.

Apart from that, I don't think there's a lot else you can do.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to open WinZip file in linux

Hi i am an fresh engineer working in a Embedding company and i am new to linux so any one help me to teach or tell how to open a WinZip file in linux as i use gunzip but hte file suffix is not gz so can any one healp me... urs ... (2 Replies)
Discussion started by: wagmare
2 Replies

2. AIX

pdf reader

which package is to be installed to view pdf files in AIX machine? i already have xpdf version 1...but, some pdf files are not opening in it.help me out. (1 Reply)
Discussion started by: me.kamph
1 Replies

3. Shell Programming and Scripting

How to open a pdf file from terminal?

how to open a .pdf file from terminal not using gpdf I work on fedora 12 and default application assigned for viewing the pdf files is document-viewer (3 Replies)
Discussion started by: rrd1986
3 Replies

4. Solaris

Replacing Gnome PDF with Adobe Reader

I'm attempting to replace gnome pdf with Acrobat Reader on a server and make Acrobat Reader the default program used to open .pdf files. I've been able to make the changes to individual users but don't want to have to edit each individuals profile. Is there a way, within Solaris 10, to make a... (2 Replies)
Discussion started by: goose25
2 Replies

5. Programming

How can this jar file open pdf ??

OKay so my question is that how does this jar file convert something in there and show pdf when open it? I don't get how it works. Can someone explain to me. I have a link below, in there will be a file call Tools, and please open the file called "PQ10-sample" it will automaticly open up a pdf as... (11 Replies)
Discussion started by: tonyduong15
11 Replies

6. Red Hat

Setting Password For PDF File--Linux

Hi, I am in need of help. My requirements are : 1) To convert the existing files (irrespective of their format) in a directory to PDF format 2) To make the converted files password protected. I did the attempt to do the same. Though the existing files (irrespective of their format) are... (1 Reply)
Discussion started by: MKR
1 Replies

7. Shell Programming and Scripting

Scanning a pdf file in Linux shell

I want to search a keyword in a list of pdf files and when i find a match i want to write the title and author of that pdf file to another file. How will I do this using linux shell script? (7 Replies)
Discussion started by: SK33
7 Replies

8. Post Here to Contact Site Administrators and Moderators

Need script to monitor open file in Linux

Kindly advice with shell script to monitor open file in linux, if the open file count is greater then 5000 then send me an email.. command : lsof | wc -l (0 Replies)
Discussion started by: adminhelp
0 Replies

9. Shell Programming and Scripting

Create a text file and a pdf file from Linux command results.

Hello. The task : Using multiple commands like : gdisk -l $SOME_DISK >> $SOME_FILEI generate some text file. For readiness I must insert page break. When the program is finished I want to convert the final text file to a pdf file. When finished, I got two files : One text file and One pdf... (1 Reply)
Discussion started by: jcdole
1 Replies
gnome-session-remove(1) 					   User Commands					   gnome-session-remove(1)

NAME
gnome-session-remove - remove session-managed applications SYNOPSIS
gnome-session-remove [--list] [application] [gnome-std-options] DESCRIPTION
gnome-session-remove enables you to remove a desktop application from the current desktop session. This means that the specified applica- tion is not restarted automatically during the next desktop session. OPTIONS
The following options are supported: --list Display a list of the applications that are currently session-managed. gnome-std-optionStandard options available for use with most GNOME applications. See gnome-std-options(5) for more information. OPERANDS
The following operands are supported: application The name of the application to be removed from the current desktop session. EXAMPLES
Example 1: Listing the Current Session-Managed Applications example% gnome-session-remove --list Currently registered clients: nautilus gnome-panel metacity gnome-smproxy magicdev Example 2: Removing an Application From the Session example% gnome-session-remove nautilus EXIT STATUS
The following exit values are returned: 0 Application exited successfully >0 Application exited with failure FILES
The following files are used by this application: /usr/bin/gnome-session-rExecutable to remove session-managed applications ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWgnome-session | +-----------------------------+-----------------------------+ |Interface stability |External | +-----------------------------+-----------------------------+ SEE ALSO
Latest version of the GNOME Desktop User Guide for your platform. gnome-session(1), gnome-std-options(5) NOTES
Written by Erwann Chenede, Sun Microsystems Inc., 2004. SunOS 5.10 7 Sep 2004 gnome-session-remove(1)
All times are GMT -4. The time now is 12:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy