2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: html/htmprint.h
|
2008-03-10 11:24:38 -04:00
|
|
|
// Purpose: interface of wxHtmlDCRenderer
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxHtmlDCRenderer
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-10-25 16:44:52 -04:00
|
|
|
This class can render HTML document into a specified area of a DC.
|
|
|
|
You can use it in your own printing code, although use of wxHtmlEasyPrinting
|
2008-03-08 08:52:38 -05:00
|
|
|
or wxHtmlPrintout is strongly recommended.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxhtml}
|
2008-10-25 16:44:52 -04:00
|
|
|
@category{html}
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxHtmlDCRenderer : public wxObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Constructor.
|
|
|
|
*/
|
|
|
|
wxHtmlDCRenderer();
|
|
|
|
|
|
|
|
/**
|
2009-03-26 09:37:37 -04:00
|
|
|
Returns the width of the HTML text in pixels.
|
|
|
|
|
|
|
|
This can be compared with the width parameter of SetSize() to check if
|
|
|
|
the document being printed fits into the page boundary.
|
|
|
|
|
|
|
|
@see GetTotalHeight()
|
|
|
|
|
|
|
|
@since 2.9.0
|
|
|
|
*/
|
|
|
|
int GetTotalWidth() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the height of the HTML text in pixels.
|
|
|
|
|
|
|
|
This is important if area height (see wxHtmlDCRenderer::SetSize) is
|
|
|
|
smaller that total height and thus the page cannot fit into it. In that
|
|
|
|
case you're supposed to call Render() as long as its return value is
|
|
|
|
smaller than GetTotalHeight()'s.
|
|
|
|
|
|
|
|
@see GetTotalWidth()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2009-03-26 09:37:37 -04:00
|
|
|
int GetTotalHeight() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Renders HTML text to the DC.
|
2008-10-25 16:44:52 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param x,y
|
2008-11-03 06:57:07 -05:00
|
|
|
position of upper-left corner of printing rectangle (see SetSize()).
|
|
|
|
@param known_pagebreaks
|
|
|
|
@todo docme
|
2008-03-08 09:43:31 -05:00
|
|
|
@param from
|
2008-11-03 06:57:07 -05:00
|
|
|
y-coordinate of the very first visible cell.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param dont_render
|
2008-03-09 08:33:59 -04:00
|
|
|
if @true then this method only returns y coordinate of the next page
|
2008-11-03 06:57:07 -05:00
|
|
|
and does not output anything.
|
|
|
|
@param to
|
|
|
|
y-coordinate of the last visible cell.
|
2008-10-25 16:44:52 -04:00
|
|
|
|
|
|
|
Returned value is y coordinate of first cell than didn't fit onto page.
|
2009-02-21 11:43:22 -05:00
|
|
|
Use this value as from in next call to Render() in order to print
|
|
|
|
multipages document.
|
2008-10-25 16:44:52 -04:00
|
|
|
|
2009-02-21 11:43:22 -05:00
|
|
|
@note
|
|
|
|
The following three methods @b must always be called before any call to
|
|
|
|
Render(), in this order:
|
2008-10-25 16:44:52 -04:00
|
|
|
- SetDC()
|
|
|
|
- SetSize()
|
|
|
|
- SetHtmlText()
|
2009-02-21 11:43:22 -05:00
|
|
|
|
|
|
|
@note Render() changes the DC's user scale and does NOT restore it.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-29 11:34:31 -04:00
|
|
|
int Render(int x, int y, wxArrayInt& known_pagebreaks, int from = 0,
|
2008-11-09 11:46:52 -05:00
|
|
|
int dont_render = false, int to = INT_MAX);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Assign DC instance to the renderer.
|
2008-10-25 16:44:52 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@a pixel_scale can be used when rendering to high-resolution DCs (e.g. printer)
|
2008-03-08 08:52:38 -05:00
|
|
|
to adjust size of pixel metrics.
|
2008-10-25 16:44:52 -04:00
|
|
|
(Many dimensions in HTML are given in pixels -- e.g. image sizes. 300x300
|
|
|
|
image would be only one inch wide on typical printer. With pixel_scale = 3.0
|
|
|
|
it would be 3 inches.)
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
void SetDC(wxDC* dc, double pixel_scale = 1.0);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2009-07-03 08:03:39 -04:00
|
|
|
This function sets font sizes and faces.
|
|
|
|
|
|
|
|
@param normal_face
|
|
|
|
This is face name for normal (i.e. non-fixed) font.
|
|
|
|
It can be either empty string (then the default face is chosen) or
|
|
|
|
platform-specific face name. Examples are "helvetica" under Unix or
|
|
|
|
"Times New Roman" under Windows.
|
|
|
|
@param fixed_face
|
|
|
|
The same thing for fixed face ( \<TT\>..\</TT\> )
|
|
|
|
@param sizes
|
|
|
|
This is an array of 7 items of int type.
|
|
|
|
The values represent size of font with HTML size from -2 to +4
|
|
|
|
( \<FONT SIZE=-2\> to \<FONT SIZE=+4\> ).
|
|
|
|
Default sizes are used if sizes is @NULL.
|
|
|
|
|
|
|
|
Default font sizes are defined by constants wxHTML_FONT_SIZE_1,
|
|
|
|
wxHTML_FONT_SIZE_2, ..., wxHTML_FONT_SIZE_7.
|
|
|
|
Note that they differ among platforms. Default face names are empty strings.
|
2008-10-25 16:44:52 -04:00
|
|
|
|
|
|
|
@see SetSize()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-29 11:34:31 -04:00
|
|
|
void SetFonts(const wxString& normal_face, const wxString& fixed_face,
|
|
|
|
const int* sizes = NULL);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2009-07-03 08:03:39 -04:00
|
|
|
/**
|
|
|
|
Sets font sizes to be relative to the given size or the system
|
|
|
|
default size; use either specified or default font
|
|
|
|
|
|
|
|
@param size
|
|
|
|
Point size of the default HTML text
|
|
|
|
@param normal_face
|
|
|
|
This is face name for normal (i.e. non-fixed) font. It can be
|
|
|
|
either empty string (then the default face is chosen) or
|
|
|
|
platform-specific face name. Examples are "helvetica" under
|
|
|
|
Unix or "Times New Roman" under Windows.
|
|
|
|
@param fixed_face
|
|
|
|
The same thing for fixed face ( \<TT\>..\</TT\> )
|
|
|
|
|
|
|
|
@see SetSize()
|
|
|
|
*/
|
|
|
|
void SetStandardFonts(int size = -1,
|
|
|
|
const wxString& normal_face = wxEmptyString,
|
|
|
|
const wxString& fixed_face = wxEmptyString);
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
2008-10-25 16:44:52 -04:00
|
|
|
Assign text to the renderer. Render() then draws the text onto DC.
|
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param html
|
2008-03-09 08:33:59 -04:00
|
|
|
HTML text. This is not a filename.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param basepath
|
2008-10-25 16:44:52 -04:00
|
|
|
base directory (html string would be stored there if it was in file).
|
|
|
|
It is used to determine path for loading images, for example.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param isdir
|
2008-03-09 08:33:59 -04:00
|
|
|
@false if basepath is filename, @true if it is directory name
|
2008-10-25 16:44:52 -04:00
|
|
|
(see wxFileSystem for detailed explanation).
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetHtmlText(const wxString& html,
|
|
|
|
const wxString& basepath = wxEmptyString,
|
2008-03-09 08:33:59 -04:00
|
|
|
bool isdir = true);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Set size of output rectangle, in pixels. Note that you @b can't change
|
2009-07-03 08:03:39 -04:00
|
|
|
width of the rectangle between calls to Render() !
|
2008-03-08 08:52:38 -05:00
|
|
|
(You can freely change height.)
|
|
|
|
*/
|
|
|
|
void SetSize(int width, int height);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxHtmlEasyPrinting
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-10-25 16:44:52 -04:00
|
|
|
This class provides very simple interface to printing architecture.
|
|
|
|
It allows you to print HTML documents using only a few commands.
|
|
|
|
|
|
|
|
@note
|
|
|
|
Do not create this class on the stack only. You should create an instance
|
|
|
|
on app startup and use this instance for all printing operations.
|
|
|
|
The reason is that this class stores various settings in it.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxhtml}
|
2008-10-25 16:44:52 -04:00
|
|
|
@category{html,printing}
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxHtmlEasyPrinting : public wxObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Constructor.
|
2008-10-25 16:44:52 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param name
|
2008-03-09 08:33:59 -04:00
|
|
|
Name of the printing object. Used by preview frames and setup dialogs.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param parentWindow
|
2008-03-09 08:33:59 -04:00
|
|
|
pointer to the window that will own the preview frame and setup dialogs.
|
2008-10-25 16:44:52 -04:00
|
|
|
May be @NULL.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
wxHtmlEasyPrinting(const wxString& name = "Printing",
|
2008-03-09 08:33:59 -04:00
|
|
|
wxWindow* parentWindow = NULL);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2009-12-01 15:23:29 -05:00
|
|
|
/**
|
|
|
|
Returns the current name being used for preview frames and setup
|
|
|
|
dialogs.
|
|
|
|
|
|
|
|
@since 2.8.11 / 2.9.1
|
|
|
|
*/
|
|
|
|
const wxString& GetName() const;
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
2008-10-25 16:44:52 -04:00
|
|
|
Returns a pointer to wxPageSetupDialogData instance used by this class.
|
|
|
|
You can set its parameters (via SetXXXX methods).
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
wxPageSetupDialogData* GetPageSetupData();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the parent window for dialogs.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxWindow* GetParentWindow() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-10-25 16:44:52 -04:00
|
|
|
Returns pointer to wxPrintData instance used by this class.
|
|
|
|
You can set its parameters (via SetXXXX methods).
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
wxPrintData* GetPrintData();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Display page setup dialog and allows the user to modify settings.
|
|
|
|
*/
|
|
|
|
void PageSetup();
|
|
|
|
|
|
|
|
/**
|
2008-03-08 09:43:31 -05:00
|
|
|
Preview HTML file.
|
2008-10-25 16:44:52 -04:00
|
|
|
|
|
|
|
Returns @false in case of error -- call wxPrinter::GetLastError to get detailed
|
2008-03-08 08:52:38 -05:00
|
|
|
information about the kind of the error.
|
|
|
|
*/
|
|
|
|
bool PreviewFile(const wxString& htmlfile);
|
|
|
|
|
|
|
|
/**
|
2008-03-08 09:43:31 -05:00
|
|
|
Preview HTML text (not file!).
|
2008-10-25 16:44:52 -04:00
|
|
|
|
|
|
|
Returns @false in case of error -- call wxPrinter::GetLastError to get detailed
|
2008-03-08 08:52:38 -05:00
|
|
|
information about the kind of the error.
|
2008-10-25 16:44:52 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param htmltext
|
2008-03-09 08:33:59 -04:00
|
|
|
HTML text.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param basepath
|
2008-10-25 16:44:52 -04:00
|
|
|
base directory (html string would be stored there if it was in file).
|
|
|
|
It is used to determine path for loading images, for example.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
bool PreviewText(const wxString& htmltext,
|
|
|
|
const wxString& basepath = wxEmptyString);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Print HTML file.
|
2008-10-25 16:44:52 -04:00
|
|
|
|
|
|
|
Returns @false in case of error -- call wxPrinter::GetLastError to get detailed
|
2008-03-08 08:52:38 -05:00
|
|
|
information about the kind of the error.
|
|
|
|
*/
|
|
|
|
bool PrintFile(const wxString& htmlfile);
|
|
|
|
|
|
|
|
/**
|
2008-03-08 09:43:31 -05:00
|
|
|
Print HTML text (not file!).
|
2008-10-25 16:44:52 -04:00
|
|
|
|
|
|
|
Returns @false in case of error -- call wxPrinter::GetLastError to get detailed
|
2008-03-08 08:52:38 -05:00
|
|
|
information about the kind of the error.
|
2008-10-25 16:44:52 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param htmltext
|
2008-03-09 08:33:59 -04:00
|
|
|
HTML text.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param basepath
|
2008-10-25 16:44:52 -04:00
|
|
|
base directory (html string would be stored there if it was in file).
|
|
|
|
It is used to determine path for loading images, for example.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
bool PrintText(const wxString& htmltext,
|
|
|
|
const wxString& basepath = wxEmptyString);
|
|
|
|
|
|
|
|
/**
|
2009-07-03 08:03:39 -04:00
|
|
|
Sets fonts. See wxHtmlDCRenderer::SetFonts for detailed description.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-29 11:34:31 -04:00
|
|
|
void SetFonts(const wxString& normal_face, const wxString& fixed_face,
|
|
|
|
const int* sizes = NULL);
|
2009-07-03 08:03:39 -04:00
|
|
|
|
2009-12-01 15:23:29 -05:00
|
|
|
/**
|
|
|
|
Sets the name used for preview frames and setup dialogs.
|
|
|
|
|
|
|
|
@since 2.8.11 / 2.9.1
|
|
|
|
*/
|
|
|
|
void SetName(const wxString& name);
|
|
|
|
|
2009-07-03 08:03:39 -04:00
|
|
|
/**
|
|
|
|
Sets default font sizes and/or default font size.
|
|
|
|
See wxHtmlDCRenderer::SetStandardFonts for detailed description.
|
|
|
|
@see SetFonts()
|
|
|
|
*/
|
|
|
|
void SetStandardFonts(int size = -1,
|
|
|
|
const wxString& normal_face = wxEmptyString,
|
|
|
|
const wxString& fixed_face = wxEmptyString);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Set page footer. The following macros can be used inside it:
|
2008-08-25 19:25:51 -04:00
|
|
|
@@DATE@ is replaced by the current date in default format
|
|
|
|
@@PAGENUM@ is replaced by page number
|
|
|
|
@@PAGESCNT@ is replaced by total number of pages
|
|
|
|
@@TIME@ is replaced by the current time in default format
|
|
|
|
@@TITLE@ is replaced with the title of the document
|
2008-10-25 16:44:52 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param footer
|
2008-03-09 08:33:59 -04:00
|
|
|
HTML text to be used as footer.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param pg
|
2008-03-09 08:33:59 -04:00
|
|
|
one of wxPAGE_ODD, wxPAGE_EVEN and wxPAGE_ALL constants.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetFooter(const wxString& footer, int pg = wxPAGE_ALL);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Set page header. The following macros can be used inside it:
|
2008-10-25 16:44:52 -04:00
|
|
|
- @@DATE@ is replaced by the current date in default format
|
|
|
|
- @@PAGENUM@ is replaced by page number
|
|
|
|
- @@PAGESCNT@ is replaced by total number of pages
|
|
|
|
- @@TIME@ is replaced by the current time in default format
|
|
|
|
- @@TITLE@ is replaced with the title of the document
|
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param header
|
2008-03-09 08:33:59 -04:00
|
|
|
HTML text to be used as header.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param pg
|
2008-03-09 08:33:59 -04:00
|
|
|
one of wxPAGE_ODD, wxPAGE_EVEN and wxPAGE_ALL constants.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetHeader(const wxString& header, int pg = wxPAGE_ALL);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the parent window for dialogs.
|
|
|
|
*/
|
|
|
|
void SetParentWindow(wxWindow* window);
|
2009-03-26 09:37:37 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
/**
|
|
|
|
Check whether the document fits into the page area.
|
|
|
|
|
|
|
|
This function is called by the base class OnPreparePrinting()
|
|
|
|
implementation and by default checks whether the document fits into
|
|
|
|
@a pageArea horizontally and warns the user if it does not, giving him
|
|
|
|
the possibility to cancel printing in this case (presumably in order to
|
|
|
|
change some layout options and retry it again).
|
|
|
|
|
|
|
|
You may override it to either suppress this check if truncation of the
|
|
|
|
HTML being printed is acceptable or, on the contrary, add more checks to
|
|
|
|
it, e.g. for the fit in the vertical direction if the document should
|
|
|
|
always appear on a single page.
|
|
|
|
|
|
|
|
@return
|
|
|
|
@true if wxHtmlPrintout should continue or @false to cancel
|
|
|
|
printing.
|
|
|
|
|
|
|
|
@since 2.9.0
|
|
|
|
*/
|
|
|
|
virtual bool CheckFit(const wxSize& pageArea, const wxSize& docArea) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxHtmlPrintout
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
This class serves as printout class for HTML documents.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxhtml}
|
2008-10-25 16:44:52 -04:00
|
|
|
@category{html,printing}
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxHtmlPrintout : public wxPrintout
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Constructor.
|
|
|
|
*/
|
|
|
|
wxHtmlPrintout(const wxString& title = "Printout");
|
|
|
|
|
|
|
|
/**
|
2008-10-25 16:44:52 -04:00
|
|
|
Adds a filter to the static list of filters for wxHtmlPrintout.
|
|
|
|
See wxHtmlFilter for further information.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
static void AddFilter(wxHtmlFilter* filter);
|
|
|
|
|
|
|
|
/**
|
2009-07-03 08:03:39 -04:00
|
|
|
This function sets font sizes and faces. See wxHtmlWindow::SetFonts
|
|
|
|
for detailed description.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-29 11:34:31 -04:00
|
|
|
void SetFonts(const wxString& normal_face, const wxString& fixed_face,
|
|
|
|
const int* sizes = NULL);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Set page footer. The following macros can be used inside it:
|
2008-10-25 16:44:52 -04:00
|
|
|
- @@DATE@ is replaced by the current date in default format
|
|
|
|
- @@PAGENUM@ is replaced by page number
|
|
|
|
- @@PAGESCNT@ is replaced by total number of pages
|
|
|
|
- @@TIME@ is replaced by the current time in default format
|
|
|
|
- @@TITLE@ is replaced with the title of the document
|
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param footer
|
2008-03-09 08:33:59 -04:00
|
|
|
HTML text to be used as footer.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param pg
|
2008-03-09 08:33:59 -04:00
|
|
|
one of wxPAGE_ODD, wxPAGE_EVEN and wxPAGE_ALL constants.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetFooter(const wxString& footer, int pg = wxPAGE_ALL);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Set page header. The following macros can be used inside it:
|
2008-10-25 16:44:52 -04:00
|
|
|
- @@DATE@ is replaced by the current date in default format
|
|
|
|
- @@PAGENUM@ is replaced by page number
|
|
|
|
- @@PAGESCNT@ is replaced by total number of pages
|
|
|
|
- @@TIME@ is replaced by the current time in default format
|
|
|
|
- @@TITLE@ is replaced with the title of the document
|
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param header
|
2008-03-09 08:33:59 -04:00
|
|
|
HTML text to be used as header.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param pg
|
2008-03-09 08:33:59 -04:00
|
|
|
one of wxPAGE_ODD, wxPAGE_EVEN and wxPAGE_ALL constants.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetHeader(const wxString& header, int pg = wxPAGE_ALL);
|
|
|
|
|
|
|
|
/**
|
2008-10-25 16:44:52 -04:00
|
|
|
Prepare the class for printing this HTML @b file.
|
|
|
|
The file may be located on any virtual file system or it may be normal file.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetHtmlFile(const wxString& htmlfile);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Prepare the class for printing this HTML text.
|
2008-10-25 16:44:52 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param html
|
2008-03-09 08:33:59 -04:00
|
|
|
HTML text. (NOT file!)
|
2008-03-08 09:43:31 -05:00
|
|
|
@param basepath
|
2008-10-25 16:44:52 -04:00
|
|
|
base directory (html string would be stored there if it was in file).
|
|
|
|
It is used to determine path for loading images, for example.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param isdir
|
2008-03-09 08:33:59 -04:00
|
|
|
@false if basepath is filename, @true if it is directory name
|
2008-10-25 16:44:52 -04:00
|
|
|
(see wxFileSystem for detailed explanation).
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetHtmlText(const wxString& html,
|
|
|
|
const wxString& basepath = wxEmptyString,
|
2008-03-09 08:33:59 -04:00
|
|
|
bool isdir = true);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-10-25 16:44:52 -04:00
|
|
|
Sets margins in millimeters.
|
|
|
|
Defaults to 1 inch for margins and 0.5cm for space between text and header
|
|
|
|
and/or footer.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetMargins(float top = 25.2, float bottom = 25.2,
|
|
|
|
float left = 25.2,
|
|
|
|
float right = 25.2,
|
|
|
|
float spaces = 5);
|
|
|
|
};
|
2008-03-10 11:24:38 -04:00
|
|
|
|