Invoice++
Loading...
Searching...
No Matches
Invoice Class Reference

#include <invoice.h>

Collaboration diagram for Invoice:

Public Member Functions

 Invoice (const std::shared_ptr< InvoiceData > &invoice_data)
 
std::string generate ()
 generate a PDF invoice and save it to the users downloads folder as the invoice_number.pdf
 

Public Attributes

HPDF_Doc pdf
 

Private Member Functions

HPDF_Page _generateNewPage ()
 create a new page and add to pages list
 
void _generateFooter (HPDF_Page page) const
 prints the footer on the current pdf page, excluding the page number
 
void _generatePageNumbers () const
 print page numbering on all pages
 

Private Attributes

std::shared_ptr< InvoiceDatainvoice_data {}
 
std::list< HPDF_Page > pages {}
 
float line_height_factor = 1.2
 
HPDF_PageSizes page_size = HPDF_PAGE_SIZE_A4
 
HPDF_PageDirection page_direction = HPDF_PAGE_PORTRAIT
 
float padding_left = 55
 
float padding_right = 55
 
float padding_top = 55
 
float padding_bottom = 65
 
HPDF_REAL current_height
 
HPDF_Font font_normal
 
HPDF_Font font_bold
 

Constructor & Destructor Documentation

◆ Invoice()

Invoice::Invoice ( const std::shared_ptr< InvoiceData > & invoice_data)
inlineexplicit
Here is the call graph for this function:

Member Function Documentation

◆ _generateFooter()

void Invoice::_generateFooter ( HPDF_Page page) const
private

prints the footer on the current pdf page, excluding the page number

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _generateNewPage()

HPDF_Page Invoice::_generateNewPage ( )
private

create a new page and add to pages list

Returns
the created page
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _generatePageNumbers()

void Invoice::_generatePageNumbers ( ) const
private

print page numbering on all pages

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generate()

std::string Invoice::generate ( )

generate a PDF invoice and save it to the users downloads folder as the invoice_number.pdf

Returns
the location of the saved pdf
Exceptions
PDFException
Here is the call graph for this function:

Member Data Documentation

◆ current_height

HPDF_REAL Invoice::current_height
private

◆ font_bold

HPDF_Font Invoice::font_bold
private

◆ font_normal

HPDF_Font Invoice::font_normal
private

◆ invoice_data

std::shared_ptr<InvoiceData> Invoice::invoice_data {}
private

◆ line_height_factor

float Invoice::line_height_factor = 1.2
private

◆ padding_bottom

float Invoice::padding_bottom = 65
private

◆ padding_left

float Invoice::padding_left = 55
private

◆ padding_right

float Invoice::padding_right = 55
private

◆ padding_top

float Invoice::padding_top = 55
private

◆ page_direction

HPDF_PageDirection Invoice::page_direction = HPDF_PAGE_PORTRAIT
private

◆ page_size

HPDF_PageSizes Invoice::page_size = HPDF_PAGE_SIZE_A4
private

◆ pages

std::list<HPDF_Page> Invoice::pages {}
private

◆ pdf

HPDF_Doc Invoice::pdf

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