wxPdfDocument  1.4.0
Library for generating PDF documents from wxWidgets applications
Loading...
Searching...
No Matches
wxPdfUtility Class Reference

Class implementing several static utility methods. More...

#include <pdfutility.h>

Static Public Member Functions

static wxString GetUniqueId (const wxString &prefix=wxEmptyString)
 Create a unique ID.
static wxString Double2String (double value, int precision=0)
 Formats a floating point number with a fixed precision.
static double String2Double (const wxString &str)
 Parses a floating point number.
static double String2Double (const wxString &str, const wxString &defaultUnit, double scaleFactor=1.0)
 Parses a floating point number taking units into account.
static wxString Convert2Roman (int value)
 Converts an integer number to a roman number.
static double ForceRange (double value, double minValue, double maxValue)
 Forces a floating point number into a fixed range.
static wxString RGB2String (const wxColour &colour)
 Converts a wxColour to the corresponding PDF specification.
static int MapFontWeight2FontStyle (wxPdfFontWeight fontWeight)
 Map font weight to font style.
static int MapFontWeight2FontStyle (wxFontWeight fontWeight)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
static wxString MapFontWeight2FontStyleString (wxPdfFontWeight fontWeight)
 Map font weight to font style in string representation.
static wxString MapFontWeight2FontStyleString (wxFontWeight fontWeight)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
static wxPdfFontWeight MapFontStyle2FontWeight (int fontStyle)
 Map font style to font weight.
static wxPdfFontWeight MapFontStyle2FontWeight (const wxString &fontStyle)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
static int MapFontStyle2StyleFlags (const wxString &fontStyle)
 Map font style to font weight.
static int MapFont2FontStyle (const wxFont &font)
 Map wxFont to font style.
static int MapFontName2FontStyle (const wxString &fontName)
 Map font name to font style.
static wxString MapFontStyle2String (int fontStyle)
 Map font styles to string representation.

Detailed Description

Class implementing several static utility methods.

Member Function Documentation

◆ Convert2Roman()

wxString wxPdfUtility::Convert2Roman ( int value)
static

Converts an integer number to a roman number.

Parameters
valueinteger value to be converted
Returns
the string representation of the integer value as a roman number

◆ Double2String()

wxString wxPdfUtility::Double2String ( double value,
int precision = 0 )
static

Formats a floating point number with a fixed precision.

Parameters
valuethe value to be formatted
precisionthe number of decimal places
Returns
the string representation of the number

◆ ForceRange()

double wxPdfUtility::ForceRange ( double value,
double minValue,
double maxValue )
static

Forces a floating point number into a fixed range.

Parameters
valuevalue to be forced into range
minValuelower limit
maxValueupper limit
Returns
value conforming to the given range:
  • the minValue if the value falls below the lower limit
  • the value itself if it is within range
  • the maxValue if the value exceeds the upper limit

◆ GetUniqueId()

wxString wxPdfUtility::GetUniqueId ( const wxString & prefix = wxEmptyString)
static

Create a unique ID.

Parameters
prefixOptional prefix for the ID
Returns
A unique ID string

◆ MapFont2FontStyle()

int wxPdfUtility::MapFont2FontStyle ( const wxFont & font)
static

Map wxFont to font style.

Note
This method only takes font properties into account that are not related to the font weight.
Parameters
fontthe wxFont
Returns
the font style

◆ MapFontName2FontStyle()

int wxPdfUtility::MapFontName2FontStyle ( const wxString & fontName)
static

Map font name to font style.

This method tries to deduce the font style from the font name.

Parameters
fontNamethe name of the font
Returns
the font style

◆ MapFontStyle2FontWeight() [1/2]

wxPdfFontWeight wxPdfUtility::MapFontStyle2FontWeight ( const wxString & fontStyle)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ MapFontStyle2FontWeight() [2/2]

wxPdfFontWeight wxPdfUtility::MapFontStyle2FontWeight ( int fontStyle)
static

Map font style to font weight.

Parameters
fontStylestyle of the font
Returns
the font weight

◆ MapFontStyle2String()

wxString wxPdfUtility::MapFontStyle2String ( int fontStyle)
static

Map font styles to string representation.

This method converts the font style flags to a human-readable string representation.

Parameters
fontNamethe name of the font
Returns
the font styles in string representation

◆ MapFontStyle2StyleFlags()

int wxPdfUtility::MapFontStyle2StyleFlags ( const wxString & fontStyle)
static

Map font style to font weight.

Parameters
fontStylestyle of the font consisting of a sequence of one-letter codes
Returns
the font styles

◆ MapFontWeight2FontStyle() [1/2]

int wxPdfUtility::MapFontWeight2FontStyle ( wxFontWeight fontWeight)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ MapFontWeight2FontStyle() [2/2]

int wxPdfUtility::MapFontWeight2FontStyle ( wxPdfFontWeight fontWeight)
static

Map font weight to font style.

Parameters
fontWeightweight of the font
Returns
the font style as style flags

◆ MapFontWeight2FontStyleString() [1/2]

wxString wxPdfUtility::MapFontWeight2FontStyleString ( wxFontWeight fontWeight)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ MapFontWeight2FontStyleString() [2/2]

wxString wxPdfUtility::MapFontWeight2FontStyleString ( wxPdfFontWeight fontWeight)
static

Map font weight to font style in string representation.

Parameters
fontWeightweight of the font
Returns
the font style in string representation

◆ RGB2String()

wxString wxPdfUtility::RGB2String ( const wxColour & colour)
static

Converts a wxColour to the corresponding PDF specification.

Parameters
colourcolour to be converted to a hexadecimal string representation
Returns
the hexadecimal string representation of the colour

◆ String2Double() [1/2]

double wxPdfUtility::String2Double ( const wxString & str)
static

Parses a floating point number.

Parameters
strthe string to be parsed
Returns
the value of floating point number given by the string representation, 0 if the string could not be parsed.

◆ String2Double() [2/2]

double wxPdfUtility::String2Double ( const wxString & str,
const wxString & defaultUnit,
double scaleFactor = 1.0 )
static

Parses a floating point number taking units into account.

Parameters
strthe string to be parsed
defaultUnitthe unit that should be assumed if the string includes no explicit unit
scaleFactorthe scale factor that should be applied for unit conversions involving pixels
Returns
the value of floating point number given by the string representation, 0 if the string could not be parsed.

The documentation for this class was generated from the following file: