Win32 |
Author |
Message |
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Mon May 13, 2019 4:48 pm Post subject: Printing |
|
|
ms - Retrieve a Printer Device Context
"You can obtain the exact printer name string to pass to CreateDC by calling
the EnumPrinters function. The following code example shows how to call
EnumPrinters and get the names of the local and locally connected printers." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Thu May 30, 2019 7:50 pm Post subject: |
|
|
How to Change Default Printer Settings in an MFC Applicat
"To change the default printer settings in an MFC application, you must
retrieve the system default settings in a CWinApp derived object and modify
those defaults before a print job is invoked." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Mon Jun 03, 2019 3:49 pm Post subject: |
|
|
ms - How To Modify Printer Settings by Using SetPrinter
"SetPrinter is a new API for Windows 95, Windows NT, Windows 2000, and
Windows XP that allows applications to change various printer attributes.
However, as the code in this article demonstrates, a certain amount of
preparation is necessary in order to call SetPrinter correctly." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Mon Jun 03, 2019 4:01 pm Post subject: |
|
|
cp - Configuring Printer Settings Programmatically
"The usage of DocumentProperties and SetPrinter API functions gives an
opportunity to change the printer settings. But, when using them, I could not
have a stable method of changing settings on all Windows OS versions. Below,
all possible methods of changing printer parameters will be described and also
the solution of how to obtain the stabler behavior for different Windows OS
versions." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Mon Jun 03, 2019 4:11 pm Post subject: |
|
|
ms - SetDefaultPrinter function
"The SetDefaultPrinter() function sets the printer name of the default printer
for the current user on the local computer" |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3049 Location: Europe
|
Posted: Mon Jun 03, 2019 4:41 pm Post subject: |
|
|
cboard - How can I set windows printer configuration in c?
"I can't get certain options set which are in the DEVMODE structure.
I set the values in the in the DEVMODE object but my Brother HL-1850 printer
completely ignores them.
I've verified the constants that are used and they are all correct.
I checked the value of the option settings and they are all correct.
I tried calling the VALID_OPTIONS option (code below) after setting all the
options but it made no difference.
It uses Windows functions: DocumentProperties() and SetPrinter()." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Mon Jun 03, 2019 4:48 pm Post subject: |
|
|
so - Printing on the FILE port with a given output path still shows the 'save as' dialog
"My application uses GDI printing to create postscript files then converted to
PDF. My printer use Ghostscript PDF driver and the FILE port (By the way why
it is named "PDF driver" if it cannot output pdf directly) I specify a file output
path with the DOCINFO struct docInfo.lpszOutput = L"c:\temp_path\{guid}.ps";
Everything works fine. But sporadically the driver prompt the 'save as'
dialog, despite I provided an output filename." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Mon Jun 03, 2019 4:56 pm Post subject: |
|
|
git - windows-graphics-programming-src/Chapt_17/Printer/Printer.cpp
// "Windows Graphics Programming: Win32 GDI and DirectDraw
// ISBN 0-13-086985-6 //
// //
// Written by Yuan, Feng www.fengyuan.com //
// Copyright (c) 2000 by Hewlett-Packard Company www.hp.com //
// Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com //
// //
// FileName : printer.cpp //
// Description: Printer demo program, Chapter 17 //
// Version : 1.00.000, May 31, 2000 " |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3049 Location: Europe
|
Posted: Sat Mar 13, 2021 11:24 am Post subject: |
|
|
msdn - CreateDCA function (wingdi.h)
"When you call CreateDC to create the HDC for a printer device, the printer
driver validates the DEVMODE. If the printer driver determines that the
DEVMODE is invalid (that is, printer driver can't convert or consume the
DEVMODE), the printer driver provides a default DEVMODE to create the
HDC for the printer device." |
|
Back to top |
|
|
|