Article View: borland.public.cppbuilder.nativeapi
Article #11107Re: Print to File, But how?
From: Eugene
Date: Fri, 27 Feb 2004 15:22
Date: Fri, 27 Feb 2004 15:22
53 lines
2788 bytes
2788 bytes
Thank you very much for your help, but i'm a newbie and i didn't hear EnumPrinters() before.So how can i use it with Borland C++ Builder 4.0? Can you give an example or show me a link for it? I couldnt find anything useful with googling? P.S. Sorry for not to break lines.I forgot it. "JD" <nospam@nospam.com> wrote: > >"Eugene" <eugene@dmx.net> wrote: >> > >Please wrap your lines when you post. Your editor may visually >wrap them for you but you need to enter a hard retrun at the >end of each line. > >> I would like to write a program(or driver) to write print >> outs to a file. [...] > >Use EnumPrinters() to get the values for the "Generic - Text >Only" printer and use those values to fill in a PRINTER_INFO_2 >structure. Then pass the structure to AddPrinter() and you get >a file-printer called "Generic" that is not the default printer >and is not shared. > >PRINTER_INFO_2 structure should look like: > > PrinterInfo->pServerName = NULL; > PrinterInfo->pPrinterName = "Generic"; > PrinterInfo->pShareName = NULL; > PrinterInfo->pPortName = "FILE:"; > PrinterInfo->pDriverName = "Generic / Text Only"; > PrinterInfo->pComment = NULL; > PrinterInfo->pLocation = NULL; > PrinterInfo->pDevMode = NULL; > PrinterInfo->pSepFile = NULL; > PrinterInfo->pPrintProcessor = "WinPrint"; > PrinterInfo->pDatatype = "RAW"; > PrinterInfo->pParameters = NULL; > PrinterInfo->pSecurityDescriptor = NULL; > PrinterInfo->Attributes = 576; > PrinterInfo->Priority = 1; > PrinterInfo->DefaultPriority = 0; > PrinterInfo->StartTime = 0; > PrinterInfo->UntilTime = 0; > PrinterInfo->Status = 0; > PrinterInfo->cJobs = 0; > PrinterInfo->AveragePPM = 0; > >~ JD >
Technical Details
Message-ID:
<403f60ad$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<403a01d6$1@newsgroups.borland.com> <403a74f3$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,c183d0e61e81ac1b X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-02-27 07:40:38 PST From: "Eugene" <eugene@dmx.net> Sender: "Eugene" <eugene@dmx.net> Reply-To: "Eugene" <eugene@dmx.net> Subject: Re: Print to File, But how? Newsgroups: borland.public.cppbuilder.nativeapi X-User-Info: 81.215.247.152 References: <403a01d6$1@newsgroups.borland.com> <403a74f3$1@newsgroups.borland.com> NNTP-Posting-Host: 207.105.83.66 Message-ID: <403f60ad$1@newsgroups.borland.com> Date: 27 Feb 2004 07:22:21 -0800 X-Trace: newsgroups.borland.com 1077895341 207.105.83.66 (27 Feb 2004 07:22:21 -0800) Lines: 54 Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail