Score:6

How to open a PDF file with "Master PDF Editor" application from terminal?

tw flag

I want to open a PDF file from terminal. I only know the command xdg-open file-name.xxx to open a file. But once I use this command, it opens the PDF file with the Document Viewer application (Evince).

How to open a file from terminal with a non-default application (specifically a PDF with Master PDF Editor)?

Score:6
ca flag

Master PDF Editor provides a binary that you can use to open a file from the terminal. Supposing that you have installed the latest version of Master PDF Editor (version 5.9.40 currently), the binary is masterpdfeditor5, so you can open a PDF file using:

masterpdfeditor5 /path/to/file.pdf
Score:5
cn flag

Typically, an application will allow to open a file from the command line by providing the file name as an argument to the command for running the application. I am not familiar with the proprietary application "Master PDF Editor", but for many applications, it can simply work like:

  • Evince, the default PDF viewer in the standard Ubuntu desktop:

    evince /path/to/file.pdf

  • Gedit, the default text editor

    gedit /path/to/file.txt

etc. 99% chance that this also works this way for "Master PDF Editor", but it is ultimately a feature of the application.

Score:4
sa flag

Other answers have shown how to do this, but I'll explain how you can do this for any program. Assuming you have Master PDF editor installed, it'll probably be on your path. You can start typing a command in the terminal and hit Tab to get autocomplete. For example, I typed master and then hit Tab, and it completes to masterpdfeditor4 (I have an older version). It might also give you multiple options if there are more than 1 programs that start with master.

In general, programs also respond to -h or --help by printing a help message. For example:

masterpdfeditor -h

yields:

Master PDF Editor 4
Build 4.3.89, Based on Qt 5.4.1, 64 bit
Not Registered version.
Copyright 2018 Code Industry Ltd.
http://code-industry.net

usage: masterpdfeditor4 file.pdf -p 2

Allowed options:
-p                          : the page number of the document to display
--help, -h                  : show this output

Some programs also respond to man <program_name> but Master Pdf Editor evidently doesn't.

cn flag
pts
Sometimes `<program_name>` is not oubvious, for example it's `evince` for Document Viewer. On my system, they are joined in the `/usr/share/applications/evince.desktop` file. If needed, ask a separate question about searching in. desktop files.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.