0
No error.
Portable document format (pdf) file viewer for x (version 3.02)
Part of xpdf(1).
xpdf [options]
[PDF-file
[{page | +dest}]]
zxpdf [options]
[PDF-file
[{page | +dest}]]
Xpdf is a viewer for Portable Document Format (PDF) files. (These are also sometimes also called 'Acrobat' files, from the name of Adobe's PDF software.) Xpdf runs under the X Window System on UNIX, VMS, and OS/2.
To run xpdf, simply type:
xpdf file.pdf
where file.pdf is your PDF file. The file name can be followed by a number specifying the page which should be displayed first, e.g.:
xpdf file.pdf 18
You can also give a named destination, prefixed with '+' in place of the page number. (This is only useful with PDF files that provide named destination targets.)
You can also start xpdf without opening any files:
xpdf
Compressed files (gz and bz2) may be viewed using the command:
zxpdf file.pdf.gz
Xpdf reads a configuration file at startup. It first tries to find the user's private config file, ~/.xpdfrc. If that doesn't exist, it looks for a system-wide config file, /etc/xpdf/xpdfrc. See the xpdfrc(5) man page for details.
Many of the following options can be set with configuration file commands or X resources. These are listed in square brackets with the description of the corresponding command line option.
-g geometrySet the initial window geometry. (-geometry is equivalent.) [X resource: xpdf.geometry]
-title titleSet the window title. By default, the title will be "xpdf: foo.pdf". [X resource: xpdf.title]
-cmap
Install a private colormap. This is ignored on TrueColor visuals. [X resource: xpdf.installCmap]
-rgb numberSet the size of largest RGB cube xpdf will try to allocate. The default is 5 (for a 5x5x5 cube); set to a smaller number to conserve color table entries. This is ignored with private colormaps and on TrueColor visuals. [X resource: xpdf.rgbCubeSize]
-rv
Set reverse video mode. This reverses the colors of everything except images. It may not always produce great results for PDF files which do weird things with color. This also causes the paper color to default to black. [X resource: xpdf.reverseVideo]
-papercolor colorSet the "paper color", i.e., the background of the page display. This will not work too well with PDF files that do things like filling in white behind the text. [X resource: xpdf.paperColor]
-mattecolor colorSet the matte color, i.e., the color used for background outside the actual page area. (There is a separate setting, xpdf.fullScreenMatteColor, for full-screen mode.) [X resource: xpdf.matteColor]
-z zoomSet the initial zoom factor. A number specifies a zoom percentage, where 100 means 72 dpi.You may also specify 'page', to fit the page to the window size, or 'width', to fit the page width to the window width. [config file: initialZoom; or X resource: xpdf.initialZoom]
-cont
Start in continuous view mode, i.e., with one vertical scroll bar for the whole document. [config file: continuousView]
-t1lib yes | noEnable or disable t1lib (a Type 1 font rasterizer). This defaults to "yes". [config file: enableT1lib]
-freetype yes | noEnable or disable FreeType (a TrueType / Type 1 font rasterizer). This defaults to "yes". [config file: enableFreeType]
-aa yes | noEnable or disable font anti-aliasing. This defaults to "yes". [config file: antialias]
-aaVector yes | noEnable or disable vector anti-aliasing. This defaults to "yes". [config file: vectorAntialias]
-ps PS-fileSet the default file name for PostScript output (i.e., the name which will appear in the print dialog). This can also be of the form [config file: psFile]
-paper sizeSet the paper size to one of "letter", "legal", "A4", or "A3". This can also be set to "match", which will set the paper size to match the size specified in the PDF file. [config file: psPaperSize]
-paperw sizeSet the paper width, in points. [config file: psPaperSize]
-paperh sizeSet the paper height, in points. [config file: psPaperSize]
-level1
Generate Level 1 PostScript. The resulting PostScript files will be significantly larger (if they contain images), but will print on Level 1 printers. This also converts all images to black and white. [config file: psLevel]
-enc encoding-nameSets the encoding to use for text output. The encoding-name must be defined with the unicodeMap command (see xpdfrc(5)). This defaults to "Latin1" (which is a built-in encoding). [config file: textEncoding]
-eol unix | dos | macSets the end-of-line convention to use for text output. [config file: textEOL]
-opw passwordSpecify the owner password for the PDF file. Providing this will bypass all security restrictions.
-upw passwordSpecify the user password for the PDF file.
-fullscreen
Open xpdf in full-screen mode, useful for presentations.
-remote nameStart/contact xpdf remote server with specified name (see the REMOTE SERVER MODE section below).
-exec commandExecute a command (see the COMMANDS section below) in an xpdf remote server window (with -remote only).
-reload
Reload xpdf remote server window (with -remote only).
-raise
Raise xpdf remote server window (with -remote only).
-quit
Kill xpdf remote server (with -remote only).
-cmd
Print commands as they're executed (useful for debugging). [config file: printCommands]
-q
Don't print any messages or errors. [config file: errQuiet]
-cfg config-fileRead config-file in place of ~/.xpdfrc or the system-wide config file.
-v
Print copyright and version information.
-h
Print usage information. (-help and --help are equivalent.)
Several other standard X options and resources will work as expected:
-display display[X resource: xpdf.display]
-fg color(-foreground is equivalent.) [X resource: xpdf*Foreground]
-bg color(-background is equivalent.) [X resource: xpdf*Background]
-font font(-fn is equivalent.) [X resource: xpdf*fontList]
The color and font options only affect the user interface elements, not the PDF display (the 'paper').
The following X resources do not have command line option equivalents:
xpdf.toolTipEnableEnables (if set to true) or disables (if set to false) the tool-tips on the toolbar buttons.
xpdf.fullScreenMatteColorSets the matte color to be used in full-screen mode. The default setting is "black".
Move to the previous/next page.
Move backward or forward by ten pages.
Move backward or forward along the history path.
Move to a specific page number. Click in the box to activate it, type the page number, then hit return.
Change the zoom factor (see the description of the -z option above).
Find a text string.
Bring up a dialog for generating a PostScript file. The dialog has options to set the pages to be printed and the PostScript file name. The file name can be '-' for stdout or '|command' to pipe the PostScript through a command, e.g., '|lpr'.
Bring up the 'about xpdf' window.
The space between the '?' and 'Quit' buttons is used to show the URL or external file name when the mouse is over a link.
Quit xpdf.
Pressing the right mouse button will post a popup menu with the following commands:
Open...Open a new PDF file via a file requester.
Create a new window and open a new PDF file via a file requester.
ReloadReload the current PDF file. Note that Xpdf will reload the file automatically (on a page change or redraw) if it has changed since it was last loaded.
Save the current file via a file requester.
Toggles between single page and continuous view modes.
Rotate the page 90 degrees counterclockwise.
Rotate the page 90 degrees clockwise. The two rotate commands are intended primarily for PDF files where the rotation isn't correctly specified in the file.
Zoom in to the currently selected rectangle.
CloseClose the current window. If this is the only open window, the document is closed, but the window is left open (i.e., this menu command won't quit xpdf).
QuitQuit xpdf.
If the PDF contains an outline (a.k.a., bookmarks), there will be an outline pane on the left side of the window. The width of the outline pane is adjustable with a vertical split bar via the knob near its bottom end.
Dragging the mouse with the left button held down will highlight an arbitrary rectangle. Any text inside this rectangle will be copied to the X selection buffer.
Clicking on a hyperlink will jump to the link's destination. A link to another PDF document will make xpdf load that document. A 'launch' link to an executable program will display a dialog, and if you click 'ok', execute the program. URL links call an external command (see the WEB BROWSERS section below).
Dragging the mouse with the middle button held down pans the window.
oOpen a new PDF file via a file requester.
rReload the current PDF file. Note that Xpdf will reload the file automatically (on a page change or redraw) if it has changed since it was last loaded.
control-LRedraw the current page.
control-WClose the current window.
Find a text string.
control-GFind next occurrence.
control-PPrint.
nMove to the next page. Scrolls to the top of the page, unless scroll lock is turned on.
pMove to the previous page. Scrolls to the top of the page, unless scroll lock is turned on.
<Space> or <PageDown> or <Next>Scroll down on the current page; if already at bottom, move to next page.
<Backspace> or <Delete> or <PageUp> or <Previous>Scroll up on the current page; if already at top, move to previous page.
vMove forward along the history path.
bMove backward along the history path.
<Home>Scroll to top of current page.
<End>Scroll to bottom of current page.
control-<Home>Scroll to first page of document.
control-<End>Scroll to last page of document.
arrowsScroll the current page.
gActivate the page number text field ("goto page").
0Set the zoom factor to 125%.
Zoom in (increment the zoom factor by 1).
-Zoom out (decrement the zoom factor by 1).
zSet the zoom factor to 'page' (fit page to window).
wSet the zoom factor to 'width' (fit page width to window).
alt-FToggle full-screen mode.
qQuit xpdf.
If you want to run xpdf automatically from netscape or mosaic (and probably other browsers) when you click on a link to a PDF file, you need to edit (or create) the files .mime.types and .mailcap in your home directory. In .mime.types add the line:
application/pdf pdf
In .mailcap add the lines:
# Use xpdf to view PDF files.
application/pdf; xpdf -q %s
Make sure that xpdf is on your executable search path.
When you click on a URL link in a PDF file, xpdf will execute the command specified by the urlCommand config file option, replacing an occurrence of '%s' with the URL. For example, to call netscape with the URL, add this line to your config file:
urlCommand "netscape -remote 'openURL(%s)'"
Xpdf's key and mouse bindings are user-configurable, using the bind and unbind options in the config file (see xpdfrc(5)). The bind command allows you to bind a key or mouse button to a sequence of one or more commands.
The following commands are supported:
gotoPage(page)Go to the specified page.
gotoPageNoScroll(page)Go to the specified page, with the current relative scroll position.
gotoDest(dest)Go to a named destination.
gotoLastPageGo to the last page in the PDF file.
gotoLastPageNoScrollGo to the last page in the PDF file, with the current relative scroll position.
nextPageGo to the next page.
nextPageNoScrollGo to the next page, with the current relative scroll position.
prevPageGo to the previous page.
prevPageNoScrollGo to the previous page, with the current relative scroll position.
pageUpScroll up by one screenful.
pageDownScroll down by one screenful.
scrollLeft(n)Scroll left by n pixels.
scrollRight(n)Scroll right by n pixels.
scrollUp(n)Scroll up by n pixels.
scrollDown(n)Scroll down by n pixels.
scrollUpPrevPage(n)Scroll up by n pixels, moving to the previous page if appropriate.
scrollDownPrevPage(n)Scroll down by n pixels, moving to the next page if appropriate.
scrollToTopEdgeScroll to the top edge of the current page, with no horizontal movement.
scrollToBottomEdgeScroll to the bottom edge of the current page, with no horizontal movement.
scrollToLeftEdgeScroll to the left edge of the current page, with no vertical movement.
scrollToRightEdgeScroll to the right edge of the current page, with no vertical movement.
scrollToTopLeftScroll to the top-left corner of the current page.
scrollToBottomRightScroll to the bottom-right corner of the current page.
goForwardMove forward along the history path.
goBackwardMove backward along the history path.
zoomPercent(z)Set the zoom factor to z%.
zoomFitPageSet the zoom factor to fit-page.
zoomFitWidthSet the zoom factor to fit-width.
zoomInZoom in - go to the next higher zoom factor.
zoomOutZoom out - go the next lower zoom factor.
continuousModeGo to continuous view mode.
singlePageModeGo to single-page view mode.
toggleContinuousModeToggle between continuous and single page view modes.
fullScreenModeGo to full-screen mode.
windowModeGo to window (non-full-screen) mode.
toggleFullScreenModeToggle between full-screen and window modes.
openOpen a PDF file in this window, using the open dialog.
openInNewWinOpen a PDF file in a new window, using the open dialog.
openFile(file)Open a specified PDF file in this window.
openFileInNewWin(file)Open a specified PDF file in a new window.
openFileAtDest(file,dest)Open a specified PDF file in this window and go to a named destination.
openFileAtDestInNewWin(file,dest)Open a specified PDF file in a new window and go to a named destination.
reloadReload the current PDF file.
redrawRedraw the window.
raiseRaise the window to the front.
closeWindowClose the window.
run(external-command-string)Run an external command. The following escapes are allowed in the command string:
%f => PDF file name (or an empty string if no
file is open)
%b => PDF file base name, i.e., file name minus
the extension (or an empty string if no
file is open)
%u => link URL (or an empty string if not over
a URL link)
%x => selection upper-left x coordinate
(or 0 if there is no selection)
%y => selection upper-left y coordinate
(or 0 if there is no selection)
%X => selection lower-right x coordinate
(or 0 if there is no selection)
%Y => selection lower-right y coordinate
(or 0 if there is no selection)
%% => %
openOutlineOpen the outline pane.
closeOutlineClose the outline pane.
toggleOutlineToggle the outline pane between open and closed.
scrollOutlineDown(n)Scroll the outline down by n increments.
scrollOutlineUp(n)Scroll the outline up by n increments.
focusToDocWinSet the keyboard focus to the main document window.
focusToPageNumSet the keyboard focus to the page number text box.
findOpen the 'find' dialog.
findNextFinds the next occurrence of the search string (no dialog).
printOpen the 'print' dialog.
aboutOpen the 'about' dialog.
quitQuit from xpdf.
The following commands depend on the current mouse position:
startSelectionStart a selection, which will be extended as the mouse moves.
endSelectionEnd a selection.
startPanStart a pan, which will scroll the document as the mouse moves
endPanEnd a pan.
postPopupMenuDisplay the popup menu.
followLinkFollow a hyperlink (does nothing if the mouse is not over a link).
followLinkInNewWinFollow a hyperlink, opening PDF files in a new window (does nothing if the mouse is not over a link). For links to non-PDF files, this command is identical to followLink.
followLinkNoSelSame as followLink, but does nothing if there is a non-empty selection. (This is useful as a mouse button binding.)
followLinkInNewWinNoSelSame as followLinkInNewWin, but does nothing if there is a non-empty selection. (This is useful as a mouse button binding.)
The default mouse bindings are as follows:
bind mousePress1 any startSelection
bind mouseRelease1 any endSelection followLinkNoSel
bind mousePress2 any startPan
bind mouseRelease2 any endPan
bind mousePress3 any postPopupMenu
bind mousePress4 any scrollUpPrevPage(16)
bind mousePress5 any scrollDownNextPage(16)
bind mousePress6 any scrollLeft(16)
bind mousePress7 any scrollRight(16)
The default key bindings are as follows:
bind ctrl-home any gotoPage(1)
bind home any scrollToTopLeft
bind ctrl-end any gotoLastPage
bind end any scrollToBottomRight
bind pgup any pageUp
bind backspace any pageUp
bind delete any pageUp
bind pgdn any pageDown
bind space any pageDown
bind left any scrollLeft(16)
bind right any scrollRight(16)
bind up any scrollUp(16)
bind down any scrollDown(16)
bind o any open
bind O any open
bind r any reload
bind R any reload
bind f any find
bind F any find
bind ctrl-f any find
bind ctrl-g any findNext
bind ctrl-p any print
bind n scrLockOff nextPage
bind N scrLockOff nextPage
bind n scrLockOn nextPageNoScroll
bind N scrLockOn nextPageNoScroll
bind p scrLockOff prevPage
bind P scrLockOff prevPage
bind p scrLockOn prevPageNoScroll
bind P scrLockOn prevPageNoScroll
bind v any goForward
bind b any goBackward
bind g any focusToPageNum
bind 0 any zoomPercent(125)
bind + any zoomIn
bind - any zoomOut
bind z any zoomFitPage
bind w any zoomFitWidth
bind alt-f any toggleFullScreenMode
bind ctrl-l any redraw
bind ctrl-w any closeWindow
bind ? any about
bind q any quit
bind Q any quit
Previous versions of xpdf included a "viKeys" X resource. It is no longer available, but the following bindings are equivalent:
bind h any scrollLeft(16)
bind l any scrollRight(16)
bind k any scrollUp(16)
bind j any scrollDown(16)
Xpdf can be started in remote server mode by specifying a server name (in addition to the file name and page number). For example:
xpdf -remote myServer file.pdf
If there is currently no xpdf running in server mode with the name 'myServer', a new xpdf window will be opened. If another command:
xpdf -remote myServer another.pdf 9
is issued, a new copy of xpdf will not be started. Instead, the first xpdf (the server) will load another.pdf and display page nine. If the file name is the same:
xpdf -remote myServer another.pdf 4
the xpdf server will simply display the specified page.
The -raise option tells the server to raise its window; it can be specified with or without a file name and page number.
The -quit option tells the server to close its window and exit.
The Xpdf tools use the following exit codes:
0
No error.
1
Error opening a PDF file.
2
Error opening an output file.
3
Error related to PDF permissions.
99
Other error.
-cont since Debian 4.0 (Etch).