# HG changeset patch # User Ben Abbott # Date 1378424807 14400 # Node ID 50794f5e2323fbdd6b93a6879d2335700f9b4c3f # Parent b91f29f021a3d92a3e65337cc1141b2833f981a3 Set gs sOutputFile option to "-" when spooling to the system printer. * scripts/plot/private/__print_parse_opts__.m: When sending output to a printer set the output to "-" which is ghostscript syntax for piping. diff -r b91f29f021a3 -r 50794f5e2323 scripts/plot/private/__print_parse_opts__.m --- a/scripts/plot/private/__print_parse_opts__.m Thu Sep 05 16:29:48 2013 -0700 +++ b/scripts/plot/private/__print_parse_opts__.m Thu Sep 05 19:46:47 2013 -0400 @@ -327,6 +327,22 @@ arg_st.ghostscript.epscrop = ! arg_st.loose; endif + if (arg_st.send_to_printer) + if (isempty (arg_st.name)) + ## Pipe the ghostscript output + arg_st.name = "-"; + else + error ("print: a file name may not specified when spooling to a printer") + endif + if (! any (strcmp (arg_st.devopt, gs_device_list)) + || ! any (strcmp (arg_st.devopt, {"pswrite", "ps2write"}))) + ## Only postscript and supported ghostscript devices + error ("print: invalid format for spooling to a printer") + endif + elseif (isempty (arg_st.name)) + error ("print: an output file name must be specified") + endif + if (isempty (arg_st.canvas_size)) if (isfigure (arg_st.figure)) [arg_st.ghostscript.papersize, paperposition] = ...