Pressbooks\Modules\Export\Mpdf\Pdf::addBookInfo PHP Method

addBookInfo() public method

Add book information page, otherwise known as title page
public addBookInfo ( )
    function addBookInfo()
    {
        $page_options = array('suppress' => 'on', 'margin-left' => 15, 'margin-right' => 15);
        $content = '<div id="title-page">';
        $content .= '<h1 class="title">' . $this->bookTitle . '</h1>';
        if (!empty($this->bookMeta['pb_subtitle'])) {
            $content .= '<h2 class="subtitle">' . $this->bookMeta['pb_subtitle'] . '</h2>';
        }
        if (isset($this->bookMeta['pb_author'])) {
            $content .= '<h3 class="author">' . $this->bookMeta['pb_author'] . '</h3>';
        }
        if (isset($this->bookMeta['pb_contributing_authors'])) {
            $content .= '<h4 class="contributing-authors">' . $this->bookMeta['pb_contributing_authors'] . '</h4>';
        }
        if (isset($this->bookMeta['pb_print_isbn'])) {
            $content .= '<p class="isbn"><strong>' . __('ISBN', 'pressbooks') . '</strong>: ' . $this->bookMeta['pb_print_isbn'] . '</p>';
        }
        if (isset($this->bookMeta['pb_publisher'])) {
            $content .= '<p class="publisher">' . $this->bookMeta['pb_publisher'] . '</p>';
        }
        if (isset($this->bookMeta['pb_publisher_city'])) {
            $content .= '<p class="publisher-city">' . $this->bookMeta['pb_publisher_city'] . '</p>';
        }
        $content .= '</div>';
        $page = array('post_title' => '', 'post_content' => $content, 'post_type' => 'bookinfo', 'mpdf_level' => 1, 'mpdf_omit_toc' => true);
        $this->addPage($page, $page_options, false, false);
    }