1xpdf(1) General Commands Manual xpdf(1)
2
3
4
6 xpdf - Portable Document Format (PDF) file viewer for X (version 3.02)
7
9 xpdf [options] [PDF-file [page | +dest]]
10
12 Xpdf is a viewer for Portable Document Format (PDF) files. (These are
13 also sometimes also called ´Acrobat' files, from the name of Adobe's
14 PDF software.) Xpdf runs under the X Window System on UNIX, VMS, and
15 OS/2.
16
17 To run xpdf, simply type:
18
19 xpdf file.pdf
20
21 where file.pdf is your PDF file. The file name can be followed by a
22 number specifying the page which should be displayed first, e.g.:
23
24 xpdf file.pdf 18
25
26 You can also give a named destination, prefixed with ´+' in place of
27 the page number. (This is only useful with PDF files that provide
28 named destination targets.)
29
30 You can also start xpdf without opening any files:
31
32 xpdf
33
35 Xpdf reads a configuration file at startup. It first tries to find the
36 user's private config file, ~/.xpdfrc. If that doesn't exist, it looks
37 for a system-wide config file, typically /etc/xpdfrc (but this location
38 can be changed when xpdf is built). See the xpdfrc(5) man page for
39 details.
40
42 Many of the following options can be set with configuration file com‐
43 mands or X resources. These are listed in square brackets with the
44 description of the corresponding command line option.
45
46 -g geometry
47 Set the initial window geometry. (-geometry is equivalent.) [X
48 resource: xpdf.geometry]
49
50 -title title
51 Set the window title. By default, the title will be "xpdf:
52 foo.pdf". [X resource: xpdf.title]
53
54 -cmap Install a private colormap. This is ignored on TrueColor visu‐
55 als. [X resource: xpdf.installCmap]
56
57 -rgb number
58 Set the size of largest RGB cube xpdf will try to allocate. The
59 default is 5 (for a 5x5x5 cube); set to a smaller number to con‐
60 serve color table entries. This is ignored with private col‐
61 ormaps and on TrueColor visuals. [X resource: xpdf.rgbCubeSize]
62
63 -rv Set reverse video mode. This reverses the colors of everything
64 except images. It may not always produce great results for PDF
65 files which do weird things with color. This also causes the
66 paper color to default to black. [X resource: xpdf.reverseV‐
67 ideo]
68
69 -papercolor color
70 Set the "paper color", i.e., the background of the page display.
71 This will not work too well with PDF files that do things like
72 filling in white behind the text. [X resource: xpdf.paperColor]
73
74 -mattecolor color
75 Set the matte color, i.e., the color used for background outside
76 the actual page area. (There is a separate setting,
77 xpdf.fullScreenMatteColor, for full-screen mode.) [X resource:
78 xpdf.matteColor]
79
80 -z zoom
81 Set the initial zoom factor. A number specifies a zoom percent‐
82 age, where 100 means 72 dpi.You may also specify ´page', to fit
83 the page to the window size, or ´width', to fit the page width
84 to the window width. [config file: initialZoom; or X resource:
85 xpdf.initialZoom]
86
87 -cont Start in continuous view mode, i.e., with one vertical scroll
88 bar for the whole document. [config file: continuousView]
89
90 -t1lib yes | no
91 Enable or disable t1lib (a Type 1 font rasterizer). This
92 defaults to "yes". [config file: enableT1lib]
93
94 -freetype yes | no
95 Enable or disable FreeType (a TrueType / Type 1 font raster‐
96 izer). This defaults to "yes". [config file: enableFreeType]
97
98 -aa yes | no
99 Enable or disable font anti-aliasing. This defaults to "yes".
100 [config file: antialias]
101
102 -aaVector yes | no
103 Enable or disable vector anti-aliasing. This defaults to "yes".
104 [config file: vectorAntialias]
105
106 -ps PS-file
107 Set the default file name for PostScript output (i.e., the name
108 which will appear in the print dialog). This can also be of the
109 form ´|command' to pipe the PostScript through a command. [con‐
110 fig file: psFile]
111
112 -paper size
113 Set the paper size to one of "letter", "legal", "A4", or "A3".
114 This can also be set to "match", which will set the paper size
115 to match the size specified in the PDF file. [config file:
116 psPaperSize]
117
118 -paperw size
119 Set the paper width, in points. [config file: psPaperSize]
120
121 -paperh size
122 Set the paper height, in points. [config file: psPaperSize]
123
124 -level1
125 Generate Level 1 PostScript. The resulting PostScript files
126 will be significantly larger (if they contain images), but will
127 print on Level 1 printers. This also converts all images to
128 black and white. [config file: psLevel]
129
130 -enc encoding-name
131 Sets the encoding to use for text output. The encoding-name
132 must be defined with the unicodeMap command (see xpdfrc(5)).
133 This defaults to "Latin1" (which is a built-in encoding). [con‐
134 fig file: textEncoding]
135
136 -eol unix | dos | mac
137 Sets the end-of-line convention to use for text output. [config
138 file: textEOL]
139
140 -opw password
141 Specify the owner password for the PDF file. Providing this
142 will bypass all security restrictions.
143
144 -upw password
145 Specify the user password for the PDF file.
146
147 -fullscreen
148 Open xpdf in full-screen mode, useful for presentations.
149
150 -remote name
151 Start/contact xpdf remote server with specified name (see the
152 REMOTE SERVER MODE section below).
153
154 -exec command
155 Execute a command (see the COMMANDS section below) in an xpdf
156 remote server window (with -remote only).
157
158 -reload
159 Reload xpdf remote server window (with -remote only).
160
161 -raise Raise xpdf remote server window (with -remote only).
162
163 -quit Kill xpdf remote server (with -remote only).
164
165 -cmd Print commands as they're executed (useful for debugging).
166 [config file: printCommands]
167
168 -q Don't print any messages or errors. [config file: errQuiet]
169
170 -cfg config-file
171 Read config-file in place of ~/.xpdfrc or the system-wide config
172 file.
173
174 -v Print copyright and version information.
175
176 -h Print usage information. (-help and --help are equivalent.)
177
178 Several other standard X options and resources will work as expected:
179
180 -display display
181 [X resource: xpdf.display]
182
183 -fg color
184 (-foreground is equivalent.) [X resource: xpdf*Foreground]
185
186 -bg color
187 (-background is equivalent.) [X resource: xpdf*Background]
188
189 -font font
190 (-fn is equivalent.) [X resource: xpdf*fontList]
191
192 The color and font options only affect the user interface elements, not
193 the PDF display (the ´paper').
194
195 The following X resources do not have command line option equivalents:
196
197 xpdf.toolTipEnable
198 Enables (if set to true) or disables (if set to false) the tool-
199 tips on the toolbar buttons.
200
201 xpdf.fullScreenMatteColor
202 Sets the matte color to be used in full-screen mode. The
203 default setting is "black".
204
206 On-screen controls, at the bottom of the xpdf window
207 left/right arrow buttons
208 Move to the previous/next page.
209
210 double left/right arrow buttons
211 Move backward or forward by ten pages.
212
213 dashed left/right arrow buttons
214 Move backward or forward along the history path.
215
216 ´Page' entry box
217 Move to a specific page number. Click in the box to activate
218 it, type the page number, then hit return.
219
220 zoom popup menu
221 Change the zoom factor (see the description of the -z option
222 above).
223
224 binoculars button
225 Find a text string.
226
227 print button
228 Bring up a dialog for generating a PostScript file. The dialog
229 has options to set the pages to be printed and the PostScript
230 file name. The file name can be ´-' for stdout or ´|command' to
231 pipe the PostScript through a command, e.g., ´|lpr'.
232
233 ´?' button
234 Bring up the ´about xpdf' window.
235
236 link info
237 The space between the ´?' and ´Quit' buttons is used to show the
238 URL or external file name when the mouse is over a link.
239
240 ´Quit' button
241 Quit xpdf.
242
243 Menu
244 Pressing the right mouse button will post a popup menu with the follow‐
245 ing commands:
246
247 Open...
248 Open a new PDF file via a file requester.
249
250 Open in new window...
251 Create a new window and open a new PDF file via a file
252 requester.
253
254 Reload Reload the current PDF file. Note that Xpdf will reload the
255 file automatically (on a page change or redraw) if it has
256 changed since it was last loaded.
257
258 Save as...
259 Save the current file via a file requester.
260
261 Continuous view
262 Toggles between single page and continuous view modes.
263
264 Rotate counterclockwise
265 Rotate the page 90 degrees counterclockwise.
266
267 Rotate clockwise
268 Rotate the page 90 degrees clockwise. The two rotate commands
269 are intended primarily for PDF files where the rotation isn't
270 correctly specified in the file.
271
272 Zoom to selection
273 Zoom in to the currently selected rectangle.
274
275 Close Close the current window. If this is the only open window, the
276 document is closed, but the window is left open (i.e., this menu
277 command won't quit xpdf).
278
279 Quit Quit xpdf.
280
281 Outline
282 If the PDF contains an outline (a.k.a., bookmarks), there will be an
283 outline pane on the left side of the window. The width of the outline
284 pane is adjustable with a vertical split bar via the knob near its bot‐
285 tom end.
286
287 Text selection
288 Dragging the mouse with the left button held down will highlight an
289 arbitrary rectangle. Any text inside this rectangle will be copied to
290 the X selection buffer.
291
292 Links
293 Clicking on a hyperlink will jump to the link's destination. A link to
294 another PDF document will make xpdf load that document. A ´launch'
295 link to an executable program will display a dialog, and if you click
296 ´ok', execute the program. URL links call an external command (see the
297 WEB BROWSERS section below).
298
299 Panning
300 Dragging the mouse with the middle button held down pans the window.
301
302 Key bindings
303 o Open a new PDF file via a file requester.
304
305 r Reload the current PDF file. Note that Xpdf will reload the
306 file automatically (on a page change or redraw) if it has
307 changed since it was last loaded.
308
309 control-L
310 Redraw the current page.
311
312 control-W
313 Close the current window.
314
315 f or control-F
316 Find a text string.
317
318 control-G
319 Find next occurrence.
320
321 control-P
322 Print.
323
324 n Move to the next page. Scrolls to the top of the page, unless
325 scroll lock is turned on.
326
327 p Move to the previous page. Scrolls to the top of the page,
328 unless scroll lock is turned on.
329
330 <Space> or <PageDown> or <Next>
331 Scroll down on the current page; if already at bottom, move to
332 next page.
333
334 <Backspace> or <Delete> or <PageUp> or <Previous>
335 Scroll up on the current page; if already at top, move to previ‐
336 ous page.
337
338 v Move forward along the history path.
339
340 b Move backward along the history path.
341
342 <Home> Scroll to top of current page.
343
344 <End> Scroll to bottom of current page.
345
346 control-<Home>
347 Scroll to first page of document.
348
349 control-<End>
350 Scroll to last page of document.
351
352 arrows Scroll the current page.
353
354 g Activate the page number text field ("goto page").
355
356 0 Set the zoom factor to 125%.
357
358 + Zoom in (increment the zoom factor by 1).
359
360 - Zoom out (decrement the zoom factor by 1).
361
362 z Set the zoom factor to 'page' (fit page to window).
363
364 w Set the zoom factor to 'width' (fit page width to window).
365
366 alt-F Toggle full-screen mode.
367
368 q Quit xpdf.
369
371 If you want to run xpdf automatically from netscape or mosaic (and
372 probably other browsers) when you click on a link to a PDF file, you
373 need to edit (or create) the files .mime.types and .mailcap in your
374 home directory. In .mime.types add the line:
375
376 application/pdf pdf
377
378 In .mailcap add the lines:
379
380 # Use xpdf to view PDF files.
381 application/pdf; xpdf -q %s
382
383 Make sure that xpdf is on your executable search path.
384
385 When you click on a URL link in a PDF file, xpdf will execute the com‐
386 mand specified by the urlCommand config file option, replacing an
387 occurrence of ´%s' with the URL. For example, to call netscape with
388 the URL, add this line to your config file:
389
390 urlCommand "netscape -remote 'openURL(%s)'"
391
393 Xpdf's key and mouse bindings are user-configurable, using the bind and
394 unbind options in the config file (see xpdfrc(5)). The bind command
395 allows you to bind a key or mouse button to a sequence of one or more
396 commands.
397
398 Available Commands
399 The following commands are supported:
400
401 gotoPage(page)
402 Go to the specified page.
403
404 gotoPageNoScroll(page)
405 Go to the specified page, with the current relative scroll posi‐
406 tion.
407
408 gotoDest(dest)
409 Go to a named destination.
410
411 gotoLastPage
412 Go to the last page in the PDF file.
413
414 gotoLastPageNoScroll
415 Go to the last page in the PDF file, with the current relative
416 scroll position.
417
418 nextPage
419 Go to the next page.
420
421 nextPageNoScroll
422 Go to the next page, with the current relative scroll position.
423
424 prevPage
425 Go to the previous page.
426
427 prevPageNoScroll
428 Go to the previous page, with the current relative scroll posi‐
429 tion.
430
431 pageUp Scroll up by one screenful.
432
433 pageDown
434 Scroll down by one screenful.
435
436 scrollLeft(n)
437 Scroll left by n pixels.
438
439 scrollRight(n)
440 Scroll right by n pixels.
441
442 scrollUp(n)
443 Scroll up by n pixels.
444
445 scrollDown(n)
446 Scroll down by n pixels.
447
448 scrollUpPrevPage(n)
449 Scroll up by n pixels, moving to the previous page if appropri‐
450 ate.
451
452 scrollDownPrevPage(n)
453 Scroll down by n pixels, moving to the next page if appropriate.
454
455 scrollToTopEdge
456 Scroll to the top edge of the current page, with no horizontal
457 movement.
458
459 scrollToBottomEdge
460 Scroll to the bottom edge of the current page, with no horizon‐
461 tal movement.
462
463 scrollToLeftEdge
464 Scroll to the left edge of the current page, with no vertical
465 movement.
466
467 scrollToRightEdge
468 Scroll to the right edge of the current page, with no vertical
469 movement.
470
471 scrollToTopLeft
472 Scroll to the top-left corner of the current page.
473
474 scrollToBottomRight
475 Scroll to the bottom-right corner of the current page.
476
477 goForward
478 Move forward along the history path.
479
480 goBackward
481 Move backward along the history path.
482
483 zoomPercent(z)
484 Set the zoom factor to z%.
485
486 zoomFitPage
487 Set the zoom factor to fit-page.
488
489 zoomFitWidth
490 Set the zoom factor to fit-width.
491
492 zoomIn Zoom in - go to the next higher zoom factor.
493
494 zoomOut
495 Zoom out - go the next lower zoom factor.
496
497 continuousMode
498 Go to continuous view mode.
499
500 singlePageMode
501 Go to single-page view mode.
502
503 toggleContinuousMode
504 Toggle between continuous and single page view modes.
505
506 fullScreenMode
507 Go to full-screen mode.
508
509 windowMode
510 Go to window (non-full-screen) mode.
511
512 toggleFullScreenMode
513 Toggle between full-screen and window modes.
514
515 open Open a PDF file in this window, using the open dialog.
516
517 openInNewWin
518 Open a PDF file in a new window, using the open dialog.
519
520 openFile(file)
521 Open a specified PDF file in this window.
522
523 openFileInNewWin(file)
524 Open a specified PDF file in a new window.
525
526 openFileAtDest(file,dest)
527 Open a specified PDF file in this window and go to a named des‐
528 tination.
529
530 openFileAtDestInNewWin(file,dest)
531 Open a specified PDF file in a new window and go to a named des‐
532 tination.
533
534 reload Reload the current PDF file.
535
536 redraw Redraw the window.
537
538 raise Raise the window to the front.
539
540 closeWindow
541 Close the window.
542
543 run(external-command-string)
544 Run an external command. The following escapes are allowed in
545 the command string:
546
547 %f => PDF file name (or an empty string if no
548 file is open)
549 %b => PDF file base name, i.e., file name minus
550 the extension (or an empty string if no
551 file is open)
552 %u => link URL (or an empty string if not over
553 a URL link)
554 %x => selection upper-left x coordinate
555 (or 0 if there is no selection)
556 %y => selection upper-left y coordinate
557 (or 0 if there is no selection)
558 %X => selection lower-right x coordinate
559 (or 0 if there is no selection)
560 %Y => selection lower-right y coordinate
561 (or 0 if there is no selection)
562 %% => %
563
564
565 openOutline
566 Open the outline pane.
567
568 closeOutline
569 Close the outline pane.
570
571 toggleOutline
572 Toggle the outline pane between open and closed.
573
574 scrollOutlineDown(n)
575 Scroll the outline down by n increments.
576
577 scrollOutlineUp(n)
578 Scroll the outline up by n increments.
579
580 focusToDocWin
581 Set the keyboard focus to the main document window.
582
583 focusToPageNum
584 Set the keyboard focus to the page number text box.
585
586 find Open the 'find' dialog.
587
588 findNext
589 Finds the next occurrence of the search string (no dialog).
590
591 print Open the 'print' dialog.
592
593 about Open the 'about' dialog.
594
595 quit Quit from xpdf.
596
597 The following commands depend on the current mouse position:
598
599 startSelection
600 Start a selection, which will be extended as the mouse moves.
601
602 endSelection
603 End a selection.
604
605 startPan
606 Start a pan, which will scroll the document as the mouse moves
607
608 endPan End a pan.
609
610 postPopupMenu
611 Display the popup menu.
612
613 followLink
614 Follow a hyperlink (does nothing if the mouse is not over a
615 link).
616
617 followLinkInNewWin
618 Follow a hyperlink, opening PDF files in a new window (does
619 nothing if the mouse is not over a link). For links to non-PDF
620 files, this command is identical to followLink.
621
622 followLinkNoSel
623 Same as followLink, but does nothing if there is a non-empty
624 selection. (This is useful as a mouse button binding.)
625
626 followLinkInNewWinNoSel
627 Same as followLinkInNewWin, but does nothing if there is a non-
628 empty selection. (This is useful as a mouse button binding.)
629
630 Default Bindings
631 The default mouse bindings are as follows:
632
633 bind mousePress1 any startSelection
634 bind mouseRelease1 any endSelection followLinkNoSel
635 bind mousePress2 any startPan
636 bind mouseRelease2 any endPan
637 bind mousePress3 any postPopupMenu
638 bind mousePress4 any scrollUpPrevPage(16)
639 bind mousePress5 any scrollDownNextPage(16)
640 bind mousePress6 any scrollLeft(16)
641 bind mousePress7 any scrollRight(16)
642
643 The default key bindings are as follows:
644
645 bind ctrl-home any gotoPage(1)
646 bind home any scrollToTopLeft
647 bind ctrl-end any gotoLastPage
648 bind end any scrollToBottomRight
649 bind pgup any pageUp
650 bind backspace any pageUp
651 bind delete any pageUp
652 bind pgdn any pageDown
653 bind space any pageDown
654 bind left any scrollLeft(16)
655 bind right any scrollRight(16)
656 bind up any scrollUp(16)
657 bind down any scrollDown(16)
658 bind o any open
659 bind O any open
660 bind r any reload
661 bind R any reload
662 bind f any find
663 bind F any find
664 bind ctrl-f any find
665 bind ctrl-g any findNext
666 bind ctrl-p any print
667 bind n scrLockOff nextPage
668 bind N scrLockOff nextPage
669 bind n scrLockOn nextPageNoScroll
670 bind N scrLockOn nextPageNoScroll
671 bind p scrLockOff prevPage
672 bind P scrLockOff prevPage
673 bind p scrLockOn prevPageNoScroll
674 bind P scrLockOn prevPageNoScroll
675 bind v any goForward
676 bind b any goBackward
677 bind g any focusToPageNum
678 bind 0 any zoomPercent(125)
679 bind + any zoomIn
680 bind - any zoomOut
681 bind z any zoomFitPage
682 bind w any zoomFitWidth
683 bind alt-f any toggleFullScreenMode
684 bind ctrl-l any redraw
685 bind ctrl-w any closeWindow
686 bind ? any about
687 bind q any quit
688 bind Q any quit
689
690 Previous versions of xpdf included a "viKeys" X resource. It is no
691 longer available, but the following bindings are equivalent:
692
693 bind h any scrollLeft(16)
694 bind l any scrollRight(16)
695 bind k any scrollUp(16)
696 bind j any scrollDown(16)
697
698
700 Xpdf can be started in remote server mode by specifying a server name
701 (in addition to the file name and page number). For example:
702
703 xpdf -remote myServer file.pdf
704
705 If there is currently no xpdf running in server mode with the name
706 ´myServer', a new xpdf window will be opened. If another command:
707
708 xpdf -remote myServer another.pdf 9
709
710 is issued, a new copy of xpdf will not be started. Instead, the first
711 xpdf (the server) will load another.pdf and display page nine. If the
712 file name is the same:
713
714 xpdf -remote myServer another.pdf 4
715
716 the xpdf server will simply display the specified page.
717
718 The -raise option tells the server to raise its window; it can be spec‐
719 ified with or without a file name and page number.
720
721 The -quit option tells the server to close its window and exit.
722
724 The Xpdf tools use the following exit codes:
725
726 0 No error.
727
728 1 Error opening a PDF file.
729
730 2 Error opening an output file.
731
732 3 Error related to PDF permissions.
733
734 99 Other error.
735
737 The xpdf software and documentation are copyright 1996-2007 Glyph &
738 Cog, LLC.
739
741 pdftops(1), pdftotext(1), pdfinfo(1), pdffonts(1), pdftoppm(1), pdfim‐
742 ages(1), xpdfrc(5)
743 http://www.foolabs.com/xpdf/
744
745
746
747 27 February 2007 xpdf(1)