$tool_path), WATCHDOG_ERROR); throw new Exception("Configured EPUB tool does not exist, unable to generate EPUB."); } // Try to use local file access for image files. $html = _print_access_images_via_file($html, $images_via_file); $version = _print_epub_phpepub_version($epub_tool[1]); // Set document information. if (version_compare($version, '4.0.0', '>=')) { $epub = new \PHPePub\Core\EPub(); } else { $epub = new EPub(); } $epub->setTitle(html_entity_decode($meta['title'], ENT_QUOTES, 'UTF-8')); $epub->setIdentifier($meta['url'], $epub::IDENTIFIER_URI); $epub->setLanguage($language->language); if (isset($meta['name'])) { $epub->setAuthor(strip_tags($meta['name']), strip_tags($meta['name'])); } $epub->setPublisher(variable_get('site_name', 'Drupal'), $base_url); $epub->setSourceURL($meta['url']); @$epub->addChapter("Chapter", "epub.html", $html, FALSE); // Finalize the book, and build the archive. $epub->finalize(); // Close and output EPUB document. $epub->sendBook(empty($filename) ? 'page' : $filename); return TRUE; }