Свойство | Тип | Описание | |
---|---|---|---|
$encodeHTML | |||
$isGifImagesEnabled | getImage will convert these if it can, unless this is set to TRUE. | ||
$isLogging | |||
$isReferencesAddedToToc | |||
$maxImageHeight | |||
$maxImageWidth | |||
$pluginDir | |||
$referencesOrder | If this list is overwritten it MUST contain at least "text" as an element. | ||
$splitDefaultSize | |||
$viewportMap |
Метод | Описание | |
---|---|---|
DANGER_getNcx ( ) : null | PHPePub\Core\Structure\Ncx | The Ncx data isn't generated before the ePub is finalized. | |
DANGER_getOpf ( ) : null | |
The Opf data isn't generated before the ePub is finalized. | |
DANGER_getZip ( ) : null | |
The Zip file isn't completed before the ePub is finalized, however files added ARE packed and written to it immediately, and their contents can't be altered. | |
__construct ( string $bookVersion = EPub::BOOK_VERSION_EPUB2, string $languageCode = 'en', string $writingDirection = EPub::DIRECTION_LEFT_TO_RIGHT ) | Class constructor. | |
__destruct ( ) : void | Class destructor | |
addCSSFile ( string $fileName, string $fileId, string $fileData, integer $externalReferences = EPub::EXTERNAL_REF_IGNORE, string $baseDir = "" ) : boolean | Add a CSS file to the book. | |
addChapter ( string $chapterName, string $fileName, string $chapterData = null, boolean $autoSplit = false, integer $externalReferences = EPub::EXTERNAL_REF_IGNORE, string $baseDir = "" ) : mixed | Add a chapter to the book, as a chapter should not exceed 250kB, you can parse an array with multiple parts as $chapterData. | |
addCustomMetaProperty ( string $name, string $content ) | Add a Meta property value to the metadata | |
addCustomMetaValue ( PHPePub\Core\Structure\OPF\MetaValue $value ) | Add a custom meta data value to the OPF metadata. | |
addCustomMetadata ( string $name, string $content ) | Add custom metadata to the book. | |
addCustomNamespace ( string $nsName, string $nsURI ) | ||
addCustomPrefix ( string $name, string $URI ) | Add a prefix declaration to the OPF file. | |
addDublinCoreMetadata ( string $dublinCoreConstant, string $value ) | Add DublinCore metadata to the book | |
addEPub3TOC ( string $fileName, string $tocData ) : boolean | ||
addFile ( string $fileName, string $fileId, string $fileData, string $mimetype ) : boolean | Add dynamically generated data as a file to the book. | |
addFileToMETAINF ( string $fileName, string $fileData ) : boolean | Add a file to the META-INF directory. | |
addLargeFile ( string $fileName, string $fileId, string $filePath, string $mimetype ) : boolean | Add a large file directly from the filestystem to the book. | |
addReferencePage ( string $pageName, string $fileName, string $pageData, string $reference, integer $externalReferences = EPub::EXTERNAL_REF_IGNORE, string $baseDir = "" ) : boolean | Reference pages is usually one or two pages for items such as Table of Contents, reference lists, Author notes or Acknowledgements. | |
backLevel ( ) | Step back one chapter level. | |
buildEPub3TOC ( string $cssFileName = null, string $title = "Table of Contents" ) : string | ||
buildTOC ( string $cssFileName = null, string $tocCSSClass = "toc", string $title = "Table of Contents", boolean $addReferences = true, boolean $addToIndex = false, string $tocFileName = "TOC.xhtml" ) : boolean | Build the Table of Contents. This is not strictly necessary, as most eReaders will build it from the navigation structure in the .ncx file. | |
extractIdAttributes ( string $partName, string $chapterData ) | ||
finalize ( ) : boolean | Check for mandatory parameters and finalize the e-book. | |
findIdAttributes ( string $chapterData ) : array | find all id attributes in the html document. | |
getAuthor ( ) : string | Get Book author. | |
getBook ( ) : string | Return the finalized book. | |
getBookSize ( ) : string | Return the finalized book size. | |
getChapterCount ( ) : number | Get Book Chapter count. | |
getCoverage ( ) : string | Get Book coverage. | |
getCurrentLevel ( ) : integer | Get current level count. | |
getDate ( ) : string | Get Book date. | |
getDescription ( ) : string | Get Book description. | |
getFileList ( ) : array | Retrieve an array of file names currently added to the book. | |
getGenerator ( ) : string | Get the book relation. | |
getIdentifier ( ) : string | Get Book identifier. | |
getIdentifierType ( ) : string | Get Book identifierType. | |
getLanguage ( ) : string | Get Book language. | |
getLog ( ) : string | ||
getPublisherName ( ) : string | Get Book publisherName. | |
getPublisherURL ( ) : string | Get Book publisherURL. | |
getRelation ( ) : string | Get the book relation. | |
getRights ( ) : string | Get Book rights. | |
getSourceURL ( ) : string | Get Book sourceURL. | |
getSplitSize ( ) : integer | Get the chapter target size. | |
getTitle ( ) : string | Get Book title. | |
getViewportMetaLine ( ) : string | Generate the viewport meta line if the viewport is set. | |
isEPubVersion2 ( ) : boolean | ||
isFinalized ( ) : boolean | Get Book status. | |
rootLevel ( ) | Step back to the root level. | |
saveBook ( string $fileName, string $baseDir = '.' ) : string | Save the ePub file to local disk. | |
sendBook ( string $fileName ) : string | boolean | Send the book as a zip download | |
setAuthor ( string $author, string $authorSortKey ) : boolean | Book author or creator, optional. | |
setBookRoot ( string $bookRoot ) | The bookRoot is the root directory inside the ePub book, defaults to "OEBPS/" | |
setCoverImage ( string $fileName, string $imageData = null, string $mimetype = null ) : boolean | Add a cover image to the book. | |
setCoverage ( string $coverage ) : boolean | Coverage, optional. | |
setCurrentLevel ( integer $newLevel ) | Step back to the given level. | |
setDangermode ( boolean $dangermode ) | Set or clear "Dangermode" | |
setDate ( integer $timestamp ) : boolean | Release date, optional. If left blank, the time of the finalization will be used. | |
setDescription ( string $description ) : boolean | Book description, optional. | |
setGenerator ( string $generator ) | Set book Generator. | |
setIdentifier ( string $identifier, string $identifierType ) : boolean | Unique book identifier, mandatory. | |
setLanguage ( string $language ) : boolean | Book language, mandatory | |
setPublisher ( string $publisherName, string $publisherURL ) : boolean | Publisher Information, optional. | |
setReferencesTitle ( string $referencesTitle = "Guide", string $referencesId = "", string $referencesClass = "references" ) : boolean | Set the references title for the ePub 3 landmarks section | |
setRelation ( string $relation ) | Set book Relation. | |
setRights ( string $rightsText ) : boolean | Book (copy)rights, optional. | |
setShortDateFormat ( ) : boolean | Set ePub date formate to the short yyyy-mm-dd form, for compliance with a bug in EpubCheck, prior to its version 1.1. | |
setSourceURL ( string $sourceURL ) : boolean | Book source URL, optional. | |
setSplitSize ( integer $size ) : void | Set default chapter target size. | |
setSubject ( string $subject ) | Add book Subject. | |
setTitle ( string $title ) : boolean | Book title, mandatory. | |
setViewport ( integer | string $width = null, integer $height = null ) | Viewport is used for fixed-layout books, specifically ePub 3 books using the Rendition metadata. | |
setisReferencesAddedToToc ( boolean $isReferencesAddedToToc = true ) : boolean | Set the references title for the ePub 3 landmarks section | |
subLevel ( string $navTitle = null, string $navId = null, string $navClass = null, boolean $isNavHidden = false, string $writingDirection = null ) : boolean | |
Add one chapter level. |
Метод | Описание | |
---|---|---|
processCSSExternalReferences ( &$cssFile, integer $externalReferences = EPub::EXTERNAL_REF_ADD, string $baseDir = "", string $cssDir = "" ) : boolean | Process images referenced from an CSS file to the book. | |
processChapterExternalReferences ( &$doc, integer $externalReferences = EPub::EXTERNAL_REF_ADD, string $baseDir = "", string $htmlDir = "" ) : boolean | Process external references from a HTML to the book. The chapter itself is not stored. | |
processChapterImages ( &$xmlDoc, integer $externalReferences = EPub::EXTERNAL_REF_ADD, string $baseDir = "", string $htmlDir = "", string $backPath = "" ) : boolean | Process img tags in a DOMDocument. | |
processChapterLinks ( &$xmlDoc, integer $externalReferences = EPub::EXTERNAL_REF_ADD, string $baseDir = "", string $htmlDir = "", string $backPath = "" ) : boolean | Process link tags in a DOMDocument. Linked files will be loaded into the archive, and the link src will be rewritten to point to that location. | |
processChapterSources ( &$xmlDoc, integer $externalReferences = EPub::EXTERNAL_REF_ADD, string $baseDir = "", string $htmlDir = "", string $backPath = "" ) : boolean | Process source tags in a DOMDocument. | |
processChapterStyles ( &$xmlDoc, integer $externalReferences = EPub::EXTERNAL_REF_ADD, string $baseDir = "", string $htmlDir = "" ) : boolean | Process style tags in a DOMDocument. Styles will be passed as CSS files and reinserted into the document. | |
resolveImage ( string $source, &$internalPath, &$internalSrc, &$isSourceExternal, string $baseDir = "", string $htmlDir = "" ) : boolean | Resolve an image src and determine it's target location and add it to the book. | |
resolveMedia ( string $source, string &$internalPath, string &$internalSrc, string &$isSourceExternal, string $baseDir = "", string $htmlDir = "" ) : boolean | Resolve a media src and determine it's target location and add it to the book. |
Метод | Описание | |
---|---|---|
finalizeTOC ( ) : boolean | Finalize and build final ePub structures. | |
initialize ( ) | initialize defaults. | |
setUp ( ) | ||
wrapChapter ( $content ) : string | Wrap ChapterContent with Head and Footer |
public DANGER_getNcx ( ) : null | PHPePub\Core\Structure\Ncx | ||
Результат | null | PHPePub\Core\Structure\Ncx | The Ncx Navigation class |
public DANGER_getOpf ( ) : null | |
||
Результат | null | |
the Opf structure class. |
public DANGER_getZip ( ) : null | |
||
Результат | null | |
The actual zip file. |
public addCSSFile ( string $fileName, string $fileId, string $fileData, integer $externalReferences = EPub::EXTERNAL_REF_IGNORE, string $baseDir = "" ) : boolean | ||
$fileName | string | Filename to use for the CSS file, must be unique for the book. |
$fileId | string | Unique identifier for the file. |
$fileData | string | CSS data |
$externalReferences | integer | How to handle external references, EPub::EXTERNAL_REF_IGNORE, EPub::EXTERNAL_REF_ADD or EPub::EXTERNAL_REF_REMOVE_IMAGES? See documentation for processCSSExternalReferences for explanation. Default is EPub::EXTERNAL_REF_IGNORE. |
$baseDir | string | Default is "", meaning it is pointing to the document root. NOT used if $externalReferences is set to EPub::EXTERNAL_REF_IGNORE. |
Результат | boolean | $success |
public addChapter ( string $chapterName, string $fileName, string $chapterData = null, boolean $autoSplit = false, integer $externalReferences = EPub::EXTERNAL_REF_IGNORE, string $baseDir = "" ) : mixed | ||
$chapterName | string | Name of the chapter, will be use din the TOC |
$fileName | string | Filename to use for the chapter, must be unique for the book. |
$chapterData | string | Chapter text in XHTML or array $chapterData valid XHTML data for the chapter. File should NOT exceed 250kB. |
$autoSplit | boolean | Should the chapter be split if it exceeds the default split size? Default=FALSE, only used if $chapterData is a string. |
$externalReferences | integer | How to handle external references, EPub::EXTERNAL_REF_IGNORE, EPub::EXTERNAL_REF_ADD or EPub::EXTERNAL_REF_REMOVE_IMAGES? See documentation for processChapterExternalReferences for explanation. Default is EPub::EXTERNAL_REF_IGNORE. |
$baseDir | string | Default is "", meaning it is pointing to the document root. NOT used if $externalReferences is set to EPub::EXTERNAL_REF_IGNORE. |
Результат | mixed | $success FALSE if the addition failed, else the new NavPoint. |
public addCustomMetaProperty ( string $name, string $content ) | ||
$name | string | property name, including the namespace declaration, ie. "dcterms:modified" |
$content | string |
public addCustomMetaValue ( PHPePub\Core\Structure\OPF\MetaValue $value ) | ||
$value | PHPePub\Core\Structure\OPF\MetaValue |
public addCustomMetadata ( string $name, string $content ) | ||
$name | string | |
$content | string |
public addCustomNamespace ( string $nsName, string $nsURI ) | ||
$nsName | string | |
$nsURI | string |
public addCustomPrefix ( string $name, string $URI ) | ||
$name | string | |
$URI | string |
public addDublinCoreMetadata ( string $dublinCoreConstant, string $value ) | ||
$dublinCoreConstant | string | name |
$value | string |
public addFile ( string $fileName, string $fileId, string $fileData, string $mimetype ) : boolean | ||
$fileName | string | Filename to use for the file, must be unique for the book. |
$fileId | string | Unique identifier for the file. |
$fileData | string | File data |
$mimetype | string | file mime type |
Результат | boolean | $success |
public addLargeFile ( string $fileName, string $fileId, string $filePath, string $mimetype ) : boolean | ||
$fileName | string | Filename to use for the file, must be unique for the book. |
$fileId | string | Unique identifier for the file. |
$filePath | string | File path |
$mimetype | string | file mime type |
Результат | boolean | $success |
public addReferencePage ( string $pageName, string $fileName, string $pageData, string $reference, integer $externalReferences = EPub::EXTERNAL_REF_IGNORE, string $baseDir = "" ) : boolean | ||
$pageName | string | Name of the chapter, will be use din the TOC |
$fileName | string | Filename to use for the chapter, must be unique for the book. |
$pageData | string | Page content in XHTML. File should NOT exceed 250kB. |
$reference | string | Reference key |
$externalReferences | integer | How to handle external references. See documentation for processChapterExternalReferences for explanation. Default is EPub::EXTERNAL_REF_IGNORE. |
$baseDir | string | Default is "", meaning it is pointing to the document root. NOT used if $externalReferences is set to EPub::EXTERNAL_REF_IGNORE. |
Результат | boolean | $success |
public backLevel ( ) |
public buildTOC ( string $cssFileName = null, string $tocCSSClass = "toc", string $title = "Table of Contents", boolean $addReferences = true, boolean $addToIndex = false, string $tocFileName = "TOC.xhtml" ) : boolean | ||
$cssFileName | string | Include a link to this css file in the TOC html. |
$tocCSSClass | string | The TOC is a , if you need special formatting, you can add a css class for that div. Default is "toc". |
$title | string | Title of the Table of contents. Default is "Table of Contents". Use this for ie. languages other than English. |
$addReferences | boolean | include reference pages in the TOC, using the $referencesOrder array to determine the order of the pages in the TOC. Default is TRUE. |
$addToIndex | boolean | Add the TOC to the NCX index at the current leve/position. Default is FALSE |
$tocFileName | string | Change the default name of the TOC file. The default is "TOC.xhtml" |
Результат | boolean |
public extractIdAttributes ( string $partName, string $chapterData ) | ||
$partName | string | |
$chapterData | string |
public findIdAttributes ( string $chapterData ) : array | ||
$chapterData | string | |
Результат | array |
public getBookSize ( ) : string | ||
Результат | string |
public getChapterCount ( ) : number | ||
Результат | number | of chapters |
public getCoverage ( ) : string | ||
Результат | string | $coverage |
public getCurrentLevel ( ) : integer | ||
Результат | integer | current level count; |
public getDescription ( ) : string | ||
Результат | string | $description |
public getFileList ( ) : array | ||
Результат | array | file list |
public getGenerator ( ) : string | ||
Результат | string | The generator identity string. |
public getIdentifier ( ) : string | ||
Результат | string | $identifier |
public getIdentifierType ( ) : string | ||
Результат | string | $identifierType |
public getLanguage ( ) : string | ||
Результат | string | $language |
public getPublisherName ( ) : string | ||
Результат | string | $publisherName |
public getPublisherURL ( ) : string | ||
Результат | string | $publisherURL |
public getRelation ( ) : string | ||
Результат | string | The relation. |
public getSourceURL ( ) : string | ||
Результат | string | $sourceURL |
public getSplitSize ( ) : integer | ||
Результат | integer | $size |
public getViewportMetaLine ( ) : string | ||
Результат | string | the meta data line, or an empty string if no viewport is defined. |
protected processCSSExternalReferences ( &$cssFile, integer $externalReferences = EPub::EXTERNAL_REF_ADD, string $baseDir = "", string $cssDir = "" ) : boolean | ||
$externalReferences | integer | How to handle external references, EPub::EXTERNAL_REF_IGNORE, EPub::EXTERNAL_REF_ADD or EPub::EXTERNAL_REF_REMOVE_IMAGES? Default is EPub::EXTERNAL_REF_ADD. |
$baseDir | string | Default is "", meaning it is pointing to the document root. |
$cssDir | string | The of the CSS file's directory from the root of the archive. |
Результат | boolean | FALSE if unsuccessful (book is finalized or $externalReferences == EXTERNAL_REF_IGNORE). |
<img src="../images/image.png"/>
$externalReferences determines how the function will handle external references. protected processChapterExternalReferences ( &$doc, integer $externalReferences = EPub::EXTERNAL_REF_ADD, string $baseDir = "", string $htmlDir = "" ) : boolean | ||
$externalReferences | integer | How to handle external references, EPub::EXTERNAL_REF_IGNORE, EPub::EXTERNAL_REF_ADD or EPub::EXTERNAL_REF_REMOVE_IMAGES? Default is EPub::EXTERNAL_REF_ADD. |
$baseDir | string | Default is "", meaning it is pointing to the document root. |
$htmlDir | string | The path to the parent HTML file's directory from the root of the archive. |
Результат | boolean | false if unsuccessful (book is finalized or $externalReferences == EXTERNAL_REF_IGNORE). |
protected processChapterImages ( &$xmlDoc, integer $externalReferences = EPub::EXTERNAL_REF_ADD, string $baseDir = "", string $htmlDir = "", string $backPath = "" ) : boolean | ||
$externalReferences | integer | How to handle external references, EPub::EXTERNAL_REF_IGNORE, EPub::EXTERNAL_REF_ADD or EPub::EXTERNAL_REF_REMOVE_IMAGES? Default is EPub::EXTERNAL_REF_ADD. |
$baseDir | string | Default is "", meaning it is pointing to the document root. |
$htmlDir | string | The path to the parent HTML file's directory from the root of the archive. |
$backPath | string | The path to get back to the root of the archive from $htmlDir. |
Результат | boolean | FALSE if uncuccessful (book is finalized or $externalReferences == EXTERNAL_REF_IGNORE). |
protected processChapterLinks ( &$xmlDoc, integer $externalReferences = EPub::EXTERNAL_REF_ADD, string $baseDir = "", string $htmlDir = "", string $backPath = "" ) : boolean | ||
$externalReferences | integer | How to handle external references, EPub::EXTERNAL_REF_IGNORE, EPub::EXTERNAL_REF_ADD or EPub::EXTERNAL_REF_REMOVE_IMAGES? Default is EPub::EXTERNAL_REF_ADD. |
$baseDir | string | Default is "", meaning it is pointing to the document root. |
$htmlDir | string | The path to the parent HTML file's directory from the root of the archive. |
$backPath | string | The path to get back to the root of the archive from $htmlDir. |
Результат | boolean | FALSE if uncuccessful (book is finalized or $externalReferences == EXTERNAL_REF_IGNORE). |
protected processChapterSources ( &$xmlDoc, integer $externalReferences = EPub::EXTERNAL_REF_ADD, string $baseDir = "", string $htmlDir = "", string $backPath = "" ) : boolean | ||
$externalReferences | integer | How to handle external references, EPub::EXTERNAL_REF_IGNORE, EPub::EXTERNAL_REF_ADD or EPub::EXTERNAL_REF_REMOVE_IMAGES? Default is EPub::EXTERNAL_REF_ADD. |
$baseDir | string | Default is "", meaning it is pointing to the document root. |
$htmlDir | string | The path to the parent HTML file's directory from the root of the archive. |
$backPath | string | The path to get back to the root of the archive from $htmlDir. |
Результат | boolean | FALSE if uncuccessful (book is finalized or $externalReferences == EXTERNAL_REF_IGNORE). |
protected processChapterStyles ( &$xmlDoc, integer $externalReferences = EPub::EXTERNAL_REF_ADD, string $baseDir = "", string $htmlDir = "" ) : boolean | ||
$externalReferences | integer | How to handle external references, EPub::EXTERNAL_REF_IGNORE, EPub::EXTERNAL_REF_ADD or EPub::EXTERNAL_REF_REMOVE_IMAGES? Default is EPub::EXTERNAL_REF_ADD. |
$baseDir | string | Default is "", meaning it is pointing to the document root. |
$htmlDir | string | The path to the parent HTML file's directory from the root of the archive. |
Результат | boolean | FALSE if uncuccessful (book is finalized or $externalReferences == EXTERNAL_REF_IGNORE). |
protected resolveImage ( string $source, &$internalPath, &$internalSrc, &$isSourceExternal, string $baseDir = "", string $htmlDir = "" ) : boolean | ||
$source | string | Image Source link. |
$baseDir | string | Default is "", meaning it is pointing to the document root. |
$htmlDir | string | The path to the parent HTML file's directory from the root of the archive. |
Результат | boolean |
protected resolveMedia ( string $source, string &$internalPath, string &$internalSrc, string &$isSourceExternal, string $baseDir = "", string $htmlDir = "" ) : boolean | ||
$source | string | Source link. |
$internalPath | string | (referenced) Return value, will be set to the target path and name in the book. |
$internalSrc | string | (referenced) Return value, will be set to the target name in the book. |
$isSourceExternal | string | (referenced) Return value, will be set to TRUE if the image originated from a full URL. |
$baseDir | string | Default is "", meaning it is pointing to the document root. |
$htmlDir | string | The path to the parent HTML file's directory from the root of the archive. |
Результат | boolean |
public rootLevel ( ) |
public setBookRoot ( string $bookRoot ) | ||
$bookRoot | string |
public setCoverImage ( string $fileName, string $imageData = null, string $mimetype = null ) : boolean | ||
$fileName | string | Filename to use for the image, must be unique for the book. |
$imageData | string | Binary image data |
$mimetype | string | Image mimetype, such as "image/jpeg" or "image/png". |
Результат | boolean | $success |
public setCoverage ( string $coverage ) : boolean | ||
$coverage | string | |
Результат | boolean | $success |
public setCurrentLevel ( integer $newLevel ) | ||
$newLevel | integer |
public setDangermode ( boolean $dangermode ) | ||
$dangermode | boolean |
public setDescription ( string $description ) : boolean | ||
$description | string | |
Результат | boolean | $success |
public setGenerator ( string $generator ) | ||
$generator | string |
public setLanguage ( string $language ) : boolean | ||
$language | string | |
Результат | boolean | $success |
public setRelation ( string $relation ) | ||
$relation | string |
public setShortDateFormat ( ) : boolean | ||
Результат | boolean | $success |
public setSourceURL ( string $sourceURL ) : boolean | ||
$sourceURL | string | |
Результат | boolean | $success |
public setSplitSize ( integer $size ) : void | ||
$size | integer | segment size in bytes |
Результат | void |
public setSubject ( string $subject ) | ||
$subject | string |
public setisReferencesAddedToToc ( boolean $isReferencesAddedToToc = true ) : boolean | ||
$isReferencesAddedToToc | boolean | |
Результат | boolean |
public subLevel ( string $navTitle = null, string $navId = null, string $navClass = null, boolean $isNavHidden = false, string $writingDirection = null ) : boolean | |
||
$navTitle | string | |
$navId | string | |
$navClass | string | |
$isNavHidden | boolean | |
$writingDirection | string | |
Результат | boolean | |
The new NavPoint for that level. |
public $isGifImagesEnabled |
public $referencesOrder |