![]() |
HTMLPRINTER
2.13.5-1
|
Data Structures | |
| struct | prtControlSeq |
Typedefs | |
| typedef void(* | prtAsyncCallback) (void *data) |
Enumerations | |
| enum | PrtError { PRT_OK = 0, PRT_BUSY = -1, PRT_PAPERJAM = -2, PRT_HEADOPEN = -3, PRT_PAPEREND = -4, PRT_OVERHEAT = -5, PRT_OVERVOLTAGE = -6, PRT_UNDERVOLTAGE = -7, PRT_FAIL = -8, PRT_SCRIPT_ERROR = -9, PRT_NO_PRINTER = -10, PRT_UNSUPPORTED = -20, PRT_INVALID_PARAM = -21, PRT_NO_RESOURCE = -22, PRT_FILE_NOT_FOUND = -23, PRT_PROTOCOL = -24, PRT_FINAL_RESULT =- 40, PRT_TIMEOUT = -41 } |
| List of general errors. More... | |
| enum | PrtPropertyInt { PRT_PROP_STATE =0, PRT_PROP_HEAD_TEMP, PRT_PROP_HEAD_VOLTAGE, PRT_PROP_PIXEL_WIDTH, PRT_PROP_CONTRAST, PRT_PROP_DEFAULT_FONT_SIZE, PRT_PROP_PRINT_MODE } |
| List of numeric properties. More... | |
| enum | PrtPropertyString { PRT_PROP_RESOURCE_PATH, PRT_PROP_FILE_PREFIX, PRT_PROP_DEFAULT_FONT, PRT_PROP_CSS, PRT_PROP_INIFILE, PRT_PROP_JS_ROOT, PRT_PROP_DEVICE } |
| List of string properties. More... | |
Functions | |
| DllSpec const char * | prt_GetVersion () |
| DllSpec std::string | prtFormat (const char *format,...) |
| DllSpec std::string | prtFormatV (const char *format, va_list va) |
| DllSpec int | prtGetFD () |
| DllSpec int | prtGetHtml (const std::map< std::string, std::string > &value, const std::string &text, std::string &html, bool full) |
| DllSpec int | prtGetHtmlURL (const std::map< std::string, std::string > &value, const std::string &url, std::string &html, bool full) |
| DllSpec bool | prtGetLocalProperties () |
| DllSpec unsigned | prtGetLogMask (void) |
| DllSpec int | prtGetPropertyInt (enum PrtPropertyInt property, int *value) |
| DllSpec int | prtGetPropertyString (enum PrtPropertyString property, char *value, int len) |
| DllSpec int | prtGetPropertyString (enum PrtPropertyString property, std::string &value) |
| DllSpec std::string | prtGetText (const std::string &name, const std::string &deflt="") |
| DllSpec enum PrtError | prtHTML (const stringmap &value, const std::string &text, bool landscape=false) |
| enum PrtError | prtHTML (const std::string &text, bool landscape=false) |
| enum PrtError | prtHTML2PNG (const char *destfile, int width, const std::string &text, bool landscape=false) |
| enum PrtError | prtHTML2PNG (const std::string &destfile, int width, const std::string &text, bool landscape=false) |
| DllSpec enum PrtError | prtHTML2PNG (const char *destfile, int width, const stringmap &value, const std::string &text, bool landscape=false) |
| DllSpec enum PrtError | prtHTML2Text (std::string &result, int width, const stringmap &value, const std::string &text, const prtControlSeq &ctrl) |
| enum PrtError | prtHTML2Text (std::string &result, int width, const std::string &text, const prtControlSeq &ctrl) |
| enum PrtError | prtHTMLAsync (const std::string &text, bool landscape=false, prtAsyncCallback cb=0, void *cbdata=0) |
| DllSpec enum PrtError | prtHTMLAsync (const stringmap &value, const std::string &text, bool landscape=false, prtAsyncCallback cb=0, void *cbdata=0) |
| DllSpec const char * | prtLibVersion () |
| DllSpec std::string | prtScriptError () |
| DllSpec int | prtSetCatalog (const std::string &filename) |
| DllSpec void | prtSetLocalProperties (bool local) |
| DllSpec void | prtSetLogMask (unsigned mask) |
| DllSpec int | prtSetPropertyInt (enum PrtPropertyInt property, int value) |
| DllSpec int | prtSetPropertyString (enum PrtPropertyString property, const char *value) |
| int | prtSetPropertyString (enum PrtPropertyString property, const std::string &value) |
| DllSpec int | prtSetRemotePrinter (const std::string &address) |
| enum PrtError | prtURL (const std::string &url, bool landscape=false) |
| enum PrtError | prtURL (const char *url, bool landscape=false) |
| enum PrtError | prtURL (const stringmap &value, const std::string &url, bool landscape=false) |
| DllSpec enum PrtError | prtURL (const stringmap &value, const char *url, bool landscape=false) |
| enum PrtError | prtURL2PNG (const std::string &destfile, int width, const char *url, bool landscape=false) |
| enum PrtError | prtURL2PNG (const std::string &destfile, int width, const stringmap &value, const char *url, bool landscape=false) |
| enum PrtError | prtURL2PNG (const char *destfile, int width, const std::string &url, bool landscape=false) |
| enum PrtError | prtURL2PNG (const char *destfile, int width, const char *url, bool landscape=false) |
| DllSpec enum PrtError | prtURL2PNG (const char *destfile, int width, const stringmap &value, const char *url, bool landscape=false) |
| enum PrtError | prtURL2PNG (const std::string &destfile, int width, const std::string &url, bool landscape=false) |
| enum PrtError | prtURL2PNG (const char *destfile, int width, const stringmap &value, const std::string &url, bool landscape=false) |
| enum PrtError | prtURL2PNG (const std::string &destfile, int width, const stringmap &value, const std::string &url, bool landscape=false) |
| enum PrtError | prtURL2Text (std::string &result, int width, const char *url, const prtControlSeq &ctrl) |
| DllSpec enum PrtError | prtURL2Text (std::string &result, int width, const stringmap &value, const char *url, const prtControlSeq &ctrl) |
| enum PrtError | prtURL2Text (std::string &result, int width, const std::string &url, const prtControlSeq &ctrl) |
| enum PrtError | prtURL2Text (std::string &result, int width, const stringmap &value, const std::string &url, const prtControlSeq &ctrl) |
| enum PrtError | prtURLAsync (const stringmap &value, const std::string &url, bool landscape=false, prtAsyncCallback cb=0, void *cbdata=0) |
| enum PrtError | prtURLAsync (const std::string &url, bool landscape=false, prtAsyncCallback cb=0, void *cbdata=0) |
| DllSpec enum PrtError | prtURLAsync (const stringmap &value, const char *url, bool landscape=false, prtAsyncCallback cb=0, void *cbdata=0) |
| enum PrtError | prtURLAsync (const char *url, bool landscape=false, prtAsyncCallback cb=0, void *cbdata=0) |
| DllSpec enum PrtError | prtWait (int timeout_msec=-1) |
| struct prtControlSeq |
control sequences that will be used during conversion to text.
| typedef void(* prtAsyncCallback) (void *data) |
callback function that is called when printing has finished
| [in] | data | data pointer provided by the application |
| enum PrtError |
List of general errors.
| Enumerator | |
|---|---|
| PRT_OK | no error |
| PRT_BUSY | Printing in progress |
| PRT_PAPERJAM | Paper jam |
| PRT_HEADOPEN | Head open |
| PRT_PAPEREND | Paper end |
| PRT_OVERHEAT | Head too hot |
| PRT_OVERVOLTAGE | Head over voltage |
| PRT_UNDERVOLTAGE | Head under voltage |
| PRT_FAIL | function failed (generic error) |
| PRT_SCRIPT_ERROR | error during script processing, check prtScriptError() for more details |
| PRT_NO_PRINTER | no printer available or file cannot be created in case of printing to a file |
| PRT_UNSUPPORTED | function not supported on used hardware |
| PRT_INVALID_PARAM | invalid parameters passed, e.g. NULL pointer for mandatory parameter |
| PRT_NO_RESOURCE | resource could not be allocated |
| PRT_FILE_NOT_FOUND | file not found |
| PRT_PROTOCOL | protocol error when talking to the print service |
| PRT_FINAL_RESULT | will never be returned, just used for determining if a result is a final result |
| PRT_TIMEOUT | timeout in prtWait() |
| enum PrtPropertyInt |
List of numeric properties.
| enum PrtPropertyString |
List of string properties.
| DllSpec const char* prt_GetVersion | ( | ) |
returns a zero-terminated string with version and build information of libvfiguiprt in ADK version string format: <major>.<minor>.<patch>-<build>, e.g. "1.2.3-4"
| DllSpec std::string prtFormat | ( | const char * | format, |
| ... | |||
| ) |
perform printf-like formatting.
| [in] | format | printf-like format string. It supports the commonly known format specifiers 's', 'i', 'd', 'u', 'o', 'x', 'X', 'p', 'c', 'f', 'e', 'g'. In addition the following format specifiers are supported:
|
| DllSpec std::string prtFormatV | ( | const char * | format, |
| va_list | va | ||
| ) |
perfom printf-like formatting. This is the same as prtFormat() just taking a va_list instead of a variable number of arguments
| DllSpec int prtGetFD | ( | ) |
obtain internal file descriptor for use in poll(). This may be used to check whether the result has been received from the print service.
| DllSpec int prtGetHtml | ( | const std::map< std::string, std::string > & | value, |
| const std::string & | text, | ||
| std::string & | html, | ||
| bool | full | ||
| ) |
preprocess HTML code and return the resulting string
| [in] | value | values used for insertions |
| [in] | text | string containing an HTML fragment (i.e. the part between <body> and </body>). |
| [out] | html | resulting HTML code |
| [in] | full | optional parameter: If false or missing just substitute the XML processing instructions, if true in addition use inline images, insert CSS code and return full HTML document |
| DllSpec int prtGetHtmlURL | ( | const std::map< std::string, std::string > & | value, |
| const std::string & | url, | ||
| std::string & | html, | ||
| bool | full | ||
| ) |
preprocess HTML code and return the resulting string
| [in] | value | values used for insertions |
| [in] | url | location of the dialog file. The location is prefixed by the resource path and by the optional prefix (see also UI_PROP_RESOURCE_PATH, UI_PROP_FILE_PREFIX) unless an absolute path was provided. |
| [out] | html | resulting HTML code |
| [in] | full | optional parameter: If false or missing just substitute the XML processing instructions, if true in addition use inline images, insert CSS code and return full HTML document |
| DllSpec bool prtGetLocalProperties | ( | ) |
| DllSpec unsigned prtGetLogMask | ( | void | ) |
Get log mask
| DllSpec int prtGetPropertyInt | ( | enum PrtPropertyInt | property, |
| int * | value | ||
| ) |
get int property
| [in] | property | property to be set |
| [out] | value | current value |
| DllSpec int prtGetPropertyString | ( | enum PrtPropertyString | property, |
| char * | value, | ||
| int | len | ||
| ) |
get string property
| [in] | property | property to be set |
| [out] | value | current value |
| [in] | len | size ouf output buffer value in bytes |
| DllSpec int prtGetPropertyString | ( | enum PrtPropertyString | property, |
| std::string & | value | ||
| ) |
get string property
| [in] | property | property to be set |
| [out] | value | current value |
| DllSpec std::string prtGetText | ( | const std::string & | name, |
| const std::string & | deflt = "" |
||
| ) |
lookup a text from current loaded catalog by key name. If text is not found in catalog or no catalog is loaded the function returns value in in parameter default.
| [in] | name | of key used to lookup the text in calalog |
| [in] | deflt | text that is returned, if text is not found in calalog |
| DllSpec enum PrtError prtHTML | ( | const stringmap & | value, |
| const std::string & | text, | ||
| bool | landscape = false |
||
| ) |
print an HTML document (synchronous)
| [in] | value | name value pairs that are used as for variable substitutions. |
| [in] | text | string containing an HTML fragment (i.e. the part between <body> and </body>). |
| [in] | landscape | activate landscape printing |
|
inline |
the same as prtHTML() just using an empty value map
|
inline |
the same as prtHTML2PNG() just using an empty value map
|
inline |
Overloaded function: Just using std::string for destfile
| DllSpec enum PrtError prtHTML2PNG | ( | const char * | destfile, |
| int | width, | ||
| const stringmap & | value, | ||
| const std::string & | text, | ||
| bool | landscape = false |
||
| ) |
render an HTML file to a PNG image
| [in] | destfile | name of the destination PNG file |
| [in] | width | width of the image in pixels |
| [in] | value | name value pairs that are used as for variable substitutions. |
| [in] | text | string containing an HTML fragment (i.e. the part between <body> and </body>). |
| [in] | landscape | activate landscape printing (image is rotated by 90 degrees) |
| DllSpec enum PrtError prtHTML2Text | ( | std::string & | result, |
| int | width, | ||
| const stringmap & | value, | ||
| const std::string & | text, | ||
| const prtControlSeq & | ctrl | ||
| ) |
convert HTML document to text string. Custom control sequences can be passed that are inserted when switching the font size or style
| [out] | result | resulting text string |
| [in] | width | width of the image in printable characters |
| [in] | value | name value pairs that are used as for variable substitutions. |
| [in] | text | string containing an HTML fragment (i.e. the part between <body> and </body>). |
| [in] | ctrl | control sequences |
|
inline |
short cut with empty value map
|
inline |
the same as prtHTMLAsync() just using an empty value map
| DllSpec enum PrtError prtHTMLAsync | ( | const stringmap & | value, |
| const std::string & | text, | ||
| bool | landscape = false, |
||
| prtAsyncCallback | cb = 0, |
||
| void * | cbdata = 0 |
||
| ) |
asynchronously start printing an HTML document, the result has to be obtained using prtWait().
| [in] | value | name value pairs that are used as for variable substitutions. |
| [in] | text | string containing an HTML fragment (i.e. the part between <body> and </body>). |
| [in] | landscape | activate landscape printing |
| [in] | cb | optional callback function that is called when printing has finished |
| [in] | cbdata | data pointer that is passed on to the callback function |
| DllSpec const char* prtLibVersion | ( | ) |
read library version
| DllSpec std::string prtScriptError | ( | ) |
| DllSpec int prtSetCatalog | ( | const std::string & | filename | ) |
load and set a catalog file containing name-value text pairs to be inserted with HTML placeholder <?text name?>. The current catalog is unloaded with filename=="" or by loading another catalog file.
| [in] | filename | of the catalog, empty string to unload the current dialog |
| DllSpec void prtSetLocalProperties | ( | bool | local | ) |
de-/activate thread local properties for the current thread. Activating thread local properties initially copies the global properties to the current thread.
| [in] | local | if true activate thread local properties, if false discard them |
| DllSpec void prtSetLogMask | ( | unsigned | mask | ) |
Set log mask
| [in] | mask | logging mask (see PRT_LOGMASK) |
| DllSpec int prtSetPropertyInt | ( | enum PrtPropertyInt | property, |
| int | value | ||
| ) |
set int property
| [in] | property | property to be set |
| [in] | value | new value |
| DllSpec int prtSetPropertyString | ( | enum PrtPropertyString | property, |
| const char * | value | ||
| ) |
set string property
| [in] | property | property to be set |
| [in] | value | new value |
|
inline |
Overloaded function: Just using std::string for value
| DllSpec int prtSetRemotePrinter | ( | const std::string & | address | ) |
set remote printer address
| [in] | address | printer address. This value overwrites the address set using the LPD environment variable. This may be used to set an IP address and port (e.g. ':0' would use the internal default printer). Using an empty string will revert to the default setting. |
|
inline |
Overloaded function: Just using std::string for url
|
inline |
the same as prtURL() just using an empty value map
|
inline |
Overloaded function: Just using std::string for url
| DllSpec enum PrtError prtURL | ( | const stringmap & | value, |
| const char * | url, | ||
| bool | landscape = false |
||
| ) |
print an HTML file (synchronous)
| [in] | value | name value pairs that are used as for variable substitutions. |
| [in] | url | location of the HTML file. The location is prefixed by the resource path and by the optional prefix (see also PRT_PROP_RESOURCE_PATH, PRT_PROP_FILE_PREFIX) |
| [in] | landscape | activate landscape printing |
|
inline |
Overloaded function: Just using std::string for destfile
|
inline |
Overloaded function: Just using std::string for destfile
|
inline |
Overloaded function: Just using std::string for url
|
inline |
shortcut omitting value
| DllSpec enum PrtError prtURL2PNG | ( | const char * | destfile, |
| int | width, | ||
| const stringmap & | value, | ||
| const char * | url, | ||
| bool | landscape = false |
||
| ) |
render an HTML file to a black and white PNG image
| [in] | destfile | name of the destination PNG file |
| [in] | width | width of the image in pixels |
| [in] | value | name value pairs that are used as for variable substitutions. |
| [in] | url | location of the HTML file. The location is prefixed by the resource path and by the optional prefix (see also PRT_PROP_RESOURCE_PATH, PRT_PROP_FILE_PREFIX) |
| [in] | landscape | activate landscape printing (image is rotated by 90 degrees) |
|
inline |
Overloaded function: Just using std::string for destfile and url
|
inline |
Overloaded function: Just using std::string for url
|
inline |
Overloaded function: Just using std::string for destfile and url
|
inline |
short cut with empty value map
| DllSpec enum PrtError prtURL2Text | ( | std::string & | result, |
| int | width, | ||
| const stringmap & | value, | ||
| const char * | url, | ||
| const prtControlSeq & | ctrl | ||
| ) |
convert HTML document to text string. Custom control sequences can be passed that are inserted when switching the font size or style
| [out] | result | resulting text string |
| [in] | width | width of the image in printable characters |
| [in] | value | name value pairs that are used as for variable substitutions. |
| [in] | url | location of the HTML file. The location is prefixed by the resource path and by the optional prefix (see also PRT_PROP_RESOURCE_PATH, PRT_PROP_FILE_PREFIX) |
| [in] | ctrl | control sequences |
|
inline |
Overloaded function: Just using std::string for url
|
inline |
Overloaded function: Just using std::string for url
|
inline |
Overloaded function: Just using std::string for url
|
inline |
Overloaded function: Just using std::string for url
| DllSpec enum PrtError prtURLAsync | ( | const stringmap & | value, |
| const char * | url, | ||
| bool | landscape = false, |
||
| prtAsyncCallback | cb = 0, |
||
| void * | cbdata = 0 |
||
| ) |
asynchronously start printing an HTML file, the result has to be obtained using prtWait().
| [in] | value | name value pairs that are used as for variable substitutions. |
| [in] | url | location of the HTML file. The location is prefixed by the resource path and by the optional prefix (see also PRT_PROP_RESOURCE_PATH, PRT_PROP_FILE_PREFIX) |
| [in] | landscape | activate landscape printing |
| [in] | cb | optional callback function that is called when printing has finished |
| [in] | cbdata | data pointer that is passed on to the callback function |
|
inline |
the same as prtURLAsync() just using an empty value map
| DllSpec enum PrtError prtWait | ( | int | timeout_msec = -1 | ) |
wait for the printing to finish and return the error code
| [in] | timeout_msec | timeout in milliseconds, a negative value means infinite timeout |