+ if (draw_mode)
+ {
+ string_map_destroy (&options);
+ return;
+ }
+
+ /* Render to <base>.txt. */
+ if (render_txt)
+ {
+ string_map_clear (&options);
+ string_map_insert_nocopy (&options, xstrdup ("output-file"),
+ xasprintf ("%s.txt", output_base));
+ driver = output_driver_create (&options);
+ if (driver == NULL)
+ exit (EXIT_FAILURE);
+ output_driver_register (driver);
+ }
+
+#ifdef HAVE_CAIRO
+ /* Render to <base>.pdf. */
+ if (render_pdf)
+ {
+ string_map_clear (&options);
+ string_map_insert_nocopy (&options, xstrdup ("output-file"),
+ xasprintf ("%s.pdf", output_base));
+ string_map_insert (&options, "top-margin", "0");
+ string_map_insert (&options, "bottom-margin", "0");
+ string_map_insert (&options, "left-margin", "0");
+ string_map_insert (&options, "right-margin", "0");
+ string_map_insert_nocopy (&options, xstrdup ("paper-size"),
+ xasprintf ("%dx%dpt", width * 5, length * 8));
+ if (min_break >= 0)
+ {
+ string_map_insert_nocopy (&options, xstrdup ("min-hbreak"),
+ xasprintf ("%d", min_break * 5));
+ string_map_insert_nocopy (&options, xstrdup ("min-vbreak"),
+ xasprintf ("%d", min_break * 8));
+ }
+ driver = output_driver_create (&options);
+ if (driver == NULL)
+ exit (EXIT_FAILURE);
+ output_driver_register (driver);
+ }
+#endif