Please note, once finalized a book can no longer have chapters of data added or changed. License: GNU LGPL 2.1. Thanks to: Adam Schmalhofer and Kirstyn Fox for invaluable input and for "nudging" me in the right direction :)
Author: A. Grandt (php@grandt.com)
Beispiel #1
0
 /**
  * @param EPub   $book
  * @param string $seriesName
  * @param string $seriesIndex
  * @param string $sortTitle
  */
 public static function setCalibreMetadata($book, $seriesName, $seriesIndex, $sortTitle = null)
 {
     $book->addCustomMetadata("calibre:series", $seriesName);
     $book->addCustomMetadata("calibre:series_index", "" . $seriesIndex);
     if (!empty($sortTitle)) {
         $book->addCustomMetadata("calibre:title_sort", $sortTitle);
     }
 }
Beispiel #2
0
 /**
  *
  * @param string $title
  * @param string $cssFileName
  *
  * @return string
  */
 function finalizeEPub3($title = "Table of Contents", $cssFileName = null)
 {
     $end = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" . "<html xmlns=\"http://www.w3.org/1999/xhtml\"\n" . "      xmlns:epub=\"http://www.idpf.org/2007/ops\"\n" . "      xml:lang=\"" . $this->languageCode . "\" lang=\"" . $this->languageCode . "\" dir=\"" . $this->writingDirection . "\">\n" . "\t<head>\n" . "\t\t<title>" . $this->docTitle . "</title>\n" . "\t\t<meta http-equiv=\"default-style\" content=\"text/html; charset=utf-8\"/>\n";
     if ($this->parentBook !== null) {
         $end .= $this->parentBook->getViewportMetaLine();
     }
     if ($cssFileName !== null) {
         $end .= "\t\t<link rel=\"stylesheet\" href=\"" . $cssFileName . "\" type=\"text/css\"/>\n";
     }
     $end .= "\t</head>\n" . "\t<body epub:type=\"frontmatter toc\">\n" . "\t\t<header>\n" . "\t\t\t<h1>" . $title . "</h1>\n" . "\t\t</header>\n" . $this->navMap->finalizeEPub3() . $this->finalizeEPub3Landmarks() . "\t</body>\n" . "</html>\n";
     return $end;
 }
