Thread View: pl.comp.lang.delphi
2 messages
2 total messages
Started by "Martin Brzezink
Sat, 28 Mar 1998 00:00
Changing paper size? (API)
Author: "Martin Brzezink
Date: Sat, 28 Mar 1998 00:00
Date: Sat, 28 Mar 1998 00:00
34 lines
1260 bytes
1260 bytes
I'm having trubble changing printers default paper format within a program. The Printer.Handle seems to have wrong value, so using it as second argument to DocumentProperties() function doesn't make the function work properly. Sending 0 instead, fixes the problem, but the changes don't apply to the Printer object (which I need to use). WHAT'S MISSING? I'd be grateful for all help. martin@openinfo.se The code: // allocate the memory DocumentProperties(Application.Handle, Printer.Handle, PChar(Printer.Printers[Printer.PrinterIndex]) , DEVMODE, DEVMODE, 0); // take printer defaults DocumentProperties(Application.Handle, Printer.Handle, PChar(Printer.Printers[Printer.PrinterIndex]) , DEVMODE, DEVMODE, DM_OUT_BUFFER); DEVMODE.dmPaperSize := DMPAPER_A5; // change the paper size DEVMODE.dmFields := DM_PAPERSIZE; // indicate the change // apply this change (DOESN'T WORK!) DocumentProperties(Application.Handle, Printer.Handle, PChar(Printer.Printers[Printer.PrinterIndex]) , DEVMODE, DEVMODE, DM_IN_BUFFER + DM_OUT_BUFFER); // show the printer dialog with A5 chosen (A4 appears instead) DocumentProperties(Application.Handle, Printer.Handle, PChar(Printer.Printers[Printer.PrinterIndex]) , DEVMODE, DEVMODE, DM_IN_PROMPT); -- martin@openinfo.se
Re: Changing paper size? (API)
Author: "Earl F. Glynn"
Date: Sat, 28 Mar 1998 00:00
Date: Sat, 28 Mar 1998 00:00
26 lines
964 bytes
964 bytes
Martin Brzezinka wrote in message <01bd5a8e$1e57d350$bb5c1986@laptop_openinfo>... >I'm having trubble changing printers default paper format within a program. >The Printer.Handle seems to have wrong value, so using it as second >argument to DocumentProperties() function doesn't make the function work >properly. >Sending 0 instead, fixes the problem, but the changes don't apply to the >Printer object (which I need to use). >WHAT'S MISSING? Martin, You might try Borland's FAQ "Changing the Papersize of a Print Job," www.borland.com/devsupport/delphi/qanda/707.html I've summarized all of Borland's TIs and FAQs about printing in one place. Look for Link in Printer Projects (under Other Projects) in my Computer Lab in a day or two for more links. efg _________________________________________ efg's Computer Lab: http://infomaster.net/external/efg Earl F. Glynn E-Mail: EarlGlynn@att.net MedTech Research Corporation, Lenexa, KS USA
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads