Skip to main content
GameDev.net gamedev.net
🔒 Locked

Printing custom documents

Started by Promit Apr 21, 2004 at 5:10 PM 1 replies 350+ views
Original Post
Promit
Promit
Suppose I''m writing, oh I don''t know, a Photoshop type of art program, or a chart creation program, or a spreadsheet program, or whatever. This program is going to have custom documents with completely arbitrary data. Rendering this on-screen is simple enough; use your typical graphics output functions. My question is, how do you go about printing these custom documents? In short, how do you control the printer? Not send it text or something, but actually, truly tell it exactly what you want. I''m mainly interested in Windows, but Linux/Mac would be nice too. On a side note, is PostScript standard on all printers now? Or do you actually have to buy a "PostScript Printer" ?
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
SiCrane
SiCrane
In windows, using a printer is just like printing to a predefined graphics context (except different). You might want to look at the WM_PRINT and WM_PRINTCLIENT windows messages, the StartPage() and EndPage() functions and basically everything on MSDN in the "Printer and Print Spooler" section of the GDI reference.
fredizzimo
fredizzimo
And postscript is not standard, in fact PCL is a much more common language for at least home printers, but even that mostly on laser printers.

So, GDI printing is the way to go, if you want compability.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.