Prev: catch native crash
Next: HttpServletRequest setHeader
From: G.W. Lucas on 8 Dec 2009 10:49 I am trying to add a print capability to an application I am writing and am having trouble getting the application to retain the settings for landscape versus portrait each time the print dialog is raised. That is, if the user sets landscape instead of portrait orientation the first time he prints, Id like it to show landscape in all subsequent times he raises the print dialog. I am less concerned about other settings. Unfortunately, Ive not been successful with any of them. Could someone point me in the right direction? I am running under Windows XP Service Pack 3. Java 1.6.0_16. To raise the printDialog, I do the following: PrinterJob printerJob = PrinterJob.getPrinterJob(); printerJob.printDialog(); This brings up a dialog which resembles the Microsoft Office applications and provides a Properties-button dialog that is consistent with the properties for my printer. But it doesnt retain the page-orientation settings from invocation to invocation. I tried the following: HashPrintRequestAttributeSet hpas = new HashPrintRequestAttributeSet (); printJob.printDialog(hpas); Which does allow me to retain the settings, but the print dialog looks completely different and, worse, does not bring up a Properties dialog at all. Nor does it include all the metadata for the printer that is available using the no-arguments printDialog() call. I could use this approach, but would really like to be able to show my users a dialog that is compatible with their other applications and gives them full access to the capabilities of their printer. Does anyone a recommendations for using the print dialog that might address this issue? Would this be addressed by using better way to set up the PrintRequestAttributeSet? Is there a different approach other than using a PrintRequestAttributeSet? Thanks. Gary P.S. On a positive note, the printouts look really sharp and the Java Graphics2D stuff is extremely accurate and a joy to use.
From: Knute Johnson on 8 Dec 2009 14:02 G.W. Lucas wrote: > I am trying to add a print capability to an application I am writing > and am having trouble getting the application to retain the settings > for �landscape� versus �portrait� each time the print dialog is > raised. That is, if the user sets landscape instead of portrait > orientation the first time he prints, I�d like it to show landscape in > all subsequent times he raises the print dialog. I am less concerned > about other settings. Unfortunately, I�ve not been successful with any > of them. Could someone point me in the right direction? > > I am running under Windows XP Service Pack 3. Java 1.6.0_16. > > To raise the printDialog, I do the following: > > PrinterJob printerJob = PrinterJob.getPrinterJob(); > printerJob.printDialog(); > > This brings up a dialog which resembles the Microsoft Office > applications and provides a Properties-button dialog that is > consistent with the properties for my printer. But it doesn�t retain > the page-orientation settings from invocation to invocation. I tried > the following: > > HashPrintRequestAttributeSet hpas = new HashPrintRequestAttributeSet > (); > printJob.printDialog(hpas); > > Which does allow me to retain the settings, but the print dialog looks > completely different and, worse, does not bring up a Properties dialog > at all. Nor does it include all the metadata for the printer that is > available using the no-arguments printDialog() call. I could use this > approach, but would really like to be able to show my users a dialog > that is compatible with their other applications and gives them full > access to the capabilities of their printer. > > Does anyone a recommendations for using the print dialog that might > address this issue? Would this be addressed by using better way to > set up the PrintRequestAttributeSet? Is there a different approach > other than using a PrintRequestAttributeSet? > > Thanks. > > Gary > > P.S. On a positive note, the printouts look really sharp and the Java > Graphics2D stuff is extremely accurate and a joy to use. You need a PageFormat to print. Keep the same PageFormat for the life of the program. When you exit, save the orientation state and restore that when you restart the program. -- Knute Johnson email s/nospam/knute2009/ -- Posted via NewsDemon.com - Premium Uncensored Newsgroup Service ------->>>>>>http://www.NewsDemon.com<<<<<<------ Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
From: Knute Johnson on 8 Dec 2009 16:05 From: Knute Johnson <nospam(a)rabbitbrush.frazmtn.com> G.W. Lucas wrote: > I am trying to add a print capability to an application I am writing > and am having trouble getting the application to retain the settings > for �landscape� versus �portrait� each time the print dialog is > raised. That is, if the user sets landscape instead of portrait > orientation the first time he prints, I�d like it to show landscape in > all subsequent times he raises the print dialog. I am less concerned > about other settings. Unfortunately, I�ve not been successful with any > of them. Could someone point me in the right direction? > > I am running under Windows XP Service Pack 3. Java 1.6.0_16. > > To raise the printDialog, I do the following: > > PrinterJob printerJob = PrinterJob.getPrinterJob(); > printerJob.printDialog(); > > This brings up a dialog which resembles the Microsoft Office > applications and provides a Properties-button dialog that is > consistent with the properties for my printer. But it doesn�t retain > the page-orientation settings from invocation to invocation. I tried > the following: > > HashPrintRequestAttributeSet hpas = new HashPrintRequestAttributeSet > (); > printJob.printDialog(hpas); > > Which does allow me to retain the settings, but the print dialog looks > completely different and, worse, does not bring up a Properties dialog > at all. Nor does it include all the metadata for the printer that is > available using the no-arguments printDialog() call. I could use this > approach, but would really like to be able to show my users a dialog > that is compatible with their other applications and gives them full > access to the capabilities of their printer. > > Does anyone a recommendations for using the print dialog that might > address this issue? Would this be addressed by using better way to > set up the PrintRequestAttributeSet? Is there a different approach > other than using a PrintRequestAttributeSet? > > Thanks. > > Gary > > P.S. On a positive note, the printouts look really sharp and the Java > Graphics2D stuff is extremely accurate and a joy to use. You need a PageFormat to print. Keep the same PageFormat for the life of the program. When you exit, save the orientation state and restore that when you restart the program. -- Knute Johnson email s/nospam/knute2009/ -- Posted via NewsDemon.com - Premium Uncensored Newsgroup Service ------->>>>>>http://www.NewsDemon.com<<<<<<------ Unlimited Access, Anonymous Accounts, Uncensored Broadband Access --- BBBS/LiI v4.01 Flag * Origin: Prism bbs (1:261/38) --- Synchronet 3.15a-Win32 NewsLink 1.92 * Time Warp of the Future BBS - Cougar, Washington - telnet://time.synchro.net
From: Roedy Green on 9 Dec 2009 00:56 On Tue, 8 Dec 2009 07:49:39 -0800 (PST), "G.W. Lucas" <gwlucas(a)sonalysts.com> wrote, quoted or indirectly quoted someone who said : >Does anyone a recommendations for using the print dialog that might >address this issue? Would this be addressed by using better way to >set up the PrintRequestAttributeSet? Is there a different approach >other than using a PrintRequestAttributeSet? This is not what you wanted to hear, but you may be stuck doing a screen capture. See http://mindprod.com/jgloss/screencapture.html and follow links. -- Roedy Green Canadian Mind Products http://mindprod.com The future has already happened, it just isn�t evenly distributed. ~ William Gibson (born: 1948-03-17 age: 61)
From: Knute Johnson on 9 Dec 2009 01:32
Knute Johnson wrote: > From: Knute Johnson <nospam(a)rabbitbrush.frazmtn.com> > > G.W. Lucas wrote: >> I am trying to add a print capability to an application I am writing >> and am having trouble getting the application to retain the settings >> for �landscape� versus �portrait� each time the print dialog is >> raised. That is, if the user sets landscape instead of portrait >> orientation the first time he prints, I�d like it to show landscape in >> all subsequent times he raises the print dialog. I am less concerned >> about other settings. Unfortunately, I�ve not been successful with any >> of them. Could someone point me in the right direction? >> >> I am running under Windows XP Service Pack 3. Java 1.6.0_16. >> >> To raise the printDialog, I do the following: >> >> PrinterJob printerJob = PrinterJob.getPrinterJob(); >> printerJob.printDialog(); >> >> This brings up a dialog which resembles the Microsoft Office >> applications and provides a Properties-button dialog that is >> consistent with the properties for my printer. But it doesn�t retain >> the page-orientation settings from invocation to invocation. I tried >> the following: >> >> HashPrintRequestAttributeSet hpas = new HashPrintRequestAttributeSet >> (); >> printJob.printDialog(hpas); >> >> Which does allow me to retain the settings, but the print dialog looks >> completely different and, worse, does not bring up a Properties dialog >> at all. Nor does it include all the metadata for the printer that is >> available using the no-arguments printDialog() call. I could use this >> approach, but would really like to be able to show my users a dialog >> that is compatible with their other applications and gives them full >> access to the capabilities of their printer. >> >> Does anyone a recommendations for using the print dialog that might >> address this issue? Would this be addressed by using better way to >> set up the PrintRequestAttributeSet? Is there a different approach >> other than using a PrintRequestAttributeSet? >> >> Thanks. >> >> Gary >> >> P.S. On a positive note, the printouts look really sharp and the Java >> Graphics2D stuff is extremely accurate and a joy to use. > > You need a PageFormat to print. Keep the same PageFormat for the life of the > program. When you exit, save the orientation state and restore that when you > restart the program. > > -- > > Knute Johnson > email s/nospam/knute2009/ > > -- > Posted via NewsDemon.com - Premium Uncensored Newsgroup Service > ------->>>>>>http://www.NewsDemon.com<<<<<<------ > Unlimited Access, Anonymous Accounts, Uncensored Broadband Access > > --- BBBS/LiI v4.01 Flag > * Origin: Prism bbs (1:261/38) > --- Synchronet 3.15a-Win32 NewsLink 1.92 > * Time Warp of the Future BBS - Cougar, Washington - telnet://time.synchro.net What's with this echo? -- Knute Johnson email s/nospam/knute2009/ -- Posted via NewsDemon.com - Premium Uncensored Newsgroup Service ------->>>>>>http://www.NewsDemon.com<<<<<<------ Unlimited Access, Anonymous Accounts, Uncensored Broadband Access |