Beispiel #3
0
use PHPePub\Core\Structure\OPF\MetaValue;
use PHPZip\Zip\File\Zip;
error_reporting(E_ALL | E_STRICT);
ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 1);
// Example.
// Create a test book for download.
// ePub uses XHTML 1.1, preferably strict.
$content_start = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\n" . "    \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n" . "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n" . "<head>" . "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n" . "<link rel=\"stylesheet\" type=\"text/css\" href=\"styles.css\" />\n" . "<title>Test Book</title>\n" . "</head>\n" . "<body>\n";
$bookEnd = "</body>\n</html>\n";
// setting timezone for time functions used for logging to work properly
date_default_timezone_set('Europe/Berlin');
$log = new Logger("Example", TRUE);
$fileDir = './PHPePub';
// Default is EPub::BOOK_VERSION_EPUB2
$book = new EPub();
$log->logLine("new EPub()");
$log->logLine("EPub class version.: " . EPub::VERSION);
$log->logLine("Zip version........: " . Zip::VERSION);
$log->logLine("getCurrentServerURL: " . $book->getCurrentServerURL());
$log->logLine("getCurrentPageURL..: " . $book->getCurrentPageURL());
// Title and Identifier are mandatory!
$book->setTitle("Test book");
$book->setIdentifier("http://JohnJaneDoePublications.com/books/TestBook.html", EPub::IDENTIFIER_URI);
// Could also be the ISBN number, preferred for published books, or a UUID.
$book->setLanguage("en");
// Not needed, but included for the example, Language is mandatory, but EPub defaults to "en". Use RFC3066 Language codes, such as "en", "da", "fr" etc.
$book->setDescription("This is a brief description\nA test ePub book as an example of building a book in PHP");
$book->setAuthor("John Doe Johnson", "Johnson, John Doe");
$book->setPublisher("John and Jane Doe Publications", "http://JohnJaneDoePublications.com/");
// I hope this is a non existent address :)
Beispiel #4
0
use PHPePub\Helpers\CalibreHelper;
use PHPePub\Helpers\iBooks\IBooksHelper;
use PHPePub\Helpers\iBooks\Orientation;
use PHPePub\Helpers\Rendition\RenditionHelper;
use PHPePub\Helpers\URLHelper;
use PHPZip\Zip\File\Zip;
error_reporting(E_ALL | E_STRICT);
ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 1);
// setting timezone for time functions used for logging to work properly
date_default_timezone_set('Europe/Berlin');
$log = new Logger("Example", TRUE);
$fileDir = './PHPePub';
// ePub 3 is not fully implemented. but aspects of it is, in order to help implementers.
// ePub 3 uses HTML5, formatted strictly as if it was XHTML but still using just the HTML5 doctype (aka XHTML5)
$book = new EPub(EPub::BOOK_VERSION_EPUB3, "en", EPub::DIRECTION_LEFT_TO_RIGHT);
// Default is ePub 2
$log->logLine("new EPub()");
$log->logLine("EPub class version.: " . EPub::VERSION);
$log->logLine("Zip version........: " . Zip::VERSION);
$log->logLine("getCurrentServerURL: " . URLHelper::getCurrentServerURL());
$log->logLine("getCurrentPageURL..: " . URLHelper::getCurrentPageURL());
// Title and Identifier are mandatory!
$book->setTitle("ePub 3 Test book");
$book->setIdentifier("http://JohnJaneDoePublications.com/books/TestBookEPub3.xhtml", EPub::IDENTIFIER_URI);
// Could also be the ISBN number, preferred for published books, or a UUID.
$book->setLanguage("en");
// Not needed, but included for the example, Language is mandatory, but EPub defaults to "en". Use RFC3066 Language codes, such as "en", "da", "fr" etc.
$book->setDescription("This is a brief description\nA test ePub book as an example of building a book in PHP");
$book->setAuthor("John Doe Johnson", "Johnson, John Doe");
$book->setPublisher("John and Jane Doe Publications", "http://JohnJaneDoePublications.com/");
Beispiel #5
0
 /**
  * Use PHPePub to dump a .epub file.
  *
  * @return Response
  */
 private function produceEpub()
 {
     /*
      * Start and End of the book
      */
     $content_start = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" . "<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:epub=\"http://www.idpf.org/2007/ops\">\n" . '<head>' . "<meta http-equiv=\"Default-Style\" content=\"text/html; charset=utf-8\" />\n" . "<title>wallabag articles book</title>\n" . "</head>\n" . "<body>\n";
     $bookEnd = "</body>\n</html>\n";
     $book = new EPub(EPub::BOOK_VERSION_EPUB3);
     /*
      * Book metadata
      */
     $book->setTitle($this->title);
     // Could also be the ISBN number, prefered for published books, or a UUID.
     $book->setIdentifier($this->title, EPub::IDENTIFIER_URI);
     // Not needed, but included for the example, Language is mandatory, but EPub defaults to "en". Use RFC3066 Language codes, such as "en", "da", "fr" etc.
     $book->setLanguage($this->language);
     $book->setDescription('Some articles saved on my wallabag');
     foreach ($this->authors as $author) {
         $book->setAuthor($author, $author);
     }
     // I hope this is a non existant address :)
     $book->setPublisher('wallabag', 'wallabag');
     // Strictly not needed as the book date defaults to time().
     $book->setDate(time());
     $book->setSourceURL($this->wallabagUrl);
     $book->addDublinCoreMetadata(DublinCore::CONTRIBUTOR, 'PHP');
     $book->addDublinCoreMetadata(DublinCore::CONTRIBUTOR, 'wallabag');
     /*
      * Front page
      */
     if (file_exists($this->logoPath)) {
         $book->setCoverImage('Cover.png', file_get_contents($this->logoPath), 'image/png');
     }
     $book->addChapter('Notices', 'Cover2.html', $content_start . $this->getExportInformation('PHPePub') . $bookEnd);
     $book->buildTOC();
     /*
      * Adding actual entries
      */
     // set tags as subjects
     foreach ($this->entries as $entry) {
         foreach ($entry->getTags() as $tag) {
             $book->setSubject($tag->getLabel());
         }
         // the reader in Kobo Devices doesn't likes special caracters
         // in filenames, we limit to A-z/0-9
         $filename = preg_replace('/[^A-Za-z0-9\\-]/', '', $entry->getTitle());
         $chapter = $content_start . $entry->getContent() . $bookEnd;
         $book->addChapter($entry->getTitle(), htmlspecialchars($filename) . '.html', $chapter, true, EPub::EXTERNAL_REF_ADD);
     }
     return Response::create($book->getBook(), 200, ['Content-Description' => 'File Transfer', 'Content-type' => 'application/epub+zip', 'Content-Disposition' => 'attachment; filename="' . $this->title . '.epub"', 'Content-Transfer-Encoding' => 'binary']);
 }
