I'd like to offer some enhancements to pdfViewer (wx/lib/pdfViewer/viewer.py*). The overall objective is to enable "quick printing" or "silent printing" as it is sometimes called.
Currently the API for this method takes no args: pdfViewer.Print(self)
For my projects I need the following capabilities added to pdfViewer.Print():
- Ability to set prompt=False so the print dialog does not appear. API would now look like:
pdfViewer(prompt=True) # set True to keep current behavior intact
- Ability to set (programmatically) which printer the output would be sent to. API would now look like:
pdfViewer(prompt=True, printer_name=None) # current behavior if no printer name given
- Ability to set the orientation of the printout. API would now look like:
pdfViewer(prompt=True, printer_name=None, orientation=None) # current behavior if no orientation given
Would such additions be acceptable? Or is this heading toward stacking too many arguments for the Print() call?
Additionally, I'd like to make a change to pdfViewer.LoadFile(). It currently only accepts a string path name which it then opens as a file(). I'd like to change it to also accept a file-like object for direct use. This would allow pdf printouts to be created entirely in memory and then passed to pdfViewer and never have to access the filesystem (improves performance and security).
I'd like to offer some enhancements to pdfViewer
(wx/lib/pdfViewer/viewer.py*). The overall objective is to enable "quick
printing" or "silent printing" as it is sometimes called.
Currently the API for this method takes no args: pdfViewer.Print(self)
For my projects I need the following capabilities added to
pdfViewer.Print():
- Ability to set prompt=False so the print dialog does not appear. API
would now look like:
pdfViewer(prompt=True) # set True to keep current behavior intact
- Ability to set (programmatically) which printer the output would be
sent to. API would now look like:
pdfViewer(prompt=True, printer_name=None) # current behavior if no
printer name given
- Ability to set the orientation of the printout. API would now look like:
pdfViewer(prompt=True, printer_name=None, orientation=None) # current
behavior if no orientation given
Would such additions be acceptable? Or is this heading toward stacking
too many arguments for the Print() call?
Additionally, I'd like to make a change to pdfViewer.LoadFile(). It
currently only accepts a string path name which it then opens as a
file(). I'd like to change it to also accept a file-like object for
direct use. This would allow pdf printouts to be created entirely in
memory and then passed to pdfViewer and never have to access the
filesystem (improves performance and security).
Would this be acceptable?
It sounds good to me, but it's up to David Hughes as it's his code. You should go ahead and implement the changes and create a Trac ticket for it. Be sure to mention the ticket number here so David will know where it is so he can review it.
Overall, should I submit one patch or multiple?
I would do one for the printing-related changes and another for LoadFile.
That's fine by me. I'm only too pleased to hear someone is actually using it!
As Robin says, a separate patch for each topic would be best.
···
On 29/09/2011 19:30, Michael Hipp wrote:
Hello,
I'd like to offer some enhancements to pdfViewer (wx/lib/pdfViewer/viewer.py*). The overall objective is to enable "quick printing" or "silent printing" as it is sometimes called.
Currently the API for this method takes no args: pdfViewer.Print(self)
For my projects I need the following capabilities added to pdfViewer.Print():
- Ability to set prompt=False so the print dialog does not appear. API would now look like:
pdfViewer(prompt=True) # set True to keep current behavior intact
- Ability to set (programmatically) which printer the output would be sent to. API would now look like:
pdfViewer(prompt=True, printer_name=None) # current behavior if no printer name given
- Ability to set the orientation of the printout. API would now look like:
pdfViewer(prompt=True, printer_name=None, orientation=None) # current behavior if no orientation given
Would such additions be acceptable? Or is this heading toward stacking too many arguments for the Print() call?
Additionally, I'd like to make a change to pdfViewer.LoadFile(). It currently only accepts a string path name which it then opens as a file(). I'd like to change it to also accept a file-like object for direct use. This would allow pdf printouts to be created entirely in memory and then passed to pdfViewer and never have to access the filesystem (improves performance and security).