4#ifndef MRIOEXTRAS_NO_PDF
58 MRIOEXTRAS_API
void addText(
const std::string& text,
bool isTitle =
false );
69 MRIOEXTRAS_API
void addImageFromFile(
const std::filesystem::path& imagePath,
const std::string& caption = {},
70 const std::vector<std::pair<double, std::string>>& valuesMarks = {} );
84 operator bool()
const {
return state_.document != 0; };
89 HPDF_Doc document =
nullptr;
90 HPDF_Page activePage =
nullptr;
91 HPDF_Font activeFont =
nullptr;
95 std::filesystem::path filename_;
97 PdfParameters params_;
99 HPDF_REAL cursorX_ = 0;
100 HPDF_REAL cursorY_ = 0;
102 bool checkDocument()
const {
return state_.document && state_.activePage; };
Pdf(const Pdf &rhs)=delete
float getCursorPosY() const
Definition MRPdf.h:81
MRIOEXTRAS_API Pdf & operator=(Pdf other) noexcept
float getCursorPosX() const
Definition MRPdf.h:80
MRIOEXTRAS_API void addText(const std::string &text, bool isTitle=false)
MRIOEXTRAS_API void newPage()
Add new pageand move cursor on it.
void setCursorPosY(HPDF_REAL posY)
Definition MRPdf.h:79
MRIOEXTRAS_API Pdf(const std::filesystem::path &documentPath, const PdfParameters ¶ms=PdfParameters())
Ctor.
void setCursorPosX(HPDF_REAL posX)
Definition MRPdf.h:78
MRIOEXTRAS_API void close()
Save and close document. After this impossible add anything in document.
MRIOEXTRAS_API ~Pdf()
Dtor. Automatically do close.
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 pa...
MRIOEXTRAS_API Pdf(Pdf &&other) noexcept
Definition MRCameraOrientationPlugin.h:8
Parameters of document style.
Definition MRPdf.h:19
HPDF_REAL textSize
Definition MRPdf.h:21
std::string fontName
Font name list of available fonts: Courier (-Bold, -Oblique, -BoldOblique) Helvetica (-Bold,...
Definition MRPdf.h:31
HPDF_REAL titleSize
Definition MRPdf.h:20