|
|
printing #2
I am trying to print a file. I need to display the print dialog so that
the user can choose the correct printer. I got all this working.
My prolem occurs when the user chooses to print to a file (out.prn).
The source file is sent to the printer instead.
Any suggestions are appreciated.
|
|
0
|
|
|
|
Reply
|
pdeline (3)
|
10/4/2006 7:00:36 PM |
|
"pete231" <pdeline@crossroads.com> wrote in message
news:1159988435.965459.281720@i3g2000cwc.googlegroups.com...
>I am trying to print a file. I need to display the print dialog so that
> the user can choose the correct printer. I got all this working.
>
> My prolem occurs when the user chooses to print to a file (out.prn).
> The source file is sent to the printer instead.
>
> Any suggestions are appreciated.
>
That's easy. Send the correct file instead of the source file.
My guess is that line 42 of xbquj.java is wrong.
--
Fred L. Kleinschmidt
Boeing Associate Technical Fellow
Technical Architect, Software Reuse Project
|
|
0
|
|
|
|
Reply
|
Fred
|
10/5/2006 3:26:05 PM
|
|
>
> That's easy. Send the correct file instead of the source file.
>
> My guess is that line 42 of xbquj.java is wrong.
I don't understand this replay. Nor do I know what xbquj.java is.
|
|
0
|
|
|
|
Reply
|
pete231
|
10/5/2006 7:30:06 PM
|
|
Don't remove the original question in a reply!
I have restored it:
>>>"pete231" <pdeline@crossroads.com> wrote in message
>>>news:1160076606.456953.260820@b28g2000cwb.googlegroups.com...
>>>I am trying to print a file. I need to display the print dialog so that
>>>the user can choose the correct printer. I got all this working.
>>>
>>>My prolem occurs when the user chooses to print to a file (out.prn).
>>>The source file is sent to the printer instead.
>>>
>>>Any suggestions are appreciated.
>>
>> That's easy. Send the correct file instead of the source file.
>>
>> My guess is that line 42 of xbquj.java is wrong.
>>
>
> I don't understand this replay. Nor do I know what xbquj.java i
Well, I made a wild guess at which file of yours had the problem.
Since you didn't include any code, I had to guess. Perhaps my
guess wasn't quite correct. I haven't been a very good mind reader
these past few months.
If you showed us what you actually tried, maybe we could provide some help.
--
Fred L. Kleinschmidt
Boeing Associate Technical Fellow
Technical Architect, Software Reuse Project
|
|
0
|
|
|
|
Reply
|
Fred
|
10/5/2006 8:42:53 PM
|
|
>
> Well, I made a wild guess at which file of yours had the problem.
> Since you didn't include any code, I had to guess. Perhaps my
> guess wasn't quite correct. I haven't been a very good mind reader
> these past few months.
>
This works. It sends the file to the printer the users selects. If they
select "print to file" it still routes the file to the printer.
public boolean print(File file)
{
PrinterJob printerjob = PrinterJob.getPrinterJob();
if ( !printerjob.printDialog() )
return false;
try
{
printerjob.getPrintService().createPrintJob().print( new
SimpleDoc(
new FileInputStream( file ),
DOC_FLAVOR,
new HashDocAttributeSet() ),
new HashPrintRequestAttributeSet() );
return true;
}
catch ( Exception e )
{
e.printStackTrace();
return false;
}
}
|
|
0
|
|
|
|
Reply
|
pete231
|
10/5/2006 10:37:42 PM
|
|
|
4 Replies
105 Views
(page loaded in 0.086 seconds)
Similiar Articles: Printing a 2d char array - comp.lang.c++.moderatedI am trying to print a 2d character array and its just not working. What am I doing wrong? I think i may need a pointer, but I am not sure just how to... Printing a single page document twice on the same page - comp.text ...I have a single page PDF document that I would like to print twice on the same page. Example: a small one page flyer that could be printed off twice o... Printing in Landscape from Perl using systen() - comp.unix.solaris ...G' Day I have got a little issue with a script that refuses to print a text file in landscape, on a SOLARIS 5.9. Therefore, I hope I could get a litt... Printing PostScript file from UNIX to Windows PrintServer (lpr ...Hi everyone. I'm have a question which is not really simple to describe but i hope most of you can follow me an understand what problem i do have. ... Printing Multiple PDFs from Windows Explorer - comp.text.pdf ...We should be able to highlight multiple files in Windows Explorer, right click, and select Print and have all the files printed. What we're seeing ... how to rename print queue - comp.unix.solarisI am printing over TCP/IP (not directly attached). The problem is that I want to rename the queue from the autogenerated name that Jetadmin chose to a name of my own. Printing to PDF automatically saves document - comp.text.pdf ...When I print to a PDF using the 'Adobe PDF' printer (I think this uses Distiller), I'm prompted to save the document at the time the job prints so I g... Printing a report on a network printer - comp.databases.filemaker ...I am having a problem when printing a filemaker pro 7 (WIN) report on a networked printer HP LAserJet 4600 color (WIN 2003 Server) with FMS 7 Advan... printing a picture scaled on middle of page if too big - comp ...Hi. How can I print pictures scaled on the middle of a page, if they are to big for it? In Corel Photo-Paint, for example, I could set this optio... Problems printing PDF - comp.unix.solarisHi, I regularly get failures printing PDF's from Solaris 7 to an HP 4MP. Anybody know what the issues are? Thanks. Marvin Wolfthal maw@weichi.com ... Printing - Wikipedia, the free encyclopediaPrinting is a process for reproducing text and images, typically with ink on paper using a printing press. It is often carried out as a large-scale industrial process ... Online printing services you trust- print online with up to 60% offFor the best in online printing services at affordable prices, call PsPrint today! Business card printing and online printing services of every kind can be yours now! 7/20/2012 3:23:17 PM
|
|
|
|
|
|
|
|
|