3 This is DVIPDFMx, an eXtended version of DVIPDFM by Mark A. Wicks.
5 Copyright (C) 2009-2013 by Jin-Hwan Cho, Matthias Franz, and Shunsaku Hirata,
6 the dvipdfmx project team.
8 Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu>
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
43 #include "pdflimits.h"
47 #include "pdfencrypt.h"
56 #include "pdfximage.h"
64 int compat_mode = 0; /* 0 = dvipdfmx, 1 = dvipdfm */
66 static int verbose = 0;
68 static int mp_mode = 0;
70 static long opt_flags = 0;
72 #define OPT_TPIC_TRANSPARENT_FILL (1 << 1)
73 #define OPT_CIDFONT_FIXEDPITCH (1 << 2)
74 #define OPT_FONTMAP_FIRST_MATCH (1 << 3)
75 #define OPT_PDFDOC_NO_DEST_REMOVE (1 << 4)
77 static char ignore_colors = 0;
78 static double annot_grow = 0.0;
79 static int bookmark_open = 0;
80 static double mag = 1.0;
81 static int font_dpi = 600;
82 static int really_quiet = 0;
84 * Precision is essentially limited to 0.01pt.
85 * See, dev_set_string() in pdfdev.c.
87 static int pdfdecimaldigits = 2;
89 /* Image cache life in hours */
90 /* 0 means erase all old images and leave new images */
91 /* -1 means erase all old images and also erase new images */
92 /* -2 means ignore image cache (default) */
93 static int image_cache_life = -2;
96 static int do_encryption = 0;
97 static unsigned key_bits = 40;
98 static unsigned permission = 0x003C;
101 static double paper_width = 595.0;
102 static double paper_height = 842.0;
103 static double x_offset = 72.0;
104 static double y_offset = 72.0;
105 static char landscape_mode = 0;
108 char *dvi_filename = NULL, *pdf_filename = NULL;
111 read_config_file (const char *config);
114 #define STRN_CMP strncasecmp
116 #define STRN_CMP strncmp
120 set_default_pdf_filename(void)
122 const char *dvi_base;
124 dvi_base = xbasename(dvi_filename);
126 strlen(dvi_base) > 4 &&
127 !STRN_CMP(".mps", dvi_base + strlen(dvi_base) - 4, 4)) {
128 pdf_filename = NEW(strlen(dvi_base)+1, char);
129 strncpy(pdf_filename, dvi_base, strlen(dvi_base) - 4);
130 pdf_filename[strlen(dvi_base)-4] = '\0';
131 } else if (strlen(dvi_base) > 4 &&
132 !STRN_CMP(".dvi", dvi_base+strlen(dvi_base)-4, 4)) {
133 pdf_filename = NEW(strlen(dvi_base)+1, char);
134 strncpy(pdf_filename, dvi_base, strlen(dvi_base)-4);
135 pdf_filename[strlen(dvi_base)-4] = '\0';
137 pdf_filename = NEW(strlen(dvi_base)+5, char);
138 strcpy(pdf_filename, dvi_base);
141 strcat (pdf_filename, ".pdf");
147 fprintf(stdout, "\nThis is %s-%s by the DVIPDFMx project team,\n", PACKAGE, VERSION);
148 fprintf(stdout, "modified for TeX Live,\n");
149 fprintf(stdout, "an extended version of dvipdfm-0.13.2c developed by Mark A. Wicks.\n");
150 fprintf(stdout, "\nCopyright (C) 2002-2013 by the DVIPDFMx project team\n");
151 fprintf(stdout, "\nThis is free software; you can redistribute it and/or modify\n");
152 fprintf(stdout, "it under the terms of the GNU General Public License as published by\n");
153 fprintf(stdout, "the Free Software Foundation; either version 2 of the License, or\n");
154 fprintf(stdout, "(at your option) any later version.\n");
160 fprintf(stdout, "\nUsage: dvipdfmx [options] dvifile\n");
161 fprintf(stdout, "-c \t\tIgnore color specials (for B&W printing)\n");
162 fprintf(stdout, "-d number\tSet PDF decimal digits (0-5) [2]\n");
163 fprintf(stdout, "-f filename\tSet font map file name [cid-x.map]\n");
164 fprintf(stdout, "-g dimension\tAnnotation \"grow\" amount [0.0in]\n");
165 fprintf(stdout, "-l \t\tLandscape mode\n");
166 fprintf(stdout, "-m number\tSet additional magnification\n");
167 fprintf(stdout, "-o filename\tSet output file name [dvifile.pdf]\n");
168 fprintf(stdout, "-p papersize\tSet papersize [a4]\n");
169 fprintf(stdout, "-q \t\tBe quiet\n");
170 fprintf(stdout, "-r resolution\tSet resolution (in DPI) for raster fonts [600]\n");
171 fprintf(stdout, "-s pages\tSelect page ranges (-)\n");
172 fprintf(stdout, "-t \t\tEmbed thumbnail images of PNG format [dvifile.1] \n");
173 fprintf(stdout, "-x dimension\tSet horizontal offset [1.0in]\n");
174 fprintf(stdout, "-y dimension\tSet vertical offset [1.0in]\n");
175 fprintf(stdout, "-z number \tSet zlib compression level (0-9) [9]\n");
177 fprintf(stdout, "-v \t\tBe verbose\n");
178 fprintf(stdout, "-vv\t\tBe more verbose\n");
179 fprintf(stdout, "-C number\tSpecify miscellaneous option flags [0]:\n");
180 fprintf(stdout, "\t\t 0x0001 reserved\n");
181 fprintf(stdout, "\t\t 0x0002 Use semi-transparent filling for tpic shading command,\n");
182 fprintf(stdout, "\t\t\t instead of opaque gray color. (requires PDF 1.4)\n");
183 fprintf(stdout, "\t\t 0x0004 Treat all CIDFont as fixed-pitch font.\n");
184 fprintf(stdout, "\t\t 0x0008 Do not replace duplicate fontmap entries.\n");
185 fprintf(stdout, "\t\t 0x0010 Do not optimize PDF destinations.\n");
186 fprintf(stdout, "\t\tPositive values are always ORed with previously given flags.\n");
187 fprintf(stdout, "\t\tAnd negative values replace old values.\n");
188 fprintf(stdout, "-D template\tPS->PDF conversion command line template [none]\n");
189 fprintf(stdout, "-E \t\tEnable DVIPDFM emulation mode\n");
190 fprintf(stdout, "-I number\tImage cache life in hours [-2]\n");
191 fprintf(stdout, " \t 0: erase all old images and leave new images\n");
192 fprintf(stdout, " \t-1: erase all old images and also erase new images\n");
193 fprintf(stdout, " \t-2: ignore image cache\n");
194 fprintf(stdout, "-K number\tEncryption key length [40]\n");
195 fprintf(stdout, "-O number\tSet maximum depth of open bookmark items [0]\n");
196 fprintf(stdout, "-P number\tSet permission flags for PDF encryption [0x003C]\n");
197 fprintf(stdout, "-S \t\tEnable PDF encryption\n");
198 fprintf(stdout, "-V number\tSet PDF minor version [4]\n");
199 fprintf(stdout, "\nAll dimensions entered on the command line are \"true\" TeX dimensions.\n");
200 fprintf(stdout, "Argument of \"-s\" lists physical page ranges separated by commas, e.g., \"-s 1-3,5-6\"\n");
201 fprintf(stdout, "Papersize is specified by paper format (e.g., \"a4\") or by w<unit>,h<unit> (e.g., \"20cm,30cm\").\n");
209 fprintf(stdout, "\nTry \"dvipdfmx --help\" for more information.\n");
215 read_length (double *vp, const char **pp, const char *endptr)
220 const char *_ukeys[] = {
226 "pt", "in", "cm", "mm", "bp",
231 q = parse_float_decimal(&p, endptr);
240 q = parse_c_ident(&p, endptr);
242 if (strlen(q) > strlen("true") &&
243 !memcmp(q, "true", strlen("true"))) {
244 q += strlen("true"); /* just skip "true" */
246 for (k = 0; _ukeys[k] && strcmp(_ukeys[k], q); k++);
248 case K_UNIT__PT: u *= 72.0 / 72.27; break;
249 case K_UNIT__IN: u *= 72.0; break;
250 case K_UNIT__CM: u *= 72.0 / 2.54 ; break;
251 case K_UNIT__MM: u *= 72.0 / 25.4 ; break;
252 case K_UNIT__BP: u *= 1.0 ; break;
254 WARN("Unknown unit of measure: %s", q);
261 *vp = v * u; *pp = p;
266 select_paper (const char *paperspec)
268 const struct paper *pi;
271 pi = paperinfo(paperspec);
272 if (pi && papername(pi)) {
273 paper_width = paperpswidth (pi);
274 paper_height = paperpsheight(pi);
276 const char *p = paperspec, *endptr, *comma;
277 comma = strchr(p, ',');
278 endptr = p + strlen(p);
280 ERROR("Unrecognized paper format: %s", paperspec);
281 error = read_length(&paper_width, &p, comma);
283 error = read_length(&paper_height, &p, endptr);
285 if (error || paper_width <= 0.0 || paper_height <= 0.0)
286 ERROR("Invalid paper size: %s (%.2fx%.2f)", paperspec, paper_width, paper_height);
292 } *page_ranges = NULL;
294 int num_page_ranges = 0;
295 int max_page_ranges = 0;
298 select_pages (const char *pagespec)
301 const char *p = pagespec;
304 /* Enlarge page range table if necessary */
305 if (num_page_ranges >= max_page_ranges) {
306 max_page_ranges += 4;
307 page_ranges = RENEW(page_ranges, max_page_ranges, struct page_range);
310 page_ranges[num_page_ranges].first = 0;
311 page_ranges[num_page_ranges].last = 0;
313 for ( ; *p && isspace(*p); p++);
314 q = parse_unsigned(&p, p + strlen(p)); /* Can't be signed. */
315 if (q) { /* '-' is allowed here */
316 page_ranges[num_page_ranges].first = atoi(q) - 1;
317 page_ranges[num_page_ranges].last = page_ranges[num_page_ranges].first;
320 for ( ; *p && isspace(*p); p++);
323 for (++p; *p && isspace(*p); p++);
324 page_ranges[num_page_ranges].last = -1;
326 q = parse_unsigned(&p, p + strlen(p));
328 page_ranges[num_page_ranges].last = atoi(q) - 1;
331 for ( ; *p && isspace(*p); p++);
334 page_ranges[num_page_ranges].last = page_ranges[num_page_ranges].first;
342 for ( ; *p && isspace(*p); p++);
344 ERROR("Bad page range specification: %s", p);
350 #define POP_ARG() {argv += 1; argc -= 1;}
351 /* It doesn't work as expected (due to dvi filename). */
352 #define CHECK_ARG(n,m) if (argc < (n) + 1) {\
354 fprintf(stderr, "\nMissing %s after \"-%c\".\n", (m), *flag);\
359 set_verbose (int argc, char *argv[])
362 if(*argv[0] == '-') {
365 for (flag = argv[0] + 1; *flag != 0; flag++) {
380 for (i = 0; i < verbose; i++) {
382 pdf_dev_set_verbose();
383 pdf_doc_set_verbose();
384 pdf_enc_set_verbose();
385 pdf_obj_set_verbose();
386 pdf_fontmap_set_verbose();
387 dpx_file_set_verbose();
394 do_args (int argc, char *argv[])
396 while (argc > 0 && *argv[0] == '-') {
397 char *flag, *nextptr;
398 const char *nnextptr;
400 for (flag = argv[0] + 1; *flag != 0; flag++) {
404 if (!strcmp(flag, "help")) {
408 } else if (!strcmp(flag, "version")) {
414 fprintf(stderr, "Unknown option in \"--%s\"", flag);
418 CHECK_ARG(1, "PS->PDF conversion command line template");
419 set_distiller_template(argv[1]);
423 CHECK_ARG(1, "bitmap font dpi");
424 font_dpi = atoi(argv[1]);
426 ERROR("Invalid bitmap font dpi specified: %s", argv[1]);
430 CHECK_ARG(1, "magnification value");
431 mag = strtod(argv[1], &nextptr);
432 if (mag < 0.0 || nextptr == argv[1])
433 ERROR("Invalid magnification specifiied: %s", argv[1]);
437 CHECK_ARG(1, "annotation \"grow\" amount");
438 nnextptr = nextptr = argv[1];
439 read_length(&annot_grow, &nnextptr, nextptr + strlen(nextptr));
443 CHECK_ARG(1, "horizontal offset value");
444 nnextptr = nextptr = argv[1];
445 read_length(&x_offset, &nnextptr, nextptr + strlen(nextptr));
449 CHECK_ARG(1, "vertical offset value");
450 nnextptr = nextptr = argv[1];
451 read_length(&y_offset, &nnextptr, nextptr + strlen(nextptr));
455 CHECK_ARG(1, "output file name");
456 pdf_filename = NEW (strlen(argv[1])+1,char);
457 strcpy(pdf_filename, argv[1]);
461 CHECK_ARG(1, "page selection specification");
462 select_pages(argv[1]);
466 pdf_doc_enable_manual_thumbnails();
469 CHECK_ARG(1, "paper format/size");
470 select_paper(argv[1]);
480 CHECK_ARG(1, "fontmap file name");
481 if (opt_flags & OPT_FONTMAP_FIRST_MATCH)
482 pdf_load_fontmap_file(argv[1], FONTMAP_RMODE_APPEND);
484 pdf_load_fontmap_file(argv[1], FONTMAP_RMODE_REPLACE);
493 if (isdigit(*(flag+1))) {
495 ver_minor = atoi(flag);
497 CHECK_ARG(1, "PDF minor version number");
498 ver_minor = atoi(argv[1]);
501 if (ver_minor < PDF_VERSION_MIN) {
502 WARN("PDF version 1.%d not supported. Using PDF 1.%d instead.",
503 ver_minor, PDF_VERSION_MIN);
504 ver_minor = PDF_VERSION_MIN;
505 } else if (ver_minor > PDF_VERSION_MAX) {
506 WARN("PDF version 1.%d not supported. Using PDF 1.%d instead.",
507 ver_minor, PDF_VERSION_MAX);
508 ver_minor = PDF_VERSION_MAX;
510 pdf_set_version((unsigned) ver_minor);
517 if (isdigit(*(flag+1))) {
521 CHECK_ARG(1, "compression level");
522 level = atoi(argv[1]);
525 pdf_set_compression(level);
530 WARN("dvipdfm \"-d\" option not supported.");
533 if (isdigit(*(flag+1))) {
535 pdfdecimaldigits = atoi(flag);
537 CHECK_ARG(1, "number of fractional digits");
538 pdfdecimaldigits = atoi(argv[1]);
543 CHECK_ARG(1, "image cache life in hours");
544 image_cache_life = atoi(argv[1]);
551 CHECK_ARG(1, "encryption key length");
552 key_bits = (unsigned) atoi(argv[1]);
553 if (key_bits < 40 || key_bits > 128 || (key_bits & 0x7))
554 ERROR("Invalid encryption key length specified: %s", argv[1]);
558 CHECK_ARG(1, "encryption permission flag");
559 permission = (unsigned) strtoul(argv[1], &nextptr, 0);
560 if (nextptr == argv[1])
561 ERROR("Invalid encryption permission flag: %s", argv[1]);
565 /* Bookmark open level */
566 CHECK_ARG(1, "bookmark open level");
567 bookmark_open = atoi(argv[1]);
574 CHECK_ARG(1, "a number");
578 flags = (unsigned) strtol(argv[1], &nextptr, 0);
579 if (nextptr == argv[1])
580 ERROR("Invalid flag: %s", argv[1]);
592 CHECK_ARG(1, "subsidiary config file");
593 read_config_file(argv[1]);
598 WARN("dvipdfm \"-e\" option not supported.");
600 } /* else fall through */
603 fprintf(stderr, "Unknown option in \"-%s\"", flag);
613 fprintf(stderr, "Multiple dvi filenames?");
615 } else if (argc > 0) {
617 * The only legitimate way to have argc == 0 here is
618 * do_args was called from config file. In that case, there is
619 * no dvi file name. Check for that case .
621 if (!mp_mode && STRN_CMP(".dvi", argv[0] + strlen(argv[0]) - 4, 4)) {
622 dvi_filename = NEW(strlen(argv[0]) + 5, char);
623 strcpy(dvi_filename, argv[0]);
624 strcat(dvi_filename, ".dvi");
626 dvi_filename = NEW(strlen(argv[0]) + 1, char);
627 strcpy(dvi_filename, argv[0]);
636 RELEASE(dvi_filename);
638 RELEASE(pdf_filename);
640 RELEASE(page_ranges);
644 read_config_file (const char *config)
646 const char *start, *end;
650 fp = DPXFOPEN(config, DPX_RES_TYPE_TEXT);
652 WARN("Could not open config file \"%s\".", config);
655 while ((start = mfgets (work_buffer, WORK_BUFFER_SIZE, fp)) != NULL) {
660 end = work_buffer + strlen(work_buffer);
661 skip_white (&start, end);
664 /* Build up an argument list as if it were passed on the command
666 if ((option = parse_ident (&start, end))) {
668 argv[0] = NEW (strlen(option)+2, char);
669 strcpy (argv[0]+1, option);
672 skip_white (&start, end);
676 argv[1] = parse_c_string (&start, end);
679 argv[1] = parse_ident (&start, end);
682 do_args (argc, argv);
684 RELEASE (argv[--argc]);
692 system_default (void)
694 if (systempapername() != NULL) {
695 select_paper(systempapername());
696 } else if (defaultpapername() != NULL) {
697 select_paper(defaultpapername());
704 pdf_close_images(); /* delete temporary files */
707 remove(pdf_filename);
709 fprintf(stderr, "\nOutput file removed.\n");
713 #define SWAP(v1,v2) do {\
722 long page_no, page_count, i, step;
723 double page_width, page_height;
726 spc_exec_at_begin_document();
728 if (num_page_ranges == 0) {
730 page_ranges = NEW(1, struct page_range);
733 page_ranges[0].first = 0;
734 page_ranges[0].last = -1; /* last page */
738 page_width = paper_width;
739 page_height = paper_height;
744 mediabox.urx = paper_width;
745 mediabox.ury = paper_height;
747 pdf_doc_set_mediabox(0, &mediabox); /* Root node */
749 for (i = 0; i < num_page_ranges; i++) {
750 if (page_ranges[i].last < 0)
751 page_ranges[i].last += dvi_npages();
753 step = (page_ranges[i].first <= page_ranges[i].last) ? 1 : -1;
754 page_no = page_ranges[i].first;
756 if (page_no < dvi_npages()) {
760 MESG("[%d", page_no+1);
761 /* Users want to change page size even after page is started! */
762 w = page_width; h = page_height; lm = landscape_mode;
763 xo = x_offset; yo = y_offset;
764 dvi_scan_specials(page_no, &w, &h, &xo, &yo, &lm, NULL, NULL, NULL, NULL, NULL, NULL);
765 if (lm != landscape_mode) {
769 if (page_width != w || page_height != h) {
773 if (x_offset != xo || y_offset != yo) {
777 if (page_width != paper_width ||
778 page_height != paper_height) {
781 mediabox.urx = page_width;
782 mediabox.ury = page_height;
783 pdf_doc_set_mediabox(page_count+1, &mediabox);
786 page_width, page_height, x_offset, y_offset);
792 page_no >= page_ranges[i].last)
795 page_no <= page_ranges[i].last)
803 if (page_count < 1) {
804 ERROR("No pages fall in range!");
807 spc_exec_at_end_document();
816 fp = MFOPEN(dvi_filename, FOPEN_RBIN_MODE);
821 int i, page_no, step, page_count = 0;
823 /* Process filename.1, filename.2,... */
824 filename = NEW(strlen(dvi_filename) + 16 + 1, char);
825 for (i = 0; i < num_page_ranges; i++) {
826 if (page_ranges[i].last < 0)
827 ERROR("Invalid page number for MPS input: -1");
829 step = (page_ranges[i].first <= page_ranges[i].last) ? 1 : -1;
830 page_no = page_ranges[i].first;
832 sprintf(filename, "%s.%d", dvi_filename, page_no + 1);
833 fp = MFOPEN(filename, FOPEN_RBIN_MODE);
835 MESG("[%d<%s>", page_no + 1, filename);
842 page_no >= page_ranges[i].last)
845 page_no <= page_ranges[i].last)
854 ERROR("No page output for \"%s\".", dvi_filename);
859 /* TODO: MetaPost mode */
864 main (int argc, char *argv[])
869 const char *base = xbasename(argv[0]);
871 if (STRN_CMP(base, "dvipdfmx", 8) != 0 &&
872 (STRN_CMP(base, "dvipdfm",7) == 0 || STRN_CMP(base, "ebb", 3) == 0))
875 if (STRN_CMP(base, "extractbb", 9) == 0 ||
876 STRN_CMP(base, "xbb", 3) == 0 ||
877 STRN_CMP(base, "ebb", 3) == 0)
878 return extractbb(argc, argv);
883 fprintf(stderr, "No dvi filename specified.");
891 kpse_set_program_name(argv[0], PACKAGE);
900 set_verbose(argc, argv);
901 /* quiet mode cannot be set in config file */
905 pdf_init_fontmaps(); /* This must come before parsing options... */
907 read_config_file(DPX_CONFIG_FILE);
909 do_args (argc, argv);
912 kpse_init_prog("", font_dpi, NULL, NULL);
913 kpse_set_program_enabled(kpse_pk_format, true, kpse_src_texmf_cnf);
915 pdf_font_set_dpi(font_dpi);
916 dpx_delete_old_cache(image_cache_life);
919 WARN("No dvi filename specified.");
924 /* Check for ".dvi" at end of argument name */
925 if (pdf_filename == NULL)
926 set_default_pdf_filename();
928 MESG("%s -> %s\n", dvi_filename, pdf_filename);
930 pdf_enc_compute_id_string(dvi_filename, pdf_filename);
932 if (key_bits > 40 && pdf_get_version() < 4)
933 ERROR("Chosen key length requires at least PDF 1.4. "
934 "Use \"-V 4\" to change.");
935 pdf_enc_set_passwd(key_bits, permission, NULL, NULL);
941 dvi2pts = 0.01; /* dvi2pts controls accuracy. */
943 unsigned ver_minor = 0;
944 char owner_pw[MAX_PWD_LEN], user_pw[MAX_PWD_LEN];
945 /* Dependency between DVI and PDF side is rather complicated... */
946 dvi2pts = dvi_init(dvi_filename, mag);
948 ERROR("dvi_init() failed!");
950 pdf_doc_set_creator(dvi_comment());
953 /* command line takes precedence */
954 dvi_scan_specials(0, &paper_width, &paper_height, &x_offset, &y_offset, &landscape_mode,
955 &ver_minor, NULL, NULL, NULL, NULL, NULL);
957 dvi_scan_specials(0, &paper_width, &paper_height, &x_offset, &y_offset, &landscape_mode,
958 &ver_minor, &do_encryption, &key_bits, &permission, owner_pw, user_pw);
960 if (key_bits < 40 || key_bits > 128 || (key_bits & 0x7))
961 ERROR("Invalid encryption key length specified: %u", key_bits);
962 else if (key_bits > 40 && pdf_get_version() < 4)
963 ERROR("Chosen key length requires at least PDF 1.4. "
964 "Use \"-V 4\" to change.");
966 pdf_enc_set_passwd(key_bits, permission, owner_pw, user_pw);
969 if (ver_minor >= PDF_VERSION_MIN && ver_minor <= PDF_VERSION_MAX) {
970 pdf_set_version(ver_minor);
972 if (landscape_mode) {
973 SWAP(paper_width, paper_height);
979 /* Set default paper size here so that all page's can inherite it.
980 * annot_grow: Margin of annotation.
981 * bookmark_open: Miximal depth of open bookmarks.
983 pdf_open_document(pdf_filename, do_encryption,
984 paper_width, paper_height, annot_grow, bookmark_open,
985 !(opt_flags & OPT_PDFDOC_NO_DEST_REMOVE));
987 /* Ignore_colors placed here since
988 * they are considered as device's capacity.
990 pdf_init_device(dvi2pts, pdfdecimaldigits, ignore_colors);
992 if (opt_flags & OPT_CIDFONT_FIXEDPITCH)
993 CIDFont_set_flags(CIDFONT_FORCE_FIXEDPITCH);
995 /* Please move this to spc_init_specials(). */
996 if (opt_flags & OPT_TPIC_TRANSPARENT_FILL)
997 tpic_set_fill_mode(1);
1007 /* Order of close... */
1008 pdf_close_device ();
1009 /* pdf_close_document flushes XObject (image) and other resources. */
1010 pdf_close_document();
1012 pdf_close_fontmaps(); /* pdf_font may depend on fontmap. */
1022 miktex_uninitialize ();