Ejemplo n.º 1
0
 public function testRenderCustomStyleAndAdditionalPdfParts()
 {
     $docbook = new ezcDocumentDocbook();
     $docbook->loadFile(dirname(__FILE__) . '/../files/pdf/long_text.xml');
     $pdfDoc = new ezcDocumentPdf(new ezcDocumentPdfOptions(array('driver' => new ezcDocumentPdfSvgDriver())));
     $pdfDoc->loadStyles(dirname(__FILE__) . '/../files/pdf/custom.css');
     $pdfDoc->registerPdfPart(new ezcDocumentPdfHeaderPdfPart());
     $pdfDoc->createFromDocbook($docbook);
     $pdf = (string) $pdfDoc;
     file_put_contents($this->tempDir . ($fileName = __CLASS__ . '_' . __FUNCTION__ . '.svg'), $pdf);
     $this->assertXmlFileEqualsXmlFile($this->basePath . 'renderer/' . $fileName, $this->tempDir . $fileName);
 }
Ejemplo n.º 2
0
<?php

require 'tutorial_autoload.php';
// Convert some input RSTfile to docbook
$document = new ezcDocumentRst();
$document->loadFile('./article/introduction.txt');
$pdf = new ezcDocumentPdf();
$pdf->options->errorReporting = E_PARSE | E_ERROR | E_WARNING;
$pdf->createFromDocbook($document->getAsDocbook());
file_put_contents(__FILE__ . '.pdf', $pdf);
Ejemplo n.º 3
0
<?php

require 'tutorial_autoload.php';
// Convert some input RSTfile to docbook
$document = new ezcDocumentRst();
$document->loadFile('./article/introduction.txt');
// Load the docbook document and create a PDF from it
$pdf = new ezcDocumentPdf();
$pdf->options->errorReporting = E_PARSE | E_ERROR | E_WARNING;
// Load a custom style sheet
$pdf->loadStyles('custom.css');
// Add a customized footer
$pdf->registerPdfPart(new ezcDocumentPdfFooterPdfPart(new ezcDocumentPdfFooterOptions(array('showDocumentTitle' => false, 'showDocumentAuthor' => false, 'height' => '10mm'))));
// Add a customized header
$pdf->registerPdfPart(new ezcDocumentPdfHeaderPdfPart(new ezcDocumentPdfFooterOptions(array('showPageNumber' => false, 'height' => '10mm'))));
$pdf->createFromDocbook($document->getAsDocbook());
file_put_contents(__FILE__ . '.pdf', $pdf);