Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > PageFormat

Reply
Thread Tools

PageFormat

 
 
freesoft_2000
Guest
Posts: n/a
 
      07-01-2005
Hi everyone,

I am trying to print something but i need to ask
something really so bare with me a little while

You know that for printing something using the java
printable interface you would have to overide this method

public int print(Graphics graphics, PageFormat pageFormat, int pageIndex)

{
//all other codings
}

Now if i wanted to print something in a certain
format, i would this

public int print(Graphics graphics, PageFormat pageFormat, int pageIndex)

{

if(pageFormat.getOrientation() == pageFormat.PORTRAIT)
{
//some codings
}

else
{
//for the calculation of pageFormat.LANDSCAPE and
//pageFormat.REVERSE_LANDSCAPE

//some codings
}

//all other codings
}

Now here is problem, how to i know if the user has
selected
OrientationRequested.REVERSE_PORTRAIT - (please note that this variable is
from the JAVA javax.print.attribute.standard.OrientationRequeste d and the
class that uses it is the PrintRequestAttribute from the JAVA Print
Service.

As you guys can see that from the page format api, it
does not have the variable REVERSE_PORTRAIT, so how do i test for it when
the printable interface method that is to be overridded only calculates
using the PageFormat class and not the print Attribute

I hope you guys are not confused by my question and am
open to any suggestions

Any suggestions would be greatly appreciated

Thank You

Yours Sincerely

Richard West

 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      07-02-2005
On Fri, 01 Jul 2005 15:17:20 -0400, freesoft_2000 wrote:

> Hi everyone,


Please refrain from multi-posting.

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments