xpdfrc(5)

๐Ÿ’– xpdfrc(5) ๐Ÿ’–

okay bestie, welcome to the File Formats Manual page for xpdfrc, and no cap, this is the file that makes all your Xpdf tools behave. Version 4.06, let's get into it ๐Ÿซถ


โœจ NAME โœจ

xpdfrc โ€” configuration file for Xpdf tools (version 4.06)


๐ŸŒธ DESCRIPTION ๐ŸŒธ

So here's the tea: every single one of the Xpdf tools reads one shared configuration file. That's it. That's the vibe. One file to rule them all ๐Ÿ‘‘

Where it lives depends on your OS, so pay attention:

  • On Linux/Unix/MacOS: if you have a .xpdfrc file sitting in your home directory, that's the one it reads. If you don't, it'll go looking for a system-wide config file at /etc/xpdfrc, if that exists. (Quick note bestie: /etc/xpdfrc is its default location, but depending on build options it might be placed somewhere else entirely. Just so you're not out here confused ๐Ÿ˜ญ)
  • On Windows: the file has to be named xpdfrc โ€” no leading dot, no extension โ€” and it has to live in the same directory as the executable (pdftotext.exe, xpdf.exe, etc.)

Now, the format. The xpdfrc file is just a series of configuration options, one per line. Blank lines get ignored. Lines starting with a # (those are your comments) also get ignored. Simple. Clean. Iconic.


๐ŸŽ€ Quoting rules (listen up, this part matters) ๐ŸŽ€

Arguments can be single-quoted or double-quoted, which is what you want for file names that have spaces in them, like "aaa bbb" or 'aaa bbb'.

โš ๏ธ But real talk: this quoting does not provide any escaping. So there is literally no way to put a double quote inside a double-quoted argument, or a single quote inside a single-quoted argument. That's the rule, no exceptions ๐Ÿ’€

Arguments can also be at-quoted: @"aaa bbb". At-quoted strings are special because they let you use the DATADIR variable, which is set to the data subdirectory inside the xpdf install directory. The percent sign (%) is the escape character here โ€” a percent sign followed by any other character gets replaced with that character. Watch:

@"abc %"def%" ghi" --> abc "def" ghi
@"${DATADIR}/foo"  --> ...install-dir.../data/foo
@"%${DATADIR}/foo" --> ${DATADIR}/foo

See how the % in that last one stops the DATADIR from expanding? Chef's kiss, honestly โœจ


The sections below list all of the configuration options, sorted into functional groups. There's an examples section at the very end, so stick around for that ๐Ÿฆ‹


๐Ÿ“ INCLUDE FILES ๐Ÿ“

  • include config-file โ€” includes the specified config file. The effect is exactly equivalent to inserting the contents of config-file directly into the parent config file, right where the include command was. And yes bestie, config files can be nested arbitrarily deeply โ€” go wild, it's giving inception ๐ŸŒ€

๐Ÿ”ค GENERAL FONT CONFIGURATION ๐Ÿ”ค

  • fontFile PDF-font-name font-file โ€” maps a PDF font, PDF-font-name, to a font for display or PostScript output. The font file, font-file, can be any type allowed in a PDF file. You can use this command for 8-bit or 16-bit (CID) fonts. Versatile queen ๐Ÿ’…
  • fontDir dir โ€” specifies a search directory for font files. You can have multiple fontDir commands and all of the specified directories get searched, in order. The font files can be Type 1 (.pfa or .pfb) or TrueType (.ttf or .ttc) โ€” anything else hanging out in that directory gets ignored, sorry not sorry. The font file name (not counting the extension) must exactly match the PDF font name. This search only happens if the font name doesn't match any of the fonts declared with the fontFile command. And heads up: there are no default fontDir directories. Zero. None. You gotta set them yourself ๐Ÿ’ช
  • fontFileCC registry-ordering font-file โ€” maps the registry-ordering character collection to a font for display or PostScript output. This mapping kicks in when the font name doesn't match any of the fonts declared with the fontFile, fontDir, psResidentFont16, or psResidentFontCC commands. It's the last-resort bestie ๐Ÿซถ

