Fix for the problem that SDL applications exited
[AROS-Contrib.git] / arospdf / doc / xpdf.1
blob654855717c05bd15f7f4434d6e9f0931db0eb92f
1 .\" Copyright 1996-2007 Glyph & Cog, LLC
2 .TH xpdf 1 "27 February 2007"
3 .SH NAME
4 xpdf \- Portable Document Format (PDF) file viewer for X (version 3.02)
5 .SH SYNOPSIS
6 .B xpdf
7 [options]
8 .RI [ PDF-file
9 .RI [ page " | +" dest ]]
10 .SH DESCRIPTION
11 .B Xpdf
12 is a viewer for Portable Document Format (PDF) files.  (These are also
13 sometimes also called \'Acrobat' files, from the name of Adobe's PDF
14 software.)  Xpdf runs under the X Window System on UNIX, VMS, and
15 OS/2.
16 .PP
17 To run xpdf, simply type:
18 .PP
19 .RS
20 xpdf file.pdf
21 .RE
22 .PP
23 where
24 .I file.pdf
25 is your PDF file.  The file name can be followed by a number
26 specifying the page which should be displayed first, e.g.:
27 .PP
28 .RS
29 xpdf file.pdf 18
30 .RE
31 .PP
32 You can also give a named destination, prefixed with \'+' in place of
33 the page number.  (This is only useful with PDF files that provide
34 named destination targets.)
35 .PP
36 You can also start xpdf without opening any files:
37 .PP
38 .RS
39 xpdf
40 .RE
41 .SH CONFIGURATION FILE
42 Xpdf reads a configuration file at startup.  It first tries to find
43 the user's private config file, ~/.xpdfrc.  If that doesn't exist, it
44 looks for a system-wide config file, typically /usr/local/etc/xpdfrc
45 (but this location can be changed when xpdf is built).  See the
46 .BR xpdfrc (5)
47 man page for details.
48 .SH OPTIONS
49 Many of the following options can be set with configuration file
50 commands or X resources.  These are listed in square brackets with the
51 description of the corresponding command line option.
52 .TP
53 .BI \-g " geometry"
54 Set the initial window geometry.
55 .RB ( \-geometry
56 is equivalent.)
57 .RB "[X resource: " xpdf.geometry ]
58 .TP
59 .BI \-title " title"
60 Set the window title.  By default, the title will be "xpdf: foo.pdf".
61 .RB "[X resource: " xpdf.title ]
62 .TP
63 .B \-cmap
64 Install a private colormap.  This is ignored on TrueColor visuals.
65 .RB "[X resource: " xpdf.installCmap ]
66 .TP
67 .BI \-rgb " number"
68 Set the size of largest RGB cube xpdf will try to allocate.  The
69 default is 5 (for a 5x5x5 cube); set to a smaller number to conserve
70 color table entries.  This is ignored with private colormaps and on
71 TrueColor visuals.
72 .RB "[X resource: " xpdf.rgbCubeSize ]
73 .TP
74 .B \-rv
75 Set reverse video mode.  This reverses the colors of everything except
76 images.  It may not always produce great results for PDF files which
77 do weird things with color.  This also causes the paper color to
78 default to black.
79 .RB "[X resource: " xpdf.reverseVideo ]
80 .TP
81 .BI \-papercolor " color"
82 Set the "paper color", i.e., the background of the page display.  This
83 will not work too well with PDF files that do things like filling in
84 white behind the text.
85 .RB "[X resource: " xpdf.paperColor ]
86 .TP
87 .BI \-mattecolor " color"
88 Set the matte color, i.e., the color used for background outside the
89 actual page area.  (There is a separate setting,
90 xpdf.fullScreenMatteColor, for full-screen mode.)
91 .RB "[X resource: " xpdf.matteColor ]
92 .TP
93 .BI \-z " zoom"
94 Set the initial zoom factor.  A number specifies a zoom percentage,
95 where 100 means 72 dpi.You may also specify \'page', to fit the page
96 to the window size, or \'width', to fit the page width to the window
97 width.
98 .RB "[config file: " initialZoom "; or X resource: " xpdf.initialZoom ]
99 .TP
100 .B \-cont
101 Start in continuous view mode, i.e., with one vertical scroll bar for
102 the whole document.
103 .RB "[config file: " continuousView ]
105 .BI \-t1lib " yes | no"
106 Enable or disable t1lib (a Type 1 font rasterizer).  This defaults to
107 "yes".
108 .RB "[config file: " enableT1lib ]
110 .BI \-freetype " yes | no"
111 Enable or disable FreeType (a TrueType / Type 1 font rasterizer).
112 This defaults to "yes".
113 .RB "[config file: " enableFreeType ]
115 .BI \-aa " yes | no"
116 Enable or disable font anti-aliasing.  This defaults to "yes".
117 .RB "[config file: " antialias ]
119 .BI \-aaVector " yes | no"
120 Enable or disable vector anti-aliasing.  This defaults to "yes".
121 .RB "[config file: " vectorAntialias ]
123 .BI \-ps " PS-file"
124 Set the default file name for PostScript output (i.e., the name which
125 will appear in the print dialog).  This can also be of the form
126 \'|command' to pipe the PostScript through a command.
127 .RB "[config file: " psFile ]
129 .BI \-paper " size"
130 Set the paper size to one of "letter", "legal", "A4", or "A3".  This
131 can also be set to "match", which will set the paper size to match the
132 size specified in the PDF file.
133 .RB "[config file: " psPaperSize ]
135 .BI \-paperw " size"
136 Set the paper width, in points.
137 .RB "[config file: " psPaperSize ]
139 .BI \-paperh " size"
140 Set the paper height, in points.
141 .RB "[config file: " psPaperSize ]
143 .B \-level1
144 Generate Level 1 PostScript.  The resulting PostScript files will be
145 significantly larger (if they contain images), but will print on Level
146 1 printers.  This also converts all images to black and white.
147 .RB "[config file: " psLevel ]
149 .BI \-enc " encoding-name"
150 Sets the encoding to use for text output.  The
151 .I encoding\-name
152 must be defined with the unicodeMap command (see
153 .BR xpdfrc (5)).
154 This defaults to "Latin1" (which is a built-in encoding).
155 .RB "[config file: " textEncoding ]
157 .BI \-eol " unix | dos | mac"
158 Sets the end-of-line convention to use for text output.
159 .RB "[config file: " textEOL ]
161 .BI \-opw " password"
162 Specify the owner password for the PDF file.  Providing this will
163 bypass all security restrictions.
165 .BI \-upw " password"
166 Specify the user password for the PDF file.
168 .B \-fullscreen
169 Open xpdf in full-screen mode, useful for presentations.
171 .BI \-remote " name"
172 Start/contact xpdf remote server with specified name (see the
173 .B "REMOTE SERVER MODE"
174 section below).
176 .BI \-exec " command"
177 Execute a command (see the
178 .B COMMANDS
179 section below) in an xpdf remote server window (with -remote only).
181 .B \-reload
182 Reload xpdf remote server window (with -remote only).
184 .B \-raise
185 Raise xpdf remote server window (with -remote only).
187 .B \-quit
188 Kill xpdf remote server (with -remote only).
190 .B \-cmd
191 Print commands as they're executed (useful for debugging).
192 .RB "[config file: " printCommands ]
194 .B \-q
195 Don't print any messages or errors.
196 .RB "[config file: " errQuiet ]
198 .BI \-cfg " config-file"
199 Read
200 .I config-file
201 in place of ~/.xpdfrc or the system-wide config file.
203 .B \-v
204 Print copyright and version information.
206 .B \-h
207 Print usage information.
208 .RB ( \-help
210 .B \-\-help
211 are equivalent.)
213 Several other standard X options and resources will work as expected:
215 .BI \-display " display"
216 .RB "[X resource: " xpdf.display ]
218 .BI \-fg " color"
219 .RB ( \-foreground
220 is equivalent.)
221 .RB "[X resource: " xpdf*Foreground ]
223 .BI \-bg " color"
224 .RB ( \-background
225 is equivalent.)
226 .RB "[X resource: " xpdf*Background ]
228 .BI \-font " font"
229 .RB ( \-fn
230 is equivalent.)
231 .RB "[X resource: " xpdf*fontList ]
233 The color and font options only affect the user interface elements,
234 not the PDF display (the \'paper').
236 The following X resources do not have command line option equivalents:
238 .B xpdf.toolTipEnable
239 Enables (if set to true) or disables (if set to false) the tool-tips
240 on the toolbar buttons.
242 .B xpdf.fullScreenMatteColor
243 Sets the matte color to be used in full-screen mode.  The default
244 setting is "black".
245 .SH CONTROLS
246 .SS On-screen controls, at the bottom of the xpdf window
248 .B "left/right arrow buttons"
249 Move to the previous/next page.
251 .B "double left/right arrow buttons"
252 Move backward or forward by ten pages.
254 .B "dashed left/right arrow buttons"
255 Move backward or forward along the history path.
257 .B "\'Page' entry box"
258 Move to a specific page number.  Click in the box to activate it, type
259 the page number, then hit return.
261 .B "zoom popup menu"
262 Change the zoom factor (see the description of the -z option above).
264 .B "binoculars button"
265 Find a text string.
267 .B "print button"
268 Bring up a dialog for generating a PostScript file.  The dialog has
269 options to set the pages to be printed and the PostScript file name.
270 The file name can be \'-' for stdout or \'|command' to pipe the
271 PostScript through a command, e.g., \'|lpr'.
273 .B "\'?' button"
274 Bring up the \'about xpdf' window.
276 .B "link info"
277 The space between the \'?' and \'Quit' buttons is used to show the URL
278 or external file name when the mouse is over a link.
280 .B "\'Quit' button"
281 Quit xpdf.
283 .SS Menu
284 Pressing the right mouse button will post a popup menu with the
285 following commands:
287 .B "Open..."
288 Open a new PDF file via a file requester.
290 .B "Open in new window..."
291 Create a new window and open a new PDF file via a file requester.
293 .B "Reload"
294 Reload the current PDF file.  Note that Xpdf will reload the file
295 automatically (on a page change or redraw) if it has changed since it
296 was last loaded.
298 .B "Save as..."
299 Save the current file via a file requester.
301 .B "Continuous view"
302 Toggles between single page and continuous view modes.
304 .B "Rotate counterclockwise"
305 Rotate the page 90 degrees counterclockwise.
307 .B "Rotate clockwise"
308 Rotate the page 90 degrees clockwise.  The two rotate commands are
309 intended primarily for PDF files where the rotation isn't correctly
310 specified in the file.
312 .B "Zoom to selection"
313 Zoom in to the currently selected rectangle.
315 .B "Close"
316 Close the current window.  If this is the only open window, the
317 document is closed, but the window is left open (i.e., this menu
318 command won't quit xpdf).
320 .B "Quit"
321 Quit xpdf.
323 .SS Outline
324 If the PDF contains an outline (a.k.a., bookmarks), there will be an
325 outline pane on the left side of the window.  The width of the outline
326 pane is adjustable with a vertical split bar via the knob near its
327 bottom end.
329 .SS Text selection
330 Dragging the mouse with the left button held down will highlight an
331 arbitrary rectangle.  Any text inside this rectangle will be copied to
332 the X selection buffer.
334 .SS Links
335 Clicking on a hyperlink will jump to the link's destination.  A link
336 to another PDF document will make xpdf load that document.  A
337 \'launch' link to an executable program will display a dialog, and if
338 you click \'ok', execute the program.  URL links call an external
339 command (see the
340 .B WEB BROWSERS
341 section below).
343 .SS Panning
344 Dragging the mouse with the middle button held down pans the window.
346 .SS Key bindings
348 .B o
349 Open a new PDF file via a file requester.
351 .B r
352 Reload the current PDF file.  Note that Xpdf will reload the file
353 automatically (on a page change or redraw) if it has changed since it
354 was last loaded.
356 .B control-L
357 Redraw the current page.
359 .B control-W
360 Close the current window.
362 .B f or control-F
363 Find a text string.
365 .B control-G
366 Find next occurrence.
368 .B control-P
369 Print.
371 .B n
372 Move to the next page.  Scrolls to the top of the page, unless scroll
373 lock is turned on.
375 .B p
376 Move to the previous page.  Scrolls to the top of the page, unless
377 scroll lock is turned on.
379 .BR <Space> " or " <PageDown> " or " <Next>
380 Scroll down on the current page; if already at bottom, move to next
381 page.
383 .BR <Backspace> " or " <Delete> " or " <PageUp> " or " <Previous>
384 Scroll up on the current page; if already at top, move to previous
385 page.
387 .B v
388 Move forward along the history path.
390 .B b
391 Move backward along the history path.
393 .B <Home>
394 Scroll to top of current page.
396 .B <End>
397 Scroll to bottom of current page.
399 .B control-<Home>
400 Scroll to first page of document.
402 .B control-<End>
403 Scroll to last page of document.
405 .B arrows
406 Scroll the current page.
408 .B g
409 Activate the page number text field ("goto page").
411 .B 0
412 Set the zoom factor to 125%.
414 .B +
415 Zoom in (increment the zoom factor by 1).
417 .B -
418 Zoom out (decrement the zoom factor by 1).
420 .B z
421 Set the zoom factor to 'page' (fit page to window).
423 .B w
424 Set the zoom factor to 'width' (fit page width to window).
426 .B alt-F
427 Toggle full-screen mode.
429 .B q
430 Quit xpdf.
431 .SH "WEB BROWSERS"
432 If you want to run xpdf automatically from netscape or mosaic (and
433 probably other browsers) when you click on a link to a PDF file, you
434 need to edit (or create) the files
435 .I .mime.types
437 .I .mailcap
438 in your home directory.  In
439 .I .mime.types
440 add the line:
443 application/pdf pdf
447 .I .mailcap
448 add the lines:
451 # Use xpdf to view PDF files.
454 application/pdf; xpdf -q %s
457 Make sure that xpdf is on your executable search path.
459 When you click on a URL link in a PDF file, xpdf will execute the
460 command specified by the urlCommand config file option, replacing an
461 occurrence of \'%s' with the URL.  For example, to call netscape with
462 the URL, add this line to your config file:
465 urlCommand "netscape -remote 'openURL(%s)'"
467 .SH COMMANDS
468 Xpdf's key and mouse bindings are user-configurable, using the bind and
469 unbind options in the config file (see
470 .BR xpdfrc (5)).
471 The bind command allows you to bind a key or mouse button to a
472 sequence of one or more commands.
473 .SS Available Commands
474 The following commands are supported:
476 .BI gotoPage( page )
477 Go to the specified page.
479 .BI gotoPageNoScroll( page )
480 Go to the specified page, with the current relative scroll position.
482 .BI gotoDest( dest )
483 Go to a named destination.
485 .B gotoLastPage
486 Go to the last page in the PDF file.
488 .B gotoLastPageNoScroll
489 Go to the last page in the PDF file, with the current relative scroll
490 position.
492 .B nextPage
493 Go to the next page.
495 .B nextPageNoScroll
496 Go to the next page, with the current relative scroll position.
498 .B prevPage
499 Go to the previous page.
501 .B prevPageNoScroll
502 Go to the previous page, with the current relative scroll position.
504 .B pageUp
505 Scroll up by one screenful.
507 .B pageDown
508 Scroll down by one screenful.
510 .BI scrollLeft( n )
511 Scroll left by
512 .I n
513 pixels.
515 .BI scrollRight( n )
516 Scroll right by
517 .I n
518 pixels.
520 .BI scrollUp( n )
521 Scroll up by
522 .I n
523 pixels.
525 .BI scrollDown( n )
526 Scroll down by
527 .I n
528 pixels.
530 .BI scrollUpPrevPage( n )
531 Scroll up by
532 .I n
533 pixels, moving to the previous page if appropriate.
535 .BI scrollDownPrevPage( n )
536 Scroll down by
537 .I n
538 pixels, moving to the next page if appropriate.
540 .B scrollToTopEdge
541 Scroll to the top edge of the current page, with no horizontal
542 movement.
544 .B scrollToBottomEdge
545 Scroll to the bottom edge of the current page, with no horizontal
546 movement.
548 .B scrollToLeftEdge
549 Scroll to the left edge of the current page, with no vertical
550 movement.
552 .B scrollToRightEdge
553 Scroll to the right edge of the current page, with no vertical
554 movement.
556 .B scrollToTopLeft
557 Scroll to the top-left corner of the current page.
559 .B scrollToBottomRight
560 Scroll to the bottom-right corner of the current page.
562 .B goForward
563 Move forward along the history path.
565 .B goBackward
566 Move backward along the history path.
568 .BI zoomPercent( z )
569 Set the zoom factor to
570 .IR z %.
572 .B zoomFitPage
573 Set the zoom factor to fit-page.
575 .B zoomFitWidth
576 Set the zoom factor to fit-width.
578 .B zoomIn
579 Zoom in - go to the next higher zoom factor.
581 .B zoomOut
582 Zoom out - go the next lower zoom factor.
584 .B continuousMode
585 Go to continuous view mode.
587 .B singlePageMode
588 Go to single-page view mode.
590 .B toggleContinuousMode
591 Toggle between continuous and single page view modes.
593 .B fullScreenMode
594 Go to full-screen mode.
596 .B windowMode
597 Go to window (non-full-screen) mode.
599 .B toggleFullScreenMode
600 Toggle between full-screen and window modes.
602 .B open
603 Open a PDF file in this window, using the open dialog.
605 .B openInNewWin
606 Open a PDF file in a new window, using the open dialog.
608 .BI openFile( file )
609 Open a specified PDF file in this window.
611 .BI openFileInNewWin( file )
612 Open a specified PDF file in a new window.
614 .BI openFileAtDest( file , dest )
615 Open a specified PDF file in this window and go to a named
616 destination.
618 .BI openFileAtDestInNewWin( file , dest )
619 Open a specified PDF file in a new window and go to a named
620 destination.
622 .B reload
623 Reload the current PDF file.
625 .B redraw
626 Redraw the window.
628 .B raise
629 Raise the window to the front.
631 .B closeWindow
632 Close the window.
634 .BI run( external-command-string )
635 Run an external command.  The following escapes are allowed in the
636 command string:
639     %f => PDF file name (or an empty string if no
640           file is open)
641     %b => PDF file base name, i.e., file name minus
642           the extension (or an empty string if no
643           file is open)
644     %u => link URL (or an empty string if not over
645           a URL link)
646     %x => selection upper-left x coordinate
647           (or 0 if there is no selection)
648     %y => selection upper-left y coordinate
649           (or 0 if there is no selection)
650     %X => selection lower-right x coordinate
651           (or 0 if there is no selection)
652     %Y => selection lower-right y coordinate
653           (or 0 if there is no selection)
654     %% => %
658 .B openOutline
659 Open the outline pane.
661 .B closeOutline
662 Close the outline pane.
664 .B toggleOutline
665 Toggle the outline pane between open and closed.
667 .BI scrollOutlineDown( n )
668 Scroll the outline down by
669 .I n
670 increments.
672 .BI scrollOutlineUp( n )
673 Scroll the outline up by
674 .I n
675 increments.
677 .B focusToDocWin
678 Set the keyboard focus to the main document window.
680 .B focusToPageNum
681 Set the keyboard focus to the page number text box.
683 .B find
684 Open the 'find' dialog.
686 .B findNext
687 Finds the next occurrence of the search string (no dialog).
689 .B print
690 Open the 'print' dialog.
692 .B about
693 Open the 'about' dialog.
695 .B quit
696 Quit from xpdf.
698 The following commands depend on the current mouse position:
700 .B startSelection
701 Start a selection, which will be extended as the mouse moves.
703 .B endSelection
704 End a selection.
706 .B startPan
707 Start a pan, which will scroll the document as the mouse moves
709 .B endPan
710 End a pan.
712 .B postPopupMenu
713 Display the popup menu.
715 .B followLink
716 Follow a hyperlink (does nothing if the mouse is not over a link).
718 .B followLinkInNewWin
719 Follow a hyperlink, opening PDF files in a new window (does nothing if
720 the mouse is not over a link).  For links to non-PDF files, this
721 command is identical to followLink.
723 .B followLinkNoSel
724 Same as followLink, but does nothing if there is a non-empty selection.
725 (This is useful as a mouse button binding.)
727 .B followLinkInNewWinNoSel
728 Same as followLinkInNewWin, but does nothing if there is a non-empty
729 selection.  (This is useful as a mouse button binding.)
730 .SS Default Bindings
731 The default mouse bindings are as follows:
734     bind mousePress1    any         startSelection
735     bind mouseRelease1  any         endSelection followLinkNoSel
736     bind mousePress2    any         startPan
737     bind mouseRelease2  any         endPan
738     bind mousePress3    any         postPopupMenu
739     bind mousePress4    any         scrollUpPrevPage(16)
740     bind mousePress5    any         scrollDownNextPage(16)
741     bind mousePress6    any         scrollLeft(16)
742     bind mousePress7    any         scrollRight(16)
745 The default key bindings are as follows:
748     bind ctrl-home      any         gotoPage(1)
749     bind home           any         scrollToTopLeft
750     bind ctrl-end       any         gotoLastPage
751     bind end            any         scrollToBottomRight
752     bind pgup           any         pageUp
753     bind backspace      any         pageUp
754     bind delete         any         pageUp
755     bind pgdn           any         pageDown
756     bind space          any         pageDown
757     bind left           any         scrollLeft(16)
758     bind right          any         scrollRight(16)
759     bind up             any         scrollUp(16)
760     bind down           any         scrollDown(16)
761     bind o              any         open
762     bind O              any         open
763     bind r              any         reload
764     bind R              any         reload
765     bind f              any         find
766     bind F              any         find
767     bind ctrl-f         any         find
768     bind ctrl-g         any         findNext
769     bind ctrl-p         any         print
770     bind n              scrLockOff  nextPage
771     bind N              scrLockOff  nextPage
772     bind n              scrLockOn   nextPageNoScroll
773     bind N              scrLockOn   nextPageNoScroll
774     bind p              scrLockOff  prevPage
775     bind P              scrLockOff  prevPage
776     bind p              scrLockOn   prevPageNoScroll
777     bind P              scrLockOn   prevPageNoScroll
778     bind v              any         goForward
779     bind b              any         goBackward
780     bind g              any         focusToPageNum
781     bind 0              any         zoomPercent(125)
782     bind +              any         zoomIn
783     bind -              any         zoomOut
784     bind z              any         zoomFitPage
785     bind w              any         zoomFitWidth
786     bind alt-f          any         toggleFullScreenMode
787     bind ctrl-l         any         redraw
788     bind ctrl-w         any         closeWindow
789     bind ?              any         about
790     bind q              any         quit
791     bind Q              any         quit
794 Previous versions of xpdf included a "viKeys" X resource.  It is no
795 longer available, but the following bindings are equivalent:
798     bind h any scrollLeft(16)
799     bind l any scrollRight(16)
800     bind k any scrollUp(16)
801     bind j any scrollDown(16)
804 .SH "REMOTE SERVER MODE"
805 Xpdf can be started in remote server mode by specifying a server name
806 (in addition to the file name and page number).  For example:
809 xpdf -remote myServer file.pdf
812 If there is currently no xpdf running in server mode with the name
813 \'myServer', a new xpdf window will be opened.  If another command:
816 xpdf -remote myServer another.pdf 9
819 is issued, a new copy of xpdf will not be started.  Instead, the first
820 xpdf (the server) will load
821 .I another.pdf
822 and display page nine.  If the file name is the same:
825 xpdf -remote myServer another.pdf 4
828 the xpdf server will simply display the specified page.
830 The -raise option tells the server to raise its window; it can be
831 specified with or without a file name and page number.
833 The -quit option tells the server to close its window and exit.
834 .SH EXIT CODES
835 The Xpdf tools use the following exit codes:
838 No error.
841 Error opening a PDF file.
844 Error opening an output file.
847 Error related to PDF permissions.
850 Other error.
851 .SH AUTHOR
852 The xpdf software and documentation are copyright 1996-2007 Glyph &
853 Cog, LLC.
854 .SH "SEE ALSO"
855 .BR pdftops (1),
856 .BR pdftotext (1),
857 .BR pdfinfo (1),
858 .BR pdffonts (1),
859 .BR pdftoppm (1),
860 .BR pdfimages (1),
861 .BR xpdfrc (5)
863 .B http://www.foolabs.com/xpdf/