Index: eps.c =================================================================== --- eps.c (revision 29235) +++ eps.c (revision 29236) @@ -46,6 +46,7 @@ static int print_layer[PCB_MAX_LAYER]; static int fast_erase = -1; static pcb_composite_op_t drawing_mode; +static long eps_drawn_objs; static pcb_export_opt_t eps_attribute_list[] = { /* other HIDs expect this to be first. */ @@ -322,6 +323,7 @@ options = eps_values; } + eps_drawn_objs = 0; pcb_cam_begin(PCB, &eps_cam, &xform, options[HA_cam].str, eps_attribute_list, NUM_OPTIONS, options); filename = options[HA_psfile].str; @@ -346,9 +348,14 @@ fclose(f); - if (pcb_cam_end(&eps_cam) == 0) + if (pcb_cam_end(&eps_cam) == 0) { if (!eps_cam.okempty_group) pcb_message(PCB_MSG_ERROR, "eps cam export for '%s' failed to produce any content (layer group missing)\n", options[HA_cam].str); + } + else if (eps_drawn_objs == 0) { + if (!eps_cam.okempty_content) + pcb_message(PCB_MSG_ERROR, "eps cam export for '%s' failed to produce any content (no objects)\n", options[HA_cam].str); + } } static int eps_parse_arguments(pcb_hid_t *hid, int *argc, char ***argv) @@ -498,6 +505,7 @@ static void use_gc(pcb_hid_gc_t gc) { + eps_drawn_objs++; if (linewidth != gc->width) { pcb_fprintf(f, "%mi setlinewidth\n", gc->width); linewidth = gc->width; Index: ps.c =================================================================== --- ps.c (revision 29235) +++ ps.c (revision 29236) @@ -336,6 +336,7 @@ pcb_composite_op_t drawing_mode; int ovr_all; + long drawn_objs; } global; static pcb_export_opt_t *ps_get_export_options(pcb_hid_t *hid, int *n) @@ -621,6 +622,7 @@ options = global.ps_values; } + global.drawn_objs = 0; pcb_cam_begin(PCB, &ps_cam, &xform, options[HA_cam].str, ps_attribute_list, NUM_OPTIONS, options); global.filename = options[HA_psfile].str; @@ -660,9 +662,15 @@ fclose(fh); } - if (pcb_cam_end(&ps_cam) == 0) + if (pcb_cam_end(&ps_cam) == 0) { if (!ps_cam.okempty_group) pcb_message(PCB_MSG_ERROR, "ps cam export for '%s' failed to produce any content (layer group missing)\n", options[HA_cam].str); + } + else if (global.drawn_objs == 0) { + if (!ps_cam.okempty_content) + pcb_message(PCB_MSG_ERROR, "ps cam export for '%s' failed to produce any content (no objects)\n", options[HA_cam].str); + } + } static int ps_parse_arguments(pcb_hid_t *hid, int *argc, char ***argv) @@ -1011,6 +1019,7 @@ static int lastcap = -1; static int lastcolor = -1; + global.drawn_objs++; if (gc == NULL) { lastcap = lastcolor = -1; return;