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
.xpdfrcfile 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/xpdfrcis 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 ofconfig-filedirectly into the parent config file, right where theincludecommand 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 multiplefontDircommands and all of the specified directories get searched, in order. The font files can be Type 1 (.pfaor.pfb) or TrueType (.ttfor.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 thefontFilecommand. And heads up: there are no defaultfontDirdirectories. 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 thefontFile,fontDir,psResidentFont16, orpsResidentFontCCcommands. 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 eitherHfor horizontal orVfor vertical. The resident font is assumed to use the specified encoding, which must have been defined with theunicodeMapcommand. 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 eitherHfor horizontal orVfor vertical. And again, the resident font is assumed to use the specified encoding, which must have been defined with theunicodeMapcommand. 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. thewidthandheightparameters 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 whenxpdfandpdftopsare 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; thepsPaperSizeoption will reset the imageable area coordinates. ๐ผ๏ธpsCrop yes | noโ if set to"yes", PostScript output is cropped to theCropBoxspecified in the PDF file; otherwise no cropping is done. this defaults to"yes". โ๏ธpsUseCropBoxAsPage yes | noโ if set to"yes", PostScript output treats theCropBoxas the page size. by default, this is"no", and theMediaBoxis 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 toyes, 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 toyes, 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", theASCIIHexEncodefilter will be used instead ofASCII85Encodefor binary data. this defaults to"no". ๐คpsLZW yes | noโ if set to"yes", theLZWEncodefilter will be used for lossless compression in PostScript output; if set to"no", theRunLengthEncodefilter 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 is0(no minimum). ๐psRasterResolution floatโ set the resolution (in dpi) for rasterized pages in PostScript output. (pdftopswill rasterize pages which use transparency.) this defaults to300. ๐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,pdftopssplits the page into horizontal"slices", to limit memory usage. this option sets the maximum slice size, in pixels. this defaults to20000000(20 million). ๐ฐpsAlwaysRasterize yes | noโ if set to"yes", all PostScript output will be rasterized. this defaults to"no". ๐ผ๏ธpsNeverRasterize yes | noโpdftopsrasterizes pages that use transparency (because PostScript doesn't support transparency). ifpsNeverRasterizeis 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: settingpsNeverRasterizeto"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. ๐ซถ
textEncodingencoding-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 theunicodeMapcommand (see above, it's right down there actually ๐). This defaults to"Latin1".textEOLunix|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. โจ
textPageBreaksyes|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.textKeepTinyCharsyes|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.nameToUnicodemap-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 anameToUnicodefile 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.
cidToUnicoderegistry-ordering map-file โ Specifies the file with the mapping from character collection to Unicode. Each line of acidToUnicodefile 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)
unicodeToUnicodefont-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 aunicodeToUnicodefile 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.
unicodeRemappingremap-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.
unicodeMapencoding-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 aunicodeMapfile 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. ๐
cMapDirregistry-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.toUnicodeDirdir โ 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. ๐mapNumericCharNamesyes|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.mapUnknownCharNamesyes|noโ If set to"yes", andmapNumericCharNamesis 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, settingmapNumericCharNamesto"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)mapExtTrueTypeFontsViaUnicodeyes|noโ When rasterizing text using an external TrueType font, there are two options for handling character codes. IfmapExtTrueTypeFontsViaUnicodeis 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. IfmapExtTrueTypeFontsViaUnicodeis 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.useTrueTypeUnicodeMappingyes|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".ignoreWrongSizeToUnicodeyes|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.dropFontfont-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. ๐
separateRotatedTextyes|noโ If set to"no",pdftotextwill attempt to place rotated text into the"correct"location in the output. If set to"yes", when using reading order mode,pdftotextwill 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.)discardCoveredTextyes|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 forpdftohtml), 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:enableFreeTypeis the replacement for the oldfreetypeControloption. default vibe isyes. ๐disableFreeTypeHinting yes | noโ set it toyesand FreeType hinting gets forced off. that's it, that's the whole job. default isno. ๐antialias yes | noโ turns font anti-aliasing on or off in the PDF rasterizer, and it affects all font rasterizers, no favorites. also:antialiasreplaces the anti-aliasing control that used to live in the oldt1libControlandfreetypeControloptions. default isyes. โจvectorAntialias yes | noโ turns anti-aliasing of vector graphics on or off in the PDF rasterizer. default isyes. ๐imageMaskAntialias yes | noโ turns anti-aliasing of image masks on or off (that's when downsampling or upsampling) in the PDF rasterizer. default isyes. ๐ฆantialiasPrinting yes | noโ if this isyes, bitmaps sent to the printer get antialiased (following whateverantialiasandvectorAntialiasare set to). if it'sno, printed bitmaps do not get antialiased. default isno. ๐จ๏ธโจ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 isyes. ๐
forceAccurateTiling yes | noโ if set toyes, the TilingType is forced to2(no distortion) for all tiling patterns, no matter what the pattern dictionary says. default isno. ๐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,stochasticClusteredis used for resolutions of300dpi and higher, anddispersedis used for resolutions lower than300dpi. ๐ฅscreenSize integerโ sets the size of the (square) halftone screen threshold matrix. by default this is4for dispersed-dot dithering,10for clustered-dot dithering, and100for stochastic clustered-dot dithering. ๐screenDotRadius integerโ sets the halftone screen dot radius. this is only used whenscreenTypeis set tostochasticClustered, and it defaults to2. 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 than1make the output brighter; gamma values less than1make it darker. default value is1. โญscreenBlackThreshold floatโ when halftoning, all values below this threshold get forced to solid black. this parameter is a floating point value between0(black) and1(white). default value is0. ๐คscreenWhiteThreshold floatโ when halftoning, all values above this threshold get forced to solid white. this parameter is a floating point value between0(black) and1(white). default value is1. ๐ค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 is0(no minimum). ๐enablePathSimplification yes | noโ if set toyes, simplify paths by removing points where it won't make a significant difference to the shape. default value isno. ๐ค๏ธoverprintPreview yes | noโ if set toyes, generate overprint preview output, honoring theOP/op/OPMsettings in the PDF file. ignored for non-CMYK output. default value isno. ๐จ
โจ 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 ๐
initialZoompercentage |page|widthโ sets the zoom factor you start out with. a plain number = a zoom percentage, and100means 72 dpi. you can also saypageto make the page fit the window, orwidthto make the page width fit the window width ๐ฆdefaultFitZoompercentage โ 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 thisdefaultFitZoomvalue. 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 โจzoomScaleFactorratio |actualโ zoom percentages get scaled by this factor. by default, 100% zoom = 72 dpi. setzoomScaleFactorto1.5and 100% zoom becomes 1.5x bigger, aka 108dpi. if you set it toactual, the zoom scale factor gets computed from your screen resolution. default is1.0๐zoomValueszoom1 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๐initialDisplayModesingle|continuous|sideBySideSingle|sideBySideContinuous|horizontalContinuousโ sets the initial display mode. default is"continuous"๐initialToolbarStateyes|noโ"yes"means xpdf opens with the toolbar visible,"no"means it opens with the toolbar hidden. default is"yes"๐initialSidebarStateyes|noโ"yes"opens xpdf with the sidebar (tabs, outline, etc.) visible,"no"opens it collapsed. default is"yes"๐initialSidebarWidthwidth โ the initial sidebar width, in pixels. only matters ifinitialSidebarStateis"yes". default value is zero, which tells xpdf to just use an internal default size ๐งinitialSelectModeblock|linearโ sets the initial selection mode. default is"linear"โญinitialMaximizedyes|noโ"yes"= xpdf windows open maximized. default is"no"๐ฅpaperColorcolor โ 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 ๐matteColorcolor โ the matte color, aka the color used for the background outside the actual page area. color can be#RRGGBB(hexadecimal) or a named color ๐ธfullScreenMatteColorcolor โ the matte color but for full-screen mode. color can be#RRGGBB(hexadecimal) or a named color ๐selectionColorcolor โ sets the selection color. color can be#RRGGBB(hexadecimal) or a named color ๐ซถreverseVideoInvertImagesyes|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"๐popupMenuCmdtitle 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 thexpdf(1)man page for the deets). multiple commands are separated by whitespace โจmaxTileWidthpixels โ the max width of tiles xpdf uses when rasterizing pages. defaults to1500๐ฒmaxTileHeightpixels โ the max height of tiles xpdf uses when rasterizing pages. defaults to1500๐ฒtileCacheSizetiles โ the max number of tiles xpdf caches when rasterizing pages. defaults to10๐ฆworkerThreadsnumThreads โ the number of worker threads xpdf uses when rasterizing pages. defaults to1๐งตallowLinksToChangeZoomyes|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"๐launchCommandcommand โ 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) ๐movieCommandcommand โ 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 ๐ฌdefaultPrinterprinter โ sets the default printer used in the viewer's print dialog ๐จ๏ธbindmodifiers-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 ๐
unbindmodifiers-key context โ removes a key binding you made withbind. 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) โ๏ธtabStateFilepath โ the file used by theloadTabStateandsaveTabStatecommands (seexpdf(1)for more). default path is~/.xpdf.tabstate๐๏ธsessionFilepath โ the file used by thesaveSessionandloadSessioncommands (seexpdf(1)for more). default path is~/.xpdf.session. when xpdf auto-saves the session via a session manager, it appends".managed"to the path ๐พsaveSessionOnQuityes|noโ"yes"means xpdf automatically saves the current session (same as thesaveSessioncommand) 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 ๐
drawAnnotationsyes|noโ"no"means annotations won't be drawn or printed. default is"yes"โ๏ธdrawFormFieldsyes|noโ"no"means form fields won't be drawn or printed. default is"yes"๐enableXFAyes|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"๐preferXFAFieldValuesyes|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"๐savePageNumbersyes|noโ"yes"means xpdf saves the current page numbers of all open files in~/.xpdf.pageswhen 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"๐printCommandsyes|noโ"yes"prints drawing commands as they're executed (great for debugging). defaults to"no"๐printStatusInfoyes|noโ"yes"prints a status message (to stdout) before each page gets processed. defaults to"no"๐ขerrQuietyes|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:
xpdf(1)pdftops(1)pdftotext(1)pdftohtml(1)pdfinfo(1)pdffonts(1)pdfdetach(1)pdftoppm(1)pdftopng(1)pdfimages(1)http://www.xpdfreader.com/
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
- alpine 3.24: xpdf-doc 4.06-r0 ยท GPL-2.0-or-later OR GPL-3.0-or-later
- arch rolling: xpdf 4.06-2 ยท GPL-2.0-only OR GPL-3.0-only
- fedora 43: xpdf 1:4.06-1.fc43 ยท (GPL-2.0-only OR GPL-3.0-only) AND BSD-3-Clause
- fedora 43: xpdf 1:4.06-1.fc43 ยท (GPL-2.0-only OR GPL-3.0-only) AND BSD-3-Clause
- fedora 44: xpdf 1:4.06-2.fc44 ยท (GPL-2.0-only OR GPL-3.0-only) AND BSD-3-Clause
- fedora 44: xpdf 1:4.06-2.fc44 ยท (GPL-2.0-only OR GPL-3.0-only) AND BSD-3-Clause
- nixpkgs unstable: xpdf 4.06
- Copyright 2002-2025 Glyph & Cog, LLC
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms