1xpdf(1) General Commands Manual xpdf(1)
2
3
4
6 xpdf - Portable Document Format (PDF) file viewer for X (version 3.03)
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
83 fit the page to the window size, or ´width', to fit the page
84 width to the window width. [config file: initialZoom; or X
85 resource: 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 rotateCW
498 Rotate the page 90 degrees clockwise.
499
500 rotateCCW
501 Rotate the page 90 degrees counterclockwise.
502
503 setSelection(pg,ulx,uly,lrx,lry)
504 Set the selection to the specified coordinates on the specified
505 page.
506
507 continuousMode
508 Go to continuous view mode.
509
510 singlePageMode
511 Go to single-page view mode.
512
513 toggleContinuousMode
514 Toggle between continuous and single page view modes.
515
516 fullScreenMode
517 Go to full-screen mode.
518
519 windowMode
520 Go to window (non-full-screen) mode.
521
522 toggleFullScreenMode
523 Toggle between full-screen and window modes.
524
525 open Open a PDF file in this window, using the open dialog.
526
527 openInNewWin
528 Open a PDF file in a new window, using the open dialog.
529
530 openFile(file)
531 Open a specified PDF file in this window.
532
533 openFileInNewWin(file)
534 Open a specified PDF file in a new window.
535
536 openFileAtDest(file,dest)
537 Open a specified PDF file in this window and go to a named des‐
538 tination.
539
540 openFileAtDestInNewWin(file,dest)
541 Open a specified PDF file in a new window and go to a named des‐
542 tination.
543
544 reload Reload the current PDF file.
545
546 redraw Redraw the window.
547
548 raise Raise the window to the front.
549
550 closeWindow
551 Close the window.
552
553 run(external-command-string)
554 Run an external command. The following escapes are allowed in
555 the command string:
556
557 %f => PDF file name (or an empty string if no
558 file is open)
559 %b => PDF file base name, i.e., file name minus
560 the extension (or an empty string if no
561 file is open)
562 %u => link URL (or an empty string if not over
563 a URL link)
564 %p => current page number (or an empty string if
565 no file is open)
566 %x => selection upper-left x coordinate
567 (or 0 if there is no selection)
568 %y => selection upper-left y coordinate
569 (or 0 if there is no selection)
570 %X => selection lower-right x coordinate
571 (or 0 if there is no selection)
572 %Y => selection lower-right y coordinate
573 (or 0 if there is no selection)
574 %i => page containing the mouse pointer
575 %j => x coordinate of the mouse pointer
576 %k => y coordinate of the mouse pointer
577 %% => %
578
579
580 openOutline
581 Open the outline pane.
582
583 closeOutline
584 Close the outline pane.
585
586 toggleOutline
587 Toggle the outline pane between open and closed.
588
589 scrollOutlineDown(n)
590 Scroll the outline down by n increments.
591
592 scrollOutlineUp(n)
593 Scroll the outline up by n increments.
594
595 focusToDocWin
596 Set the keyboard focus to the main document window.
597
598 focusToPageNum
599 Set the keyboard focus to the page number text box.
600
601 find Open the 'find' dialog.
602
603 findNext
604 Finds the next occurrence of the search string (no dialog).
605
606 print Open the 'print' dialog.
607
608 about Open the 'about' dialog.
609
610 quit Quit from xpdf.
611
612 The following commands depend on the current mouse position:
613
614 startSelection
615 Start a selection, which will be extended as the mouse moves.
616
617 endSelection
618 End a selection.
619
620 startPan
621 Start a pan, which will scroll the document as the mouse moves
622
623 endPan End a pan.
624
625 postPopupMenu
626 Display the popup menu.
627
628 followLink
629 Follow a hyperlink (does nothing if the mouse is not over a
630 link).
631
632 followLinkInNewWin
633 Follow a hyperlink, opening PDF files in a new window (does
634 nothing if the mouse is not over a link). For links to non-PDF
635 files, this command is identical to followLink.
636
637 followLinkNoSel
638 Same as followLink, but does nothing if there is a non-empty
639 selection. (This is useful as a mouse button binding.)
640
641 followLinkInNewWinNoSel
642 Same as followLinkInNewWin, but does nothing if there is a non-
643 empty selection. (This is useful as a mouse button binding.)
644
645 Default Bindings
646 The default mouse bindings are as follows:
647
648 bind mousePress1 any startSelection
649 bind mouseRelease1 any endSelection followLinkNoSel
650 bind mousePress2 any startPan
651 bind mouseRelease2 any endPan
652 bind mousePress3 any postPopupMenu
653 bind mousePress4 any scrollUpPrevPage(16)
654 bind mousePress5 any scrollDownNextPage(16)
655 bind mousePress6 any scrollLeft(16)
656 bind mousePress7 any scrollRight(16)
657
658 The default key bindings are as follows:
659
660 bind ctrl-home any gotoPage(1)
661 bind home any scrollToTopLeft
662 bind ctrl-end any gotoLastPage
663 bind end any scrollToBottomRight
664 bind pgup any pageUp
665 bind backspace any pageUp
666 bind delete any pageUp
667 bind pgdn any pageDown
668 bind space any pageDown
669 bind left any scrollLeft(16)
670 bind right any scrollRight(16)
671 bind up any scrollUp(16)
672 bind down any scrollDown(16)
673 bind o any open
674 bind O any open
675 bind r any reload
676 bind R any reload
677 bind f any find
678 bind F any find
679 bind ctrl-f any find
680 bind ctrl-g any findNext
681 bind ctrl-p any print
682 bind n scrLockOff nextPage
683 bind N scrLockOff nextPage
684 bind n scrLockOn nextPageNoScroll
685 bind N scrLockOn nextPageNoScroll
686 bind p scrLockOff prevPage
687 bind P scrLockOff prevPage
688 bind p scrLockOn prevPageNoScroll
689 bind P scrLockOn prevPageNoScroll
690 bind v any goForward
691 bind b any goBackward
692 bind g any focusToPageNum
693 bind 0 any zoomPercent(125)
694 bind + any zoomIn
695 bind - any zoomOut
696 bind z any zoomFitPage
697 bind w any zoomFitWidth
698 bind alt-f any toggleFullScreenMode
699 bind ctrl-l any redraw
700 bind ctrl-w any closeWindow
701 bind ? any about
702 bind q any quit
703 bind Q any quit
704
705 Previous versions of xpdf included a "viKeys" X resource. It is no
706 longer available, but the following bindings are equivalent:
707
708 bind h any scrollLeft(16)
709 bind l any scrollRight(16)
710 bind k any scrollUp(16)
711 bind j any scrollDown(16)
712
713
715 Xpdf can be started in remote server mode by specifying a server name
716 (in addition to the file name and page number). For example:
717
718 xpdf -remote myServer file.pdf
719
720 If there is currently no xpdf running in server mode with the name
721 ´myServer', a new xpdf window will be opened. If another command:
722
723 xpdf -remote myServer another.pdf 9
724
725 is issued, a new copy of xpdf will not be started. Instead, the first
726 xpdf (the server) will load another.pdf and display page nine. If the
727 file name is the same:
728
729 xpdf -remote myServer another.pdf 4
730
731 the xpdf server will simply display the specified page.
732
733 The -raise option tells the server to raise its window; it can be spec‐
734 ified with or without a file name and page number.
735
736 The -quit option tells the server to close its window and exit.
737
739 The Xpdf tools use the following exit codes:
740
741 0 No error.
742
743 1 Error opening a PDF file.
744
745 2 Error opening an output file.
746
747 3 Error related to PDF permissions.
748
749 99 Other error.
750
752 The xpdf software and documentation are copyright 1996-2011 Glyph &
753 Cog, LLC.
754
756 pdftops(1), pdftotext(1), pdfinfo(1), pdffonts(1), pdfdetach(1),
757 pdftoppm(1), pdfimages(1), xpdfrc(5)
758 http://www.foolabs.com/xpdf/
759
760
761
762 15 August 2011 xpdf(1)