PDF Creator Pilot documentation |
Download CHM version of this manual. |
|
![]() ![]() Collapse AllPDF document's handle of device context for EMF drawing functions.
|
| LONG HDC { get; } |
Value
PDF document's handle of device context (HDC).
Remarks
The HDC property can be used to get a handle to device context (HDC) for Windows GDI functions.
Note: This property returns a device context (DC) for current page. If you change current page or add a new one you must call this property again to get DC for current page.
Example
Using HDC property
Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
PDF.FileName := 'test.pdf';
PDF.UseScreenDC := true;
PDF.BeginDoc;
{ use standart GDI drawing here }
Rectangle(PDF.HDC, 10, 10, 20, 20);
PDF.EndDoc;
C/C++
[copy to clipboard]
// PDF object is supposed to be created PDF->FileName = "test.pdf"; PDF->UseScreenDC = TRUE; PDF->BeginDoc(); HDC hdc = (HDC)PDF->HDC; // use standart GDI drawing here Rectangle(hdc, 10, 10, 20, 20); PDF->EndDoc();
C#
[copy to clipboard]
// PDF object is supposed to be created PDF.FileName = "test.pdf"; PDF.UseScreenDC = true; PDF.BeginDoc(); Graphics gr = Graphics.FromHdc((IntPtr)PDF.HDC); // use standart GDI+ drawing here gr.DrawRectangle(Pens.Black, 10, 10, 10, 10); gr.Dispose(); PDF.EndDoc();
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created PDF.FileName = "test.pdf" PDF.UseScreenDC = True PDF.BeginDoc // use standart GDI drawing here Rectangle PDF.HDC, 10, 10, 20, 20 PDF.EndDoc
See Also
Reference


