Examples of XPrintable


Examples of com.sun.star.view.XPrintable

        xStorable.storeAsURL(storeUrl, storeProps);          
    }
   
    protected void printDocComponent(XComponent xDoc) throws java.lang.Exception {
        XPrintable xPrintable = (XPrintable)UnoRuntime.queryInterface(XPrintable.class, xDoc);
        PropertyValue[] printerDesc = new PropertyValue[1];
        printerDesc[0] = new PropertyValue();
        printerDesc[0].Name = "Name";
        printerDesc[0].Value = aPrinterName;

        xPrintable.setPrinter(printerDesc);       
       
        PropertyValue[] printOpts = new PropertyValue[1];
        printOpts[0] = new PropertyValue();
        printOpts[0].Name = "Pages";
        printOpts[0].Value = "1";       
       
        xPrintable.print(printOpts);     
    }
View Full Code Here

Examples of com.sun.star.view.XPrintable

      XComponent xcomponent = xcomponentloader.loadComponentFromURL(
      sUrl.toString(), "_blank", 0,
      new PropertyValue[0] );
     
      // Querying for the interface XPrintable on the loaded document
      XPrintable xprintable =
      ( XPrintable ) UnoRuntime.queryInterface( XPrintable.class, xcomponent );
     
      // Setting the property "Name" for the favoured printer (name of IP address)
      PropertyValue []propertyvalue = new PropertyValue[ 1 ];
      propertyvalue[ 0 ] = new PropertyValue();
      propertyvalue[ 0 ].Name = "Name";
      propertyvalue[ 0 ].Value = args[ 0 ];
     
      // Setting the name of the printer
      xprintable.setPrinter( propertyvalue );
     
      // Setting the property "Pages" so that only the desired pages will be printed.
      propertyvalue[ 0 ] = new PropertyValue();
      propertyvalue[ 0 ].Name = "Pages";
      propertyvalue[ 0 ].Value = args[ 2 ];
     
      // Printing the loaded document
      xprintable.print( propertyvalue );
     
      System.exit(0);
    }
    catch( Exception exception ) {
      System.err.println( exception );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.