Archived

This topic is now archived and is closed to further replies.

Promit

Printing custom documents

Recommended Posts

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" ?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites