| 1 |
xpdf(1) General Commands Manual xpdf(1) |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
NAME |
| 6 |
xpdf - Portable Document Format (PDF) file viewer (version 4.06) |
| 7 |
|
| 8 |
SYNOPSIS |
| 9 |
xpdf [options] [PDF-file [:page | +dest]] ... |
| 10 |
|
| 11 |
xpdf [options] -remote remote-name [command ...] |
| 12 |
|
| 13 |
xpdf [options] -open [PDF-file] |
| 14 |
|
| 15 |
DESCRIPTION |
| 16 |
Xpdf is a viewer for Portable Document Format (PDF) files. (These are |
| 17 |
also sometimes also called 'Acrobat' files, from the name of Adobe's |
| 18 |
PDF software.) Xpdf uses the Qt GUI toolkit and runs on Unix, OS X, |
| 19 |
and Windows. |
| 20 |
|
| 21 |
To run xpdf, type: |
| 22 |
|
| 23 |
xpdf file.pdf |
| 24 |
|
| 25 |
where file.pdf is your PDF file. The file name can be followed by a |
| 26 |
page number to be displayed, prefixed with a colon: |
| 27 |
|
| 28 |
xpdf file.pdf :18 |
| 29 |
|
| 30 |
or by a named destination, prefixed with '+' (this is only useful with |
| 31 |
PDF files that provide named destination targets): |
| 32 |
|
| 33 |
xpdf file.pdf +destinationA |
| 34 |
|
| 35 |
If you specify multiple files, they will each be opened in a separate |
| 36 |
tab: |
| 37 |
|
| 38 |
xpdf file1.pdf file2.pdf :18 file3.pdf |
| 39 |
|
| 40 |
You can also start xpdf without opening any files: |
| 41 |
|
| 42 |
xpdf |
| 43 |
|
| 44 |
CONFIGURATION FILE |
| 45 |
Xpdf reads a configuration file at startup. It first tries to find the |
| 46 |
user's private config file, ~/.xpdfrc. If that doesn't exist, it looks |
| 47 |
for a system-wide config file, typically /etc/xpdfrc (but this location |
| 48 |
can be changed when xpdf is built). See the xpdfrc(5) man page for de- |
| 49 |
tails. |
| 50 |
|
| 51 |
OPTIONS |
| 52 |
The following command line options are available. All command line op- |
| 53 |
tions must come before any PDF files to be opened. |
| 54 |
|
| 55 |
Many of the options can be set with configuration file commands. These |
| 56 |
are listed in square brackets with the description of the corresponding |
| 57 |
command line option. |
| 58 |
|
| 59 |
-geometry geometry |
| 60 |
Set the initial window geometry. |
| 61 |
|
| 62 |
-title title |
| 63 |
Set the window title. By default, the title will be "xpdf: |
| 64 |
foo.pdf". |
| 65 |
|
| 66 |
-open [PDF-file] |
| 67 |
This option sets up a default remote server. If Xpdf is already |
| 68 |
running (with the "-open" switch), the PDF file (if any) is |
| 69 |
opened in a new tab. If Xpdf (with the "-open" switch) is not |
| 70 |
already running, starts Xpdf and opens the PDF file (if any). |
| 71 |
This is useful for GUI desktop environments, e.g., the typical |
| 72 |
double-click on a PDF file case. |
| 73 |
|
| 74 |
-rv Set reverse video mode. This reverses the colors of everything |
| 75 |
except images. It may not always produce great results for PDF |
| 76 |
files which do weird things with color. This also causes the |
| 77 |
paper color to default to black. |
| 78 |
|
| 79 |
-papercolor color |
| 80 |
Set the "paper color", i.e., the background of the page display. |
| 81 |
The color can be #RRGGBB (hexadecimal) or a named color. This |
| 82 |
option will not work well with PDF files that do things like |
| 83 |
filling in white behind the text. [config file: paperColor] |
| 84 |
|
| 85 |
-mattecolor color |
| 86 |
Set the matte color, i.e., the color used for background outside |
| 87 |
the actual page area. The color can be #RRGGBB (hexadecimal) or |
| 88 |
a named color. [config file: matteColor] |
| 89 |
|
| 90 |
-fsmattecolor color |
| 91 |
Set the matte color for full-screen mode. The color can be |
| 92 |
#RRGGBB (hexadecimal) or a named color. [config file: |
| 93 |
fullScreenMatteColor] |
| 94 |
|
| 95 |
-z zoom |
| 96 |
Set the initial zoom factor. A number specifies a zoom percent- |
| 97 |
age, where 100 means 72 dpi. You may also specify 'page', to |
| 98 |
fit the page to the window size, or 'width', to fit the page |
| 99 |
width to the window width. [config file: initialZoom] |
| 100 |
|
| 101 |
-rot angle |
| 102 |
Rotate pages by 0 (the default), 90, 180, or 270 degrees. |
| 103 |
|
| 104 |
-aa yes | no |
| 105 |
Enable or disable font anti-aliasing. This defaults to "yes". |
| 106 |
[config file: antialias] |
| 107 |
|
| 108 |
-aaVector yes | no |
| 109 |
Enable or disable vector anti-aliasing. This defaults to "yes". |
| 110 |
[config file: vectorAntialias] |
| 111 |
|
| 112 |
-enc encoding-name |
| 113 |
Sets the encoding to use for text output. The encoding-name |
| 114 |
must be defined with the unicodeMap command (see xpdfrc(5)). |
| 115 |
This defaults to "Latin1" (which is a built-in encoding). [con- |
| 116 |
fig file: textEncoding] |
| 117 |
|
| 118 |
-pw password |
| 119 |
Specify the password for the PDF file. This can be either the |
| 120 |
owner password (which will bypass all security restrictions) or |
| 121 |
the user password. |
| 122 |
|
| 123 |
-fullscreen |
| 124 |
Open xpdf in full-screen mode, useful for presentations. |
| 125 |
|
| 126 |
-remote remote-name |
| 127 |
Start Xpdf in remote server mode. See the REMOTE SERVER MODE |
| 128 |
section. |
| 129 |
|
| 130 |
-display display |
| 131 |
Set the X display (only available with X11). |
| 132 |
|
| 133 |
-cmd Print commands as they're executed (useful for debugging). |
| 134 |
[config file: printCommands] |
| 135 |
|
| 136 |
-tabstate tabstate-file |
| 137 |
Sets the file used by the loadTabState and saveTabState com- |
| 138 |
mands. [config file: tabStateFile] |
| 139 |
|
| 140 |
-cfg config-file |
| 141 |
Read config-file in place of ~/.xpdfrc or the system-wide config |
| 142 |
file. |
| 143 |
|
| 144 |
-v Print copyright and version information. |
| 145 |
|
| 146 |
-h Print usage information. (-help and --help are equivalent.) |
| 147 |
|
| 148 |
CONTROLS |
| 149 |
Toolbar |
| 150 |
toggle sidebar button |
| 151 |
Toggles (i.e., shows or hides) the sidebar. |
| 152 |
|
| 153 |
status indicator |
| 154 |
This icon is animated while Xpdf is rendering a page. It turns |
| 155 |
red when an error or warning has been issued. Clicking on it |
| 156 |
opens the error dialog. |
| 157 |
|
| 158 |
selection mode |
| 159 |
This icon is an "I-beam" in linear selection mode, and an arrow |
| 160 |
in block selection mode. Clicking on it toggles between the two |
| 161 |
selection modes. |
| 162 |
|
| 163 |
page number entry box |
| 164 |
Move to a specific page number. Click in the box to activate |
| 165 |
it, type the page number, then hit return. This will instead |
| 166 |
display and accept page labels, if the "view - page labels" menu |
| 167 |
item is checked. |
| 168 |
|
| 169 |
left/right arrow buttons |
| 170 |
Go backward or forward along the history path. |
| 171 |
|
| 172 |
zoom out/in buttons |
| 173 |
Zoom out or in (i.e., change magnification) incrementally. |
| 174 |
|
| 175 |
zoom popup menu |
| 176 |
Change the zoom factor (see the description of the -z option |
| 177 |
above). |
| 178 |
|
| 179 |
fit width button |
| 180 |
Change the zoom factor to fit the page width to the window |
| 181 |
width. |
| 182 |
|
| 183 |
fit page button |
| 184 |
Change the zoom factor to fit the page to the window size. |
| 185 |
|
| 186 |
find entry box |
| 187 |
Find a text string. Click in the box to activate it, type a |
| 188 |
search string, then hit return. |
| 189 |
|
| 190 |
find next button |
| 191 |
Find the next occurrence of the search string. |
| 192 |
|
| 193 |
find previous button |
| 194 |
Find the previous occurrence of the search string. |
| 195 |
|
| 196 |
find settings button |
| 197 |
Display the current find settings: case insensitive, case sensi- |
| 198 |
tive, smart case (case sensitive only if the search string con- |
| 199 |
tains uppercase characters), find whole words. |
| 200 |
|
| 201 |
Menu bar |
| 202 |
The menu bar is above the toolbar. The menu items should be self-ex- |
| 203 |
planatory. |
| 204 |
|
| 205 |
Tab list |
| 206 |
The tab list is on the left, just below the toolbar. It lists all open |
| 207 |
tabs. |
| 208 |
|
| 209 |
Outline/layers/attachments pane |
| 210 |
This pane is on the left, below the tab list. The popup allows you to |
| 211 |
select from outline, layers, or attachments. |
| 212 |
|
| 213 |
The outline is a tree-like structure of bookmarks that allows moving |
| 214 |
within the PDF file. Not all PDF files have outlines. |
| 215 |
|
| 216 |
Layers (a.k.a. optional content) allow parts of the PDF content to be |
| 217 |
shown or hidden. Not all PDF files have layers. |
| 218 |
|
| 219 |
Attachments are other files embedded within the PDF file. There is a |
| 220 |
'save' button for each attached file. Not all PDF files have attach- |
| 221 |
ments. |
| 222 |
|
| 223 |
Text selection |
| 224 |
In block selection mode, dragging the mouse with the left button held |
| 225 |
down will highlight an arbitrary rectangle. Shift-clicking will extend |
| 226 |
the selection. |
| 227 |
|
| 228 |
In linear selection mode, dragging with the left button will highlight |
| 229 |
text in reading order. Double-clicking or triple-clicking will select |
| 230 |
a word or a line, respectively. Shift-clicking will extend the selec- |
| 231 |
tion. |
| 232 |
|
| 233 |
Selected text can be copied to the clipboard (with the edit/copy menu |
| 234 |
item). On X11, selected text will be available in the X selection buf- |
| 235 |
fer. |
| 236 |
|
| 237 |
Links |
| 238 |
When the mouse is over a hyperlink, the link target will be shown in a |
| 239 |
popup near the bottom of the window. |
| 240 |
|
| 241 |
Clicking on a hyperlink will jump to the link's destination. A link to |
| 242 |
another PDF document will make xpdf load that document. A 'launch' |
| 243 |
link to an executable program will display a dialog, and if you click |
| 244 |
'ok', execute the program. URL links are opened in a system-dependent |
| 245 |
way. (On UNIX, Qt uses the $BROWSER environment variable.) |
| 246 |
|
| 247 |
Mouse bindings |
| 248 |
The left mouse button is used to select text (see above). |
| 249 |
|
| 250 |
Clicking on a link with the middle button opens the link in a new tab. |
| 251 |
|
| 252 |
Dragging the mouse with the middle button held down pans the window. |
| 253 |
|
| 254 |
The right mouse button opens a popup menu (see popupMenuCmd in |
| 255 |
xpdfrc(5)). |
| 256 |
|
| 257 |
Key bindings |
| 258 |
This section lists the default key bindings. Bindings can be changed |
| 259 |
using the config file (see xpdfrc(5)). |
| 260 |
|
| 261 |
control-o |
| 262 |
Open a new PDF file via a file requester. |
| 263 |
|
| 264 |
control-r |
| 265 |
Reload the current PDF file. Note that Xpdf will reload the |
| 266 |
file automatically (on a page change or redraw) if it has |
| 267 |
changed since it was last loaded. |
| 268 |
|
| 269 |
control-f |
| 270 |
Find a text string. This sets keyboard focus to the 'find' box. |
| 271 |
|
| 272 |
control-G |
| 273 |
Find next occurrence. |
| 274 |
|
| 275 |
control-C |
| 276 |
Copy selected text to the clipboard. |
| 277 |
|
| 278 |
control-P |
| 279 |
Print. |
| 280 |
|
| 281 |
control-0 (control-zero) |
| 282 |
Set the zoom factor to 125%. |
| 283 |
|
| 284 |
control-+ (control-plus) |
| 285 |
Zoom in (increment the zoom factor by 1). |
| 286 |
|
| 287 |
control-- (control-minus) |
| 288 |
Zoom out (decrement the zoom factor by 1). |
| 289 |
|
| 290 |
control-s |
| 291 |
Save PDF via a file requester. |
| 292 |
|
| 293 |
control-t |
| 294 |
Open a new tab. |
| 295 |
|
| 296 |
control-n |
| 297 |
Open a new window. |
| 298 |
|
| 299 |
control-w |
| 300 |
Close the current tab. Closes the window if this was the last |
| 301 |
open tab. Quits the application if this was the last open win- |
| 302 |
dow. |
| 303 |
|
| 304 |
control-l |
| 305 |
Toggle between full-screen and window modes. |
| 306 |
|
| 307 |
control-q |
| 308 |
Quit. |
| 309 |
|
| 310 |
control-<tab> |
| 311 |
Next tab. |
| 312 |
|
| 313 |
control-shift-<tab> |
| 314 |
Previous tab. |
| 315 |
|
| 316 |
control-? |
| 317 |
Help. |
| 318 |
|
| 319 |
alt-<left-arrow> |
| 320 |
Go backward along the history path. |
| 321 |
|
| 322 |
alt-<right-arrow> |
| 323 |
Go forward along the history path. |
| 324 |
|
| 325 |
home Go to the top left of current page. |
| 326 |
|
| 327 |
control-<home> |
| 328 |
Go to the first page. |
| 329 |
|
| 330 |
end Go to the bottom right of current page. |
| 331 |
|
| 332 |
control-<end> |
| 333 |
Go to the last page. |
| 334 |
|
| 335 |
<space> or <PageDown> |
| 336 |
Scroll down on the current page; if already at bottom, move to |
| 337 |
next page. |
| 338 |
|
| 339 |
control-<PageDown> or control-<down-arrow> |
| 340 |
Go to the next page. If <ScrollLock> is active, this maintains |
| 341 |
the relative position on the page. |
| 342 |
|
| 343 |
<PageUp> |
| 344 |
Scroll up on the current page; if already at top, move to previ- |
| 345 |
ous page. |
| 346 |
|
| 347 |
control-<PageUp> or control-<up-arrow> |
| 348 |
Go to the previous page. If <ScrollLock> is active, this main- |
| 349 |
tains the relative position on the page. |
| 350 |
|
| 351 |
<esc> Exit full-screen mode. |
| 352 |
|
| 353 |
arrows Scroll the current page. |
| 354 |
|
| 355 |
g Set keyboard focus to the page number entry box. |
| 356 |
|
| 357 |
z Set the zoom factor to 'page' (fit page to window). |
| 358 |
|
| 359 |
w Set the zoom factor to 'width' (fit page width to window). |
| 360 |
|
| 361 |
Full-screen mode |
| 362 |
Xpdf can be placed into full-screen mode via the -fullscreen command |
| 363 |
line option, the 'full screen' menu item, or a binding to the |
| 364 |
fullScreenMode or toggleFullScreenMode command. |
| 365 |
|
| 366 |
Entering full-screen mode automatically switches to single-page view |
| 367 |
mode and to the fit-page zoom factor. |
| 368 |
|
| 369 |
Full-screen mode can be exited via the default <esc> key binding, or |
| 370 |
via a binding to the windowMode or toggleFullScreenModecommand. |
| 371 |
|
| 372 |
COMMANDS |
| 373 |
Xpdf's key and mouse bindings are user-configurable, using the bind and |
| 374 |
unbind commands in the config file (see xpdfrc(5)). The bind command |
| 375 |
allows you to bind a key or mouse button to a sequence of one or more |
| 376 |
commands. |
| 377 |
|
| 378 |
In commands that take arguments (inside parentheses), special charac- |
| 379 |
ters (namely '(', ')', ',', and '\x01') can be escaped by preceding |
| 380 |
them with a '\x01' character. This is mostly useful in things like |
| 381 |
scripts that need to be able to open arbitrary PDF files, using the |
| 382 |
'openFile' command. |
| 383 |
|
| 384 |
The following commands are supported: |
| 385 |
|
| 386 |
about Open the 'about' dialog. |
| 387 |
|
| 388 |
blockSelectMode |
| 389 |
Set block selection mode. In this mode, the selection is a sim- |
| 390 |
ple rectangle. Any part of the page can be selected, regardless |
| 391 |
of the content on the page. |
| 392 |
|
| 393 |
checkOpenFile(file) |
| 394 |
Check that file is open in the current tab, and open it if not. |
| 395 |
|
| 396 |
checkOpenFileAtDest(file,dest) |
| 397 |
Check that file is open in the current tab, and open it if not. |
| 398 |
In either case go to the specified named destination. |
| 399 |
|
| 400 |
checkOpenFileAtPage(file,page) |
| 401 |
Check that file is open in the current tab, and open it if not. |
| 402 |
In either case go to the specified page. |
| 403 |
|
| 404 |
closeSidebar |
| 405 |
Close the sidebar. |
| 406 |
|
| 407 |
closeSidebarMoveResizeWin |
| 408 |
Close the sidebar, resizing the window so that the document size |
| 409 |
doesn't change, and moving the window so that the document stays |
| 410 |
in the same place on the screen. |
| 411 |
|
| 412 |
closeSidebarResizeWin |
| 413 |
Close the sidebar, resizing the window so that the document size |
| 414 |
doesn't change. |
| 415 |
|
| 416 |
closeTabOrQuit |
| 417 |
Close the tab. If this was the last open tab, close the window. |
| 418 |
If this was the last window open, quit. |
| 419 |
|
| 420 |
closeWindowOrQuit |
| 421 |
Close the window. If this was the last open window, quit. |
| 422 |
|
| 423 |
continuousMode |
| 424 |
Switch to continuous view mode. |
| 425 |
|
| 426 |
copy Copy selected text to the clipboard. |
| 427 |
|
| 428 |
copyLinkTarget |
| 429 |
Copy the target of the link under the mouse cursor to the clip- |
| 430 |
board. |
| 431 |
|
| 432 |
endPan End a pan operation. |
| 433 |
|
| 434 |
endSelection |
| 435 |
End a selection. |
| 436 |
|
| 437 |
expandSidebar(n) |
| 438 |
Expand the sidebar by n pixels. Opens the sidebar if it is cur- |
| 439 |
rently closed. |
| 440 |
|
| 441 |
find Set keyboard focus to the 'find' box. |
| 442 |
|
| 443 |
findFirst |
| 444 |
Find the first occurrence of the search string. |
| 445 |
|
| 446 |
findNext |
| 447 |
Find the next occurrence of the search string. |
| 448 |
|
| 449 |
findPrevious |
| 450 |
Find the previous occurrence of the search string. |
| 451 |
|
| 452 |
focusToDocWin |
| 453 |
Set keyboard focus to the main document window. |
| 454 |
|
| 455 |
focusToPageNum |
| 456 |
Set keyboard focus to the page number text box. |
| 457 |
|
| 458 |
followLink |
| 459 |
Follow a hyperlink (does nothing if the mouse is not over a |
| 460 |
link). |
| 461 |
|
| 462 |
followLinkInNewTab |
| 463 |
Follow a hyperlink, opening PDF files in a new tab (does nothing |
| 464 |
if the mouse is not over a link). For links to non-PDF files, |
| 465 |
this command is identical to followLink. |
| 466 |
|
| 467 |
followLinkInNewTabNoSel |
| 468 |
Same as followLinkInNewTab, but does nothing if there is a non- |
| 469 |
empty selection. (This is useful as a mouse button binding.) |
| 470 |
|
| 471 |
followLinkInNewWin |
| 472 |
Follow a hyperlink, opening PDF files in a new window (does |
| 473 |
nothing if the mouse is not over a link). For links to non-PDF |
| 474 |
files, this command is identical to followLink. |
| 475 |
|
| 476 |
followLinkInNewWinNoSel |
| 477 |
Same as followLinkInNewWin, but does nothing if there is a non- |
| 478 |
empty selection. (This is useful as a mouse button binding.) |
| 479 |
|
| 480 |
followLinkNoSel |
| 481 |
Same as followLink, but does nothing if there is a non-empty se- |
| 482 |
lection. (This is useful as a mouse button binding.) |
| 483 |
|
| 484 |
fullScreenMode |
| 485 |
Go to full-screen mode. |
| 486 |
|
| 487 |
goBackward |
| 488 |
Move backward along the history path. |
| 489 |
|
| 490 |
goForward |
| 491 |
Move forward along the history path. |
| 492 |
|
| 493 |
gotoDest(dest) |
| 494 |
Go to a named destination. |
| 495 |
|
| 496 |
gotoLastPage |
| 497 |
Go to the last page in the PDF file. |
| 498 |
|
| 499 |
gotoPage(page) |
| 500 |
Go to the specified page. |
| 501 |
|
| 502 |
help Open the help URL. |
| 503 |
|
| 504 |
hideMenuBar |
| 505 |
Hide the menu bar. |
| 506 |
|
| 507 |
hideToolbar |
| 508 |
Hide the toolbar. |
| 509 |
|
| 510 |
horizontalContinuousMode |
| 511 |
Switch to horizontal continuous view mode. |
| 512 |
|
| 513 |
linearSelectMode |
| 514 |
Set linear selection mode. In this mode, the selection follows |
| 515 |
text. Non-text regions cannot be selected. |
| 516 |
|
| 517 |
loadSession |
| 518 |
Load the session from the session save file. The path for the |
| 519 |
session file is specified with the sessionFile setting (see |
| 520 |
xpdfrc(5)). |
| 521 |
|
| 522 |
loadTabState |
| 523 |
Load the tab state file (which was written via the saveTabState |
| 524 |
command), and restore the tabs listed in that file. The path |
| 525 |
for the tab state file is specified with the tabStateFile set- |
| 526 |
ting (see xpdfrc(5)). |
| 527 |
|
| 528 |
newTab Open an empty new tab. |
| 529 |
|
| 530 |
newWindow |
| 531 |
Open an empty new window. |
| 532 |
|
| 533 |
nextPage |
| 534 |
Go to the next page. |
| 535 |
|
| 536 |
nextPageNoScroll |
| 537 |
Go to the next page, with the current relative scroll position. |
| 538 |
|
| 539 |
nextTab |
| 540 |
Switch to the next tab. |
| 541 |
|
| 542 |
normalVideoMode |
| 543 |
Switch to normal video mode (the opposite of reverse video |
| 544 |
mode). |
| 545 |
|
| 546 |
open Open a PDF file in the current tab, using the open dialog. |
| 547 |
|
| 548 |
openErrorWindow |
| 549 |
Open the error window. |
| 550 |
|
| 551 |
openFile(file) |
| 552 |
Open the specified file in the current tab. |
| 553 |
|
| 554 |
openFile2(file,page,dest,passwd,location) |
| 555 |
Open the specified file. If dest is not empty, go to the speci- |
| 556 |
fied named destination. Else, if page is not empty, go to the |
| 557 |
specified page number. If password is not empty, it is used as |
| 558 |
the PDF password. If location is "win", open the file in a new |
| 559 |
window; if it is "tab", open in a new tab; if it is "check", |
| 560 |
open in the current tab, but only if the specified PDF file |
| 561 |
isn't already open; else open in the current tab. Any/all of |
| 562 |
the arguments, other than file, can be empty strings. For exam- |
| 563 |
ple: |
| 564 |
openFile2(test.pdf,7,,,tab) |
| 565 |
|
| 566 |
openFileAtDest(file,dest) |
| 567 |
Open the specified file in the current tab at the specified |
| 568 |
named destination. |
| 569 |
|
| 570 |
openFileAtDestIn(file,dest,location) |
| 571 |
Open the specified file at the specified named destination. Lo- |
| 572 |
cation must be "win" for a new window or "tab" for a new tab. |
| 573 |
|
| 574 |
openFileAtPage(file,page) |
| 575 |
Open the specified file in the current tab at the specified |
| 576 |
page. |
| 577 |
|
| 578 |
openFileAtPageIn(file,page,location) |
| 579 |
Open the specified file at the specified page. Location must be |
| 580 |
"win" for a new window or "tab" for a new tab. |
| 581 |
|
| 582 |
openFileIn(file,location) |
| 583 |
Open the specified file. Location must be "win" for a new win- |
| 584 |
dow or "tab" for a new tab. |
| 585 |
|
| 586 |
openIn(location) |
| 587 |
Open a PDF file, using the open dialog. Location must be "win" |
| 588 |
for a new window or "tab" for a new tab. |
| 589 |
|
| 590 |
openSidebar |
| 591 |
Open the sidebar. |
| 592 |
|
| 593 |
openSidebarMoveResizeWin |
| 594 |
Open the sidebar, resizing the window so that the document size |
| 595 |
doesn't change, and moving the window so that the document stays |
| 596 |
in the same place on the screen. |
| 597 |
|
| 598 |
openSidebarResizeWin |
| 599 |
Open the sidebar, resizing the window so that the document size |
| 600 |
doesn't change. |
| 601 |
|
| 602 |
pageDown |
| 603 |
Scroll down by one screenful. |
| 604 |
|
| 605 |
pageUp Scroll up by one screenful. |
| 606 |
|
| 607 |
postPopupMenu |
| 608 |
Display the popup menu. |
| 609 |
|
| 610 |
prevPage |
| 611 |
Go to the previous page. |
| 612 |
|
| 613 |
prevPageNoScroll |
| 614 |
Go to the previous page, with the current relative scroll posi- |
| 615 |
tion. |
| 616 |
|
| 617 |
prevTab |
| 618 |
Switch to the previous tab. |
| 619 |
|
| 620 |
print Open the 'print' dialog. |
| 621 |
|
| 622 |
quit Quit from xpdf. |
| 623 |
|
| 624 |
raise Bring the xpdf window to the front. |
| 625 |
|
| 626 |
reload Reload the current PDF file. |
| 627 |
|
| 628 |
reverseVideoMode |
| 629 |
Switch to reverse video mode. |
| 630 |
|
| 631 |
rotateCCW |
| 632 |
Rotate the page 90 degrees counterclockwise. |
| 633 |
|
| 634 |
rotateCW |
| 635 |
Rotate the page 90 degrees clockwise. |
| 636 |
|
| 637 |
run(external-command-string) |
| 638 |
Run an external command. The following escapes are allowed in |
| 639 |
the command string: |
| 640 |
|
| 641 |
%f => PDF file name (or an empty string if no |
| 642 |
file is open) |
| 643 |
%b => PDF file base name, i.e., file name minus |
| 644 |
the extension (or an empty string if no |
| 645 |
file is open) |
| 646 |
%u => link URL (or an empty string if not over |
| 647 |
a URL link) |
| 648 |
%p => current page number (or an empty string if |
| 649 |
no file is open) |
| 650 |
%x => selection upper-left x coordinate |
| 651 |
(or 0 if there is no selection) |
| 652 |
%y => selection upper-left y coordinate |
| 653 |
(or 0 if there is no selection) |
| 654 |
%X => selection lower-right x coordinate |
| 655 |
(or 0 if there is no selection) |
| 656 |
%Y => selection lower-right y coordinate |
| 657 |
(or 0 if there is no selection) |
| 658 |
%t => selected text (limited to 500 characters) |
| 659 |
%i => page containing the mouse pointer |
| 660 |
%j => x coordinate of the mouse pointer |
| 661 |
%k => y coordinate of the mouse pointer |
| 662 |
%% => % |
| 663 |
|
| 664 |
The external command string will often contain spaces, so the |
| 665 |
whole command must be quoted in the xpdfrc file: |
| 666 |
|
| 667 |
bind x "run(ls -l)" |
| 668 |
|
| 669 |
The command string may not be run through a shell. It is recom- |
| 670 |
mended to keep the command simple, so that it doesn't depend on |
| 671 |
specific shell functionality. For complex things, you can have |
| 672 |
the command string run a shell script. |
| 673 |
|
| 674 |
saveAs Save PDF via a file requester. |
| 675 |
|
| 676 |
saveImage |
| 677 |
Open the 'save image' dialog. |
| 678 |
|
| 679 |
saveSession |
| 680 |
Save the current session, consisting of all open windows and |
| 681 |
tabs, to the session save file. This file can be loaded later |
| 682 |
with the loadSession command. The path for the session file is |
| 683 |
specified with the sessionFile setting (see xpdfrc(5)). |
| 684 |
|
| 685 |
saveTabState |
| 686 |
Save a list of all tabs open in this window to the tab state |
| 687 |
file. For each tab, this writes the PDF file name and page num- |
| 688 |
ber (on separate lines). This file can be loaded later with the |
| 689 |
loadTabState command. The path for the tab state file is speci- |
| 690 |
fied with the tabStateFile setting (see xpdfrc(5)). |
| 691 |
|
| 692 |
scrollDown(n) |
| 693 |
Scroll down by n pixels. |
| 694 |
|
| 695 |
scrollDownNextPage(n) |
| 696 |
Scroll down by n pixels, moving to the next page if appropriate. |
| 697 |
|
| 698 |
scrollLeft(n) |
| 699 |
Scroll left by n pixels. |
| 700 |
|
| 701 |
scrollOutlineDown(n) |
| 702 |
Scroll the outline down by n increments. |
| 703 |
|
| 704 |
scrollOutlineUp(n) |
| 705 |
Scroll the outline up by n increments. |
| 706 |
|
| 707 |
scrollRight(n) |
| 708 |
Scroll right by n pixels. |
| 709 |
|
| 710 |
scrollToBottomEdge |
| 711 |
Scroll to the bottom edge of the last displayed page, with no |
| 712 |
horizontal movement. |
| 713 |
|
| 714 |
scrollToBottomRight |
| 715 |
Scroll to the bottom-right corner of the last displayed page. |
| 716 |
|
| 717 |
scrollToLeftEdge |
| 718 |
Scroll to the left edge of the current page, with no vertical |
| 719 |
movement. |
| 720 |
|
| 721 |
scrollToRightEdge |
| 722 |
Scroll to the right edge of the current page, with no vertical |
| 723 |
movement. |
| 724 |
|
| 725 |
scrollToTopEdge |
| 726 |
Scroll to the top edge of the first displayed page, with no hor- |
| 727 |
izontal movement. |
| 728 |
|
| 729 |
scrollToTopLeft |
| 730 |
Scroll to the top-left corner of the first displayed page. |
| 731 |
|
| 732 |
scrollUp(n) |
| 733 |
Scroll up by n pixels. |
| 734 |
|
| 735 |
scrollUpPrevPage(n) |
| 736 |
Scroll up by n pixels, moving to the previous page if appropri- |
| 737 |
ate. |
| 738 |
|
| 739 |
selectLine |
| 740 |
Set the selection to the line at the current mouse position. |
| 741 |
|
| 742 |
selectWord |
| 743 |
Set the selection to the word at the current mouse position. |
| 744 |
|
| 745 |
setSelection(pg,ulx,uly,lrx,lry) |
| 746 |
Set the selection to the specified coordinates on the specified |
| 747 |
page. |
| 748 |
|
| 749 |
showAttachmentsPane |
| 750 |
Shows the attachments in the outline/layers/attachments pane. |
| 751 |
|
| 752 |
showDocumentInfo |
| 753 |
Open the document information dialog. |
| 754 |
|
| 755 |
showKeyBindings |
| 756 |
Open the key bindings dialog. |
| 757 |
|
| 758 |
showLayersPane |
| 759 |
Shows the layers in the outline/layers/attachments pane. |
| 760 |
|
| 761 |
showMenuBar |
| 762 |
Show the menu bar. |
| 763 |
|
| 764 |
showOutlinePane |
| 765 |
Shows the outline in the outline/layers/attachments pane. |
| 766 |
|
| 767 |
showToolbar |
| 768 |
Show the toolbar. |
| 769 |
|
| 770 |
shrinkSidebar(n) |
| 771 |
Shrink the sidebar by n pixels. Closes the sidebar if shrinking |
| 772 |
it would go below the minimum allowed side. |
| 773 |
|
| 774 |
sideBySideContinuousMode |
| 775 |
Switch to side-by-side continuous view mode. |
| 776 |
|
| 777 |
sideBySideSingleMode |
| 778 |
Switch to side-by-side two-page view mode. |
| 779 |
|
| 780 |
singlePageMode |
| 781 |
Switch to single-page view mode. |
| 782 |
|
| 783 |
startExtendedSelection |
| 784 |
Extend the selection to the current mouse position, and continue |
| 785 |
extending as the mouse moves. |
| 786 |
|
| 787 |
startPan |
| 788 |
Start a pan operation at the current mouse position, which will |
| 789 |
scroll the document as the mouse moves. |
| 790 |
|
| 791 |
startSelection |
| 792 |
Start a selection at the current mouse position, which will be |
| 793 |
extended as the mouse moves. |
| 794 |
|
| 795 |
toggleContinuousMode |
| 796 |
Toggle between continuous and single page view modes. |
| 797 |
|
| 798 |
toggleFullScreenMode |
| 799 |
Toggle between full-screen and window modes. |
| 800 |
|
| 801 |
toggleMenuBar |
| 802 |
Toggle the menu bar between shown and hidden. |
| 803 |
|
| 804 |
toggleReverseVideoMode |
| 805 |
Toggle between reverse and normal video modes. |
| 806 |
|
| 807 |
toggleSelectMode |
| 808 |
Toggle between block and linear selection mode. |
| 809 |
|
| 810 |
toggleSidebar |
| 811 |
Toggle the sidebar between open and closed. |
| 812 |
|
| 813 |
toggleSidebarMoveResizeWin |
| 814 |
Toggle the sidebar between open and closed, resizing the window |
| 815 |
so that the document size doesn't change, and moving the window |
| 816 |
so that the document stays in the same place on the screen. |
| 817 |
|
| 818 |
toggleSidebarResizeWin |
| 819 |
Toggle the sidebar between open and closed, resizing the window |
| 820 |
so that the document size doesn't change. |
| 821 |
|
| 822 |
toggleToolbar |
| 823 |
Toggle the toolbar between shown and hidden. |
| 824 |
|
| 825 |
viewPageLabels |
| 826 |
Show page labels (if the PDF file has them), rather than page |
| 827 |
numbers. |
| 828 |
|
| 829 |
viewPageNumbers |
| 830 |
Show page numbers, rather than page labels. |
| 831 |
|
| 832 |
windowMode |
| 833 |
Go to window (non-full-screen) mode. |
| 834 |
|
| 835 |
zoomFitPage |
| 836 |
Set the zoom factor to fit-page. |
| 837 |
|
| 838 |
zoomFitWidth |
| 839 |
Set the zoom factor to fit-width. |
| 840 |
|
| 841 |
zoomIn Zoom in - go to the next higher zoom factor. |
| 842 |
|
| 843 |
zoomOut |
| 844 |
Zoom out - go the next lower zoom factor. |
| 845 |
|
| 846 |
zoomPercent(z) |
| 847 |
Set the zoom factor to z%. |
| 848 |
|
| 849 |
zoomToSelection |
| 850 |
Zoom to the current selection. |
| 851 |
|
| 852 |
REMOTE SERVER MODE |
| 853 |
Starting xpdf with the "-remote" switch puts it into remote server |
| 854 |
mode. All remaining command line options are commands (see the COM- |
| 855 |
MANDS section). Subsequent invocations of "xpdf -remote" with the same |
| 856 |
remote server name will send commands to the already-running instance |
| 857 |
of xpdf. The "checkOpenFile" commands are useful here for things like |
| 858 |
changing pages. For example: |
| 859 |
|
| 860 |
# Start up xpdf, and open something.pdf. |
| 861 |
xpdf -remote foo 'openFile(something.pdf)' |
| 862 |
|
| 863 |
# Switch to page 7 in the already-open something.pdf. If |
| 864 |
the user |
| 865 |
# has closed xpdf in the meantime, this will restart it and |
| 866 |
reopen |
| 867 |
# the file. |
| 868 |
xpdf -remote foo 'checkOpenFileAtPage(something.pdf, 7)' |
| 869 |
|
| 870 |
# Pass two commands to the remote instance: (1) open some- |
| 871 |
thing.pdf |
| 872 |
# and then (2) raise the xpdf window. |
| 873 |
xpdf -remote foo 'openFile(something.pdf)' raise |
| 874 |
|
| 875 |
EXIT CODES |
| 876 |
The Xpdf tools use the following exit codes: |
| 877 |
|
| 878 |
0 No error. |
| 879 |
|
| 880 |
1 Error opening a PDF file. |
| 881 |
|
| 882 |
2 Error opening an output file. |
| 883 |
|
| 884 |
3 Error related to PDF permissions. |
| 885 |
|
| 886 |
99 Other error. |
| 887 |
|
| 888 |
AUTHOR |
| 889 |
The xpdf software and documentation are copyright 1996-2025 Glyph & |
| 890 |
Cog, LLC. |
| 891 |
|
| 892 |
SEE ALSO |
| 893 |
pdftops(1), pdftotext(1), pdftohtml(1), pdfinfo(1), pdffonts(1), pdfde- |
| 894 |
tach(1), pdftoppm(1), pdftopng(1), pdfimages(1), xpdfrc(5) |
| 895 |
http://www.xpdfreader.com/ |
| 896 |
|
| 897 |
|
| 898 |
|
| 899 |
14 Nov 2025 xpdf(1) |