Index: draw_eps.c =================================================================== --- draw_eps.c (revision 36263) +++ draw_eps.c (revision 36264) @@ -81,8 +81,9 @@ fprintf(pctx->outf, "%%%%EOF\n"); } -void rnd_eps_init(rnd_eps_t *pctx, rnd_box_t bounds, double scale, int in_mono, int as_shown) +void rnd_eps_init(rnd_eps_t *pctx, FILE *f, rnd_box_t bounds, double scale, int in_mono, int as_shown) { + pctx->outf = f; pctx->linewidth = -1; pctx->lastcap = -1; pctx->lastcolor = -1; Index: draw_eps.h =================================================================== --- draw_eps.h (revision 36263) +++ draw_eps.h (revision 36264) @@ -21,8 +21,8 @@ double spare_d1, spare_d2, spare_d3, spare_d4; } rnd_eps_t; -/* Set up context before the file is open */ -void rnd_eps_init(rnd_eps_t *pctx, rnd_box_t bounds, double scale, int in_mono, int as_shown); +/* Set up context for a file */ +void rnd_eps_init(rnd_eps_t *pctx, FILE *f, rnd_box_t bounds, double scale, int in_mono, int as_shown); /* Set up output file and print header before export, footer after export */ void rnd_eps_print_header(rnd_eps_t *pctx, const char *outfn, int ymirror); Index: eps.c =================================================================== --- eps.c (revision 36263) +++ eps.c (revision 36264) @@ -166,8 +166,6 @@ options_ = options; - pctx->outf = the_file; - region.X1 = 0; region.Y1 = 0; region.X2 = PCB->hidlib.size_x; @@ -228,7 +226,7 @@ qsort(pcb_layer_stack, pcb_max_layer(PCB), sizeof(pcb_layer_stack[0]), layer_sort); } - rnd_eps_init(pctx, *bnds, options_[HA_scale].dbl, options[HA_mono].lng, options[HA_as_shown].lng); + rnd_eps_init(pctx, the_file, *bnds, options_[HA_scale].dbl, options[HA_mono].lng, options[HA_as_shown].lng); if (pctx->outf != NULL) rnd_eps_print_header(pctx, rnd_hid_export_fn(filename), pctx->as_shown && conf_core.editor.show_solder_side);