Technical Note #2 at,
http://www.amyuni.com/downloads/tn02.htm
has some examples of setting printer driver settings using DEVMODE.
Does anyone have an example of using DEVMODE like this in C++ for setting the output of the driver to a specific file path?
I need to prepare a demo before we purchase and so I need to be able to do this first.
Thanks,
Robert
Setting specific output path using DEVMODE
Setting the output file name cannot be done using the DEVMODE structure. It can be done however using the DOCINFO structure that is passed to the StartDoc API call. Example:
DOCINFO doc;
memset( &doc, 0, sizeof( doc ) );
doc.cbSize = sizeof( doc );
doc.lpszDocName = _T("My test PDF");
doc.lpszOutput = _T("c:\\temp\\test.pdf");
StartDoc( hDC, &doc );
DOCINFO doc;
memset( &doc, 0, sizeof( doc ) );
doc.cbSize = sizeof( doc );
doc.lpszDocName = _T("My test PDF");
doc.lpszOutput = _T("c:\\temp\\test.pdf");
StartDoc( hDC, &doc );
-
- Posts: 8
- Joined: Thu Oct 09 2003
Win32 Callback for knowing when Output File is written
Dany,
This is fine for people drawing to a GDI surface.
However, I need to set this output path for the printer right after PDFDriverInit so any time a user prints to that printer driver it prints to that file.
Also, is there a Win32 API Callback Function I can register to know when the contents of a folder and/or drive change.
So what I need is:
1. Init driver
2. Set output path
3. Know when the output has been sent there (and more importantly finished)
4. End Driver
- robert
This is fine for people drawing to a GDI surface.
However, I need to set this output path for the printer right after PDFDriverInit so any time a user prints to that printer driver it prints to that file.
Also, is there a Win32 API Callback Function I can register to know when the contents of a folder and/or drive change.
So what I need is:
1. Init driver
2. Set output path
3. Know when the output has been sent there (and more importantly finished)
4. End Driver
- robert