Question

Printing - Imageable Area, Printer Margins, etc.

Asked by: ShawnCurry

I'm working on a label printing program and I need smaller printer margins.  I know the printer is capable of printing with a smaller margin, because M$ Word can do it..

I need to be able to set the margins on the physical page size, not the "imageable" area..

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2004-01-05 at 15:21:39ID20841623
Tags

margin

Topic

Java Programming Language

Participating Experts
3
Points
50
Comments
22

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Printer Margins Messed Up
    My printer's lowest margins are: Top: 0.33" Bottom: 0.67" Left: 0.25" Right: 0.25" How can I make my Top and Bottom margins .5"? If I set my bottom margin to .5", the program either doesn't let me or it doesn't print anything below .67&quo...
  2. Printer/Page Margins
    In general, is there a setting on a printer (specifically using a Dell M5200) that will allow printing outside the minimum margins that are set I am printing onto a form that has characters close to the top and left edge of the paper (8-1/2 X 11) however they are being cut o...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: CEHJPosted on 2004-01-05 at 15:23:50ID: 10048160

>>I need to be able to set the margins on the physical page size, not the "imageable" area..

Wouldn't they effectively be equivalent?

 

by: objectsPosted on 2004-01-05 at 15:40:48ID: 10048253

Use the document attribute javax.print.attribute.standard.MediaPrintableArea.

 

by: ShawnCurryPosted on 2004-01-05 at 16:52:33ID: 10048703

This link gives a nice explanation of why they're not equal:
http://www.javaworld.com/javaworld/jw-10-2000/jw-1020-print.html


I'm looking at the api docs for the MediaPrintableArea now...

Have you used this before?  I'm not really sure how to use it...  It does appear to be what I'm looking for...

 

by: objectsPosted on 2004-01-05 at 16:55:00ID: 10048719

No haven't used it, looks like you you specify it's value in the attribute set.

 

by: objectsPosted on 2004-01-05 at 16:59:58ID: 10048743

PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
pras.add(new MediaPrintableArea((float)0.0,(float)0.0,w, h, MediaPrintableArea.MM));

 

by: CEHJPosted on 2004-01-05 at 17:48:58ID: 10049010

>>This link gives a nice explanation of why they're not equal:

Yes - i'm not suggesting that they're *logically* equivalent, hence my use of the word 'effectively'. It's just that i'd be agreeably surprised [please let me know if i'm wrong]if these metrics can be queried accurately and reliably by Java and therefore you might take a route of less resistance.

 

by: objectsPosted on 2004-01-05 at 17:56:18ID: 10049049

whats the definition of 'effectively' equivalent :)

> [please let me know if i'm wrong]

That usually just ends in a lond winded circular discussion :)

 

by: CEHJPosted on 2004-01-05 at 18:16:47ID: 10049152

My suggestion was merely getting at using one tangible-sounding property to stand for others that are far more dubious.

Forgive me if I sound sceptical ShawnCurry, but it's only comparatively recently I've seen Word/Windoze able to print labels properly so I'm a little less than 100% confident when I see diagrams dissecting margin subsets in Java articles.

>>

> [please let me know if i'm wrong]

That usually just ends in a lond winded circular discussion :)

>>

I'd be quite happy with a demo - no discussion necessary.

 

by: ShawnCurryPosted on 2004-01-05 at 22:41:56ID: 10050122

This is really frustrating.  I haven't tried the MediaPrintableArea yet.  I did run some tests on the setImageableArea(...) method for the Paper and PageFormat objects, now using a second printer..  Also tried the pageDialog() method.  Somehow, despite *appearing* to have something to do with the imageable area of the page, sadly they seem to have nothing to do with it.  It prints a perfect 1 inch margin every time, across 2 different printers so far..  I have 2 more printers I could hook up, but I'm sure I'll find the exact same thing.

The printer I'm trying now is a Canon i450 inkjet.  This printer (according to the manual) is capable of printing edge to edge - no margins at all !!

