2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-11-04 20:37:50 +00:00
qpdf/libqpdf/QPDFPageDocumentHelper.cc

65 lines
1.5 KiB
C++

#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();
}
void
QPDFPageDocumentHelper::removeUnreferencedResources()
{
std::vector<QPDFPageObjectHelper> pages = getAllPages();
for (std::vector<QPDFPageObjectHelper>::iterator iter = pages.begin();
iter != pages.end(); ++iter)
{
(*iter).removeUnreferencedResources();
}
}
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());
}