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