Two Pilots™    Home  |  Navigation  |  Site Map  |  Products  |  Download  |  Prices  |  For Partners  |  Support


All forums · Statistics · Search ·

Two Pilots forum / For software developers / hdc print preview
Author Message
Alex
# Posted: 12 Feb 2008 18:18


Hi..

Ive read some posts on here that it is easy to capture gdi print preview data and write it straight into a PDF. ive searched the documentation which is extremely light in detailing how this is done.. can you please give me a simple example how to send a printdocument from VB.NET straight into a PDF..

e.g. drawstring etc etc..

whats next..

Many thanks

Vitaliy Shibaev
Member
# Posted: 14 Feb 2008 08:22


Hi!

Here is the sample on C++ with GDI+ (please translate to VB.NET independently):

PDF->UseScreenDC = VARIANT_TRUE;
long Resol;
PDF->GetUsedDCResolution(&Resol);
PDF->Resolution = Resol;
PDF->BeginDoc();

GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);

long used_dc = PDF->HDC;
HDC dc = (HDC)used_dc;
Graphics Gr(dc);
Gr.DrawString(...)
...//using Gr
PDF.EndDoc();

GdiplusShutdown(gdiplusToken);

Best regards,
Vitaliy Shibaev
Two Pilots

 

 

Powered by miniBB 2.0 RC7 © 2001-2004 Page creation time (sec.): 0.013

 

Page top