#include <PDFDCEX.h>
Public Member Functions | |
PDFDCEX () | |
~PDFDCEX () | |
HDC | Begin (PDFDoc &in_pdfdoc, const Point &page_dimension=Point(8.5, 11)) |
void | End () |
UInt32 | GetDPI () |
void | Destroy () |
PDFDCEX is a utility class used to represent a PDF Device Context (DC).
Windows developers can use standard GDI or GDI+ API-s to write on PDFDCEX and to generate PDF documents based on their existing drawing functions. PDFDCEX can also be used to implement file conversion from any printable file format to PDF.
PDFDCEX class can be used in many ways to translate from GDI to PDF:
Very few code changes are required to perform the translation from GDI to PDF as PDFDCEX provides a GDI Device Context handle which can be passed to all GDI function requiring an HDC. PDFDCEX does use a "Virtual Printer" approach so the translation should be of both high quality and speed.
For more advanced translations or creations of PDF documents, such as security handling, the use of other PDFNet classes will be required.
An example use of PDFDCEX can be found in PDFDCTest.cpp:
pdftron::PDF::PDFDCEX::PDFDCEX | ( | ) |
Default constructor. Creates an empty new GDI to PDF translator.
pdftron::PDF::PDFDCEX::~PDFDCEX | ( | ) |
Destructor
HDC pdftron::PDF::PDFDCEX::Begin | ( | PDFDoc & | in_pdfdoc, |
const Point & | page_dimension = Point(8.5, 11) |
||
) |
Begin the process of translating GDI drawing into a PDF, starting with the creation of a GDI Device Context.
in_pdfdoc | the document which the converted GDI pages will be appended to. |
page_dimension | Width and Height, expressed in inches, defining the boundaries of the physical medium on which the page is intended to be displayed or printed. If page_dimension is not specified the default dimensions of the page are 8.5 x 11 inches. |
The following is a listing of some standard U.S. page sizes: in inches
The following is a listing of ISO standard page sizes: in 1/72 inch scale
void pdftron::PDF::PDFDCEX::Destroy | ( | ) |
Frees the native memory of the object.
void pdftron::PDF::PDFDCEX::End | ( | ) |
Closes the GDI Device Context, translating the GDI instruction to PDF, and adds the PDF objects to the page in the location specified by PDFDCEX::Begin( page, box, ...).
An | exception is thrown if there are any fatal errors in the the translation process. |
UInt32 pdftron::PDF::PDFDCEX::GetDPI | ( | ) |