void ps_printer::begin_page(int n) { out.begin_comment("Page:") .comment_arg(i_to_a(n)); out.comment_arg(i_to_a(++pages_output)) .end_comment(); output_style.f = 0; output_space_code = 32; output_draw_point_size = -1; output_line_thickness = -1; output_hpos = output_vpos = -1; ndefined_styles = 0; out.simple_comment("BeginPageSetup"); #if 0 /* * NOTE: * may decide to do this once per page */ media_set(); #endif out.put_symbol("BP") .simple_comment("EndPageSetup"); if (sbuf_color != default_color) set_color(&sbuf_color); }
void ps_printer::media_set() { /* * The setpagedevice implies an erasepage and initgraphics, and * must thus precede any descriptions for a particular page. * * NOTE: * This does not work with ps2pdf when there are included eps * segments that contain PageSize/setpagedevice. * This might be a bug in ghostscript -- must be investigated. * Using setpagedevice in an .eps is really the wrong concept, anyway. * * NOTE: * For the future, this is really the place to insert other * media selection features, like: * MediaColor * MediaPosition * MediaType * MediaWeight * MediaClass * TraySwitch * ManualFeed * InsertSheet * Duplex * Collate * ProcessColorModel * etc. */ if (!(broken_flags & (USE_PS_ADOBE_2_0|NO_PAPERSIZE))) { out.begin_comment("BeginFeature:") .comment_arg("*PageSize") .comment_arg(media_name()) .end_comment(); int w = media_width(); int h = media_height(); if (w > 0 && h > 0) // warning to user is done elsewhere fprintf(out.get_file(), "<< /PageSize [ %d %d ] /ImagingBBox null >> setpagedevice\n", w, h); out.simple_comment("EndFeature"); } }