๐Ÿ–จ๏ธ POSTSCRIPT FONT CONFIGURATION ๐Ÿ–จ๏ธ

  • psFontPassthrough yes | no โ€” if you set it to "yes", it passes 8-bit font names straight through to the PostScript output with no substitution. Fonts that aren't embedded in the PDF file are expected to be available on the printer. This defaults to "no".
  • psResidentFont PDF-font-name PS-font-name โ€” when the 8-bit font PDF-font-name is used (without embedding) in a PDF file, it gets translated to the PostScript font PS-font-name, which is assumed to be resident in the printer. Usually PDF-font-name and PS-font-name are the same thing. By default, only the Base-14 fonts are assumed to be resident. Base-14 only, bestie, don't get it twisted โœจ
  • psResidentFont16 PDF-font-name wMode PS-font-name encoding โ€” when the 16-bit (CID) font PDF-font-name with writing mode wMode is used (without embedding) in a PDF file, it gets translated to the PostScript font PS-font-name, which is assumed to be resident in the printer. The writing mode must be either H for horizontal or V for vertical. The resident font is assumed to use the specified encoding, which must have been defined with the unicodeMap command. No unicodeMap, no deal ๐Ÿ™ˆ
  • psResidentFontCC registry-ordering wMode PS-font-name encoding โ€” when a 16-bit (CID) font using the registry-ordering character collection and wMode writing mode is used (without embedding) in a PDF file, the PostScript font PS-font-name gets substituted in for it. The substituted font is assumed to be resident in the printer. Writing mode must be either H for horizontal or V for vertical. And again, the resident font is assumed to use the specified encoding, which must have been defined with the unicodeMap command. Same energy, different command ๐Ÿ’œ
  • psEmbedType1Fonts yes | no โ€” if set to "no", it prevents embedding of Type 1 fonts in generated PostScript. This defaults to "yes".
  • psEmbedTrueTypeFonts yes | no โ€” if set to "no", it prevents embedding of TrueType fonts in generated PostScript. This defaults to "yes".
  • psEmbedCIDTrueTypeFonts yes | no โ€” if set to "no", it prevents embedding of CID TrueType fonts in generated PostScript. For Level 3 PostScript this generates a CID font; for lower levels it generates a non-CID composite font. This defaults to "yes".
  • psEmbedCIDPostScriptFonts yes | no โ€” if set to "no", it prevents embedding of CID PostScript fonts in generated PostScript. For Level 3 PostScript this generates a CID font; for lower levels it generates a non-CID composite font. This defaults to "yes". Same deal as the one above, just for PostScript fonts instead of TrueType ๐ŸŒˆ

that's part 1 bestie, and there's more coming โ€” don't go anywhere ๐Ÿ’–

โœจ POSTSCRIPT CONTROL โœจ

