[poppler] Fwd: Enhancement: Add support for printing to a Windows printer from pdftocairo

Adrian Johnson ajohnson at redneon.com
Mon Jul 21 06:03:58 PDT 2014


On 21/07/14 03:50, Rodrigo Rivas wrote:
> Hi, all.
> 
> I few weeks ago I sent a patch to bugzilla for printing directly to a
> Windows printer using pdftocairo [1].
> 
> This patch seems to have attracted little attention :-( but I think
> that it can be a really useful feature (it is for me!).
> 
> Could anybody please review the patch and add some feedback. Maybe it
> can be improved to make it more appealing?

I had a look at your patch. I'll add some comments to the bug report on
the patch later this week. My immediate concern is the command line
arguments. It is worth getting some feedback from this list on the
command line arguments to ensure they can easily be extended to support
future requirements.

Currently your patch implements the following options:

 -prn  sets windows printer output mode. The output file name is used as
   the printer name. If no output file name the default printer is used.

 -prnsource <int>  set paper source using the number required by the
   windows DEVMODE struct.

Instead of using the output file name as the printer name I would prefer
using a separate option. eg

 -printer <printer-name>

We can then use the output file name (if specified) for printing to a file.

I'm not sure that -prn is the best name. Maybe -winprint or -print. That
latter could also be used for printing via CUPS on Linux platforms.

Using the integer value of the windows paper source enumeration as an
argument to -prnsource is not something we want as part of our user
interface. We should instead be using the names eg "auto", "manual",
"upper", "lower".

There are a few other printer capabilities in the DEVMODE struct that we
should consider supporting. It may be better to use some sort of
option=value format on the command line to allow additional capabilities
to be added as required. This would also allow CUPS options to be
supported if we later added support for CUPS printing.

You do not need to add support for all these features in your patch. But
we do need to think about how the command line arguments should be
designed to allow additional printer capabilities to be supported.

To summarize I think the printing options should take the form:

-print                enable printer output
-printer <name>       specify printer name or use default if -printer
                      option not used
-printopt option=value  set printer options. specify additional
                       -printopt arguments for additional options.


Any other opinions on the printing options?


> 
> Thank you in advance!
> 
>  [1]: https://bugs.freedesktop.org/show_bug.cgi?id=79936
> 
> --
> Rodrigo Rivas
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/poppler
> 



More information about the poppler mailing list