|
wxMaxima
|
Class representing a PDF drawing context. More...
#include <pdfdc.h>
Public Member Functions | |
| wxPdfDC () | |
| Default constructor. | |
| wxPdfDC (const wxPrintData &printData) | |
| Constructor initializing the DC with print data. | |
| wxPdfDC (wxPdfDocument *pdfDocument, double templateWidth, double templateHeight) | |
| Constructor for creating a template in an existing PDF document. | |
| wxPdfDocument * | GetPdfDocument () |
| Returns the associated PDF document. | |
| void | SetResolution (int ppi) |
| Sets the resolution for the DC. | |
| int | GetResolution () const |
| Returns the current resolution. | |
| void | SetFontResolution (int ppi) |
| Sets the resolution font sizes are interpreted at. | |
| int | GetFontResolution () const |
| Returns the resolution font sizes are interpreted at. | |
| void | SetImageType (wxBitmapType bitmapType, int quality=75) |
| Sets the image type and quality for bitmap output. | |
| void | SetMapModeStyle (wxPdfMapModeStyle style) |
| Sets the map mode style. | |
| wxPdfMapModeStyle | GetMapModeStyle () const |
| Returns the current map mode style. | |
Class representing a PDF drawing context.
| wxPdfDC::wxPdfDC | ( | const wxPrintData & | printData | ) |
Constructor initializing the DC with print data.
| printData | Printer configuration data |
| wxPdfDC::wxPdfDC | ( | wxPdfDocument * | pdfDocument, |
| double | templateWidth, | ||
| double | templateHeight | ||
| ) |
Constructor for creating a template in an existing PDF document.
| pdfDocument | Associated PDF document |
| templateWidth | Width of the template in user units |
| templateHeight | Height of the template in user units |
| int wxPdfDC::GetFontResolution | ( | ) | const |
Returns the resolution font sizes are interpreted at.
eturn Resolution in pixels per inch
| wxPdfMapModeStyle wxPdfDC::GetMapModeStyle | ( | ) | const |
| wxPdfDocument * wxPdfDC::GetPdfDocument | ( | ) |
Returns the associated PDF document.
| int wxPdfDC::GetResolution | ( | ) | const |
| void wxPdfDC::SetFontResolution | ( | int | ppi | ) |
Sets the resolution font sizes are interpreted at.
A wxFont's point size is turned into the size of the PDF font the way a screen DC would draw it: as if the DC had the resolution of the screen (wxDisplay::GetPPI(), 72 on macOS). That makes text drawn with wxPdfDC look as large, relative to the rest of the drawing, as it does in a window – but it also makes the PDF depend on the screen of the computer that created it: the same code writes larger text on a 120 dpi screen than on a 96 dpi one, and smaller text on a Mac.
Applications that lay out their drawing for a fixed resolution can make the output reproducible by setting it here; text measurement (GetTextExtent()) uses the same value, so the layout stays consistent.
| ppi | Resolution in pixels per inch that font sizes are meant for, for example 96 (the reference resolution of Windows and GTK) or 72 (so that a font of n points is drawn n points high if the DC's resolution is 72 as well). Values <= 0 restore the screen's. |
| void wxPdfDC::SetImageType | ( | wxBitmapType | bitmapType, |
| int | quality = 75 |
||
| ) |
Sets the image type and quality for bitmap output.
| bitmapType | The type of the bitmap (e.g., wxBITMAP_TYPE_JPEG) |
| quality | Compression quality from 0 to 100 |
| void wxPdfDC::SetMapModeStyle | ( | wxPdfMapModeStyle | style | ) |
Sets the map mode style.
Map mode style determines how logical coordinates and font sizes are scaled to the PDF page, allowing emulation of platform-specific behaviors or native PDF API scaling.
| style | The map mode style to apply |
| void wxPdfDC::SetResolution | ( | int | ppi | ) |