Guess I'll do some diving into that MediaPrintableArea; although I can't find where it connects to.

I really want to do this..  I don't know how to do anything in MFC.  I thought it would be a quick little 2 week project with my GUI engine and all.  I'm 100% confident it's in there somewhere - Sun seems to be able to get perfect 1 inch margins across different printers.

Hmm...  Think I might have to boot into Linux and test this again..

Ah well, when I do find the solution I'll post some snippets.

 

by: objectsPosted on 2004-01-05 at 23:14:46ID: 10050217

> although I can't find where it connects to.

depends how you are printing, eg. you can pass it to the print() method of PrinterJob.

 

by: ShawnCurryPosted on 2004-01-06 at 13:38:00ID: 10056252

I knew I could get it to work!!!  There were actually 2 ways to do it:

1. Set the PageFormat when you invoke setPrintable()   (doesn't work if you do it anywhere else)
2. Set the PrintRequestAttributes when you invoke print()   (MediaPrintableArea(thanks))

I did come across a really annoying bug with the PrintService, however; although I'm not sure who's bug it is.

I'm working on a helper class (PrinterConstraints) in which I intend to query for the *maximum* ImageableArea of media x for printer y, so I can adjust my margins accordingly.  So, I'm querying the PrintService for this data.  I would like to store the MediaSizeName, but it seems you can't get this value from the map - you have to call getSupportedAttributeCategories() on the PrintService, and search the array for it.  You can pull the rest of them out just fine, however..  Also, it seems the final PrintRequestAttribute doesn't have a Class.  It appears that  when it's placed in the array, it's not null, but if you invoke getClass() on it, it returns null !!!

I'm running WinXP Pro, an Epson i450 inkjet, and J2SE 1.4.1_01.
I also have RedHat 9 with 1.4.2_02 and a couple old printers;  I'll test these and post the results.
If you have another setup, I would be interested in finding out whether it's the printer or the OS (or Sun)

java.awt.print.PrinterJob printJob = java.awt.print.PrinterJob.getPrinterJob();
javax.print.PrintService ps = printJob.getPrintService();
Class[] attrs = ps.getSupportedAttributeCategories();
System.out.println( "Attribute Categories" );
for( int i = 0; i < attrs.length; i++ )
{
      if( attrs[i] != null ) {
            System.out.println( ps.getDefaultAttributeValue( attrs[i] )  .getClass().toString() );
            System.out.println( ps.getDefaultAttributeValue(
                  attrs[i] ) );
                  //Class.forName( "javax.print.attribute.standard.PageRanges" ) ) );
                  //Class.forName( "javax.print.attribute.standard.MediaSizeName" ) ) );
                  //Class.forName( "javax.print.attribute.standard.MediaPrintableArea" ) ) );
      }
      else System.out.println( "Attribute was null" );
}
javax.print.attribute.PrintServiceAttributeSet psas = ps.getAttributes();
javax.print.attribute.Attribute[] a = psas.toArray();
System.out.println( "Attributes" );
for( int i = 0; i < a.length; i++ )
      System.out.println( a[i].getName() );


Also, when I'm done with the PrinterConstraints, I'll post that too.  (you're welcome!!)

Thanks,
Shawn

 

by: objectsPosted on 2004-01-06 at 13:52:10ID: 10056402

> Also, it seems the final PrintRequestAttribute doesn't have a Class

It should.

> It appears that  when it's placed in the array, it's not null, but if you invoke getClass() on it, it returns null !!!

Find that hard to believe, let me test it.

 

by: objectsPosted on 2004-01-06 at 14:01:38ID: 10056506

What makes u think getClass() returns null? All seems fine to me.

 

by: ShawnCurryPosted on 2004-01-06 at 18:17:52ID: 10058296

>> What makes u think getClass() returns null? All seems fine to me.

Well, I guess its not the getClass(), it's the getDefaultAttributeValue() that returns null.  For an instance of sun.print.SunAlternateMedia.  That's probably supposed to be that way i guess..

As for the MediaSizeName problem, I think I see what is happening..  it reports getName() as "media".  I looked it up in the source, and that's what's supposed to happen.  The source of my confusion is getDefaultAttributeValue( Class ).  The object I obtain from this is an instance of MediaSizeName - which extends Media, but does not override the getName() method.  According to the documentation, it's not supposed to.  So, you have it pass a Media class to get at that value.

Anyhow, as promised - here is my PrinterConstraints class:

import java.awt.print.PrinterJob;
import java.awt.print.PageFormat;
import java.awt.print.Paper;
import javax.print.PrintService;
import javax.print.attribute.PrintRequestAttributeSet;
import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.standard.MediaPrintableArea;

public class PrinterConstraints
{
      private PrintService ps;
      private MediaPrintableArea mpa;
      
      public PrinterConstraints()
      {
            this( PrinterJob.getPrinterJob().getPrintService() );
      }
      
      public PrinterConstraints( PrintService ps )
      {
            this.ps = ps;
            try {
                  this.mpa = (MediaPrintableArea)ps.getDefaultAttributeValue(
                        Class.forName( "javax.print.attribute.standard.MediaPrintableArea" ) );
            } catch( ClassNotFoundException e ) { e.printStackTrace(); }
      }
      
      public PrintRequestAttributeSet getMaxImageablePRAS()
      {
          return new HashPrintRequestAttributeSet( mpa );
      }
      
      public PageFormat getMaxImageablePageFormat()
      {
            PrinterJob printJob = PrinterJob.getPrinterJob();
            PageFormat format = printJob.defaultPage();
            Paper paper = format.getPaper();
            paper.setImageableArea( 0.0, 0.0, paper.getWidth(), paper.getHeight() );
            format.setPaper( paper );
            return format;
      }
      
      public double getTopMargin( int units )
      {
            if( units == PIXELS )
                  return mpa.getY( INCH ) * PIXELS;
            return mpa.getY( units );
      }
      
      public double getLeftMargin( int units )
      {
            if( units == PIXELS )
                  return mpa.getX( INCH ) * PIXELS;
            return mpa.getX( units );
      }
      
      public void setPrintService( PrintService ps ) { this.ps = ps; }
      public void setMediaPrintableArea( MediaPrintableArea mpa ) { this.mpa = mpa; }
      public PrintService getPrintService() { return ps; }
      public MediaPrintableArea getMediaPrintableArea() { return mpa; }
      
      public final static int INCH = MediaPrintableArea.INCH;
      public final static int MM = MediaPrintableArea.MM;
      public final static int PIXELS = 72;
}

------------------------

I provided 2 methods to get the maximum ImageableArea; one yields an instance of PageFormat, which you can use in the setPrintable() method; the other yields a PrintRequestAttributeSet (actually an instance of HashPrintRequestAttributeSet) which you can use in the PrinterJob's print() method.

I provided 2 constructors, the default constructor gets the PrintService from PrinterJob.getPrinterJob().getPrintService(); the other takes a PrintService as an argument.

A MediaPrintableArea is obtained from the PrintService, and luckily it already contains the maximum ImageableArea.  Besides finding the printable area, the MediaPrintableArea is also used to find the top and bottom margins.

The getTopMargin() and getBottomMargin() methods take one of the provided constants (INCH, MM, PIXELS) as an argument and yields a double representing the printer margin in the specified units.

Feel free to use it, change it, break it, claim you wrote it yourself, I don't care.  All I ask is that if you improve it in some way, post it here..

Thanks,
Shawn

 

by: CEHJPosted on 2004-01-06 at 18:22:52ID: 10058323

>>Feel free to use it

Thanks - i'll give it a run later ;-) Even better if we can see the label printing stuff later!

 

by: objectsPosted on 2004-01-06 at 18:23:26ID: 10058327

 

by: benny111Posted on 2004-01-20 at 04:55:59ID: 10154473

I have tried your solution but i can't seem to make it work.

here is relevant code from my program, can you see what i am doing wrong?
All code is here: http://www.users.on.net/benmunday/

also a picture of the result.

Thanx
Ben

 

by: benny111Posted on 2004-01-20 at 04:58:36ID: 10154487

sorry, relevant code is in the file called PrintMaster.java

 

by: ShawnCurryPosted on 2004-01-21 at 12:38:28ID: 10168373

Ahh yeah.. sorry.. realized that the other day the getMaxImageablePageFormat() only worked the way I was using it..  It was probably shifting the whole thing up and to the left - correct?  Made some changes - It returns the right format now:

/* PrinterConstraints.java
 * Queries the default printer or a printservice for the maximum printable
 * area of a page.
 * Author: Shawn Curry
 * Date: 1/21/04
 */

import java.awt.print.PrinterJob;
import java.awt.print.PageFormat;
import java.awt.print.Paper;
import javax.print.PrintService;
import javax.print.attribute.PrintRequestAttributeSet;
import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.standard.MediaPrintableArea;

public class PrinterConstraints
{
      private PrintService ps;
      private MediaPrintableArea mpa;
      
      public PrinterConstraints()
      {
                try {
                this( PrinterJob.getPrinterJob().getPrintService() );
                } catch( NullPointerException e ) { System.err.println("Printer not found"); }
      }
      
      public PrinterConstraints( PrintService ps )
      {
            this.ps = ps;
            try {
                  this.mpa = (MediaPrintableArea)ps.getDefaultAttributeValue(
                        Class.forName( "javax.print.attribute.standard.MediaPrintableArea" ) );
            } catch( ClassNotFoundException e ) { e.printStackTrace(); }
      }
      
      public PrintRequestAttributeSet getMaxImageablePRAS()
      {
          return new HashPrintRequestAttributeSet( mpa );
      }
      
      public PageFormat getMaxImageablePageFormat()
      {
            PrinterJob printJob = PrinterJob.getPrinterJob();
            PageFormat format = printJob.defaultPage();
            Paper paper = format.getPaper();
            paper.setImageableArea(
                  mpa.getX(INCH) * PIXELS,
                  mpa.getY(INCH) * PIXELS,
                  mpa.getWidth(INCH) * PIXELS,
                  mpa.getHeight(INCH) * PIXELS);
            //paper.setImageableArea( 0.0, 0.0, paper.getWidth(), paper.getHeight() );
            format.setPaper( paper );
            return format;
      }
      
      public double getTopMargin( int units )
      {
            if( units == PIXELS )
                  return mpa.getY( INCH ) * PIXELS;
            return mpa.getY( units );
      }
      
      public double getLeftMargin( int units )
      {
            if( units == PIXELS )
                  return mpa.getX( INCH ) * PIXELS;
            return mpa.getX( units );
      }
      
      public void setPrintService( PrintService ps ) { this.ps = ps; }
      public void setMediaPrintableArea( MediaPrintableArea mpa ) { this.mpa = mpa; }
      public PrintService getPrintService() { return ps; }
      public MediaPrintableArea getMediaPrintableArea() { return mpa; }
      
      public final static int INCH = MediaPrintableArea.INCH;
      public final static int MM = MediaPrintableArea.MM;
      public final static int PIXELS = 72;
}

 

by: ShawnCurryPosted on 2004-01-21 at 12:41:33ID: 10168404

Also, a NullPointerException was thrown if it didn't find a printer (when you use the default constructor).

 

by: benny111Posted on 2004-01-21 at 21:18:35ID: 10171371

How can i transform the scale of a TextLayout object to fit the avaliable printing area?
this is what i've got, it doesn't print anything on the page at all...

private AffineTransform at = new AffineTransform();
String testString = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
Font myFont = new Font("Times",Font.BOLD,20);
g2.setFont(myFont);
FontMetrics fm = g2.getFontMetrics();

AffineTransform saveXform = g2.getTransform();
TextLayout textTl = new TextLayout(testString, myFont, new FontRenderContext(null, false, false));
AffineTransform scaleWidth = new AffineTransform();
scaleWidth.concatenate(at);

double db = fm.stringWidth(testString);
      if( db > width)
      {
          double scale = (width/db);
          scaleWidth.setToScale(scale, scale);
          g2.transform(scaleWidth);
          textTl.draw(g2, imagePosX, imagePosY+(fm.getAscent()));
      }
      else
      {
          g2.drawString(testString, imagePosX, imagePosY+(fm.getAscent()));
      }


Hope you guy's have some insights...

Thanx
Ben

 

by: ShawnCurryPosted on 2004-01-21 at 23:13:03ID: 10171753

You must add that code to the paint method of a JComponent, such as a JPanel.  This object should implement a Printable interface.  When print() is called, you simply paint the window.

You owe me some points for this:  #8)

This class depends on PrinterConstraints.java

/*
 * @(#)Test.java
 * Printing a TextLayout
 * Author: Shawn Curry
 * Date: 1/22/04
 */

import java.awt.*;
import java.awt.print.*;
import java.awt.geom.*;
import java.awt.font.*;
import javax.swing.*;
import javax.print.attribute.standard.MediaPrintableArea;

class Test extends JFrame {
      
      private final static int INCH_TO_PIXEL = 72;
      
      private PrinterConstraints printer = new PrinterConstraints();
      private MediaPrintableArea mpa = printer.getMediaPrintableArea();
      
      private double width = mpa.getWidth( MediaPrintableArea.INCH ) * INCH_TO_PIXEL;
      private double height = mpa.getHeight( MediaPrintableArea.INCH ) * INCH_TO_PIXEL;

      private float imagePosX = (float)(mpa.getX( MediaPrintableArea.INCH ) * INCH_TO_PIXEL);
      private float imagePosY = (float)(mpa.getY( MediaPrintableArea.INCH ) * INCH_TO_PIXEL);
      
      public Test() {
            try {
            Page page = new Page();
            page.setSize( (int)width, 11 * INCH_TO_PIXEL );
            JScrollPane scroll = new JScrollPane( page );
            scroll.setPreferredSize( new Dimension( 400, 250 ) );
            getContentPane().add( scroll );
            setSize( 500, 350 );
            setVisible( true );
            
            PrinterJob printJob = PrinterJob.getPrinterJob();
            PageFormat format = printer.getMaxImageablePageFormat();
            
            printJob.setPrintable( page, format );
        if( printJob.printDialog() )
        {      
              try {
                printJob.print();
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        }
          } catch( Exception e ) { e.printStackTrace(); }
      }

      public static void main(String args[]) {
            Test test = new Test();
            test.setDefaultCloseOperation( EXIT_ON_CLOSE );
      }
      
      class Page extends JPanel implements Printable
      {
            public void paint( Graphics g )
            {
                  Graphics2D g2 = (Graphics2D)g;
                  String testString = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
                  Font myFont = new Font("Times",Font.BOLD,20);
                  g2.setFont(myFont);
                  FontMetrics fm = g2.getFontMetrics();
                  
                  TextLayout textTl = new TextLayout(testString, myFont, new FontRenderContext(null, false, false));
                  AffineTransform at = new AffineTransform();
                  at.scale( width / fm.stringWidth( testString ), height / fm.getHeight() );
                  at.translate( imagePosX, imagePosY );
                  g2.transform( at );
                  textTl.draw( g2, imagePosX, imagePosY );
            }
            
            public int print(Graphics g, PageFormat pf, int pi)
                  throws PrinterException
            {
                  if( pi > 0 )
                        return Printable.NO_SUCH_PAGE;
                Graphics2D g2d = (Graphics2D)g;
                  g2d.translate(pf.getImageableX(), pf.getImageableY());
                  RepaintManager rm = RepaintManager.currentManager(this);
                  rm.setDoubleBufferingEnabled(false);
                  paint(g2d);
                  rm.setDoubleBufferingEnabled(true);
                  return Printable.PAGE_EXISTS;
            }
      }
}

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...