MeshLib
 
Loading...
Searching...
No Matches
MR::Pdf Class Reference

#include <MRPdf.h>

Public Member Functions

MRMESH_API Pdf (const std::filesystem::path &documentPath, const PdfParameters &params=PdfParameters())
 Ctor.
 
MRMESH_API Pdf (Pdf &&other) noexcept
 
MRMESH_API Pdfoperator= (Pdf other) noexcept
 
MRMESH_API ~Pdf ()
 Dtor. Automatically do close.
 
 Pdf (const Pdf &rhs)=delete
 
Pdfoperator= (const Pdf &rhs)=delete
 
MRMESH_API void addText (const std::string &text, bool isTitle=false)
 
MRMESH_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.
 
MRMESH_API void newPage ()
 Add new pageand move cursor on it.
 
MRMESH_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.
 

Detailed Description

Class for simple creation pdf.

Constructor & Destructor Documentation

◆ Pdf() [1/3]

MRMESH_API MR::Pdf::Pdf ( const std::filesystem::path & documentPath,
const PdfParameters & params = PdfParameters() )

Ctor.

◆ Pdf() [2/3]

MRMESH_API MR::Pdf::Pdf ( Pdf && other)
noexcept

◆ ~Pdf()

MRMESH_API MR::Pdf::~Pdf ( )

Dtor. Automatically do close.

◆ Pdf() [3/3]

MR::Pdf::Pdf ( const Pdf & rhs)
delete

Member Function Documentation

◆ addImageFromFile()

MRMESH_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.

Parameters
valuesMarksif 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
captionif not empty - add caption under marks (if exist) or image.

◆ addText()

MRMESH_API void MR::Pdf::addText ( const std::string & text,
bool isTitle = false )

Add text block in current cursor position. Move cursor. Box horizontal size is page width without offset. Box vertical size is automatically for text. horAlignment = left if isTitle - horAlignment = center, use titleFontSize

◆ close()

MRMESH_API void MR::Pdf::close ( )

Save and close document. After this impossible add anything in document.

◆ getCursorPosX()

float MR::Pdf::getCursorPosX ( ) const
inline

◆ getCursorPosY()

float MR::Pdf::getCursorPosY ( ) const
inline

◆ newPage()

MRMESH_API void MR::Pdf::newPage ( )

Add new pageand move cursor on it.

◆ operator bool()

MR::Pdf::operator bool ( ) const
inline

Checking the ability to work with a document.

◆ operator=() [1/2]

Pdf & MR::Pdf::operator= ( const Pdf & rhs)
delete

◆ operator=() [2/2]

MRMESH_API Pdf & MR::Pdf::operator= ( Pdf other)
noexcept

◆ setCursorPosX()

void MR::Pdf::setCursorPosX ( HPDF_REAL posX)
inline

◆ setCursorPosY()

void MR::Pdf::setCursorPosY ( HPDF_REAL posY)
inline

The documentation for this class was generated from the following file: