From 7f001d1fb95273b59b5ccf6a6db5bd98a4ad802b Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Tue, 16 Mar 2010 15:17:33 +0000 Subject: Added Fl_PSfile_Device::start_job() with user-given filename. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7277 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_PS_Printer.cxx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Fl_PS_Printer.cxx b/src/Fl_PS_Printer.cxx index 8504b28b7..82f0bd921 100644 --- a/src/Fl_PS_Printer.cxx +++ b/src/Fl_PS_Printer.cxx @@ -178,8 +178,11 @@ static const char * prolog = // width (string) x y show_pos_width "/show_pos_width {GS moveto dup stringwidth pop 3 2 roll exch div -1 matrix scale concat " "show GR } bind def\n" -//"/show_pos_width {GS moveto dup stringwidth pop 3 2 roll exch div dup /sx exch def -1 matrix scale concat " -//"show 6 FS sx 10 string cvs show GR } bind def\n" // displays also scaling value + +//"/show_pos_width {GS moveto dup stringwidth pop 3 2 roll exch div " +//"dup 0.85 lt {pop 0.85} if " +//"dup /sx exch def -1 matrix scale concat " +//"show 8 FS sx 10 string cvs 0 4 getinterval 0 -3 rmoveto show GR } bind def\n" // displays also scaling value ; @@ -1186,6 +1189,14 @@ int Fl_PSfile_Device::start_job (int pagecount, enum Page_Format format, enum Pa return start_postscript(pagecount, format, layout); } +int Fl_PSfile_Device::start_job (const char *fname, int pagecount, enum Page_Format format, enum Page_Layout layout) +{ + output = fopen(fname, "w"); + if(output == NULL) return 1; + ps_filename_ = strdup(fname); + return start_postscript(pagecount, format, layout); +} + void Fl_PSfile_Device::end_job (void) // finishes PostScript & closes file { -- cgit v1.2.3