Chords

SongPdfExporter
in package
implements SongPdfExporterInterface

Transforms song into printable PDF document.

Interfaces, Classes, Traits and Enums

SongPdfExporterInterface
Transforms song into printable PDF document.

Table of Contents

COLUMN_SPACE  = 10
Space between columns.
HEADER_HEIGHT  = 80
Height of page header.
MARGIN_BOTTOM  = 20
Bottom page margin.
MARGIN_LEFT  = 40
Left page margin.
MARGIN_RIGHT  = 40
Right page margin.
MARGIN_TOP  = 20
Top page margin.
TEMP_EXCEPTION_MESSAGE  = 'Could not save temporary PDF file.'
toPdf()  : string
Transforms the song into printable PDF document.
buildHeader()  : string
Creates a PDF file with song header.
buildText()  : string
Creates a PDF file with song lyrics.
buildTitle()  : string
Creates a PDF file with song title.
fontSizeToPoints()  : string
Converts font size option to points.
getTempFile()  : string
Returns random temporary file name.

Constants

TEMP_EXCEPTION_MESSAGE

private mixed TEMP_EXCEPTION_MESSAGE = 'Could not save temporary PDF file.'

Methods

buildHeader()

Creates a PDF file with song header.

private buildHeader(SongInfo $info, PdfExportOptions $options, float $pageWidth) : string

Song header includes a small song name and author.

Parameters
$info : SongInfo
$options : PdfExportOptions

export settings

$pageWidth : float

width of the page

Return values
string

path to PDF file

buildText()

Creates a PDF file with song lyrics.

private buildText(SongLyrics $lyrics, PdfExportOptions $options, float $columnWidth, float $columnHeight) : string

Each page in the created file corresponds to a single column.

Parameters
$lyrics : SongLyrics

lyrics

$options : PdfExportOptions

export settings

$columnWidth : float

width of a column

$columnHeight : float

height of a column

Return values
string

path to PDF file

buildTitle()

Creates a PDF file with song title.

private buildTitle(SongInfo $info, PdfExportOptions $options, float $pageWidth) : string

Song title includes large song name and all provided metadata.

Parameters
$info : SongInfo
$options : PdfExportOptions

export settings

$pageWidth : float

width of the page

Return values
string

path to PDF file

fontSizeToPoints()

Converts font size option to points.

private fontSizeToPoints(string $fontSize) : string
Parameters
$fontSize : string

font size

Return values
string

size in points

getTempFile()

Returns random temporary file name.

private getTempFile() : string
Return values
string

file path

Search results