MeshLib Python Docs
Loading...
Searching...
No Matches
mrmeshpy.Pdf Class Reference

Classes

class  AlignmentHorizontal
 
class  Cell
 
class  CellCustomParams
 
class  ImageParams
 
class  PaletteRowStats
 
class  TextCellParams
 
class  TextParams
 

Public Member Functions

bool __bool__ (self)
 
None __init__ (self, PdfParameters params='MR::PdfParameters()')
 
str __repr__ (self)
 
None addImage (self, Image image, Pdf.ImageParams params)
 
None addImageFromFile (self, os.PathLike|str|bytes imagePath, Pdf.ImageParams params)
 
None addPaletteStatsTable (self, std_vector_Pdf_PaletteRowStats paletteStats)
 
None addRow (self, std_vector_Pdf_Cell cells)
 
None addTable (self, std_vector_std_pair_std_string_float table)
 
None addTableTitles (self, std_vector_std_string titles)
 
None addText (self, str text, bool isTitle=False)
 
None addText (self, str text, Pdf.TextParams params)
 
None drawTextCell (self, str text, Pdf.TextCellParams params)
 
None drawTextInRect (self, str text, Box2f rect, Pdf.TextParams params)
 
float getCursorPosX (self)
 
float getCursorPosY (self)
 
Vector2f getPageSize (self)
 
Box2f getPageWorkArea (self)
 
float getTableTextWidth (self, str text)
 
float getTextWidth (self, str text, Pdf.TextParams params)
 
None newPage (self)
 
None newTable (self, int columnCount)
 
None saveToFile (self, os.PathLike|str|bytes documentPath)
 
None setColumnValuesFormat (self, std_vector_std_string formats)
 
None setCursorPosX (self, float posX)
 
None setCursorPosY (self, float posY)
 
None setNewPageAction (self, func_void_from_Pdf action)
 
None setTableColumnWidths (self, std_vector_float widths)
 
None setTableCustomRule (self, func_Pdf_CellCustomParams_from_int_int_std_string rule)
 

Detailed Description

Generated from:  MR::Pdf


 Class for simple creation pdf.

Constructor & Destructor Documentation

◆ __init__()

None mrmeshpy.Pdf.__init__ ( self,
PdfParameters params = 'MR::PdfParameters()' )
Ctor. Create a document, but not a page. To create a new page use newPage() method

Member Function Documentation

◆ __bool__()

bool mrmeshpy.Pdf.__bool__ ( self)
Checking the ability to work with a document

◆ __repr__()

str mrmeshpy.Pdf.__repr__ ( self)

◆ addImage()

None mrmeshpy.Pdf.addImage ( self,
Image image,
Pdf.ImageParams params )

◆ addImageFromFile()

None mrmeshpy.Pdf.addImageFromFile ( self,
os.PathLike | str | bytes imagePath,
Pdf.ImageParams params )
 @brief Add image from file in current cursor position.
 If image bigger than page size, autoscale image to page size.
 Move cursor.

◆ addPaletteStatsTable()

None mrmeshpy.Pdf.addPaletteStatsTable ( self,
std_vector_Pdf_PaletteRowStats paletteStats )

◆ addRow()

None mrmeshpy.Pdf.addRow ( self,
std_vector_Pdf_Cell cells )
add in pdf table row with values

◆ addTable()

None mrmeshpy.Pdf.addTable ( self,
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.

◆ addTableTitles()

None mrmeshpy.Pdf.addTableTitles ( self,
std_vector_std_string titles )
add in pdf table row with titles

◆ addText() [1/2]

None mrmeshpy.Pdf.addText ( self,
str 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

◆ addText() [2/2]

None mrmeshpy.Pdf.addText ( self,
str text,
Pdf.TextParams params )

◆ drawTextCell()

None mrmeshpy.Pdf.drawTextCell ( self,
str text,
Pdf.TextCellParams params )

◆ drawTextInRect()

None mrmeshpy.Pdf.drawTextInRect ( self,
str text,
Box2f rect,
Pdf.TextParams params )
draw text in specific rect on page
text will be cropped by rect

◆ getCursorPosX()

float mrmeshpy.Pdf.getCursorPosX ( self)

◆ getCursorPosY()

float mrmeshpy.Pdf.getCursorPosY ( self)

◆ getPageSize()

Vector2f mrmeshpy.Pdf.getPageSize ( self)

◆ getPageWorkArea()

Box2f mrmeshpy.Pdf.getPageWorkArea ( self)

◆ getTableTextWidth()

float mrmeshpy.Pdf.getTableTextWidth ( self,
str text )
parameters to customization table cell
return text width (for table font parameters)

◆ getTextWidth()

float mrmeshpy.Pdf.getTextWidth ( self,
str text,
Pdf.TextParams params )
return text width

◆ newPage()

None mrmeshpy.Pdf.newPage ( self)
Add new pageand move cursor on it

◆ newTable()

None mrmeshpy.Pdf.newTable ( self,
int columnCount )
set up new table (clear table customization, reset parameters to default values)

◆ saveToFile()

None mrmeshpy.Pdf.saveToFile ( self,
os.PathLike | str | bytes documentPath )
Save document to file

◆ setColumnValuesFormat()

None mrmeshpy.Pdf.setColumnValuesFormat ( self,
std_vector_std_string formats )
set format for conversion values to string for each column

◆ setCursorPosX()

None mrmeshpy.Pdf.setCursorPosX ( self,
float posX )

◆ setCursorPosY()

None mrmeshpy.Pdf.setCursorPosY ( self,
float posY )

◆ setNewPageAction()

None mrmeshpy.Pdf.setNewPageAction ( self,
func_void_from_Pdf action )
set function to customize new page after creation

◆ setTableColumnWidths()

None mrmeshpy.Pdf.setTableColumnWidths ( self,
std_vector_float widths )
set table column widths

◆ setTableCustomRule()

None mrmeshpy.Pdf.setTableCustomRule ( self,
func_Pdf_CellCustomParams_from_int_int_std_string rule )
add rule to customize table cells

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