MCPcopy Create free account
hub / github.com/OpenPrinting/cups / write_labels

Function write_labels

filter/pstops.c:3284–3320  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3282 */
3283
3284static void
3285write_labels(pstops_doc_t *doc, /* I - Document information */
3286 int orient) /* I - Orientation of the page */
3287{
3288 float width, /* Width of page */
3289 length; /* Length of page */
3290
3291
3292 doc_puts(doc, "gsave\n");
3293
3294 if ((orient ^ Orientation) & 1)
3295 {
3296 width = PageLength;
3297 length = PageWidth;
3298 }
3299 else
3300 {
3301 width = PageWidth;
3302 length = PageLength;
3303 }
3304
3305 switch (orient & 3)
3306 {
3307 case 1 : /* Landscape */
3308 doc_printf(doc, "%.1f 0.0 translate 90 rotate\n", length);
3309 break;
3310 case 2 : /* Reverse Portrait */
3311 doc_printf(doc, "%.1f %.1f translate 180 rotate\n", width, length);
3312 break;
3313 case 3 : /* Reverse Landscape */
3314 doc_printf(doc, "0.0 %.1f translate -90 rotate\n", width);
3315 break;
3316 }
3317
3318 doc_puts(doc, "ESPwl\n");
3319 doc_puts(doc, "grestore\n");
3320}
3321
3322
3323/*

Callers 1

end_nupFunction · 0.85

Calls 2

doc_putsFunction · 0.85
doc_printfFunction · 0.85

Tested by

no test coverage detected