xpdf(1)
πΈ NAME πΈ
xpdf β a Portable Document Format (PDF) file viewer for X (the program itself goes by the name xpopple) π¦
β¨ SYNOPSIS β¨
xpdf [options] [PDF-file [page | +dest]]
π DESCRIPTION π
okay bestie sit down because xpopple is literally a viewer for Portable Document Format (PDF) files. (you might also hear people call these "Acrobat" files, which is just because of Adobe's PDF software β same thing, different name π ) and it runs under the X Window System on UNIX. iconic behavior honestly.
xpopple uses the Poppler library to process PDF files. so here's the lore: Poppler was originally derived from version 3 of Glyph & Cog, LLC's Xpdf suite, but Poppler doesn't include the Xpdf viewer program itself. xpopple is the Xpdf program, just modified to use Poppler. so it's giving Xpdf energy but Poppler-powered. slay π
to run xpopple, simply type:
xpdf file.pdf
where file.pdf is your PDF file. and the file name can be followed by a number specifying the page which should be displayed first, like:
xpdf file.pdf 18
you can <em>also</em> give a named destination, prefixed with + in place of the page number. (this is only useful with PDF files that provide named destination targets, so don't come for me if your random PDF doesn't have them π)
you can also start xpdf without opening any files at all:
xpdf
and compressed formats?? yes bestie β gz, bz2, xz, and Z are also supported. for example:
xpdf file.pdf.gz
π CONFIGURATION FILE π
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. go read it, i'll wait π«Ά
π OPTIONS π
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. so like, you've got options inside your options. very main character.
-ggeometry β set the initial window geometry. (-geometryis equivalent.) [X resource:Xpdf.geometry]-titletitle β set 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]-rgbnumber β set the size of largest RGB cube xpdf will try to allocate. the default is5(for a 5x5x5 cube); set it 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 (and bestie, some PDFs do weird things with color). this also causes the paper color to default toblack. [X resource:Xpdf.reverseVideo]-papercolorcolor β set 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]-mattecolorcolor β set 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]-zzoom β set the initial zoom factor. a number specifies a zoom percentage, where100means 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, or"height", to fit the page height to the window height. [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]-psPS-file β set 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"| command"to pipe the PostScript through a command. [config file:psFile]-papersize β set 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. the default paper size will be retrieved from libpaper (unless xpdf was built without libpaper, in which case the default paper size is"letter"). [config file:psPaperSize]-paperwsize β set the paper width, in points. [config file:psPaperSize]-paperhsize β set 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]-encencoding-name β sets the encoding to use for text output. the encoding-name must be defined with theunicodeMapcommand (seexpdfrc(5)). this defaults to"Latin1"(which is a built-in encoding). [config file:textEncoding]-opwpassword β specify the owner password for the PDF file. providing this will bypass all security restrictions. π-upwpassword β specify the user password for the PDF file.-fullscreenβ open xpdf in full-screen mode, useful for presentations. main character energy fr fr β¨-pagecmdcommand β run a shell command each time a new page is displayed, with the page number as an argument. this can be used for presentation recording. [config file:pageCommand]-remotename β start/contact xpdf remote server with specified name (see the REMOTE SERVER MODE section below).-execcommand β execute a command (see the COMMANDS section below) in an xpdf remote server window (with-remoteonly).-reloadβ reload xpdf remote server window (with-remoteonly).-raiseβ raise xpdf remote server window (with-remoteonly).-quitβ kill xpdf remote server (with-remoteonly).-cmdβ print commands as they're executed (useful for debugging). [config file:printCommands]-qβ don't print any messages or errors. [config file:errQuiet]-cfgconfig-file β read config-file in place of~/.xpdfrcor the system-wide config file.-vβ print copyright and version information.-hβ print usage information. (-help,--helpand-?are equivalent.)-mfile1 file2 ... β open multiple pdf files: file1 file2 ... etc.
NOTE: the list of files is terminated once an argument starting with a dash is encountered. in order to view file names starting with a dash, simply prepend"./".-mmay be used multiple times.
π standard X options π
several other standard X options and resources will work as expected:
-displaydisplay β [X resource:Xpdf.display]-fgcolor β (-foregroundis equivalent.) [X resource:xpdf*Foreground]-bgcolor β (-backgroundis equivalent.) [X resource:xpdf*Background]-fontfont β override the fonts used for the user interface. this uses a single X core font for all user interface elements, which is not ideal; see the USER INTERFACE FONTS section below for better approaches. (-fnis equivalent.) [X resource:xpdf*font]
the color and font options only affect the user interface elements, not the PDF display (the "paper"). important distinction bestie π«Ά
π X resources with no command line option π
the following X resources do not have command line option equivalents:
Xpdf.toolTipEnableβ enables (if set totrue) or disables (if set tofalse) the tool-tips on the toolbar buttons.Xpdf.fullScreenMatteColorβ sets the matte color to be used in full-screen mode. the default setting is"black".
π OBSOLETE OPTIONS π
these ones?? they're gone bestie. the following command line options were accepted by earlier versions of Xpdf but are no longer allowed. in most cases, this is because they control rendering options that Poppler does not support. rip to them but they're different now π
-aayes | no β obsolete. controlled the use of font anti-aliasing in the PDF rasterizer.-aaVectoryes | no β obsolete. controlled the use of vector anti-aliasing in the PDF rasterizer.-eolunix | dos | mac β obsolete. set the end-of-line convention to use for text output.-freetypeyes | no β obsolete. controlled whether FreeType was used for font rasterization.-t1libyes | no β obsolete. controlled whether t1lib was used for font rasterization.
and that's only part one, bestieβ¦ there's more coming π stay with me π
π CONTROLS π
okay bestie, get comfy, because this is the part where you learn how to actually drive this thing π
β¨ On-screen controls, at the bottom of the xpdf window β¨
- left/right arrow buttons β hop to the previous/next page. simple as that π¦
- double left/right arrow buttons β the turbo version: jump backward or forward by ten pages at a time π₯
- dashed left/right arrow buttons β move backward or forward along the history path (like your browser's back button but for PDFs, iykyk)
- 'Page' entry box β go straight to a specific page number. click in the box to activate it, type the number, then hit return π«Ά
- zoom popup menu β change the zoom factor (it's the same thing as the
-zoption we talked about earlier, fr fr) - binoculars button β find a text string π
- print button β opens the "print" dialog for generating a PostScript file. that dialog lets you set the pages to be printed and the PostScript file name. and listen: the file name can be
-for stdout, or"| command"to pipe the PostScript through a command, like"| lpr". iconic. - '?' button β opens the "about" dialog π
- link info β the little space between the "?" and "Quit" buttons is where the URL or external file name shows up when your mouse is hovering over a link β¨
- 'Quit' button β quit xpdf. bye bestie π
πΈ Menu πΈ
right-click (yes, press the right mouse button) and you get a popup menu with these commands:
- Open... β open a new PDF file via a file requester.
- Open in new window... β make a whole new window and open a new PDF file via a file requester. main character energy tbh.
- Reload β reload the current PDF file. ngl though, Xpdf will reload the file automatically (on a page change or redraw) if it has changed since it was last loaded.
- Save as... β save the current file via a file requester.
- Continuous view β toggles between single page and continuous view modes.
- Rotate counterclockwise β rotate the page 90 degrees counterclockwise.
- Rotate clockwise β rotate the page 90 degrees clockwise. both rotate commands are intended primarily for PDF files where the rotation isn't correctly specified in the file, just so you know π
- Zoom to selection β zoom in to the currently selected rectangle.
- Close β close the current window. but here's the thing: 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). sneaky.
- Quit β quit xpdf. for real this time.
π¦ Outline π¦
if the PDF has an outline (a.k.a. bookmarks), there will be an outline pane on the left side of the window. the width of that pane is adjustable with a vertical split bar via the knob near its bottom end. obsessed with the customization honestly.
β¨ Text selection β¨
drag the mouse with the left button held down and you'll highlight an arbitrary rectangle. any text inside that rectangle gets copied to the X selection buffer. copy-paste slay π
π Links π
clicking a hyperlink jumps to the link's destination. a link to another PDF document makes xpdf load that document. a "launch" link to an executable program will pop up a dialog, and if you click "OK", it executes the program. URL links call an external command (peep the WEB BROWSERS section down below π).
π«Ά Panning π«Ά
drag the mouse with the middle button held down and you pan the window. that's it, that's the whole vibe.
π Key bindings π
oβ open a new PDF file via a file requester.rβ reload the current PDF file. and again, note that Xpdf will reload the file automatically (on a page change or redraw) if it has changed since it was last loaded.sβ save the current PDF file via a file requester.control-Lβ redraw the current page.control-Wβ close the current window.forcontrol-For/β find a text string.control-Gβ find next occurrence.control-shift-Gβ find previous occurrence.control-Pβ print.nβ move to the next page. scrolls to the top of the page, unless scroll lock is turned on.pβ move to the previous page. scrolls to the top of the page, unless scroll lock is turned on.<Space>or<PageDown>β scroll down on the current page; if you're already at the bottom, move to the next page.<Backspace>or<Delete>or<PageUp>β scroll up on the current page; if you're already at the top, move to the previous page.vβ move forward along the history path.bβ move 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.arrowsβ scroll the current page.[β rotate the page 90 degrees counterclockwise.]β rotate the page 90 degrees clockwise.gβ activate the page number text field (aka "goto page").0β set the zoom factor to 125%.+β zoom in (go to the next higher zoom factor).-β zoom out (go to the next lower zoom factor).zβ set the zoom factor to"page"(fit page to window).wβ set the zoom factor to"width"(fit page width to window).hβ set the zoom factor to"height"(fit page height to window).alt-Cβ toggle between continuous and single page view modes.alt-Fβ toggle full-screen mode.alt-Oβ toggle the outline pane between open and closed.?β open the "about" dialog.qor<Escape>β quit xpdf.
π WEB BROWSERS π
if you wanna run xpdf automatically from netscape or mosaic (and probably other browsers too) 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 this line:
application/pdf pdf
and in .mailcap add these lines:
# Use xpdf to view PDF files.
application/pdf; xpdf -q %s
make sure that xpdf is on your executable search path, okay? don't skip that part π
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)'"
π COMMANDS π
Xpdf's key and mouse bindings are user-configurable, using the bind and unbind options in the config file (go read xpdfrc(5) bestie). the bind command lets you bind a key or mouse button to a sequence of one or more commands. yes, sequences. go wild β¨
π Available Commands π
these are the commands you can use:
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.gotoLastPageβ go to the last page in the PDF file.gotoLastPageNoScrollβ go to the last page in the PDF file, with the current relative scroll position.nextPageβ go to the next page.nextPageNoScrollβ go to the next page, with the current relative scroll position.prevPageβ go to the previous page.prevPageNoScrollβ go to the previous page, with the current relative scroll position.pageUpβ scroll up by one screenful.pageDownβ scroll 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.scrollDownNextPage(n)β scroll down by n pixels, moving to the next page if appropriate.scrollToTopEdgeβ scroll to the top edge of the current page, with no horizontal movement.scrollToBottomEdgeβ scroll to the bottom edge of the current page, with no horizontal movement.scrollToLeftEdgeβ scroll to the left edge of the current page, with no vertical movement.scrollToRightEdgeβ scroll to the right edge of the current page, with no vertical movement.scrollToTopLeftβ scroll to the top-left corner of the current page.scrollToBottomRightβ scroll to the bottom-right corner of the current page.goForwardβ move forward along the history path.goBackwardβ move backward along the history path.zoomPercent(z)β set the zoom factor to z%.zoomFitPageβ set the zoom factor to fit-page.zoomFitWidthβ set the zoom factor to fit-width.zoomFitHeightβ set the zoom factor to fit-height.zoomInβ zoom in (go to the next higher zoom factor).zoomOutβ zoom out (go to the next lower zoom factor).zoomToSelectionβ zoom in to the currently selected rectangle, if there is one.rotateCWβ rotate the page 90 degrees clockwise.rotateCCWβ rotate the page 90 degrees counterclockwise.setSelection(pg,ulx,uly,lrx,lry)β set the selection to the specified coordinates on the specified page.continuousModeβ go to continuous view mode.singlePageModeβ go to single-page view mode.toggleContinuousModeβ toggle between continuous and single page view modes.fullScreenModeβ go to full-screen mode.windowModeβ go to window (non-full-screen) mode.toggleFullScreenModeβ toggle between full-screen and window modes.openβ open a PDF file in this window, using the "open" dialog.openInNewWinβ open 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.openFileAtPage(file,page)β open a specified PDF file in this window and go to a page.openFileAtPageInNewWin(file,page)β open a specified PDF file in a new window and go to a page.reloadβ reload the current PDF file.saveAsβ save the PDF file, using the "save as" dialog.redrawβ redraw the window.raiseβ raise the window to the front.closeWindowβ close the window. if this was the last open window, clear the window, but don't quit from Xpdf. (we're being polite about it β¨)closeWindowOrQuitβ close the window. if this was the last open window, quit from Xpdf. (we're not being polite about it π)run(external-command-string)β run an external command. the following escapes are allowed in the command string:%fβ the PDF file name (or an empty string if no file is open π«₯)%bβ the PDF file base name, i.e. file name minus the extension (or empty string if no file is open)%uβ the link URL (or empty string if the mouse isn't over a URL link)%pβ the current page number (or empty string if no file is open)%xβ selection upper-left x coordinate (or0if there's no selection)%yβ selection upper-left y coordinate (or0if there's no selection)%Xβ selection lower-right x coordinate (or0if there's no selection)%Yβ selection lower-right y coordinate (or0if there's no selection)%iβ the page containing the mouse pointer%jβ x coordinate of the mouse pointer%kβ y coordinate of the mouse pointer%%β a literal%
The external command string will often contain spaces, bestie, so the whole command must be quoted in the xpdfrc file:
bind x "run(ls -l)"
openOutlineβ open the outline pane.closeOutlineβ close the outline pane.toggleOutlineβ toggle the outline pane between open and closed.scrollOutlineDown(n)β scroll the outline down bynincrements.scrollOutlineUp(n)β scroll the outline up bynincrements.focusToDocWinβ set the keyboard focus to the main document window.focusToPageNumβ set the keyboard focus to the page number text box.findβ open the "find" dialog. πsearch(key)β search for the string key as if it had been entered in the "find" dialog.findNextβ finds the next occurrence of the search string (no dialog).findPrevβ finds the previous occurrence of the search string (no dialog).printβ open the "print" dialog.aboutβ open the "about" dialog.quitβ quit fromxpdf. π
The following commands depend on the current mouse position, so likeβ¦ the mouse is the main character here π:
startSelectionβ start a selection, which will be extended as the mouse moves.endSelectionβ end a selection.startPanβ start a pan, which will scroll the document as the mouse moves.endPanβ end a pan.postPopupMenuβ display the popup menu.followLinkβ follow a hyperlink (does nothing if the mouse is not over a link).followLinkInNewWinβ follow 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 tofollowLink.followLinkNoSelβ same asfollowLink, but does nothing if there is a non-empty selection. (This is useful as a mouse button binding.)followLinkInNewWinNoSelβ same asfollowLinkInNewWin, but does nothing if there is a non-empty selection. (This is useful as a mouse button binding.)
π±οΈ Default Bindings β¨
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 [ any rotateCCW
bind ] any rotateCW
bind o any open
bind O any open
bind r any reload
bind R any reload
bind s any saveAs
bind S any saveAs
bind f any find
bind F any find
bind ctrl-f any find
bind / any find
bind ctrl-g any findNext
bind ctrl-G any findPrev
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 V any goForward
bind b any goBackward
bind B any goBackward
bind g any focusToPageNum
bind G any focusToPageNum
bind 0 any zoomPercent(125)
bind + any zoomIn
bind - any zoomOut
bind z any zoomFitPage
bind Z any zoomFitPage
bind w any zoomFitWidth
bind W any zoomFitWidth
bind h any zoomFitHeight
bind H any zoomFitHeight
bind alt-c any toggleContinuousMode
bind alt-f any toggleFullScreenMode
bind alt-o any toggleOutline
bind ctrl-l any redraw
bind ctrl-w any closeWindowOrQuit
bind ? any about
bind q any quit
bind Q any quit
bind escape 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)
π REMOTE SERVER MODE π
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.
π€ USER INTERFACE FONTS π
In order to support international text in user interface elements, xpdf uses the support for UTF-8 and Xft fonts that was introduced in OpenMotif 2.3.
The user interface makes use of four fonts which are specified using Motif Render Tables: default for most text, mono for text in a monospaced font, and helpHuge and helpBig for headings in the "about" dialog. The fonts used can be customised using X resources. By default, they are configured as follows:
Xpdf*renderTable.default.fontType: FONT_IS_XFT
Xpdf*renderTable.default.fontName: Sans-Serif
Xpdf*renderTable.default.fontSize: 12
Xpdf*renderTable.default.fontEncoding: iso10646-1
Xpdf*renderTable.helpHuge.fontType: FONT_IS_XFT
Xpdf*renderTable.helpHuge.fontName: Serif
Xpdf*renderTable.helpHuge.fontStyle: bold
Xpdf*renderTable.helpHuge.fontSize: 20
Xpdf*renderTable.helpHuge.fontEncoding: iso10646-1
Xpdf*renderTable.helpBig.fontType: FONT_IS_XFT
Xpdf*renderTable.helpBig.fontName: Serif
Xpdf*renderTable.helpBig.fontSize: 16
Xpdf*renderTable.helpBig.fontEncoding: iso10646-1
Xpdf*renderTable.mono.fontType: FONT_IS_XFT
Xpdf*renderTable.mono.fontName: Monospace
Xpdf*renderTable.mono.fontSize: 12
Xpdf*renderTable.mono.fontEncoding: iso10646-1
If you prefer to use X core fonts, as in earlier versions of xpdf, you can specify these using conventional resources, provided that you use fonts with the "iso10646-1" Unicode charset:
Xpdf*font: -*-helvetica-medium-r-normal-*-12-*-*-*-*-*-iso10646-1
Xpdf*XmTextField.font: -*-courier-medium-r-normal-*-12-*-*-*-*-*-iso10646-1
πͺ EXIT CODES β
xpdf uses the following exit codes:
0β no error. π1β error opening a PDF file. π99β other error.
π AUTHORS π
The original Xpdf software and documentation are copyright 1996β2014 Glyph & Cog, LLC. Modifications for Poppler support and further development were done by the Debian and Gentoo Xpdf maintainers, and by xpopple contributors.
π¦ SEE ALSO πΈ
pdftops(1), pdftotext(1), pdftohtml(1), pdfinfo(1), pdffonts(1), pdfdetach(1), pdftoppm(1), pdftopng(1), pdfimages(1), xpdfrc(5)
and that's a wrap bestie π«Ά this lil masterpiece of a page is dated 2026-04-17 and it's version xpdf(1) β no cap, that's the whole thing. periodt π
β¨
π¦ where this page comes from
- ubuntu stonking: xpdf 3.04+git20260802-1 Β· GPL-2.0-only OR GPL-3.0-only
- Copyright 1996-2014 Glyph & Cog, LLC
- Copyright 2014-2026 Adam Sampson <ats@offog.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms