|
pdfedit
0.4.5
About: PDFedit is a free and open source library for manipulating PDF documents.
Fossies Dox: pdfedit-0.4.5.tar.gz ("inofficial" and yet experimental doxygen-generated source code documentation) ![]() |
#include <cpagecontents.h>


Public Member Functions | |
| CPageContents (CPage *page) | |
| ~CPageContents () | |
| virtual void | reset () |
| void | reparse () |
| template<typename Container > | |
| void | addToFront (const Container &cont) |
| template<typename Container > | |
| void | addToBack (const Container &cont) |
| void | remove (size_t csnum) |
| template<typename RectangleContainer > | |
| size_t | findText (std::string text, RectangleContainer &recs, const TextSearchParams ¶ms=TextSearchParams()) const |
| void | replaceText (const std::string &what, const std::string &with) |
| void | addText (const std::string &what, const libs::Point &where, const std::string &font_id) |
| void | addInlineImage (const CStream::Buffer &what, const libs::Point &image_size, const libs::Point &where) |
| template<typename WordEngine , typename LineEngine , typename ColumnEngine > | |
| void | convert (textoutput::OutputBuilder &out) |
| template<typename OpContainer , typename PositionComparator > | |
| void | getObjectsAtPosition (OpContainer &opContainer, PositionComparator cmp) |
| boost::shared_ptr< CContentStream > | getContentStream (CContentStream *cc) |
| boost::shared_ptr< CContentStream > | getContentStream (size_t pos) |
| template<typename Container > | |
| void | getContentStreams (Container &container) |
| void | getText (std::string &text, const std::string *encoding=NULL, const libs::Rectangle *rc=NULL) const |
| void | moveAbove (boost::shared_ptr< const CContentStream > ct) |
| void | moveAbove (size_t pos) |
| void | moveBelow (boost::shared_ptr< const CContentStream > ct) |
| void | moveBelow (size_t pos) |
| template<typename Cont > | |
| void | setContents (shared_ptr< CDict > dict, const Cont &cont) |
Public Member Functions inherited from pdfobjects::ICPageModule | |
| void | init () |
| void | reset () |
| virtual | ~ICPageModule () |
Static Public Member Functions | |
| template<typename Cont > | |
| static void | setContents (boost::shared_ptr< CDict > dict, const Cont &cont) |
Class representing the Contents entry in a page. Provides convinient access and modify operations on "Contents" entry of a page dictionary.
Definition at line 59 of file cpagecontents.h.
| pdfobjects::CPageContents::CPageContents | ( | CPage * | page) |
Definition at line 224 of file cpagecontents.cc.
References pdfobjects::CPage::getDictionary().
| pdfobjects::CPageContents::~CPageContents | ( | ) |
Definition at line 231 of file cpagecontents.cc.
References reset().
| void pdfobjects::CPageContents::addInlineImage | ( | const CStream::Buffer & | what, |
| const libs::Point & | image_size, | ||
| const libs::Point & | where | ||
| ) |
Adds simple image to the page.
Definition at line 513 of file cpagecontents.cc.
References pdfobjects::CDict::addProperty(), pdfobjects::CDict::addProperty(), pdfobjects::CDict::addProperty(), pdfobjects::CDict::addProperty(), addToBack(), pdfobjects::createOperator(), pdfobjects::createOperatorScale(), pdfobjects::createOperatorTranslation(), pdfobjects::getLastOperator(), pdfobjects::getLastOperator(), pdfobjects::getLastOperator(), and pdfobjects::getLastOperator().
| void pdfobjects::CPageContents::addText | ( | const std::string & | what, |
| const libs::Point & | where, | ||
| const std::string & | font_id | ||
| ) |
Adds text in to the page.
Definition at line 467 of file cpagecontents.cc.
References addToBack(), pdfobjects::createOperator(), pdfobjects::createOperator(), pdfobjects::createOperator(), pdfobjects::createOperator(), pdfobjects::createOperator(), pdfobjects::getLastOperator(), pdfobjects::getLastOperator(), pdfobjects::getLastOperator(), pdfobjects::getLastOperator(), and pdfobjects::getLastOperator().
| template void pdfobjects::CPageContents::addToBack< deque< shared_ptr< PdfOperator > > > | ( | const Container & | cont) |
Add new content stream to the back. This function adds new entry in the "Contents" property of a page. The container of provided operators must form a valid contentstream. This function should be used when supplied operators should be handled at the end e.g. should be drawn at the end which means they will appear "above" other objects.
This function can be used to separate our changes from original content stream. Indicats that the page changed.
| cont | Container of operators to add. |
Definition at line 305 of file cpagecontents.cc.
References pdfobjects::hasValidPdf(), pdfobjects::hasValidPdf(), pdfobjects::hasValidPdf(), pdfobjects::hasValidPdf(), and pdfobjects::hasValidRef().
Referenced by addInlineImage(), and addText().
| template void pdfobjects::CPageContents::addToFront< deque< shared_ptr< PdfOperator > > > | ( | const Container & | cont) |
Add new content stream to the front. This function adds new entry in the "Contents" property of a page. The container of provided operators must form a valid contentstream. This function should be used when supplied operators should be handled at the beginning end e.g. should be drawn first which means they will appear the "below" other object.
This function can be used to separate our changes from original content stream. Indicats that the page changed.
| cont | Container of operators to add. |
Definition at line 265 of file cpagecontents.cc.
References pdfobjects::hasValidPdf(), pdfobjects::hasValidPdf(), pdfobjects::hasValidPdf(), and pdfobjects::hasValidRef().
|
inline |
Get text source of a page.
Definition at line 234 of file cpagecontents.h.
References debug::DBG_INFO, pdfobjects::PdfOperator::getIterator(), pdfobjects::hasValidPdf(), and kernelPrintDbg.
| size_t pdfobjects::CPageContents::findText | ( | std::string | text, |
| RectangleContainer & | recs, | ||
| const TextSearchParams & | params = TextSearchParams() |
||
| ) | const |
Find all occurences of a text on this page.
It uses xpdf TextOutputDevice to get the bounding box of found text.
| text | Text to find. |
| recs | Output container of rectangles of all occurences of the text. |
| params | Search parameters. |
Definition at line 395 of file cpagecontents.cc.
References gFalse, gFalse, gFalse, gFalse, gFalse, gTrue, i, i, i, i, i, and NULL.
| shared_ptr< CContentStream > pdfobjects::CPageContents::getContentStream | ( | CContentStream * | cc) |
Returns shared pointer to the specified content stream.
Definition at line 238 of file cpagecontents.cc.
| shared_ptr< CContentStream > pdfobjects::CPageContents::getContentStream | ( | size_t | pos) |
Returns shared pointer to the specified content stream.
Definition at line 251 of file cpagecontents.cc.
|
inline |
Fills container with contents streams.
Definition at line 308 of file cpagecontents.h.
|
inline |
Get pdf operators at specified position. This call will be delegated to content stream object.
| opContainer | Operator container where operators in specified are wil be stored. |
| cmp | Null if default kernel area comparator should be used otherwise points to an object which will decide whether an operator is "near" a point. |
Definition at line 286 of file cpagecontents.h.
| void pdfobjects::CPageContents::getText | ( | std::string & | text, |
| const std::string * | encoding = NULL, |
||
| const libs::Rectangle * | rc = NULL |
||
| ) | const |
Returns plain text extracted from a page using xpdf code.
This method uses xpdf TextOutputDevice that outputs a page to a text device. Text in a pdf is stored neither word by word nor letter by letter. It is not easy not decide whether two letters form a word. Xpdf uses insane algorithm that works most of the time.
| text | Output string where the text will be saved. |
| encoding | Encoding format. |
| rc | Rectangle from which to extract the text. |
Definition at line 364 of file cpagecontents.cc.
References debug::DBG_DBG, gFalse, gFalse, gFalse, globalParams, kernelPrintDbg, and NULL.
| void pdfobjects::CPageContents::moveAbove | ( | boost::shared_ptr< const CContentStream > | ct) |
Move contentstream up one level. Which means it will be repainted by less objects.
Referenced by moveAbove().
| void pdfobjects::CPageContents::moveAbove | ( | size_t | pos) |
Definition at line 1029 of file cpagecontents.cc.
References moveAbove().
| void pdfobjects::CPageContents::moveBelow | ( | boost::shared_ptr< const CContentStream > | ct) |
Move contentstream below one level. Which means it will be repainted by more objects.
Referenced by moveBelow().
| void pdfobjects::CPageContents::moveBelow | ( | size_t | pos) |
Definition at line 1038 of file cpagecontents.cc.
References moveBelow().
| void pdfobjects::CPageContents::remove | ( | size_t | csnum) |
Remove content stream. This function removes all objects from "Contents" entry which form specified contentstream. Indicats that the page changed.
| csnum | Number of content stream to remove. |
Definition at line 343 of file cpagecontents.cc.
References pdfobjects::hasValidPdf().
| void pdfobjects::CPageContents::reparse | ( | ) |
Reparse content stream using actual display parameters.
Definition at line 781 of file cpagecontents.cc.
References pdfobjects::hasValidPdf(), and pdfobjects::hasValidRef().
Replaces text in the whole page.
Definition at line 455 of file cpagecontents.cc.
|
virtual |
Definition at line 1044 of file cpagecontents.cc.
References NULL.
Referenced by ~CPageContents().
|
static |
Set Contents entry from a container of content streams. Indicats that the page changed.
Referenced by pdfobjects::CPageChanges::displayChange().
| void pdfobjects::CPageContents::setContents | ( | shared_ptr< CDict > | dict, |
| const Cont & | cont | ||
| ) |
Set Contents entry from a container of content streams. Indicats that the page changed.
Definition at line 675 of file cpagecontents.cc.
References pdfobjects::Specification::Page::CONTENTS, pdfobjects::Specification::Page::CONTENTS, pdfobjects::hasValidPdf(), pdfobjects::hasValidPdf(), pdfobjects::hasValidRef(), and pdfobjects::hasValidRef().