Setting specific output path using DEVMODE

If you are a C/C++/C# developer and have any questions about using our products from your application here is the place to post them.
Post Reply
robert_thompson_13
Posts: 8
Joined: Thu Oct 09 2003

Setting specific output path using DEVMODE

Post by robert_thompson_13 »

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
Dany
Amyuni Team
Posts: 113
Joined: Wed Sep 11 2002
Location: Montreal.
Contact:

Post by Dany »

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 );
robert_thompson_13
Posts: 8
Joined: Thu Oct 09 2003

Win32 Callback for knowing when Output File is written

Post by robert_thompson_13 »

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
Post Reply