PDF generation, no content

Please report bugs here!

Moderator: Thorsten

Post Reply
BCooper
Posts: 19
Joined: Mon Jul 01, 2013 10:37 am

PDF generation, no content

Post by BCooper » Tue Aug 13, 2013 3:54 am

Not sure if this is a bug or not, has anyone seen it where the PDF's are generated without the actual content, everything else seems to be there. See attached.
PDFCapture.PNG
You do not have the required permissions to view the files attached to this post.

Thorsten
Posts: 14793
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: PDF generation, no content

Post by Thorsten » Tue Aug 13, 2013 2:56 pm

Hi,

which version do you use?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

BCooper
Posts: 19
Joined: Mon Jul 01, 2013 10:37 am

Re: PDF generation, no content

Post by BCooper » Tue Aug 13, 2013 10:25 pm

2.8.2, Microsoft-IIS/7.5, PHP 5.4.16, sqlsrv

Update 1:

If I edit \phpmyfaq\inc\PMF\Export\Pdf.php.
Change line 208 from: $this->pdf->WriteHTML(str_replace('../', '', $faqData['content']), true);
To: $this->pdf->WriteHTML('<p>hello world</p>', true);

It works, I see 'hello world' appear.

If I echo out $faqData['content'] it looks something like this;

Code: Select all

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat vestibulum facilisis.</p>
<p>Vestibulum pulvinar 'arcu' sed aliquam aliquam.<br /><br /></p>
<p><img src="/images/1_5a4d4e619049137b2e0dfbb0692a958f.jpg" alt="" /><br /><br /></p>
<p>Mauris interdum magna pulvinar sodales porttitor. Aenean ut mollis mi. Duis sed eleifend diam. Nunc vehicula eget libero in posuere.</p>
<p><img src="/images/1_0917a1309cc508ce60d7f8a30945cedf.jpg" alt="" /></p>
<p>Â </p>
<p>Donec faucibus nec ligula et mattis.  'Nulla ' facilisi. Suspendisse congue adipiscing bibendum.</p>
<p>Â <img src="/images/1_0be63bffa4ecd98e2950abf54ce369a8.jpg" alt="" /></p>
<p>Sed varius, nisi id condimentum varius, enim metus semper lacus, sed convallis risus velit 'id enim'.</p>
<p><img src="/images/1_2ae4b16ae01d98ffe881caab6409580e.jpg" alt="" /></p>
<p>Â </p>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>
<p><img src="/images/1_8815168f7e26542dfe22409c6add9001.jpg" alt="" /></p>
<p>Â </p>
Update 2:

Appears to be some kind of encoding issue?

If I edit \phpmyfaq\inc\PMF\Export\Pdf.php.
Change line 208 to: $this->pdf->WriteHTML(str_replace("\xc2\xa0",' ',str_replace('../', '', $faqData['content'])), true);

It works, Getting rid of the 'Â' character seems to allow the content to generate.


References:
PHP Parsing Problem - &nbsp; and  http://stackoverflow.com/questions/4515 ... m-nbsp-and

Post Reply