Java2 Printing API Jean-Cédric Desrochers March 9, 2000.

Slides:



Advertisements
Similar presentations
WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
Advertisements

Module 10 WPF 2-D Graphics, Multimedia, and Printing.
1 Configuring Internet- related services (April 22, 2015) © Abdou Illia, Spring 2015.
1 Configuring Web services (Week 15, Monday 4/17/2006) © Abdou Illia, Spring 2006.
1 of 3 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Graphics Programming. In this class, we will cover: The difference between AWT and Swing Creating a frame Frame positioning Displaying information in.
By Rashid Khan Lesson 7-Preparing for Output: Printer Configuration and Management.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 Goals Give student some idea.
MCDST : Supporting Users and Troubleshooting a Microsoft Windows XP Operating System Chapter 12: Network Printing and Offline Files.
Lesson 18: Configuring Application Restriction Policies
Java Review Structure of a graphics program. Computer Graphics and User Interfaces Java is Object-Oriented A program uses objects to model the solution.
AN OVERVIEW OF MAC PDF TOOLS 1. PDF Tools for Mac PDF files can be used either in Windows, Unix or Apple’s Mac OS operating system commonly. It still.
Overview of Computer Graphics Chapter 1. Bird’s Eye View  Overview of Computer Graphics –Basic concept of computer graphics, system, programming platforms,
Windows Server 2008 Chapter 6 Last Update
1 Windows Printing. 2 Objectives You will be able to Output text and graphics to a printer. Print multipage documents. Use the standard Windows print.
A.k.a. GUI’s.  If you want to discuss your Lab 2 grade come see me this week. ◦ Office: 436 ERB. One hour prior to class ◦ Open to Appointments MWF 
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 16: Java Applets & AWT Fundamentals of Web Programming.
Word Processing ADE100- Computer Literacy Lecture 12.
Module 14: Configuring Print Resources and Printing Pools.
MCTS GUIDE TO MICROSOFT WINDOWS 7 Chapter 9 User Productivity Tools.
Chapter 6 Configuring Windows Server 2008 Printing
Java Programming, 3e Concepts and Techniques Chapter 3 Section 65 – Manipulating Data Using Methods – Java Applet.
JavaScript: Functions © by Pearson Education, Inc. All Rights Reserved.
Microsoft Windows 7 - Illustrated Unit P Managing Hardware.
©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 8 Implementing Java Programs.
(c) University of Washington08-1 CSC 143 Models and Views Reading: Ch. 18.
Java Programming: Advanced Topics 1 Common Elements of Graphical User Interfaces Chapter 6.
CS 3131 Introduction to Programming in Java Rich Maclin Computer Science Department.
XPS Rasterization Service in Windows 7
Active Server Pages  In this chapter, you will learn:  How browsers and servers interacted on the Internet when the Internet first became popular 
Advanced User Interfaces with Java SD’98 - Session 3206 Ted Faison Faison Computing Inc.
Windows Programming Using C# Printing, Documentation, & Deployment.
Java Applets. 2 Introduction to Java Applet Programs Applications are ___________________ programs –executed with Java interpreter Applet is a small program.
Pravin Yannawar, DOCS, NMU Jalgaon Basic Java : Applets 2 Objectives of This Session Identify the need for Applets Distinguish between Applets and Applications.
Graphics and Event-Driven Programming in Java John C. Ramirez Department of Computer Science University of Pittsburgh.
Configuring Data Protection Chapter 12 powered by dj.
Java Programming: Advanced Topics 1 Components and Facilities for Rich Graphical User Interfaces Chapter 7.
Cs413_chapt02.ppt CS413 Advanced Swing Graphical User Interface Components Text: Advanced Java 2 Platform: Chapter 2 Abstract Windowing Toolkit (AWT) Library.
The Abstract Window Toolkit (AWT) supports Graphical User Interface (GUI) programming. AWT features include: a rich set of user interface components; a.
Intro to Applets. Applet Applets run within the Web browser environment Applets bring dynamic interaction and live animation to an otherwise static HTML.
GUIs Graphical User Interfaces. Everything coming together Known: – Inheritance – Interfaces – Abstract classes – Polymorphism – Exceptions New: – Events.
DAP 12 Assignment 10. Assignment #10 – DAP 2007 Three-column brochure Assignment Go back to the job that you have researched for the resume assignment,
Unit 1: Plotting DT2510: Advanced CAD Methods. Identifying the user interface: Application menu Quick Access toolbar InfoCenter Ribbon Drawing window.
Creating Graphics in Java CSE301 University of Sunderland Harry R Erwin, PhD.
1 Applets are small applications that are accessed on an Internet server, transported over the internet, automatically installed and run as a part of web.
MCTS GUIDE TO MICROSOFT WINDOWS 7 Chapter 9 User Productivity Tools.
Ⅰ. PS Driver ML-4050N Series PostScript, Driver ML-4050N Series PostScript, Driver.
Introducing Dreamweaver. Dreamweaver The web development application used to create web pages Part of the Adobe creative suite.
Review_5 Graphics. The visual representation of images is known as…
Hands-On Microsoft Windows Server 2008 Chapter 5 Configuring Windows Server 2008 Printing.
The Chain of Responsibility Pattern (Behavioral) ©SoftMoore ConsultingSlide 1.
Advanced Java Screen Update Techniques SD’98 - Session 4406 Ted Faison Faison Computing Inc.
Requirements Analysis Review Modeling Team Matt Weyant 26 Oct 1999.
Hands-On Microsoft Windows Server 2008 Chapter 6 Configuring Windows Server 2008 Printing.
Preface IIntroduction Course Objectives I-2 Oracle Complete Solution I-3 Course Agenda I-4 Tables Used in This Course I-5 The Order Entry Schema I-6 The.
CSE S. Tanimoto Java Introduction 1 Java A Programming Language for Web-based Computing.
Modifying Page Layout You may find that the default page layout settings in Word are not sufficient for the document you want to create, in which case.
Advanced AWT The Rendering Pipeline
Fundamentals of Windows Mouse n 4 Basic Operations: –Pointing –Clicking –Double Clicking –Dragging.
Goals Give student some idea what this class is about
IMAGE SIZE AND RESOLUTION
Java Graphics The basic rendering mechanism is the drawing system that controls when and how programs can draw on a graphics component. When a component.
Configuring Internet-related services
WORKING WITH SHARED DOCUMENTS
Model, View, Controller design pattern
Java 2 Swing B.Ramamurthy 5/1/2019 B.Ramamurthy.
Learning the Basics of Microsoft Word 2010 for Microsoft Windows
11.1 Applets & graphics.
TA: Nouf Al-Harbi NoufNaief.net :::
Presentation transcript:

