Components for Developers
© 2000-2012, Two Pilots

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF-X Pilot History In the Lab

PDF Creator Pilot documentation

Download CHM version of this manual.
Metafiles
Collapse All

This method gets the handle of the device context (HDC) of a PDF document for EMF drawing functions.

Syntax

OLE_HANDLE GetDC ()
Return value
Handle of the device context

Remarks

Note: This method returns a device context (DC) for the current page. If you change the current page or add a new page, you must call this method again to get the DC for the current page.

Example

Using the Device Context

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
PDF.SetLicenseData('demo', 'demo');
PDF.UseScreenBasedDC := true;

{ use standard GDI drawing functions: }
Rectangle(PDF.GetDC(), 10, 10, 20, 20);

PDF.SaveToFile('test.pdf', true);
C/C++
[copy to clipboard]
// PDF object is supposed to be created
PDF->SetLicenseData("demo", "demo");
PDF->UseScreenBasedDC = true;

// use standard GDI drawing functions:
Rectangle(PDF->GetDC(), 10, 10, 20, 20);

PDF->SaveToFile("test.pdf", true);
C#
[copy to clipboard]
// PDF object is supposed to be created
PDF.SetLicenseData("demo", "demo");
PDF.UseScreenBasedDC = true;

// use standard GDI drawing functions:
Rectangle(PDF.GetDC(), 10, 10, 20, 20);

PDF.SaveToFile("test.pdf", true);
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
PDF.SetLicenseData "demo", "demo"
PDF.UseScreenBasedDC = True

// use standard GDI drawing functions:
Rectangle PDF.GetDC, 10, 10, 20, 20

PDF.SaveToFile "test.pdf", true

See Also

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF-X Pilot History In the Lab

 

 

PDF Library | Virtual Printer | Converters to PDF

Support | Blog | Forum | Contacts

© 2000-2012, Two Pilots