Print a PDF on Windows CE (embedded system)

859 views
Skip to first unread message

Support

unread,
Aug 30, 2012, 6:28:46 PM8/30/12
to pdfne...@googlegroups.com
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://social.msdn.microsoft.com/Forums/lv-LV/winembnatapp/thread/a18dc13c-4859-4aa8-89cb-251315d4acb8

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(r);

   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:

   http://social.msdn.microsoft.com/Forums/lv-LV/winembnatapp/thread/a18dc13c-4859-4aa8-89cb-251315d4acb8

Reply all
Reply to author
Forward
0 new messages