MeshLib Python Docs
Loading...
Searching...
No Matches
mrmeshpy.Pdf Class Reference
Inheritance diagram for mrmeshpy.Pdf:

Classes

class  AlignmentHorizontal
class  Cell
class  CellCustomParams
class  ConstCell
class  ConstCellCustomParams
class  ConstImageParams
class  ConstPaletteRowStats
class  ConstTextCellParams
class  ConstTextParams
class  ImageParams
class  PaletteRowStats
class  TextCellParams
class  TextParams

Public Member Functions

None __init__ (self, ConstPdfParameters params='MR::PdfParameters()')
None addImage (self, ConstImage image, Pdf.ConstImageParams params)
None addImageFromFile (self, os.PathLike|str|bytes imagePath, Pdf.ConstImageParams params)
None addPaletteStatsTable (self, Const_std_vector_Pdf_PaletteRowStats paletteStats)
None addRow (self, Const_std_vector_Pdf_Cell cells)
None addTable (self, Const_std_vector_std_pair_std_string_float table)
None addTableTitles (self, Const_std_vector_std_string titles)
None addText (self, str text, bool isTitle=False)
None addText (self, str text, Pdf.ConstTextParams params)
None drawRect (self, ConstBox2f rect, ConstColor fillColor, ConstColor strokeColor)
None drawTextCell (self, str text, Pdf.ConstTextCellParams params)
None drawTextInRect (self, str text, ConstBox2f rect, Pdf.ConstTextParams params)
float getTableTextWidth (self, str text)
float getTextWidth (self, str text, Pdf.ConstTextParams params)
None newPage (self)
None newTable (self, int columnCount)
None saveToFile (self, os.PathLike|str|bytes documentPath)
None setColumnValuesFormat (self, Const_std_vector_std_string formats)
None setCursorPosX (self, float posX)
None setCursorPosY (self, float posY)
None setNewPageAction (self, Const_func_void_from_Pdf action)
None setTableColumnWidths (self, Const_std_vector_float widths)
None setTableCustomRule (self, Const_func_Pdf_CellCustomParams_from_int_int_std_string rule)
Public Member Functions inherited from mrmeshpy.ConstPdf
bool __bool__ (self)
 __init__ (self, *args, **kwargs)
str __repr__ (self)
float getCursorPosX (self)
float getCursorPosY (self)
Vector2f getPageSize (self)
Box2f getPageWorkArea (self)

Detailed Description

Generated from:  MR::Pdf

Class for simple creation pdf.

Constructor & Destructor Documentation

◆ __init__()

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

Member Function Documentation

◆ addImage()

None mrmeshpy.Pdf.addImage ( self,
ConstImage image,
Pdf.ConstImageParams params )

◆ addImageFromFile()

None mrmeshpy.Pdf.addImageFromFile ( self,
os.PathLike | str | bytes imagePath,
Pdf.ConstImageParams 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,
Const_std_vector_Pdf_PaletteRowStats paletteStats )

◆ addRow()

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

◆ addTable()

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

◆ addTableTitles()

None mrmeshpy.Pdf.addTableTitles ( self,
Const_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.ConstTextParams params )

◆ drawRect()

None mrmeshpy.Pdf.drawRect ( self,
ConstBox2f rect,
ConstColor fillColor,
ConstColor strokeColor )
draw rect (filled with border)

◆ drawTextCell()

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

◆ drawTextInRect()

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

◆ 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.ConstTextParams 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,
Const_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,
Const_func_void_from_Pdf action )
set function to customize new page after creation

◆ setTableColumnWidths()

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

◆ setTableCustomRule()

None mrmeshpy.Pdf.setTableCustomRule ( self,
Const_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: