1%% dvipdfmx.cfg for dvipdfmx and xdvipdfmx.  (Public domain.)
2%%
3%% PDF Version Setting
4%%
5%% PDF (minor) version stamp to use in output file.
6%% This also implies maximal version of PDF file allowed to be included.
7%% Dvipdfmx does not support 1.0, 1.1, 1.2 since TrueType font embedded
8%% as CIDFontType2 requires at least version 1.3. Transparent imaging
9%% model requires version 1.4. So if you want soft-masking support for
10%% PNG image with alpha channels, you should set version to 4 or higher.
11%% PDF 1.5 enables object compression.
12
13V  5
14
15%% Dvipdfmx Compatibility Flags
16%%
17%%   0x0002  Use semi-transparent filling for tpic shading command,
18%%           instead of opaque gray color. (requires PDF 1.4)
19%%   0x0004  Treat all CIDFont as fixed-pitch font.
20%%           This is only for backward compatibility. Don't use that.
21%%   0x0008  Do not replace duplicate fontmap entries.
22%%           Dvipdfm's (not 'x') behaviour.
23%%   0x0010  Do not optimize PDF destinations. Use this if you want to
24%%           refer from other files to destinations in the current file.
25
26%C  0x0000
27
28%% PDF Document Settings
29%%
30%% Papersize Option:
31%%
32%%   p papersize-spec
33%%
34%% papersize-spec is 'paper-format' or length-pair, e.g., 'a4', 'letter',
35%% '20cm,30cm'. Recognized unit is 'cm', 'mm', 'bp', 'pt', 'in'.
36%%
37%% FreeBSD-specific: papersize-spec is configured via libpaper when the
38%% below "p" line is commented out.  PAPERSIZE environment variable
39%% and/or /usr/local/etc/papersize file is used.  See paperconfig(8) manual
40%% page for more detaul.
41
42%% p  a4
43
44%% Annotation Box Margin:
45%%
46%%   g length
47%%
48%% Add margin to annotation rectangle created via various \specials. Many
49%% TeX macro packages set the annotation bounding box equal to the TeX box
50%% that encloses the material. That's not always what you want.
51%% Annotations created by pdf:bannot/pdf:eannot is also affected.
52
53%g  0
54
55%% Bookmark Open Level:
56%%
57%%   O integer
58%%
59%% Mark bookmark (outline) item as initial state 'open' if the depth
60%% of that item (from root node) is less than or equal to the integer
61%% specified with this option.
62
63O  0
64
65%% PDF Security (Encryption) Setting
66%%
67%% Those options won't take effects unless you use flag 'S'.
68%%
69%% Key bits for PDF encryption (40 - 128)
70
71K  40
72
73%% Permission flag for PDF encryption: Revision will be 3 if the key size
74%% is greater than 40 bits.
75%%
76%% 0x0004 (Revision 2) Print the document.
77%%        (Revision 3) Print the document (possibly not at the highest quality
78%%        level, depending on whether bit 12[0x0800] is also set).
79%% 0x0008 Modify the contents of the document by operations other than those
80%%        controlled by bits 6[0x0020], 9[0x0100], and 11[0x0400].
81%% 0x0010 (Revision 2) Copy or otherwise extract text and graphics from the
82%%        document, including extracting text and graphics (in support of
83%%        accessibility to disabled users or for other purposes).
84%%        (Revision 3) Copy or otherwise extract text and grphics from the
85%%        document by operations other than that controlled by bit 10[0x0200].
86%% 0x0020 Add or modify text annotations, fill in interactive form fields,
87%%        and, if bit 4[0x0008] is also set, create or modify interactive
88%%        form fields (including signature fields).
89%%
90%% (Revision 3 only)
91%% 0x0100 Fill in existing interactive form fields (including signature
92%%        fields), even if bit 6 is clear.
93%% 0x0200 Extract text and graphics (in support of accessibility to disabled
94%%        users or for other purposes).
95%% 0x0400 Assemble the document (insert, rotate, or delete pages and create
96%%        bookmarks or thumbnail images), even if bit 4 is clear.
97%% 0x0800 Print the document to a representation from which a faithful digital
98%%        copy of the PDF content could be generated. When this bit is clear
99%%        (and bit 3 is set), printing is limited to a low-level representation
100%%        of the appearance, possibly of degraded quality.
101
102P  0x003C
103
104%% Image Handler
105%%
106%% With 'D' option dvipdfmx may invoke shell command via system()
107%% function call.
108%%
109%% Command-line template for a-to-b conversion:
110%%
111%% Supported target format ('b') is currently PDF.
112%% Percent sign '%' is special character:
113%%
114%%   %i  Input file name (FQPN). Name of file to be converted to PDF.
115%%   %o  Output file name (FQPN). Temporary file to store conversion
116%%       result. Removed after inclusion is finished. (regardless of
117%%       success or failure)
118%%   %b  The "base" name of the input file, e.g., "foo" instead of
119%%       "foo.eps".
120%%   %v  The PDF version to be converted to, e.g. "1.4" for PDF 1.4.
121%%   %%  Replaced with single '%'.
122
123%% Ghostscript (PS-to-PDF and PDF-to-PDF):
124%%
125%% ps2pdf is a front-end to gs. For a complete list of options, see
126%% http://ghostscript.com/doc/current/Ps2pdf.htm#Options
127%%
128%% In TeX Live, we use the rungs wrapper instead of ps2pdf, becuse we
129%% must omit the -dSAFER which ps2pdf specifies: in order for pstricks
130%% to work with xetex,
131%% /usr/local/texlive/*/texmf-dist/dvips/pstricks/pstricks.pro (for
132%% example) needs to be accessed.  Also, it is better to use our
133%% supplied gs on Windows.
134%%
135%% Without the -dEPSCROP below, an eps file with negative llx/lly (as
136%% created by MetaPost, for example) fails.  In 2013, changes were made
137%% to the drivers xetex.def, dvipdfmx.def, etc., to handle non-zero
138%% llx/lly so we could use it.  The file epsf-dvipdfmx.tex is available
139%% from CTAN/TL/etc. to support plain's epsf.tex.
140%%
141%% In 2014, we discovered that -sPAPERSIZE=a0 was needed to support
142%% pstricks under xetex; otherwise, images were cropped (see thread at
143%% http://tug.org/pipermail/xetex/2014-November/025664.html).
144%% Happily, it seems that using both -dEPSCROP and -sPAPERSIZE=a0
145%% simultaneously works ok.  So that's we do below.
146%%
147%% By default, gs encodes all images contained in a PS file using
148%% the lossy DCT (i.e., JPEG) filter. This often leads to inferior
149%% result (see the discussion at http://electron.mit.edu/~gsteele/pdf/).
150%% The "-dAutoFilterXXXImages" and "-dXXXImageFilter" options used
151%% below force all images to be encoded with the lossless Flate (zlib,
152%% same as PNG) filter. Note that if the PS file already contains DCT
153%% encoded images (which is possible in PS level 2), then these images
154%% will also be re-encoded using Flate. To turn the conversion off,
155%% simply remove the options mentioned above.
156%%
157%% Incidentally, especially in TL, more than one dvipdfmx.cfg may be
158%% extant.  You can find the one that is active by running:
159%% kpsewhich -progname=dvipdfmx -format='other text files' dvipdfmx.cfg
160%% and control which one is found by setting DVIPDFMXINPUTS.
161%%
162D  "rungs -q -dNOPAUSE -dBATCH -dEPSCrop -sPAPERSIZE=a0 -sDEVICE=pdfwrite -dCompatibilityLevel=%v -dAutoFilterGrayImages=false -dGrayImageFilter=/FlateEncode -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -sOutputFile='%o' '%i' -c quit"
163
164% other random ps converters people have experimented with.
165%D "/usr/local/bin/ps2pdf -dEPSCrop '%i' '%o'"
166%D "/usr/texbin/epstopdf '%i' -o '%o'"
167%D "/usr/bin/pstopdf '%i' -o '%o'"
168%
169%% Frank Siegert's PStill:
170%D  "/usr/local/bin/pstill -c -o '%o' '%i'"
171%
172%% Batik + Fop (SVG-to-PDF):
173%% If you want both PS and SVG, you need to write a script or program
174%% that selectively invokes converters.
175%D  "java -classpath classpaths -jar /path/to/batik-rasterizer.jar -m application/pdf -d '%o' '%i'"
176%
177%% There are no way to directly know suggested size of (raster) images.
178%% You may want to use %b here, since you can try reading the ebb file
179%% to see what is natural (physical) size of images.
180%D  "ras2pdf -r 300x300 -b '%b.bb' -o '%o' '%i'"
181%
182%% ImageMagick:
183%% Easiest way to support various file formats.
184%D  "convert '%i' 'epdf:%o'"
185
186%% Other Options
187%%
188%% DPI for PK font creation
189
190%r  600
191
192%% Set number of fractional digit kept for various numbers in PDF page
193%% content output. By setting this to 2 (default), dvipdfmx rounds
194%% real numbers at 2nd fractional (decimal) digit; e.g., "3.14159" is
195%% written as "3.14". Increasing this to more than 2 isn't meaningful
196%% for old Acrobat due to implementation limit of Acrobat.
197%% Length 0.01 in unscaled coordinate system amount to width of 1 pixel
198%% in 7200ppi display.
199
200%d  5
201
202%% Image cache life in hours
203%%  0 means erase all old images and leave new images
204%% -1 means erase all old images and also erase new images
205%% -2 means ignore image cache
206%I -2
207
208%% Font Map Files
209%%
210%% teTeX 2.x and TeX Live using updmap (pdfTeX format)
211f  pdftex.map
212
213%% teTeX 2.x and TeX Live using updmap (DVIPDFM format)
214%f dvipdfm.map
215
216%% teTeX 2.x and TeX Live using updmap (DVIPS format)
217%% MiKTeX 2.2 and 2.3
218%f psfonts.map
219
220%% Put additional fontmap files here (usually for Type0 fonts)
221%f  cid-x.map
222
223% the following file is generated by updmap(-sys) from the
224% KanjiMap entries in the updmap.cfg file.
225f kanjix.map
226% minimal example for Chinese and Korean users
227% improvements please to tex-live@tug.org
228f ckx.map
229
230%% Include other config files
231%i <filename>
232