Java2 Printing API Jean-Cédric Desrochers March 9, 2000

Jean-Cédric Desrochers2 Agenda Java2 Printing API: -Printing concepts -The java.awt.print package -Examples Real World Experience -Projects and Realization -Issues and Workarounds What’s new in JDK 1.3

Jean-Cédric Desrochers3 Printing Concepts Based on a callback model : -Printing system controls when pages are printed; -Application provides pages to print; -Pages requested out of order and more than once; More flexible : -Reverse order; -Print with a series of bands;

Jean-Cédric Desrochers4 Job control entities : -Initiate and control the printing process; -Java provides classes like PrinterJob, PageFormat and Paper to manage print jobs; Document related entities : -Low-level classes like Printable knows how to render a single kind of page (page painter); -High-level classes like Pageable and Book represent a collection of pages with different formats; Printing Concepts (ii)

Jean-Cédric Desrochers5 Page painter : -Render a page using a graphics context; -Implements the printable.Print() method; -Notifies when all pages are rendered; Printing Concepts (iii) public int print(Graphics g, PageFormat page, int pageIndex)

Jean-Cédric Desrochers6 The java.awt.print package

Jean-Cédric Desrochers7 Printable Interface Simplest way to print: -Application provides a page painter; -Printing system calls the print() method; In a Printable job: -Only one painter and one PageFormat; -Job starts with page at index 0 (sequential); -Page painter notifies when the end of the doc has been reached; -Single-threaded;

Jean-Cédric Desrochers8 Pageable Interface More flexible: -Pages differ in layout and implementation; -The system knows the number of pages; In a Pageable job: -Different page painters and PageFormats ; -Pages printed in an arbitrary order;

Jean-Cédric Desrochers9 PrinterJob Class Typical Life-Cycle: 1) Get a new PrinterJob by calling getPrinterJob () 2) Determine what PageFormat to use 3) Set the Printable or the Pageable object to be printed 4) Additional properties (copies, job name) 5) Call printDialog() to show a dialog box (optional) 6) Call print() to print the job

Jean-Cédric Desrochers10 PageFormat Class Describes the geometry of the page: -Origin is at the upper left corner of paper; -Units are in 1/72 inch; -Specifies the imageable area of the page;

Jean-Cédric Desrochers11 Printing using Printable

Jean-Cédric Desrochers12 Printing using Printable (ii)

Jean-Cédric Desrochers13 Example with Graphics2D

Jean-Cédric Desrochers14 Printing Swing Components

Jean-Cédric Desrochers15 Printing Swing Components (ii)

Jean-Cédric Desrochers16 Printing using Pageable

Jean-Cédric Desrochers17 Other Classes PrinterGraphics Interface: -Implemented by Graphics objects that are passed to a Printable object; Paper Class: -Physical characteristics of a piece of paper; -Used by the PageFormat ;

Jean-Cédric Desrochers18 Exceptions PrinterException : -Thrown by the Printable.print () method PrinterIOException : -Subclass of PrinterException ; -IO error occured during printing; PrinterAbortException : -Subclass of PrinterException ; -User or application cancelled the print job;

Jean-Cédric Desrochers19 Real World Experience Build and print HTML Reports: -Generated with Oracle Reports; -Available through HTTP server; -Shown in Java GUI with ICEBrowser; Great Ideas: -Use the browser’s panel to print; -Manage multiple pages;

Jean-Cédric Desrochers20 Challenges Image Quality: -Resolution was awful; Turn double buffering off: -Faster printing; -Higher resolution and quality;

Jean-Cédric Desrochers21 Challenges (ii) Formatting of documents: -Unable to set margins; -Printing system use default PageFormat ; -Known bug; Printing very long: -Generating HUGE spool file; -Only on Windows with Laser Printers; -Also, known bug;

Jean-Cédric Desrochers22 Advance Features Use of translate() : -Moves an imaginary pen to a next position; Use of clip areas: -Restrict the component to only be painted in a given area;

Jean-Cédric Desrochers23 Advance Features (ii) Use of scaling: -Scales the 2D graphics context; -Ratio of one maintains the size; Other Graphics operations: -Rotation; -Transformation;

Jean-Cédric Desrochers24 What’s new in JDK1.3 Same package, same classes; A lot of bug fixes!!! New classes for AWT printing model: -JobAttributes class; -PageAttributes class;

Jean-Cédric Desrochers25 Conclusion A good printing model; Need some tuning; Based on native resources; Learn use of Java2D API;