Java 8 DocPrintJob - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 DocPrintJob class.

This code example shows how to use the following methods:addPrintJobListener, print
 *     See the License for the specific language governing permissions and 
 *     limitations under the License. 
 */ 
 
package org.springframework.integration.print.outbound; 
 
import java.io.InputStream;
import java.util.Locale;
 
import javax.print.Doc;
import javax.print.DocFlavor;
import javax.print.DocPrintJob;
import javax.print.SimpleDoc;
import javax.print.attribute.DocAttributeSet;
import javax.print.attribute.HashDocAttributeSet;
import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.PrintRequestAttributeSet;
import javax.print.attribute.standard.Chromaticity;
import javax.print.attribute.standard.Copies;
import javax.print.attribute.standard.JobName;

5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:addPrintJobListener
 
	boolean done = false;
 
	public PrintJobMonitor(DocPrintJob job) {
 
		job.addPrintJobListener(new PrintJobAdapter() {
 
			@Override 
			public void printJobCanceled(PrintJobEvent arg0) {
				if (LOG.isWarnEnabled()) {
					LOG.warn("PrintJob Job canceled.");
				} 
				allDone(); 
			} 
 
			@Override 
			public void printJobCompleted(PrintJobEvent printJobEvent) {
				if (LOG.isDebugEnabled()) {
					LOG.debug("PrintJob Job completed.");
				} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:print
This code example shows how to use the following methods:print
						} 
					} 
				}, flavor, null);
				DocPrintJob job = service.createPrintJob();
				PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
				job.print(doc, attributes);
				out.close();
			} 
		} else { 
			// parrt: works with [image/jpeg, image/png, image/x-png, image/vnd.wap.wbmp, image/bmp, image/gif] 
			Rectangle rect = comp.getBounds();
			BufferedImage image = new BufferedImage(rect.width, rect.height,
													BufferedImage.TYPE_INT_RGB);
			Graphics2D g = (Graphics2D) image.getGraphics();
			g.setColor(Color.WHITE);
			g.fill(rect);
//			g.setColor(Color.BLACK); 
			comp.paint(g);
			String extension = fileName.substring(fileName.lastIndexOf('.') + 1);
			boolean result = ImageIO.write(image, extension, new File(fileName));
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:print
				"Input Stream is null: file not found?"); 
		} 
		Doc doc = new SimpleDoc(is, inputFlavor, null);
		 
		DocPrintJob printJob = printService.createPrintJob();
		printJob.print(doc, attrs);
	} 
} 
// END main 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:print
 
        // Start XSLT transformation and FOP processing 
        transformer.transform(src, res);
 
        Doc doc = new SimpleDoc(renderer, DocFlavor.SERVICE_FORMATTED.PAGEABLE, null);
        printJob.print(doc, null);
    } 
 
    /** 
     * Main method. 
     * @param args command-line arguments 
     */ 
    public static void main(String[] args) {
        try { 
            System.out.println("FOP ExampleFO2JPSPrint\n");
            System.out.println("Preparing...");
 
            //Setup directories 
            File baseDir = new File(".");
            File outDir = new File(baseDir, "out");
3
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Java 8 DocPrintJob Methods: