![]() |
wxIScan
|
Traverse recursively through the DOM tree beginning with the given node. More...
#include <wxiscanhocr2pdf.h>
Public Member Functions | |
wxIScanSmartHocr2Pdf (wxXmlDocument *poXmlDoc, wxPdfDocument *poPdfDoc, int nResolution, const wxString &strHocrClassFilter=wxT("ocr_line")) | |
DOM tree traverser class for wxIScanFrame::AddPdfPage() based on wxIScanFrameHocr2Pdf class to achieve a "smarter" word based PDF output hidden behind the image. | |
Protected Member Functions | |
virtual void | Print2Pdf (double x, double y, const wxString &strText) |
Print the given text at the given coordinates. | |
virtual void | Flush2Pdf () |
Flush outstanding print-to-PDF-commands. | |
Protected Attributes | |
double | m_x |
double | m_y |
Save printing coordinates. | |
wxString | m_strText |
Save outstanding text. |
Traverse recursively through the DOM tree beginning with the given node.
This class extends wxIScanHocr2Pdf by "smart" glueing the letters of one word together. This makes it easer to search a PDF document for words (instead of single) letters).
NOTE:
1) This is some sort of a "private" class to wxIScanFrame and should not be used outside wxIScanFrame::AddPdfPage().
2) There is no validity check done on poXmlDoc, poPdfDoc and nResolution. That is it is assumed that all parameters of the constructor are valid.
Definition at line 121 of file wxiscanhocr2pdf.h.
wxIScanSmartHocr2Pdf::wxIScanSmartHocr2Pdf | ( | wxXmlDocument * | poXmlDoc, |
wxPdfDocument * | poPdfDoc, | ||
int | nResolution, | ||
const wxString & | strHocrClassFilter = wxT( "ocr_line" ) |
||
) |
DOM tree traverser class for wxIScanFrame::AddPdfPage() based on wxIScanFrameHocr2Pdf class to achieve a "smarter" word based PDF output hidden behind the image.
poXmlDoc | the (valid!) pointer to the XML DOM tree |
poPdfDoc | the (valid!) pointer to the PDF document |
nResolution | the (virtual) resolution of the image |
strHocrClassFilter | the class to use for hOCR information (e. g. whole lines or words) |
Definition at line 122 of file wxiscanhocr2pdf.cpp.
References m_strText, and m_y.
: wxIScanHocr2Pdf( poXmlDoc, poPdfDoc, nResolution, strHocrClassFilter ) { // Clear the collection buffer. m_strText.Empty(); // Reset ... m_y= -1.0; }
void wxIScanSmartHocr2Pdf::Flush2Pdf | ( | ) | [protected, virtual] |
Flush outstanding print-to-PDF-commands.
NOTE: This function does the real printing initialized by (maybe multiple) calls to Print2Pdf().
Reimplemented from wxIScanHocr2Pdf.
Definition at line 156 of file wxiscanhocr2pdf.cpp.
References wxIScanHocr2Pdf::m_poPdfDoc, m_strText, m_x, and m_y.
void wxIScanSmartHocr2Pdf::Print2Pdf | ( | double | x, |
double | y, | ||
const wxString & | strText | ||
) | [protected, virtual] |
Print the given text at the given coordinates.
x | abscissa of the origin |
y | ordinate of the origin |
strText | text to print |
NOTE: This function only collects text until Flush2Pdf() is called.
Reimplemented from wxIScanHocr2Pdf.
Definition at line 138 of file wxiscanhocr2pdf.cpp.
wxString wxIScanSmartHocr2Pdf::m_strText [protected] |
Save outstanding text.
Definition at line 158 of file wxiscanhocr2pdf.h.
Referenced by Flush2Pdf(), Print2Pdf(), and wxIScanSmartHocr2Pdf().
double wxIScanSmartHocr2Pdf::m_x [protected] |
Definition at line 157 of file wxiscanhocr2pdf.h.
Referenced by Flush2Pdf(), and Print2Pdf().
double wxIScanSmartHocr2Pdf::m_y [protected] |
Save printing coordinates.
Definition at line 157 of file wxiscanhocr2pdf.h.
Referenced by Flush2Pdf(), Print2Pdf(), and wxIScanSmartHocr2Pdf().