Printing through a specified printer using JAVA AWT / jnlp from a web browser

I have a requirement to print documents through a web browser directly on multiple printers, depending on the user's choice. The user will have a different printer setting in our service and will choose which one to use.

This functionality is used by dropship.amazon.in (Amazon's warehouse management system). They call it PackStations.

The following are instructions for using packstation:

  • First we need to save the printer name or address for different categories, such as label printing, barcode printing.

  • By clicking on the start in front of the specified category, you will download the jnlp file with the following source.

    <?xml version='1.0' encoding='UTF-8'?>
    
    <jnlp spec='1.0+' codebase= 'https://dropship.amazon.in:443/DropShipCentral/PrintServer/'>
    <information>
        <title>VendorFlex Print Server</title>
        <vendor>Amazon.com</vendor>
        <description>VendorFlex Print Server</description>
        <description kind="short">VendorFlexPrintServer</description>
        <icon href="AmazonVFPrintServer.jpg" kind="splash"/>
    </information>
    
    <security>
        <all-permissions/>
    </security>
    
    <resources>
        <j2se version="1.6+"/>
        <jar href="vendorflex-printserver.jar" main="true"/>
        <jar href="apache-httpcomponents-httpclient.jar"/>
        <jar href="apache-httpcomponents-httpcore.jar"/>
        <jar href="jakartacommons-codec.jar"/>
        <jar href="jakartacommons-lang.jar"/>
        <jar href="jakartacommons-logging-adapters.jar"/>
        <jar href="jakartacommons-logging-api.jar"/>
        <jar href="apache-commons-io.jar"/>
        <jar href="json-org-java.jar"/>
        <jar href="vfprintservershared.jar"/>
    </resources>
    
    <application-desc main-class="amazon.internal.dropship.printserver.main.PSMain">
            <argument>QNAY</argument>
    <argument>test</argument>
    <argument>https://dropship.amazon.in:443</argument>
    
    </application-desc>
    

  • Execution of this file will show two buttons, start and stop.

  • , - -, - .

  • AWT? print AWT?

  • , AWT . , -, AWT .

- , , .

+4

Source: https://habr.com/ru/post/1667226/


All Articles