Beispiel #6
0
<?php

include 'vendor/autoload.php';
use PHPePub\Core\EPub;
error_reporting(E_ALL | E_STRICT);
ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 1);
// Example.
// Create a test book for download.
// ePub uses XHTML 1.1, preferably strict.
$book = new EPub();
$book->setTitle("Test book");
$book->setIdentifier("http://JohnJaneDoePublications.com/books/TestBook.html", EPub::IDENTIFIER_URI);
// Could also be the ISBN number, preferred for published books, or a UUID.
$book->setLanguage("en");
// Not needed, but included for the example, Language is mandatory, but EPub defaults to "en". Use RFC3066 Language codes, such as "en", "da", "fr" etc.
$book->setDescription("This is a brief description\nA test ePub book as an example of building a book in PHP");
$book->setAuthor("John Doe Johnson", "Johnson, John Doe");
$book->setPublisher("John and Jane Doe Publications", "http://JohnJaneDoePublications.com/");
// I hope this is a non existent address :)
$book->setDate(time());
// Strictly not needed as the book date defaults to time().
$book->setRights("Copyright and licence information specific for the book.");
// As this is generated, this _could_ contain the name or licence information of the user who purchased the book, if needed. If this is used that way, the identifier must also be made unique for the book.
$book->setSourceURL("http://JohnJaneDoePublications.com/books/TestBook.html");
$book->isGifImagesEnabled = TRUE;
$cssData = "body {\n  margin-left: .5em;\n  margin-right: .5em;\n  text-align: justify;\n}\n\np {\n  font-family: serif;\n  font-size: 10pt;\n  text-align: justify;\n  text-indent: 1em;\n  margin-top: 0px;\n  margin-bottom: 1ex;\n}\n\nh1, h2 {\n  font-family: sans-serif;\n  font-style: italic;\n  text-align: center;\n  background-color: #6b879c;\n  color: white;\n  width: 100%;\n}\n\nh1 {\n    margin-bottom: 2px;\n}\n\nh2 {\n    margin-top: -2px;\n    margin-bottom: 2px;\n}\n";
$book->addCSSFile("Styles/styles.css", "css1", $cssData);
$content_start = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\n" . "    \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n" . "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n" . "<head>" . "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n" . "<link rel=\"stylesheet\" type=\"text/css\" href=\"../Styles/styles.css\" />\n" . "<title>Test Book</title>\n" . "</head>\n" . "<body>\n";
$bookEnd = "</body>\n</html>\n";
//$fileDir = './PHPePub/tests/';
use PHPePub\Core\Structure\OPF\DublinCore;
use PHPePub\Core\Logger;
use PHPZip\Zip\File\Zip;
error_reporting(E_ALL | E_STRICT);
ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 1);
// Example.
// Create a test book for download.
// ePub uses XHTML 1.1, preferably strict.
$content_start = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\n" . "    \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n" . "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n" . "<head>" . "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n" . "<link rel=\"stylesheet\" type=\"text/css\" href=\"styles.css\" />\n" . "<title>Test Book</title>\n" . "</head>\n" . "<body>\n";
$bookEnd = "</body>\n</html>\n";
// setting timezone for time functions used for logging to work properly
date_default_timezone_set('Europe/Berlin');
$log = new Logger("Example", TRUE);
$fileDir = './PHPePub';
$book = new EPub();
// Default is EPub::BOOK_VERSION_EPUB2
$log->logLine("new EPub()");
$log->logLine("EPub class version.: " . EPub::VERSION);
$log->logLine("Zip version........: " . Zip::VERSION);
$log->logLine("getCurrentServerURL: " . $book->getCurrentServerURL());
$log->logLine("getCurrentPageURL..: " . $book->getCurrentPageURL());
// Title and Identifier are mandatory!
$book->setTitle("Test book");
$book->setIdentifier("http://JohnJaneDoePublications.com/books/TestBook.html", EPub::IDENTIFIER_URI);
// Could also be the ISBN number, preferred for published books, or a UUID.
$book->setLanguage("en");
// Not needed, but included for the example, Language is mandatory, but EPub defaults to "en". Use RFC3066 Language codes, such as "en", "da", "fr" etc.
$book->setDescription("This is a brief description\nA test ePub book as an example of building a book in PHP");
$book->setAuthor("John Doe Johnson", "Johnson, John Doe");
$book->setPublisher("John and Jane Doe Publications", "http://JohnJaneDoePublications.com/");
include 'vendor/autoload.php';
use PHPePub\Core\EPub;
error_reporting(E_ALL | E_STRICT);
ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 1);
// Example.
// Create a test book for download.
// ePub uses XHTML 1.1, preferably strict.
// This is the minimalistic version.
// This is for the example, this is the XHTML 1.1 header
$content_start = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\n" . "    \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n" . "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n" . "<head>" . "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n" . "<link rel=\"stylesheet\" type=\"text/css\" href=\"styles.css\" />\n" . "<title>Test Book</title>\n" . "</head>\n" . "<body>\n";
$bookEnd = "</body>\n</html>\n";
// setting timezone for time functions used for logging to work properly
date_default_timezone_set('Europe/Berlin');
$fileDir = './PHPePub';
$book = new EPub();
// no arguments gives us the default ePub 2, lang=en and dir="ltr"
// Title and Identifier are mandatory!
$book->setTitle("Simple Test book");
$book->setIdentifier("http://JohnJaneDoePublications.com/books/TestBookSimple.html", EPub::IDENTIFIER_URI);
// Could also be the ISBN number, preferrd for published books, or a UUID.
$book->setLanguage("en");
// Not needed, but included for the example, Language is mandatory, but EPub defaults to "en". Use RFC3066 Language codes, such as "en", "da", "fr" etc.
$book->setDescription("This is a brief description\nA test ePub book as an example of building a book in PHP");
$book->setAuthor("John Doe Johnson", "Johnson, John Doe");
$book->setPublisher("John and Jane Doe Publications", "http://JohnJaneDoePublications.com/");
// I hope this is a non existent address :)
$book->setDate(time());
// Strictly not needed as the book date defaults to time().
$book->setRights("Copyright and licence information specific for the book.");
// As this is generated, this _could_ contain the name or licence information of the user who purchased the book, if needed. If this is used that way, the identifier must also be made unique for the book.
Beispiel #9
0
 /**
  * @param EPub   $book
  * @param string $value "landscape", "portrait" or "auto"
  */
 public static function setSpread($book, $value)
 {
     if (!$book->isEPubVersion2() && $value === self::SPREAD_NONE || $value === self::SPREAD_LANDSCAPE || $value === self::SPREAD_PORTRAIT || $value === self::SPREAD_BOTH || $value === self::SPREAD_AUTO) {
         $book->addCustomMetaProperty(self::RENDITION_SPREAD, $value);
     }
 }
