PHP 클래스 Pressbooks\Modules\Export\Mpdf\Pdf

상속: extends Pressbooks\Modules\Export\Export
파일 보기 프로젝트 열기: pressbooks/pressbooks 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$bookMeta array Book Metadata
$bookTitle string Holds the title of the book being published
$exportStylePath string Fullpath to book CSS file.
$globalOptions array Global theme options, set by the user
$memoryNeeded integer mPDF uses a lot of memory, this the recommended minimum
$mpdf object MPDF Class
$numbered boolean Number the chapters
$options array mPDF theme options, set by the user

공개 메소드들

메소드 설명
__construct ( )
addBookInfo ( ) Add book information page, otherwise known as title page
addCopyright ( ) Copyright information on a separate page
addCover ( ) Add the cover for the book.
addFrontMatter ( array $contents ) Adds front matter, resets the page numbering on the first loop, romanizes the numeric style
addFrontMatterByType ( string $type, array $contents ) Add front matter of a specific/special type
addPage ( array $page, array $page_options = [], boolean $display_footer = true, boolean $display_header = true ) : boolean Add a page to the pdf
addPartsAndChapters ( $contents )
addPreContent ( array $contents ) Add all specially handled content.
addToc ( ) Add the mpdf Table of Contents.
convert ( ) : boolean Book Assembly. Create $this->outputPath
fixAnnoyingCharacters ( string $html ) : string This function prevents mPDF from completely aborting the export routine, or replacing each non-breaking space with a '?' if ignore_invalid_utf8 is true. Important to leave this in.
getBookmarkEntry ( array $page ) : string Return the PDF bookmark entry for this page should be unique, using static variable for cheap cache
getFilteredContent ( string $content ) : string Cleans up html
getFooter ( boolean $display = true, string $content = '' ) : string Return formatted footers.
getHeader ( boolean $display = true, string $content = '' ) : string Return formatted headers.
getOrderedBookContents ( ) : array Restructures \Pressbooks\Book::getBookContents() into a format more useful for direct iteration, and tracks a nesting level for Bookmark and ToC entries.
getThemeCss ( object $theme ) : string Get current child and parent theme css files. Child themes only have one parent theme, and 99% of the time this is 'Luther' or /pressbooks-book/ whose stylesheet is named 'style.css'
getTocEntry ( string $page ) : string Return the Table of Contents entry for this page.
hasDependencies ( ) : boolean Dependency check.
setCss ( ) Add all css files
validate ( ) : boolean Check the sanity of $this->outputPath

보호된 메소드들

메소드 설명
atLeastOneExport ( array $chapters ) : boolean Does array of chapters have at least one export? Recursive.
isPdf ( string $file ) : boolean Verify if file has 'application/pdf' mimeType.

비공개 메소드들

메소드 설명
stripUnwantedStyles ( array $styles ) : array Helper function to omit unwanted stylesheets in the output

메소드 상세

__construct() 공개 메소드

public __construct ( )

addBookInfo() 공개 메소드

Add book information page, otherwise known as title page
public addBookInfo ( )

addCopyright() 공개 메소드

Copyright information on a separate page
public addCopyright ( )

addCover() 공개 메소드

Add the cover for the book.
public addCover ( )

addFrontMatter() 공개 메소드

Adds front matter, resets the page numbering on the first loop, romanizes the numeric style
public addFrontMatter ( array $contents )
$contents array

addFrontMatterByType() 공개 메소드

Add front matter of a specific/special type
public addFrontMatterByType ( string $type, array $contents )
$type string - special content placed ahead of everything else
$contents array - book contents

addPage() 공개 메소드

Add a page to the pdf
public addPage ( array $page, array $page_options = [], boolean $display_footer = true, boolean $display_header = true ) : boolean
$page array - the content
$page_options array - numbering reset, style, suppress adding to TOC
$display_footer boolean turn on/off footer display
$display_header boolean turn on/off header display
리턴 boolean

addPartsAndChapters() 공개 메소드

public addPartsAndChapters ( $contents )

addPreContent() 공개 메소드

Add all specially handled content.
public addPreContent ( array $contents )
$contents array - the book

addToc() 공개 메소드

Note, the functionality of the TOC is limited: its behavior varies according mirrored margin settings, and will always generate blank pages after. http://mpdf1.com/forum/discussion/comment/6417#Comment_6417
public addToc ( )

atLeastOneExport() 보호된 메소드

Does array of chapters have at least one export? Recursive.
protected atLeastOneExport ( array $chapters ) : boolean
$chapters array
리턴 boolean

convert() 공개 메소드

Book Assembly. Create $this->outputPath
public convert ( ) : boolean
리턴 boolean

fixAnnoyingCharacters() 공개 메소드

This function prevents mPDF from completely aborting the export routine, or replacing each non-breaking space with a '?' if ignore_invalid_utf8 is true. Important to leave this in.
public fixAnnoyingCharacters ( string $html ) : string
$html string
리턴 string

getBookmarkEntry() 공개 메소드

Return the PDF bookmark entry for this page should be unique, using static variable for cheap cache
public getBookmarkEntry ( array $page ) : string
$page array
리턴 string

getFilteredContent() 공개 메소드

Cleans up html
public getFilteredContent ( string $content ) : string
$content string
리턴 string

getFooter() 공개 메소드

Return formatted footers.
public getFooter ( boolean $display = true, string $content = '' ) : string
$display boolean
$content string The post type being added to the page.
리턴 string

getHeader() 공개 메소드

Return formatted headers.
public getHeader ( boolean $display = true, string $content = '' ) : string
$display boolean
$content string The post type being added to the page
리턴 string

getOrderedBookContents() 공개 메소드

Restructures \Pressbooks\Book::getBookContents() into a format more useful for direct iteration, and tracks a nesting level for Bookmark and ToC entries.
public getOrderedBookContents ( ) : array
리턴 array

getThemeCss() 공개 메소드

Get current child and parent theme css files. Child themes only have one parent theme, and 99% of the time this is 'Luther' or /pressbooks-book/ whose stylesheet is named 'style.css'
public getThemeCss ( object $theme ) : string
$theme object
리턴 string $css

getTocEntry() 공개 메소드

Return the Table of Contents entry for this page.
public getTocEntry ( string $page ) : string
$page string
리턴 string

hasDependencies() 정적인 공개 메소드

Dependency check.
static public hasDependencies ( ) : boolean
리턴 boolean

isPdf() 보호된 메소드

Verify if file has 'application/pdf' mimeType.
protected isPdf ( string $file ) : boolean
$file string
리턴 boolean

setCss() 공개 메소드

Add all css files
public setCss ( )

validate() 공개 메소드

Check the sanity of $this->outputPath
public validate ( ) : boolean
리턴 boolean

프로퍼티 상세

$bookMeta 보호되어 있는 프로퍼티

Book Metadata
protected array $bookMeta
리턴 array

$bookTitle 보호되어 있는 프로퍼티

Holds the title of the book being published
protected string $bookTitle
리턴 string

$exportStylePath 보호되어 있는 프로퍼티

Fullpath to book CSS file.
protected string $exportStylePath
리턴 string

$globalOptions 보호되어 있는 프로퍼티

Global theme options, set by the user
protected array $globalOptions
리턴 array

$memoryNeeded 보호되어 있는 프로퍼티

mPDF uses a lot of memory, this the recommended minimum
또한 보기: http://mpdf1.com/manual/index.php?tid=408
protected int $memoryNeeded
리턴 integer

$mpdf 보호되어 있는 프로퍼티

MPDF Class
protected object $mpdf
리턴 object

$numbered 보호되어 있는 프로퍼티

Number the chapters
protected bool $numbered
리턴 boolean

$options 보호되어 있는 프로퍼티

mPDF theme options, set by the user
protected array $options
리턴 array