Q:
I would like to use PDFNet Mobile SDK for Windows CE to print PDF to a given printer.
I figured out how to convert PDF to JPEG on WinCE (using pdftron.PDF.PDFDraw) however I am not sure how to print.
Any ideas?
A:
I believe that the following links/resources will be of help regarding printing a Bitmap in WinCE:
http://www.codeproject.com/Articles/31/A-DIBSection-wrapper-for-Win32-and-WinCE
http://www.ucancode.net/Graphics-Library-for-WinCE-Draw-Bitmap-Gif-Jpg–Visual-C-Codes.htm
Having said this, I noticed that there may be a simpler way to print PDF on WinCE … using pdftron.PDF.PDFDraw.DrawInRect(HDC)
PDFDraw pdfdraw;
pdfdraw.SetDPI(96);
pdfdraw.SetPrintMode(true);
for (int = 1; i<num; ++i) {
::StartPage(hDC);
PDF::Rect r;
r.x1 = 0, r.y1 = 0;
double conv_x2pts = 72.0/::GetDeviceCaps(hDC, LOGPIXELSX);
double conv_y2pts = 72.0/::GetDeviceCaps(hDC, LOGPIXELSY);
// HORZRES is in pixels, divide by pixels / inch and multiply by points / inch to get points printable area across and down.
r.x2 = ::GetDeviceCaps(hDC, HORZRES) * conv_x2pts;
r.y2 = ::GetDeviceCaps(hDC, VERTRES) * conv_y2pts;
PDF::Rect r2®;
pdfdraw.DrawInRect(doc.GetPage(i), hDC, r);
}
…
Where hDC is a printer device context
For info on how to create printer device context please see: