MeshLib C++ Docs
Loading...
Searching...
No Matches
MR::Pdf Class Reference

#include <MRPdf.h>

Classes

struct  ImageParams
 Parameters to adding image from file. More...
 
struct  PaletteRowStats
 

Public Member Functions

MRIOEXTRAS_API Pdf (const std::filesystem::path &documentPath, const PdfParameters &params=PdfParameters())
 Ctor.
 
MRIOEXTRAS_API Pdf (Pdf &&other) noexcept
 
MRIOEXTRAS_API Pdfoperator= (Pdf other) noexcept
 
MRIOEXTRAS_API ~Pdf ()
 Dtor. Automatically do close.
 
MRIOEXTRAS_API void addText (const std::string &text, bool isTitle=false)
 
MRIOEXTRAS_API void addTable (const std::vector< std::pair< std::string, float > > &table)
 
MRIOEXTRAS_API void addPaletteStatsTable (const std::vector< PaletteRowStats > &paletteStats)
 
MRIOEXTRAS_API void addImageFromFile (const std::filesystem::path &imagePath, const ImageParams &params)
 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 (float posX)
 
void setCursorPosY (float posY)
 
float getCursorPosX () const
 
float getCursorPosY () const
 
MRIOEXTRAS_API Vector2f getPageSize () const
 
MRIOEXTRAS_API Box2f getPageWorkArea () const
 
MRIOEXTRAS_API operator bool () const
 Checking the ability to work with a document.
 

Detailed Description

Class for simple creation pdf.

Constructor & Destructor Documentation

◆ Pdf() [1/2]

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

Ctor.

◆ Pdf() [2/2]

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

◆ ~Pdf()

MRIOEXTRAS_API MR::Pdf::~Pdf ( )

Dtor. Automatically do close.

Member Function Documentation

◆ addImageFromFile()

MRIOEXTRAS_API void MR::Pdf::addImageFromFile ( const std::filesystem::path & imagePath,
const ImageParams & params )

Add image from file in current cursor position. If image bigger than page size, autoscale image to page size. Move cursor.

◆ addPaletteStatsTable()

MRIOEXTRAS_API void MR::Pdf::addPaletteStatsTable ( const std::vector< PaletteRowStats > & paletteStats)

◆ addTable()

MRIOEXTRAS_API void MR::Pdf::addTable ( const std::vector< std::pair< std::string, float > > & table)

Add set of pair string - value in current cursor position. Move cursor. Box horizontal size is page width without offset. Box vertical size is automatically for text.

◆ addText()

MRIOEXTRAS_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()

MRIOEXTRAS_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

◆ getPageSize()

MRIOEXTRAS_API Vector2f MR::Pdf::getPageSize ( ) const

◆ getPageWorkArea()

MRIOEXTRAS_API Box2f MR::Pdf::getPageWorkArea ( ) const

◆ newPage()

MRIOEXTRAS_API void MR::Pdf::newPage ( )

Add new pageand move cursor on it.

◆ operator bool()

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

Checking the ability to work with a document.

◆ operator=()

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

◆ setCursorPosX()

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

◆ setCursorPosY()

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

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