2018-06-18 19:05:53 +00:00
|
|
|
#include <qpdf/QPDFPageDocumentHelper.hh>
|
|
|
|
|
|
|
|
QPDFPageDocumentHelper::Members::~Members()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
QPDFPageDocumentHelper::Members::Members()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
QPDFPageDocumentHelper::QPDFPageDocumentHelper(QPDF& qpdf) :
|
|
|
|
QPDFDocumentHelper(qpdf)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
std::vector<QPDFPageObjectHelper>
|
|
|
|
QPDFPageDocumentHelper::getAllPages()
|
|
|
|
{
|
|
|
|
std::vector<QPDFObjectHandle> const& pages_v = this->qpdf.getAllPages();
|
|
|
|
std::vector<QPDFPageObjectHelper> pages;
|
|
|
|
for (std::vector<QPDFObjectHandle>::const_iterator iter = pages_v.begin();
|
|
|
|
iter != pages_v.end(); ++iter)
|
|
|
|
{
|
|
|
|
pages.push_back(QPDFPageObjectHelper(*iter));
|
|
|
|
}
|
|
|
|
return pages;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
QPDFPageDocumentHelper::pushInheritedAttributesToPage()
|
|
|
|
{
|
|
|
|
this->qpdf.pushInheritedAttributesToPage();
|
|
|
|
}
|
|
|
|
|
2018-06-22 00:16:05 +00:00
|
|
|
void
|
|
|
|
QPDFPageDocumentHelper::removeUnreferencedResources()
|
|
|
|
{
|
|
|
|
std::vector<QPDFPageObjectHelper> pages = getAllPages();
|
|
|
|
for (std::vector<QPDFPageObjectHelper>::iterator iter = pages.begin();
|
|
|
|
iter != pages.end(); ++iter)
|
|
|
|
{
|
|
|
|
(*iter).removeUnreferencedResources();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-18 19:05:53 +00:00
|
|
|
void
|
|
|
|
QPDFPageDocumentHelper::addPage(QPDFPageObjectHelper newpage, bool first)
|
|
|
|
{
|
|
|
|
this->qpdf.addPage(newpage.getObjectHandle(), first);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
QPDFPageDocumentHelper::addPageAt(QPDFPageObjectHelper newpage, bool before,
|
|
|
|
QPDFPageObjectHelper refpage)
|
|
|
|
{
|
|
|
|
this->qpdf.addPageAt(newpage.getObjectHandle(), before,
|
|
|
|
refpage.getObjectHandle());
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
QPDFPageDocumentHelper::removePage(QPDFPageObjectHelper page)
|
|
|
|
{
|
|
|
|
this->qpdf.removePage(page.getObjectHandle());
|
|
|
|
}
|