Make error sheet two-sided as needed.
@@ -1517,8 +1517,10 @@ generate_job_error_sheet(
pdfio_stream_t *st; // Page stream
pdfio_obj_t *courier; // Courier font
pdfio_dict_t *dict; // Page dictionary
+ size_t i, // Looping var
+ count; // Number of pages
const char *msg; // Current message
- size_t count; // Number of messages
+ size_t mcount; // Number of messages
// Create a page dictionary with the Courier font...
@@ -1527,6 +1529,15 @@ generate_job_error_sheet(
pdfioPageDictAddFont(dict, "F1", courier);
+ // Figure out how many impressions to produce...
+ if (!strcmp(p->options->sides, "one-sided"))
+ count = 1;
+ else
+ count = 2;
+
+ // Create pages...
+ for (i = 0; i < count; i ++)
+ {
// Create the error sheet...
st = pdfio_start_page(p, dict);
@@ -1548,16 +1559,16 @@ generate_job_error_sheet(
pdfioContentSetTextFont(st, "F1", XFORM_TEXT_SIZE);
pdfioContentSetTextLeading(st, XFORM_TEXT_HEIGHT);
- for (msg = (const char *)cupsArrayGetFirst(p->errors), count = 0; msg; msg = (const char *)cupsArrayGetNext(p->errors))
+ for (msg = (const char *)cupsArrayGetFirst(p->errors), mcount = 0; msg; msg = (const char *)cupsArrayGetNext(p->errors))
{
if (*msg == 'E')
{
pdfioContentTextShowf(st, false, " %s\n", msg + 1);
- count ++;
+ mcount ++;
}
}
- if (count == 0)
+ if (mcount == 0)
pdfioContentTextShow(st, false, " No Errors\n");
pdfioContentSetTextFont(st, "F1", 2.0 * XFORM_TEXT_SIZE);
@@ -1568,20 +1579,21 @@ generate_job_error_sheet(
pdfioContentSetTextFont(st, "F1", XFORM_TEXT_SIZE);
pdfioContentSetTextLeading(st, XFORM_TEXT_HEIGHT);
- for (msg = (const char *)cupsArrayGetFirst(p->errors), count = 0; msg; msg = (const char *)cupsArrayGetNext(p->errors))
+ for (msg = (const char *)cupsArrayGetFirst(p->errors), mcount = 0; msg; msg = (const char *)cupsArrayGetNext(p->errors))
{
if (*msg == 'I')
{
pdfioContentTextShowf(st, false, " %s\n", msg + 1);
- count ++;
+ mcount ++;
}
}
- if (count == 0)
+ if (mcount == 0)
pdfioContentTextShow(st, false, " No Warnings\n");
pdfioContentTextEnd(st);
pdfio_end_page(p, st);
+ }
return (true);
}