Beispiel #10
0
 /**
  * @param EPub $book
  * @param bool $value
  */
 public static function setBinding($book, $value)
 {
     if (!$book->isEPubVersion2()) {
         $book->addCustomMetaProperty(self::EPUB3_BINDING, Boolean::getBoolean($value));
     }
 }
 /**
  * @return \Symfony\Component\HttpFoundation\StreamedResponse
  */
 public function streamResponse()
 {
     $this->epub->sendBook($this->filename);
 }
Beispiel #12
0
use PHPePub\Core\EPub;
use PHPePub\Helpers\CalibreHelper;
error_reporting(E_ALL | E_STRICT);
ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 1);
// Example.
// Create a test book for download.
// ePub uses XHTML 1.1, preferably strict.
// This is the minimalistic version.
// This is for the example, this is the XHTML 1.1 header
$content_start = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\n" . "    \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n" . "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n" . "<head>" . "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n" . "<link rel=\"stylesheet\" type=\"text/css\" href=\"styles.css\" />\n" . "<title>Test Book</title>\n" . "</head>\n" . "<body>\n";
$bookEnd = "</body>\n</html>\n";
// setting timezone for time functions used for logging to work properly
date_default_timezone_set('Europe/Berlin');
$fileDir = './PHPePub';
$book = new EPub();
// no arguments gives us the default ePub 2, lang=en and dir="ltr"
// Title and Identifier are mandatory!
$book->setTitle("Simple Test book");
$book->setIdentifier("http://JohnJaneDoePublications.com/books/TestBookSimple.html", EPub::IDENTIFIER_URI);
// Could also be the ISBN number, preferrd for published books, or a UUID.
$book->setLanguage("en");
// Not needed, but included for the example, Language is mandatory, but EPub defaults to "en". Use RFC3066 Language codes, such as "en", "da", "fr" etc.
$book->setDescription("This is a brief description\nA test ePub book as an example of building a book in PHP");
$book->setAuthor("John Doe Johnson", "Johnson, John Doe");
$book->setPublisher("John and Jane Doe Publications", "http://JohnJaneDoePublications.com/");
// I hope this is a non existent address :)
$book->setDate(time());
// Strictly not needed as the book date defaults to time().
$book->setRights("Copyright and licence information specific for the book.");
// As this is generated, this _could_ contain the name or licence information of the user who purchased the book, if needed. If this is used that way, the identifier must also be made unique for the book.
Beispiel #13
0
use PHPZip\Zip\File\Zip;
error_reporting(E_ALL | E_STRICT);
ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 1);
// Example.
// Create a test book for download.
// ePub 3 uses a variant of HTML5 called XHTML5
$content_start = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" . "<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:epub=\"http://www.idpf.org/2007/ops\">\n" . "<head>" . "<meta http-equiv=\"Default-Style\" content=\"text/html; charset=utf-8\" />\n" . "<link rel=\"stylesheet\" type=\"text/css\" href=\"styles.css\" />\n" . "<title>Test Book</title>\n" . "</head>\n" . "<body>\n";
$bookEnd = "</body>\n</html>\n";
// setting timezone for time functions used for logging to work properly
date_default_timezone_set('Europe/Berlin');
$log = new Logger("Example", TRUE);
$fileDir = './PHPePub';
// ePub 3 is not fully implemented. but aspects of it is, in order to help implementers.
// ePub 3 uses HTML5, formatted strictly as if it was XHTML but still using just the HTML5 doctype (aka XHTML5)
$book = new EPub(EPub::BOOK_VERSION_EPUB3, "en", EPub::DIRECTION_LEFT_TO_RIGHT);
// Default is ePub 2
$log->logLine("new EPub()");
$log->logLine("EPub class version.: " . EPub::VERSION);
$log->logLine("Zip version........: " . Zip::VERSION);
$log->logLine("getCurrentServerURL: " . $book->getCurrentServerURL());
$log->logLine("getCurrentPageURL..: " . $book->getCurrentPageURL());
// Title and Identifier are mandatory!
$book->setTitle("ePub 3 Test book");
$book->setIdentifier("http://JohnJaneDoePublications.com/books/TestBookEPub3.html", EPub::IDENTIFIER_URI);
// Could also be the ISBN number, preferred for published books, or a UUID.
$book->setLanguage("en");
// Not needed, but included for the example, Language is mandatory, but EPub defaults to "en". Use RFC3066 Language codes, such as "en", "da", "fr" etc.
$book->setDescription("This is a brief description\nA test ePub book as an example of building a book in PHP");
$book->setAuthor("John Doe Johnson", "Johnson, John Doe");
$book->setPublisher("John and Jane Doe Publications", "http://JohnJaneDoePublications.com/");
use PHPZip\Zip\File\Zip;
error_reporting(E_ALL | E_STRICT);
ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 1);
// Example.
// Create a test book for download.
// ePub 3 uses a variant of HTML5 called XHTML5
$content_start = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" . "<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:epub=\"http://www.idpf.org/2007/ops\">\n" . "<head>" . "<meta http-equiv=\"Default-Style\" content=\"text/html; charset=utf-8\" />\n" . "<link rel=\"stylesheet\" type=\"text/css\" href=\"styles.css\" />\n" . "<title>Test Book</title>\n" . "</head>\n" . "<body>\n";
$bookEnd = "</body>\n</html>\n";
// setting timezone for time functions used for logging to work properly
date_default_timezone_set('Europe/Berlin');
$log = new Logger("Example", TRUE);
$fileDir = './PHPePub';
// ePub 3 is not fully implemented. but aspects of it is, in order to help implementers.
// ePub 3 uses HTML5, formatted strictly as if it was XHTML but still using just the HTML5 doctype (aka XHTML5)
$book = new EPub(EPub::BOOK_VERSION_EPUB3, "en", EPub::DIRECTION_LEFT_TO_RIGHT);
// Default is ePub 2
$log->logLine("new EPub()");
$log->logLine("EPub class version.: " . EPub::VERSION);
$log->logLine("Zip version........: " . Zip::VERSION);
$log->logLine("getCurrentServerURL: " . $book->getCurrentServerURL());
$log->logLine("getCurrentPageURL..: " . $book->getCurrentPageURL());
// Title and Identifier are mandatory!
$book->setTitle("ePub 3 Test book");
$book->setIdentifier("http://JohnJaneDoePublications.com/books/TestBookEPub3.html", EPub::IDENTIFIER_URI);
// Could also be the ISBN number, preferred for published books, or a UUID.
$book->setLanguage("en");
// Not needed, but included for the example, Language is mandatory, but EPub defaults to "en". Use RFC3066 Language codes, such as "en", "da", "fr" etc.
$book->setDescription("This is a brief description\nA test ePub book as an example of building a book in PHP");
$book->setAuthor("John Doe Johnson", "Johnson, John Doe");
$book->setPublisher("John and Jane Doe Publications", "http://JohnJaneDoePublications.com/");
Beispiel #15
0
 /**
  * @param EPub $book
  * @param bool $value
  */
 function setEPub3IBooksBinding($book, $value)
 {
     $book->addCustomMetaProperty(Properties::EPUB3_BINDING, $this->getIBookBoolean($value));
 }