144 Page(
const Element &el);
146 Page(
const Element &el,
const Id &id_,
int image_number, Option<int> width, Option<int> height, Option<Position> position);
148 void update_subelements();
151 SpacePtr topMargin, leftMargin, rightMargin, bottomMargin, printSpace;
152 std::vector<std::shared_ptr<Space> > spaces;
153 std::map<Id, std::weak_ptr<Space> > id_spaces;
162 std::vector<PagePtr>
GetPages()
const;
164 Page&
AddPage(
const Id &id_,
int image_number, Option<int> width_ = Option<int>(), Option<int> height_ = Option<int>(), Option<Page::Position> pos = Option<Page::Position>());
166 Page&
AddPageAfter(
const Id &pred,
const Id &id_,
int image_number, Option<int> width_ = Option<int>(), Option<int> height_ = Option<int>(), Option<Page::Position> pos = Option<Page::Position>());
168 Page&
AddPageBefore(
const Id &next,
const Id &id_,
int image_number, Option<int> width_ = Option<int>(), Option<int> height_ = Option<int>(), Option<Page::Position> pos = Option<Page::Position>());
175 Layout(
const Element &el);
177 void update_subelements();
179 std::vector<std::shared_ptr<Page> > pages;
180 std::map<Id, std::weak_ptr<Page> > id_pages;
186 #error you cannot include this file directly
Page & operator=(const Page &)=delete
SpacePtr GetLeftMargin()
Returns the left margin.
Option< Position > GetPosition() const
Returns the position of the page.
void SetQuality(Quality q)
Sets the quality of the original page.
void SetAccuracy(double acc)
Sets the estimated % of OCR accuracy on the page [0, 100].
Space & GetSpace(const Id &sid)
Returns a space.
void SetQualityDetail(const StringUTF8 &s)
Sets the details on the quality of the original page.
Layout(const Layout &)=delete
void SetHeight(int i)
Sets the height of the page.
std::vector< Id > GetStyles() const
Returns the list of style references.
Option< StringUTF8 > GetPageClass() const
Returns the class of the page (user defined class such as "title")
void SetPageClass(const StringUTF8 &s)
Sets the class of the page (user defined class such as "title")
void RemovePage(const Id &pid)
Removes a page.
Page & AddPage(const Id &id_, int image_number, Option< int > width_=Option< int >(), Option< int > height_=Option< int >(), Option< Page::Position > pos=Option< Page::Position >())
Adds a page.
Option< double > GetAccuracy() const
Returns the estimated % of OCR accuracy on the page [0, 100].
Option< double > GetPageConfidence() const
Returns the confidence of OCR on the page [0, 1].
virtual ~Layout() override
Option< StringUTF8 > GetPrintedImageNumber() const
Returns the page number that is printed on the document.
void AddStyle(const Id &styleid)
Adds a reference to a style.
void RemoveSpace(const Id &sid)
Removes a space.
std::vector< Id > GetStyles() const
Returns the list of style references.
Option< Quality > GetQuality() const
Returns the quality of the original page.
SpacePtr GetPrintSpace()
Returns the main print space.
SpacePtr GetBottomMargin()
Returns the bottom margin.
SpacePtr GetRightMargin()
Returns the right margin.
Layout & operator=(const Layout &)=delete
void SetPhysicalImageNumber(int pnum)
Sets the number of the page within the document.
void SetPageConfidence(double c)
Sets the confidence of OCR on the page [0, 1].
void RemoveStyle(const Id &styleid)
Removes a reference to a style.
std::vector< PagePtr > GetPages() const
Returns the list of all pages.
std::weak_ptr< Space > SpacePtr
void AddStyle(const Id &styleid)
Adds a reference to a style.
Space & AddRightMargin(const Id &id_, double x, double y, double w, double h)
Adds a right margin.
Option< StringUTF8 > GetQualityDetail() const
Returns details on the quality of the original page.
const Id & GetId() const
Returns the id of the element.
void SetPrintedImageNumber(const StringUTF8 &s)
Sets the page number that is printed on the document.
void SetWidth(int i)
Sets the width of the page.
Space & AddBottomMargin(const Id &id_, double x, double y, double w, double h)
Adds a bottom margin.
Page & GetPage(const Id &pid)
Returns a page.
Page & AddPageBefore(const Id &next, const Id &id_, int image_number, Option< int > width_=Option< int >(), Option< int > height_=Option< int >(), Option< Page::Position > pos=Option< Page::Position >())
Adds a page before another.
SpacePtr GetTopMargin()
Returns the top margin.
Option< int > GetHeight() const
Returns the height of the page.
Page & AddPageAfter(const Id &pred, const Id &id_, int image_number, Option< int > width_=Option< int >(), Option< int > height_=Option< int >(), Option< Page::Position > pos=Option< Page::Position >())
Adds a page after another.
Space & AddLeftMargin(const Id &id_, double x, double y, double w, double h)
Adds a left margin.
Option< Id > GetProcessing() const
Returns the id of the processing applied to the page.
std::weak_ptr< Page > PagePtr
Space & AddTopMargin(const Id &id_, double x, double y, double w, double h)
Adds a top margin.
Option< int > GetWidth() const
Returns the width of the page.
Page(const Page &)=delete
int GetPhysicalImageNumber() const
Returns the number of the page within the document.
void RemoveStyle(const Id &styleid)
Removes a reference to a style.
Space & AddPrintSpace(const Id &id_, double x, double y, double w, double h)
Adds the print space.
std::vector< SpacePtr > GetSpaces() const
Returns the list of all spaces.