Prining to a local label printer from a remote OPV server running on Ubuntu

Just wondering if anyone has any ideas of how to do this.

 

I followed Ben's work on printing from an Amazon Cloud Ubuntu Server running OPV and Google Cloudprint.  I found that this worked well for A4 pages on a standard laser printer, but configuring the sizing for labelprinters was problematic.

 

I have a vague inkling that embedding javascript in the print dialogue would allow it to pick up what local printers are installed and print to them.  This would mean that the printers would not have to be added to the remote server, removing a massive headache.

 

Anyone with any experience doing this?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Prining to a local label printer from a remote OPV ...

The document you are printing is not generated until you hit print...unfortunately even if javascript picked up a local printer - it isnt possible for the server (where the doc is generated) to print to that local printer without drivers installed...on the server.  Thats why we need a cloud driver to run it if we are running on the cloud.  

There may be a better cloud printer driver you could use rather than google.

To print to a local printer you need to generate the document using preview then print it locally.

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Prining to a local label printer from a remote OPV ...

Thanks for your reply Ben.

 

What about this: A "print now" button that actually downloaded the document generated on the server to the local computer (in  the background) and then opened a print dialogue?  How tough is that to implement?

 

It just seems a little clunky to hit "preview" and then print the document.  E.g. I have no wish to really preview every invoice or drug label that I need printed.

 

Cahir

Re: Prining to a local label printer from a remote OPV ...

The reality is that a browser doesnt have access to the resources to avoid the systems print spooler and dialog, effectively all document printing from browsers still utilizes this dialog, chrome has its own, IE uses the system.  Most browser should be run with least priveleges, hence you need users to confirm actions.

You can configure a browser to download pdf's rather than viewing them if you wish, personally I would just hit preview and then shortcut Ctrl-P.  

Javascript can print but it still uses the system dialog (ie its the same as Ctrl-P)

http://www.javascriptkit.com/howto/newtech2.shtml

As you can see this requires the document be loaded in a browser window to print it.

Openvpms is primarily designed a a server hosted PMS, not a distributed client accesssing a central database, thus printing is by default centralized.  

I assume that you have had no luck getting the label printer to work via google cloud print?  

Additional I would point out that enabling a browser to perform a system action on a document such as saving it to a location without the user saying where, might be considered exploitable.

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Prining to a local label printer from a remote OPV ...

It might be possible to do this using an applet or webstart app that takes a PDF generated on the server and then prints it locally using a java PDF library such as PDFBox. A webstart app would allow setting local printer preferences for particular templates.

So the steps would be:

1. click Print Now

2. java webstart print application is launched, with parameters identifying the the document to print

On first access, the print application would be downloaded to the client machine.

3. if the print application hasn't seen the document template before, it prompts to select a default printer

4. document is printed to the default printer for that template

Note that java PDF libraries may not be able to replicate what Acrobat Reader prints.

 

Re: Prining to a local label printer from a remote OPV ...

Ben - I did get cloudprint to print to the label printer.  However, the driver I used (cloudprint) could not properly direct all of the star label printer's settings.  So I could not get the font and label size right.

 

Tony(?) How much would the above project cost to fund?

Re: Prining to a local label printer from a remote OPV ...

Hi Cahir,

I am surprised you would have problems with CloudPrint in regards fonts etc as I would have expected that it would just pass through to the driver on the PC/server where you have the printer configured.  I dont have a star printer but will do some testing on my Dymo.

Tim A.  would need to document the project and after discussion could get costed.

Cheers Tony

Re: Prining to a local label printer from a remote OPV ...

I imagine a webstart based solution would take a week or so of development time. The application would also need to be signed as per https://blogs.oracle.com/java-platform-group/entry/new_security_requirem... so OpenVPMS would need to purchase a code signing certificate from Comodo or similar. These typically need to be renewed annually.

-Tim

Syndicate content