okay bestie, this is where we tell PostScript how to act ๐Ÿ’… these settings control how xpdf and pdftops generate PostScript output. no cap, they're lowkey important. let's go ๐ŸŽ€

  • psPaperSize width(pts) height(pts) โ€” sets the paper size for PostScript output. the width and height parameters give the paper size in PostScript points (1 point = 1/72 inch). ๐Ÿ“
  • psPaperSize letter | legal | A4 | A3 | match โ€” sets the paper size for PostScript output to a standard size. the default paper size is set when xpdf and pdftops are built, typically to "letter" or "A4". this can also be set to "match", which will set the paper size to match the size specified in the PDF file. โœจ
  • psImageableArea llx lly urx ury โ€” sets the imageable area for PostScript output. the four integers are the coordinates of the lower-left and upper-right corners of the imageable region, specified in points (with the origin being the lower-left corner of the paper). this defaults to the full paper size; the psPaperSize option will reset the imageable area coordinates. ๐Ÿ–ผ๏ธ
  • psCrop yes | no โ€” if set to "yes", PostScript output is cropped to the CropBox specified in the PDF file; otherwise no cropping is done. this defaults to "yes". โœ‚๏ธ
  • psUseCropBoxAsPage yes | no โ€” if set to "yes", PostScript output treats the CropBox as the page size. by default, this is "no", and the MediaBox is used as the page size. ๐Ÿฆ‹
  • psExpandSmaller yes | no โ€” if set to "yes", PDF pages smaller than the PostScript imageable area are expanded to fill the imageable area. otherwise, no scaling is done on smaller pages. this defaults to "no". ๐ŸŒฑ
  • psShrinkLarger yes | no โ€” if set to yes, PDF pages larger than the PostScript imageable area are shrunk to fit the imageable area. otherwise, no scaling is done on larger pages. this defaults to "yes". ๐Ÿ”ฅ
  • psCenter yes | no โ€” if set to yes, PDF pages smaller than the PostScript imageable area (after any scaling) are centered in the imageable area. otherwise, they are aligned at the lower-left corner of the imageable area. this defaults to "yes". ๐ŸŽฏ
  • psDuplex yes | no โ€” if set to "yes", the generated PostScript will set the "Duplex" pagedevice entry. this tells duplex-capable printers to enable duplexing. this defaults to "no". ๐Ÿ–จ๏ธ
  • psLevel level1 | level1sep | level2 | level2gray | level2sep | level3 | level3gray | level3Sep โ€” sets the PostScript level to generate. this defaults to "level2". ๐Ÿ‘‘
  • psPreload yes | no โ€” if set to "yes", PDF forms are converted to PS procedures, and image data is preloaded. this uses more memory in the PostScript interpreter, but generates significantly smaller PS files in situations where, e.g., the same image is drawn on every page of a long document. this defaults to "no". ๐Ÿงš
  • psOPI yes | no โ€” if set to "yes", generates PostScript OPI comments for all images and forms which have OPI information. this option is only available if the Xpdf tools were compiled with OPI support. this defaults to "no". ๐ŸŒˆ
  • psASCIIHex yes | no โ€” if set to "yes", the ASCIIHexEncode filter will be used instead of ASCII85Encode for binary data. this defaults to "no". ๐Ÿ”ค
  • psLZW yes | no โ€” if set to "yes", the LZWEncode filter will be used for lossless compression in PostScript output; if set to "no", the RunLengthEncode filter will be used instead. LZW generates better compression (smaller PS files), but may not be supported by some printers. this defaults to "yes". ๐Ÿ—œ๏ธ
  • psUncompressPreloadedImages yes | no โ€” if set to "yes", all preloaded images in PS files will be uncompressed. if set to "no", the original compressed images will be used when possible. the "yes" setting is useful to work around certain buggy PostScript interpreters. this defaults to "no". ๐Ÿ›
  • psMinLineWidth float โ€” set the minimum line width, in points, for PostScript output. the default value is 0 (no minimum). ๐Ÿ“
  • psRasterResolution float โ€” set the resolution (in dpi) for rasterized pages in PostScript output. (pdftops will rasterize pages which use transparency.) this defaults to 300. ๐Ÿ”
  • psRasterMono yes | no โ€” if set to "yes", rasterized pages in PS files will be monochrome (8-bit gray) instead of color. this defaults to "no". ๐ŸŽจ
  • psRasterSliceSize pixels โ€” when rasterizing pages, pdftops splits the page into horizontal "slices", to limit memory usage. this option sets the maximum slice size, in pixels. this defaults to 20000000 (20 million). ๐Ÿฐ
  • psAlwaysRasterize yes | no โ€” if set to "yes", all PostScript output will be rasterized. this defaults to "no". ๐Ÿ–ผ๏ธ
  • psNeverRasterize yes | no โ€” pdftops rasterizes pages that use transparency (because PostScript doesn't support transparency). if psNeverRasterize is set to "yes", rasterization is disabled: pages will never be rasterized, even if they contain transparency. this will likely result in incorrect output for PDF files that use transparency, and a warning message to that effect will be printed. this defaults to "no". ๐Ÿ’€
๐Ÿ’€ warning, bestie: setting psNeverRasterize to "yes" means pages with transparency will never be rasterized. this will likely result in incorrect output for PDF files that use transparency, and a warning message to that effect will be printed. fr fr, be careful. ๐Ÿ˜ญ
  • fontDir dir โ€” see the description above, in the DISPLAY FONTS section. ๐ŸŽ€

๐Ÿ’– TEXT CONTROL AND CHARACTER MAPPING ๐Ÿ’–

Okay bestie, this is the part where we teach xpdf how to turn all those pretty glyphs into actual text you can copy-paste. This is the group chat where characters get their names, their Unicode vibes get sorted out, and everything gets mapped correctly. Pay attention, this one's meaty. ๐Ÿซถ


  • textEncoding encoding-name โ€” Sets the encoding to use for text output. (This can be overridden with the "-enc" switch on the command line.) The encoding-name must be defined with the unicodeMap command (see above, it's right down there actually ๐Ÿ‘‡). This defaults to "Latin1".
  • textEOL unix | dos | mac โ€” Sets the end-of-line convention to use for text output. The options are, and I cannot stress this enough, literally just these three:
    unix = LF
    dos  = CR+LF
    mac  = CR

(This can be overridden with the "-eol" switch on the command line.) The default value is based on the OS where xpdf and pdftotext were built. So it just knows, okay? It woke up like this. โœจ

  • textPageBreaks yes | no โ€” If set to "yes", text extraction will insert page breaks (form feed characters) between pages. This defaults to "yes". So yeah, by default you get those lil form feeds, slay.
  • textKeepTinyChars yes | no โ€” If set to "yes", text extraction will keep all characters. If set to "no", text extraction will discard tiny (smaller than 3 point) characters after the first 50000 per page, avoiding extremely slow run times for PDF files that use special fonts to do shading or cross-hatching. This defaults to "yes". So if your PDF is taking a lil nap and never waking up, this is your girl fr fr.
  • nameToUnicode map-file โ€” Specifies a file with the mapping from character names to Unicode. This is used to handle PDF fonts that have valid encodings but no ToUnicode entry. Each line of a nameToUnicode file looks like this:
    hex-string name

The hex-string is the Unicode (UCS-2) character index, and name is the corresponding character name. Multiple nameToUnicode files can be used; if a character name is given more than once, the code in the last specified file is used. (Last one wins, periodt.) There is a built-in default nameToUnicode table with all of Adobe's standard character names. Iconic of Adobe honestly.

  • cidToUnicode registry-ordering map-file โ€” Specifies the file with the mapping from character collection to Unicode. Each line of a cidToUnicode file represents one character:
    hex-string

The hex-string is the Unicode (UCS-2) index for that character. The first line maps CID 0, the second line CID 1, etc. File size is determined by size of the character collection. Only one file is allowed per character collection; the last specified file is used. There are no built-in cidToUnicode mappings. ๐Ÿ˜ญ (you have to bring your own, sorry bestie)

  • unicodeToUnicode font-name-substring map-file โ€” This is used to work around PDF fonts which have incorrect Unicode information. It specifies a file which maps from the given (incorrect) Unicode indexes to the correct ones. The mapping will be used for any font whose name contains font-name-substring. Each line of a unicodeToUnicode file represents one Unicode character:
    in-hex out-hex1 out-hex2 ...

The in-hex field is an input (incorrect) Unicode index, and the rest of the fields are one or more output (correct) Unicode indexes. Each occurrence of in-hex will be converted to the specified output sequence. It's giving "fix it in post" but for fonts, and honestly? Valid.

  • unicodeRemapping remap-file โ€” Remap Unicode characters when doing text extraction. This specifies a file that maps from a particular Unicode index to zero or more replacement Unicode indexes. Each line of the remap file represents one Unicode character:
    in-hex out-hex1 out-hex2 ...

Any Unicode characters not listed will be left unchanged. This function is typically used to remap things like non-breaking spaces, soft hyphens, ligatures, etc. Cleaning up the little messy bits so your extracted text isn't lowkey cursed.

  • unicodeMap encoding-name map-file โ€” Specifies the file with mapping from Unicode to encoding-name. These encodings are used for text output (see below). Each line of a unicodeMap file represents a range of one or more Unicode characters which maps linearly to a range in the output encoding:
    in-start-hex in-end-hex out-start-hex

Entries for single characters can be abbreviated to:

    in-hex out-hex

The in-start-hex and in-end-hex fields (or the single in-hex field) specify the Unicode range. The out-start-hex field (or the out-hex field) specifies the start of the output encoding range. The length of the out-start-hex (or out-hex) string determines the length of the output characters (e.g., UTF-8 uses different numbers of bytes to represent characters in different ranges). Entries must be given in increasing Unicode order. Do NOT skip around, she will not tolerate it. Only one file is allowed per encoding; the last specified file is used. The Latin1, ASCII7, Symbol, ZapfDingbats, UTF-8, and UCS-2 encodings are predefined. ๐Ÿ‘‘

  • cMapDir registry-ordering dir โ€” Specifies a search directory, dir, for CMaps for the registry-ordering character collection. There can be multiple directories for a particular collection. There are no default CMap directories. You gotta point her in the right direction yourself, bestie.
  • toUnicodeDir dir โ€” Specifies a search directory, dir, for ToUnicode CMaps. There can be multiple ToUnicode directories. There are no default ToUnicode directories. Same energy as above: bring your own. ๐ŸŽ€
  • mapNumericCharNames yes | no โ€” If set to "yes", the Xpdf tools will attempt to map various numeric character names sometimes used in font subsets. In some cases this leads to usable text, and in other cases it leads to gibberish โ€” there is no way for Xpdf to tell. This defaults to "yes". It's a gamble every single time and she's just out here trying her best.
  • mapUnknownCharNames yes | no โ€” If set to "yes", and mapNumericCharNames is set to "no", the Xpdf tools will apply a simple pass-through mapping (Unicode index = character code) for all unrecognized glyph names. (For CID fonts, setting mapNumericCharNames to "no" is unnecessary.) In some cases, this leads to usable text, and in other cases it leads to gibberish โ€” there is no way for Xpdf to tell. This defaults to "no". ๐Ÿ’€ (again, no promises, we're all just vibing)
  • mapExtTrueTypeFontsViaUnicode yes | no โ€” When rasterizing text using an external TrueType font, there are two options for handling character codes. If mapExtTrueTypeFontsViaUnicode is set to "yes", Xpdf will use the font encoding/ToUnicode info to map character codes to Unicode, and then use the font's Unicode cmap to map Unicode to GIDs. If mapExtTrueTypeFontsViaUnicode is set to "no", Xpdf will assume the character codes are GIDs (i.e., use an identity mapping). This defaults to "yes". Two paths, one font, choose wisely.
  • useTrueTypeUnicodeMapping yes | no โ€” If set to "yes", the Xpdf tools will use the Unicode encoding information in TrueType fonts (16-bit only), if available, to override the PDF ToUnicode maps. Otherwise, the ToUnicode maps are always used when present. This defaults to "no".
  • ignoreWrongSizeToUnicode yes | no โ€” If set to "yes", Xpdf will ignore any ToUnicode CMaps that don't match the font type (8-bit vs 16-bit). The PDF spec requires ToUnicode CMaps match, and Adobe appears to ignore CMaps that don't match. This defaults to "no" (for backward compatibility). Adobe out here breaking the rules and we're just matching their energy for old times' sake.
  • dropFont font-name โ€” Drop all text drawn in the specified font. To drop text drawn in unnamed fonts, use:
    dropFont ""

There can be any number of dropFont commands. Ruthless. Iconic. Bye bye, text. ๐Ÿ’…

  • separateRotatedText yes | no โ€” If set to "no", pdftotext will attempt to place rotated text into the "correct" location in the output. If set to "yes", when using reading order mode, pdftotext will append rotated text to the end, after unrotated text. This defaults to "no". (Yes, "correct" is in quotes in the original. The vibes are immaculate and also suspicious.)
  • discardCoveredText yes | no โ€” If set to "yes", the xpdf tools will discard all text drawn before ("under") a full-page fill. If set to "no", such text will be marked as invisible (only relevant for pdftohtml), but not discarded. This defaults to "no". So basically: do you wanna delete the hidden text, or just make it shy?

๐ŸŽจ RASTERIZER SETTINGS ๐ŸŽจ

okay bestie, this is where the pixels get their whole moment โœจ like this section is literally the glow-up station for how your PDF gets drawn. let's go, no skips, every knob and dial, fr fr. ๐Ÿ’…

  • enableFreeType yes | no โ€” turns FreeType on or off, and FreeType is the whole TrueType / Type 1 font rasterizer situation. important: this only even matters if the Xpdf tools were built with FreeType support, so if they weren't, it's giving nothing. also heads up: enableFreeType is the replacement for the old freetypeControl option. default vibe is yes. ๐Ÿ’–
  • disableFreeTypeHinting yes | no โ€” set it to yes and FreeType hinting gets forced off. that's it, that's the whole job. default is no. ๐ŸŽ€
  • antialias yes | no โ€” turns font anti-aliasing on or off in the PDF rasterizer, and it affects all font rasterizers, no favorites. also: antialias replaces the anti-aliasing control that used to live in the old t1libControl and freetypeControl options. default is yes. โœจ
  • vectorAntialias yes | no โ€” turns anti-aliasing of vector graphics on or off in the PDF rasterizer. default is yes. ๐ŸŒˆ
  • imageMaskAntialias yes | no โ€” turns anti-aliasing of image masks on or off (that's when downsampling or upsampling) in the PDF rasterizer. default is yes. ๐Ÿฆ‹
  • antialiasPrinting yes | no โ€” if this is yes, bitmaps sent to the printer get antialiased (following whatever antialias and vectorAntialias are set to). if it's no, printed bitmaps do not get antialiased. default is no. ๐Ÿ–จ๏ธโœจ
  • strokeAdjust yes | no | cad โ€” sets the stroke adjustment mode, choose your fighter:
    • no โ†’ no stroke adjustment at all, we're raw-dogging it.
    • yes โ†’ normal stroke adjustment happens: horizontal and vertical lines get moved by up to half a pixel so they look cleaner when vector anti-aliasing is enabled.
    • cad โ†’ a slightly different stroke adjustment algorithm is used to make sure lines of the same original width always get the same adjusted width (the trade-off being gaps and overlaps between adjacent lines are allowed). default is yes. ๐Ÿ‘‘
  • forceAccurateTiling yes | no โ€” if set to yes, the TilingType is forced to 2 (no distortion) for all tiling patterns, no matter what the pattern dictionary says. default is no. ๐Ÿ’…
  • screenType dispersed | clustered | stochasticClustered โ€” sets the halftone screen type, which gets used when generating a monochrome (1-bit) bitmap. the three options are: dispersed-dot dithering, clustered-dot dithering (with a round dot and 45-degree screen angle), and stochastic clustered-dot dithering. by default, stochasticClustered is used for resolutions of 300 dpi and higher, and dispersed is used for resolutions lower than 300 dpi. ๐Ÿ”ฅ
  • screenSize integer โ€” sets the size of the (square) halftone screen threshold matrix. by default this is 4 for dispersed-dot dithering, 10 for clustered-dot dithering, and 100 for stochastic clustered-dot dithering. ๐Ÿ“
  • screenDotRadius integer โ€” sets the halftone screen dot radius. this is only used when screenType is set to stochasticClustered, and it defaults to 2. in clustered-dot mode, the dot radius is half of the screen size. dispersed-dot dithering doesn't have a dot radius at all. ๐Ÿ™ˆ
  • screenGamma float โ€” sets the halftone screen gamma correction parameter. gamma values greater than 1 make the output brighter; gamma values less than 1 make it darker. default value is 1. โญ
  • screenBlackThreshold float โ€” when halftoning, all values below this threshold get forced to solid black. this parameter is a floating point value between 0 (black) and 1 (white). default value is 0. ๐Ÿ–ค
  • screenWhiteThreshold float โ€” when halftoning, all values above this threshold get forced to solid white. this parameter is a floating point value between 0 (black) and 1 (white). default value is 1. ๐Ÿค
  • minLineWidth float โ€” sets the minimum line width, in device pixels. this affects the rasterizer only, not the PostScript converter (except when it uses rasterization to handle transparency). default value is 0 (no minimum). ๐Ÿ“
  • enablePathSimplification yes | no โ€” if set to yes, simplify paths by removing points where it won't make a significant difference to the shape. default value is no. ๐Ÿ›ค๏ธ
  • overprintPreview yes | no โ€” if set to yes, generate overprint preview output, honoring the OP/op/OPM settings in the PDF file. ignored for non-CMYK output. default value is no. ๐ŸŽจ

โœจ VIEWER SETTINGS โœจ

okay bestie these ones are only for the Xpdf GUI PDF viewer, like the actual window-y app, not the command-line tools ๐Ÿ’–

  • initialZoom percentage | page | width โ€” sets the zoom factor you start out with. a plain number = a zoom percentage, and 100 means 72 dpi. you can also say page to make the page fit the window, or width to make the page width fit the window width ๐Ÿฆ‹
  • defaultFitZoom percentage โ€” so if xpdf gets launched with fit-page or fit-width zoom and there's no window geometry given, it's gonna compute a desired window size from the PDF page size plus this defaultFitZoom value. translation: the window size gets picked so that exactly one page fits in the window at this zoom factor (which has to be a percentage, no cap). the default value is based on your screen resolution โœจ
  • zoomScaleFactor ratio | actual โ€” zoom percentages get scaled by this factor. by default, 100% zoom = 72 dpi. set zoomScaleFactor to 1.5 and 100% zoom becomes 1.5x bigger, aka 108dpi. if you set it to actual, the zoom scale factor gets computed from your screen resolution. default is 1.0 ๐Ÿ’…
  • zoomValues zoom1 zoom2 zoom3 ... โ€” the list of zoom values (percentages) shown in the zoom combo box. default list is: 25 50 75 100 110 125 150 175 200 300 400 600 800 ๐Ÿ‘‘
  • initialDisplayMode single | continuous | sideBySideSingle | sideBySideContinuous | horizontalContinuous โ€” sets the initial display mode. default is "continuous" ๐ŸŒˆ
  • initialToolbarState yes | no โ€” "yes" means xpdf opens with the toolbar visible, "no" means it opens with the toolbar hidden. default is "yes" ๐ŸŽ€
  • initialSidebarState yes | no โ€” "yes" opens xpdf with the sidebar (tabs, outline, etc.) visible, "no" opens it collapsed. default is "yes" ๐Ÿ’œ
  • initialSidebarWidth width โ€” the initial sidebar width, in pixels. only matters if initialSidebarState is "yes". default value is zero, which tells xpdf to just use an internal default size ๐Ÿงš
  • initialSelectMode block | linear โ€” sets the initial selection mode. default is "linear" โญ
  • initialMaximized yes | no โ€” "yes" = xpdf windows open maximized. default is "no" ๐Ÿ”ฅ
  • paperColor color โ€” sets the "paper color", aka the background of the page display. color can be #RRGGBB (hexadecimal) or a named color. > heads up: this will not play nice with PDF files that do stuff like filling in white behind the text ๐Ÿ’€
  • matteColor color โ€” the matte color, aka the color used for the background outside the actual page area. color can be #RRGGBB (hexadecimal) or a named color ๐ŸŒธ
  • fullScreenMatteColor color โ€” the matte color but for full-screen mode. color can be #RRGGBB (hexadecimal) or a named color ๐ŸŒ™
  • selectionColor color โ€” sets the selection color. color can be #RRGGBB (hexadecimal) or a named color ๐Ÿซถ
  • reverseVideoInvertImages yes | no โ€” "no" means xpdf's reverse-video mode inverts text and vector graphic content but not images. "yes" means it inverts images too. default is "no" ๐Ÿ’…
  • popupMenuCmd title command ... โ€” adds a command to the popup menu. title is the text shown in the menu. command is an Xpdf command (peep the COMMANDS section of the xpdf(1) man page for the deets). multiple commands are separated by whitespace โœจ
  • maxTileWidth pixels โ€” the max width of tiles xpdf uses when rasterizing pages. defaults to 1500 ๐Ÿ”ฒ
  • maxTileHeight pixels โ€” the max height of tiles xpdf uses when rasterizing pages. defaults to 1500 ๐Ÿ”ฒ
  • tileCacheSize tiles โ€” the max number of tiles xpdf caches when rasterizing pages. defaults to 10 ๐Ÿ“ฆ
  • workerThreads numThreads โ€” the number of worker threads xpdf uses when rasterizing pages. defaults to 1 ๐Ÿงต
  • allowLinksToChangeZoom yes | no โ€” PDF links, outline items included, can carry a new zoom level. if this is "yes", Xpdf changes the zoom when links get clicked; if "no", Xpdf moves to the destination but leaves the zoom alone. defaults to "yes" ๐Ÿ”—
  • launchCommand command โ€” the command that runs when you click a "launch"-type link. the whole point is for the command to be a program/script that figures out the file type and launches the right viewer. the command line will be the file to be launched, followed by any parameters specified with the link. > do not use "%s" in command. by default this is unset, and Xpdf will just try to execute the file (after prompting you, bestie) ๐Ÿš€
  • movieCommand command โ€” the command that runs when you click a movie annotation. the string "%s" gets replaced with the movie file name. this has no default value ๐ŸŽฌ
  • defaultPrinter printer โ€” sets the default printer used in the viewer's print dialog ๐Ÿ–จ๏ธ
  • bind modifiers-key context command ... โ€” adds a key or mouse button binding. modifiers can be zero or more of:
    shift-
    ctrl-
    alt-

key can be a regular ASCII character, or any one of:

    space
    tab
    return
    enter
    backspace
    esc
    insert
    delete
    home
    end
    pgup
    pgdn
    left / right / up / down                (arrow keys)
    f1 .. f35                               (function keys)
    mousePress1 .. mousePress7              (mouse buttons)
    mouseRelease1 .. mouseRelease7          (mouse buttons)
    mouseClick1 .. mouseClick7              (mouse buttons)
    mouseDoubleClick1 .. mouseDoubleClick7  (mouse buttons)
    mouseTripleClick1 .. mouseTripleClick7  (mouse buttons)

context is either "any" or a comma-separated combo of:

    fullScreen / window       (full screen mode on/off)
    continuous / singlePage   (continuous mode on/off)
    overLink / offLink        (mouse over link or not)
    scrLockOn / scrLockOff    (scroll lock on/off)

the context string can include only one of each pair in that list ๐Ÿ‘€

command is an Xpdf command (again, COMMANDS section of xpdf(1)). multiple commands are separated by whitespace.

the bind command replaces any existing binding, but only if it was defined for the exact same modifiers, key, and context. all tokens (modifiers, key, context, commands) are case-sensitive, so don't get sloppy ๐Ÿ’€

example key bindings:

    # bind ctrl-a in any context to the nextPage
    # command
    bind ctrl-a any nextPage

    # bind uppercase B, when in continuous mode
    # with scroll lock on, to the reload command
    # followed by the prevPage command
    bind B continuous,scrLockOn reload prevPage

see the xpdf(1) man page for more examples ๐Ÿ“–

  • unbind modifiers-key context โ€” removes a key binding you made with bind. this is mostly useful for nuking default key bindings before you set up new ones (like, if the default binding is given for the "any" context and you wanna make new bindings across multiple contexts) โœ‚๏ธ
  • tabStateFile path โ€” the file used by the loadTabState and saveTabState commands (see xpdf(1) for more). default path is ~/.xpdf.tabstate ๐Ÿ—‚๏ธ
  • sessionFile path โ€” the file used by the saveSession and loadSession commands (see xpdf(1) for more). default path is ~/.xpdf.session. when xpdf auto-saves the session via a session manager, it appends ".managed" to the path ๐Ÿ’พ
  • saveSessionOnQuit yes | no โ€” "yes" means xpdf automatically saves the current session (same as the saveSession command) when quitting, whether that's via the menu or a key binding. default is "yes" ๐ŸŒ™

๐ŸŒˆ MISCELLANEOUS SETTINGS ๐ŸŒˆ

the little odds and ends, bestie, but they matter ๐Ÿ’–

  • drawAnnotations yes | no โ€” "no" means annotations won't be drawn or printed. default is "yes" โœ๏ธ
  • drawFormFields yes | no โ€” "no" means form fields won't be drawn or printed. default is "yes" ๐Ÿ“
  • enableXFA yes | no โ€” if an XFA form is present and this is "yes", Xpdf parses the XFA form and uses certain XFA info to override AcroForm info. "no" means the XFA form won't be read. default is "yes" ๐Ÿ‘‘
  • preferXFAFieldValues yes | no โ€” "yes" means Xpdf uses the XFA field value if it's there, and falls back to the AcroForm value otherwise. "no" means Xpdf uses the AcroForm value and completely ignores the XFA value. default is "yes" ๐Ÿ”€
  • savePageNumbers yes | no โ€” "yes" means xpdf saves the current page numbers of all open files in ~/.xpdf.pages when the files get closed (or when you quit xpdf). next time you open that file, the last-viewed page number gets restored. default is "yes" ๐Ÿ“Œ
  • printCommands yes | no โ€” "yes" prints drawing commands as they're executed (great for debugging). defaults to "no" ๐Ÿ›
  • printStatusInfo yes | no โ€” "yes" prints a status message (to stdout) before each page gets processed. defaults to "no" ๐Ÿ“ข
  • errQuiet yes | no โ€” "yes" suppresses all error and warning messages from all of the Xpdf tools. defaults to "no" ๐Ÿคซ

โœจ EXAMPLES โœจ

okay bestie, here's a whole sample xpdfrc file, verbatim, so you can see how all the pieces fit together. It pulls from the Thai support package, the Japanese support package, ghostscript's Base-14 Type 1 fonts, the Bakoma fonts, sets some PostScript options, declares resident Univers fonts, sets text output options, and flips on some misc options. ๐Ÿ’–

# from the Thai support package
nameToUnicode /usr/local/share/xpdf/Thai.nameToUnicode

# from the Japanese support package
cidToUnicode Adobe-Japan1 /usr/local/share/xpdf/Adobe-Japan1.cidToUnicode
unicodeMap   JISX0208     /usr/local/share/xpdf/JISX0208.unicodeMap
cMapDir      Adobe-Japan1 /usr/local/share/xpdf/cmap/Adobe-Japan1

# use the Base-14 Type 1 fonts from ghostscript
fontFile Times-Roman           /usr/local/share/ghostscript/fonts/n021003l.pfb
fontFile Times-Italic          /usr/local/share/ghostscript/fonts/n021023l.pfb
fontFile Times-Bold            /usr/local/share/ghostscript/fonts/n021004l.pfb
fontFile Times-BoldItalic      /usr/local/share/ghostscript/fonts/n021024l.pfb
fontFile Helvetica             /usr/local/share/ghostscript/fonts/n019003l.pfb
fontFile Helvetica-Oblique     /usr/local/share/ghostscript/fonts/n019023l.pfb
fontFile Helvetica-Bold        /usr/local/share/ghostscript/fonts/n019004l.pfb
fontFile Helvetica-BoldOblique /usr/local/share/ghostscript/fonts/n019024l.pfb
fontFile Courier               /usr/local/share/ghostscript/fonts/n022003l.pfb
fontFile Courier-Oblique       /usr/local/share/ghostscript/fonts/n022023l.pfb
fontFile Courier-Bold          /usr/local/share/ghostscript/fonts/n022004l.pfb
fontFile Courier-BoldOblique   /usr/local/share/ghostscript/fonts/n022024l.pfb
fontFile Symbol                /usr/local/share/ghostscript/fonts/s050000l.pfb
fontFile ZapfDingbats          /usr/local/share/ghostscript/fonts/d050000l.pfb

# use the Bakoma Type 1 fonts
# (this assumes they happen to be installed in /usr/local/fonts/bakoma)
fontDir /usr/local/fonts/bakoma

# set some PostScript options
psPaperSize          letter
psDuplex             no
psLevel              level2
psEmbedType1Fonts    yes
psEmbedTrueTypeFonts yes

# assume that the PostScript printer has the Univers and
# Univers-Bold fonts
psResidentFont Univers      Univers
psResidentFont Univers-Bold Univers-Bold

# set the text output options
textEncoding UTF-8
textEOL      unix

# misc options
enableFreeType  yes
launchCommand   viewer-script

๐Ÿ“ FILES ๐Ÿ“

  • /etc/xpdfrc โ€” this is the default location for the system-wide configuration file. Depending on build options, it may be placed elsewhere. So don't be shocked if your distro put it somewhere else, bestie.
  • $HOME/.xpdfrc โ€” this is your user configuration file. If it exists, it will be read in place of the system-wide file. Like, it takes the wheel. ๐Ÿซถ

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

The Xpdf software and documentation are copyright 1996-2025 Glyph & Cog, LLC. That's the whole author block, no cap. ๐Ÿ’œ


๐Ÿ”ฎ SEE ALSO ๐Ÿ”ฎ

go read these too, they're the rest of the squad:


and that's the whole xpdfrc(5) page, bestie. It dropped on 14 Nov 2025, and it's xpdfrc(5). You ate that. Periodt. ๐Ÿ’…โœจ

๐Ÿ“ฆ where this page comes from