🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #11152

Re: Print to File, But how?

#11152
From: JD
Date: Mon, 23 Feb 2004 21:47
42 lines
2336 bytes
"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: <403a74f3$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <403a01d6$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-23 14:10:35 PST
From: "JD" <nospam@nospam.com>
Sender: "JD" <nospam@nospam.com>
Reply-To: "JD" <nospam@nospam.com>
Subject: Re: Print to File, But how?
Newsgroups: borland.public.cppbuilder.nativeapi
X-User-Info: 172.175.172.232     
References:  <403a01d6$1@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <403a74f3$1@newsgroups.borland.com>
Date: 23 Feb 2004 13:47:31 -0800
X-Trace: newsgroups.borland.com 1077572851 207.105.83.66 (23 Feb 2004 13:47:31 -0800)
Lines: 43
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail