#include <MRPdf.h>
Public Member Functions | |
MRIOEXTRAS_API | Pdf (const std::filesystem::path &documentPath, const PdfParameters ¶ms=PdfParameters()) |
Ctor. | |
MRIOEXTRAS_API | Pdf (Pdf &&other) noexcept |
MRIOEXTRAS_API Pdf & | operator= (Pdf other) noexcept |
MRIOEXTRAS_API | ~Pdf () |
Dtor. Automatically do close. | |
Pdf (const Pdf &rhs)=delete | |
Pdf & | operator= (const Pdf &rhs)=delete |
MRIOEXTRAS_API void | addText (const std::string &text, bool isTitle=false) |
MRIOEXTRAS_API void | addImageFromFile (const std::filesystem::path &imagePath, const std::string &caption={}, const std::vector< std::pair< double, std::string > > &valuesMarks={}) |
Add image from file in current cursor position. If image bigger than page size, autoscale image to page size. Move cursor. | |
MRIOEXTRAS_API void | newPage () |
Add new pageand move cursor on it. | |
MRIOEXTRAS_API void | close () |
Save and close document. After this impossible add anything in document. | |
void | setCursorPosX (HPDF_REAL posX) |
void | setCursorPosY (HPDF_REAL posY) |
float | getCursorPosX () const |
float | getCursorPosY () const |
operator bool () const | |
Checking the ability to work with a document. | |
Class for simple creation pdf.
MRIOEXTRAS_API MR::Pdf::Pdf | ( | const std::filesystem::path & | documentPath, |
const PdfParameters & | params = PdfParameters() ) |
Ctor.
|
noexcept |
MRIOEXTRAS_API MR::Pdf::~Pdf | ( | ) |
Dtor. Automatically do close.
|
delete |
MRIOEXTRAS_API void MR::Pdf::addImageFromFile | ( | const std::filesystem::path & | imagePath, |
const std::string & | caption = {}, | ||
const std::vector< std::pair< double, std::string > > & | valuesMarks = {} ) |
Add image from file in current cursor position. If image bigger than page size, autoscale image to page size. Move cursor.
valuesMarks | if not empty - add marks under image. valuesMarks contains pairs<relative_position, marks_text>. relative_position is in range [0., 1.], where 0. - left border of image, 1. - right border |
caption | if not empty - add caption under marks (if exist) or image. |
MRIOEXTRAS_API void MR::Pdf::addText | ( | const std::string & | text, |
bool | isTitle = false ) |
MRIOEXTRAS_API void MR::Pdf::close | ( | ) |
Save and close document. After this impossible add anything in document.
|
inline |
|
inline |
MRIOEXTRAS_API void MR::Pdf::newPage | ( | ) |
Add new pageand move cursor on it.
|
inline |
Checking the ability to work with a document.
|
inline |
|
inline |