当前位置: 首页>>代码示例>>PHP>>正文


PHP mPDF::TOC_Entry方法代码示例

本文整理汇总了PHP中mPDF::TOC_Entry方法的典型用法代码示例。如果您正苦于以下问题:PHP mPDF::TOC_Entry方法的具体用法?PHP mPDF::TOC_Entry怎么用?PHP mPDF::TOC_Entry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mPDF的用法示例。


在下文中一共展示了mPDF::TOC_Entry方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createPdf


//.........这里部分代码省略.........
                    }
                    $suppChapters = true;
                }
            }
            for ($i = 0; $i < count($chapters); $i++) {
                $htmlEncode = array('name', 'author');
                foreach ($htmlEncode as $encode) {
                    $chapters[$i][$encode] = htmlentities($chapters[$i][$encode], ENT_QUOTES, "UTF-8");
                }
                $document = new TransformDoc();
                $document->setStrFile($chapters[$i]['src'], $chapters[$i]['dir']);
                $document->generateXHTML();
                //problem, here
                $document->validatorXHTML();
                if ($chapterCount == 1) {
                    $contentPreg = $this->stripTagsAddChapters($document->getStrXHTML());
                    $contentPreg = ltrim($contentPreg);
                    if (substr($contentPreg, 0, 13) == "<pagebreak />") {
                        $contentPreg = substr_replace($contentPreg, '', 0, 13);
                    }
                    $mpdf->addPage('', '', '', '', 'On');
                    $mpdf->PageNumSubstitutions[] = array('from' => $mpdf->page + 1, 'reset' => 1, 'type' => '1', 'suppress' => 'off');
                    $mpdf->WriteHTML("<div class='content'>", 2);
                    $mpdf->WriteHTML($contentPreg, 2);
                    if ($suppChapters == true) {
                        foreach ($chapters as $chapter) {
                            if (isset($chapter['type']) && $chapter['type'] == "supp") {
                                $document = new TransformDoc();
                                $document->setStrFile($chapter['src'], $chapter['dir']);
                                $document->generateXHTML();
                                $document->validatorXHTML();
                                if ($authorBiographies > 1) {
                                    $contentPreg = $this->stripTags($document->getStrXHTML());
                                    $mpdf->TOC_Entry($chapter['name']);
                                    $mpdf->WriteHTML("<pagebreak />" . $contentPreg, 2);
                                } else {
                                    $addAuthorBiographyToBack = true;
                                    $authorBiography = $this->stripTags($document->getStrXHTML());
                                }
                            }
                        }
                    }
                    break;
                } else {
                    $contentPreg = $this->stripTags($document->getStrXHTML());
                    $contentPreg = ltrim($contentPreg);
                    if (substr($contentPreg, 0, 13) == "<pagebreak />") {
                        $contentPreg = substr_replace($contentPreg, '', 0, 13);
                    }
                    if ($i != 0) {
                        $prepend = "<pagebreak />";
                    } else {
                        $mpdf->addPage('', 'E', '', '', 'On');
                        $mpdf->PageNumSubstitutions[] = array('from' => $mpdf->page + 1, 'reset' => 1, 'type' => '1', 'suppress' => 'off');
                        $mpdf->WriteHTML("<div class='content'>", 2);
                    }
                    if ($imprintType == "atomistic") {
                        $mpdf->WriteHTML($prepend . "<tocentry content='" . $chapters[$i]['name'] . "' level='0' />" . $contentPreg, 2);
                    } elseif ($imprintType == "collection") {
                        if ($chapters[$i]['description'] != "") {
                            $introduction = "<div class='submissionIntro'><h1>" . $chapters[$i]['author'] . "</h1>" . $this->stripTags($chapters[$i]['description'], true) . "</div><pagebreak /><tocentry content='" . $chapters[$i]['name'] . " by " . $chapters[$i]['author'] . "' level='0' />";
                        }
                        $mpdf->WriteHTML($prepend . $introduction . $contentPreg, 2);
                    }
                }
            }
开发者ID:master3395,项目名称:CBPPlatform,代码行数:67,代码来源:PdfConvert.inc.php

示例2: mPDF

<?php

include './mpdf/mpdf.php';
$mpdf = new mPDF();
$mpdf->TOCpagebreak();
$mpdf->TOC_Entry("X Acknowledgements");
$mpdf->Output();
exit;
开发者ID:arai13,项目名称:poster-URPC,代码行数:8,代码来源:test.php

示例3:

        </div>';

      $mpdf->TOCpagebreakByArray(array(
        'TOCuseLinking' => true,
        'toc_ohname' => 'indice',
        'toc_ohvalue' => 1,
        'toc_preHTML' => $previo, 
        'toc_postHTML' => $post,
        'resetpagenum' => 2,
        'ohname' => 'indice',
        'ohvalue' => 1,
        ));

      $valida = 0;
      $mpdf->WriteHTML('<b><h2>1. Objetivo General</h2></b>');
      $mpdf->TOC_Entry('<b style="font-family: roboto-light">1. Objetivo General</b>', 0);
      if($row["objetivo"] == ''){
        $mpdf->WriteHTML('<div style="text-align:justify;">No Aplica.</div>');
        $altura = $mpdf->y;
        if($altura > 205){
          $mpdf->AddPage();
        } else {
          $mpdf->WriteHTML('<br>');
        }
      }
      else {  
        $mpdf->WriteHTML('<div style="text-align:justify;">'.$row["objetivo"].'</div>');
        $altura = $mpdf->y;
        if($altura > 205){
          $mpdf->AddPage();
        } else {
开发者ID:vnavarrou,项目名称:Procedimientos,代码行数:31,代码来源:muestraPDF.php

示例4: strtoupper

$mpdf->WriteHTML("<p style='font-size: 16px; text-align: left; float: left;'><i> Students: </i></span>");
$mpdf->WriteHTML("<columnbreak />");
$mpdf->WriteHTML("<p style='font-size: 16px; text-align: right; float: right;'><i> Faculty: </i> </span>");
$mpdf->WriteHTML("</div>");
$mpdf->TOCpagebreak(array('toc-preHTML' => '<h1> Contents </h1>'));
$mpdf->AddPage('P', 'Letter', '1');
//$mpdf->WriteHTML('<pagebreak resetpagenum="1" />');
$mpdf->WriteHTML('<columns column-count="2" column-gap="17" />');
$mpdf->keepColumns = true;
$mpdf->pagenumPrefix = "Page ";
$mpdf->SetHeader('{PAGENO}');
foreach ($sql as $name => $dep) {
    $result = $conn->query($dep);
    $mpdf->WriteHTML('<h4 class="text-align: center"> ' . strtoupper($name) . '</h4>');
    $letter = 'A';
    $mpdf->TOC_Entry($name, 0);
    if ($result->num_rows > 0) {
        while ($row = $result->fetch_assoc()) {
            $text = $row['abstract'];
            $title = $row['title'];
            $mpdf->TOC_Entry($title, 1);
            $text = iconv("UTF-8", "UTF-8//IGNORE", $text);
            $title = iconv("UTF-8", "UTF-8//IGNORE", $title);
            $authors = array();
            array_push($authors, $row['pauthor']);
            // getting authors
            $app_id = $row['app_id'];
            $author_sql = "SELECT author_name FROM authors WHERE app_id='{$app_id}'";
            $author_result = $conn->query($author_sql);
            if ($author_result->num_rows > 0) {
                while ($auth = $author_result->fetch_assoc()) {
开发者ID:arai13,项目名称:poster-URPC,代码行数:31,代码来源:print.php


注:本文中的mPDF::TOC_Entry方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。