Grandt / PHPePub

PHP Classes for dynamically generating EPub files.
http://www.phpclasses.org/package/6115
241 stars 83 forks source link

How can I set reference/landmark type for specific pages/chapters? #46

Closed W3Extensions closed 7 years ago

W3Extensions commented 7 years ago

I'm having difficulty creating a valid EPUB3 file due to missing landmarks in the generated epub3toc.xhtml file.

The Cover and TOC are added, but I don't know how to define my colophon, preface, forward, etc. This is a big problem for generating iBooks-valid ePub files.

W3Extensions commented 7 years ago

I found the solution. For anyone trying to solve this issue, you needed to use addReference instead of addChapter. (See EPub.php).

addReferencePage($pageName, $fileName, $pageData, $reference, $externalReferences = EPub::EXTERNAL_REF_IGNORE, $baseDir = "")