[gs-devel] ghostscript print to usercontrol in c#

Ken Sharp ken.sharp at artifex.com
Thu Sep 3 00:29:10 PDT 2009


At 11:59 03/09/2009 +0800, peng tao wrote:

>In a word: How can we print a pdf to usercontrol directly? (Better to load 
>pdf in memory as a C# object, like Bitmap...)

You can't print to a c# object 'directly', Ghostscript renders PostScirpt 
or PDf into a raw bitmap, the Ghostscript device is the component which 
converts the bitmap into 'something else'. This can be a file format, or it 
can drive a printer directly using the data.

I believe in your case you will need to create your own device which is 
handed the bitmap data from the rendering engine, and you will need to 
refactor it as required to fit your own C# object.

A starting point in understanding how to do this might be the 'jpeg' family 
of devices. There are 3 of these, and they are all defined in the file 
gdevjpeg.c



             Ken


More information about the gs-devel mailing list