Note that there are some explanatory texts on larger screens.

plurals
  1. POZend Framework PDF multiline problems
    primarykey
    data
    text
    <p>I have a problem, with Zend_PDF multiline, my problem is that I <strong>can't write the entire text</strong> to my pdf.My text looks like this: <a href="http://pastebin.com/f6413f664" rel="noreferrer">http://pastebin.com/f6413f664</a></p> <p>But when I open my .pdf file, the text looks like this: <a href="http://screencast.com/t/1CBjvRodeZQd" rel="noreferrer">http://screencast.com/t/1CBjvRodeZQd</a></p> <p>And here is my code:</p> <pre><code> public function pdfAction() { $this-&gt;_helper-&gt;layout-&gt;disableLayout(); $this-&gt;_helper-&gt;viewRenderer-&gt;setNoRender(); $theID = ($this-&gt;_getParam('id') !== NULL) ? (int)$this-&gt;_getParam('id') : false; ($theID === false) ? $this-&gt;_redirect('/home') : false; //Information $info = $this-&gt;artists-&gt;artistInfo($theID); // Create new PDF $pdf = new Zend_Pdf(); $pdf-&gt;properties['Title'] = "TITLE"; $pdf-&gt;properties['Author'] = "AUTHOR"; // Add new page to the document $page = $pdf-&gt;newPage(Zend_Pdf_Page::SIZE_A4); $pdf-&gt;pages[] = $page; // Set font $page-&gt;setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 8); // Draw text foreach (explode("&lt;/p&gt;", $info[0]['biography']) as $i =&gt; $line) { $page-&gt;drawText($line, 0, 820 - $i * 10, 'UTF-8'); } $this-&gt;getResponse()-&gt;setHeader('Content-type', 'application/x-pdf', true); $this-&gt;getResponse()-&gt;setHeader('Content-disposition', 'attachment; filename=my-file.pdf', true); $this-&gt;getResponse()-&gt;setBody($pdf-&gt;render()); } </code></pre> <p>What I want to do, is for every <code>&lt;p&gt;</code> to have a break(<code>&lt;br /&gt;</code>\n) and to display the entire text.</p> <p>Any solutions guys?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload