Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Java (http://www.programmingforums.org/forum17.html)
-   -   printing 1 or 2 pages and not 9999 (http://www.programmingforums.org/showthread.php?t=4325)

Easter Bunny Jun 6th, 2005 7:02 AM

printing 1 or 2 pages and not 9999
 
1 Attachment(s)
how do i get rid of that annoying 9999 pages that will be printed once i hit print? i also want to print 2 or so pages of stuff, but it's still putting everything on one page and then it doesn't fit. does it have something to do with PageFormat? i've taken a stroll through the web in search of a cure, but haven't found one (that i understand) yet.

anyone want to give me clues? i don't want the code, i just want to know what to use and so on. i want to sort of figure most of it out myself.

thanks guys.

ps : if you don't know what i'm nattering on about, then there is a screenshot attached where i circled the 9999 bit.

Dizzutch Jun 10th, 2005 9:41 AM

where are you hitting print from?

Knight Jun 10th, 2005 11:44 AM

Are you just trying to print like normal? Just change the (9999) to (2) or whatever you would like. If I completely missed what you're asking for, forgive me :)

Easter Bunny Jun 13th, 2005 1:54 AM

i do the whole
:

if ( pj.printDialog() )// javax.print.attribute.standard.PageRanges( 1, pages )) )
{
        pj.print();
}


thing, but as soon as i have more than a page to print, then it doesn't want to do the next bit on the second page. i was told that users are losers and if there are 9999 pages selected, then odds are good that they will ignore it and then have a hernia when the printer prints a page and then spits out 9998 blank pages.

if you can have 60 lines of data, and only 40 fit on a page, how will you change the 9999 to a 2 and also, how do you get those last 20 lines on the second page?

Pilgrim Jun 13th, 2005 8:42 AM

Ok, here are two resources I found on printing in Java.

The first is a multi-step tutorial on printing in Java.
http://www.javaworld.com/javaworld/j...020-print.html

The second is a page from Sun about advanced printing. It includes printing in multiple pages and if your data is larger than one page.
http://java.sun.com/developer/online.../advprint.html

I hope these are somewhat helpful to you. If I find more info, I'll let you know.

Easter Bunny Jun 14th, 2005 4:48 AM

thanks dude. will check it out when i'm on lunch(assuming the customres let me have lunch). will let you know if i got it.

thanks again. ;)


All times are GMT -5. The time now is 6:35 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC