<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Images not working in dompdf</title>
	<atom:link href="http://www.flashnutz.com/2009/08/images-not-working-in-dompdf/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.flashnutz.com/2009/08/images-not-working-in-dompdf/</link>
	<description>HELPING WEB DEVELOPERS DEVELOP</description>
	<lastBuildDate>Tue, 27 Dec 2011 09:46:11 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: escope</title>
		<link>http://www.flashnutz.com/2009/08/images-not-working-in-dompdf/comment-page-1/#comment-11954</link>
		<dc:creator>escope</dc:creator>
		<pubDate>Fri, 02 Dec 2011 14:56:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.flashnutz.com/2009/08/images-not-working-with-dompdf/#comment-11954</guid>
		<description>Hey, thanks for that tip... i was struggeling for 1 hour with this and forgot to check the google... your article was on 1st place ... Thank you very very much</description>
		<content:encoded><![CDATA[<p>Hey, thanks for that tip&#8230; i was struggeling for 1 hour with this and forgot to check the google&#8230; your article was on 1st place &#8230; Thank you very very much</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pito</title>
		<link>http://www.flashnutz.com/2009/08/images-not-working-in-dompdf/comment-page-1/#comment-11886</link>
		<dc:creator>Pito</dc:creator>
		<pubDate>Wed, 23 Nov 2011 15:17:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.flashnutz.com/2009/08/images-not-working-with-dompdf/#comment-11886</guid>
		<description>I am using dompdf to generate the PDF file and swift to email it to my email address. I am able to generate the PDF file with all the information and I get it in my email but I am having issues with images. For some reason I can’t get the images to appear in my PDF file, I get a small red X.

Here is what I have for my code:



 $val)
		$post-&gt;$key = trim(strip_tags($_POST[$key]));
		
	// Check for blank fields
	if (empty($post-&gt;name) OR empty($post-&gt;dob) OR empty($post-&gt;age) OR empty($post-&gt;address) OR empty($post-&gt;city) OR empty($post-&gt;state) OR empty($post-&gt;zip) OR empty($post-&gt;email) OR empty($post-&gt;phone) OR empty($post-&gt;name2) OR empty($post-&gt;cell2) OR empty($post-&gt;name4) OR empty($post-&gt;phone4) OR empty($post-&gt;signature))
		$error = true;
		
	else {
		
		// Get this directory, to include other files from
		$dir = dirname(__FILE__);
		
		// Get the contents of the pdf into a variable for later
		ob_start();
		require_once($dir.&#039;/pdf.php&#039;);
		$pdf_html = ob_get_contents();
		ob_end_clean();
		
		// Load the dompdf files
		require_once($dir.&#039;/dompdf/dompdf_config.inc.php&#039;);
		
		$dompdf = new DOMPDF(); // Create new instance of dompdf
		$dompdf-&gt;load_html($pdf_html); // Load the html
		$dompdf-&gt;render(); // Parse the html, convert to PDF
		$pdf_content = $dompdf-&gt;output(); // Put contents of pdf into variable for later
		
		// Get the contents of the HTML email into a variable for later
		ob_start();
		require_once($dir.&#039;/html.php&#039;);
		$html_message = ob_get_contents();
		ob_end_clean();
		
		// Load the SwiftMailer files
		require_once($dir.&#039;/swift/swift_required.php&#039;);

		$mailer = new Swift_Mailer(new Swift_MailTransport()); // Create new instance of SwiftMailer

		$message = Swift_Message::newInstance()
				       -&gt;setSubject(&#039;FODT Registration Form&#039;) // Message subject
					   -&gt;setTo(array(&#039;my email address@gmail.com&#039; =&gt; &#039;Registration&#039;)) // Array of people to send to
					   -&gt;setFrom(array(&#039;no-reply@gmail.com.org&#039; =&gt; &#039;FODT&#039;)) // From:
					   -&gt;setBody($html_message, &#039;text/html&#039;) // Attach that HTML message from earlier
					   -&gt;attach(Swift_Attachment::newInstance($pdf_content, &#039;DiveRegForm.pdf&#039;, &#039;application/pdf&#039;)); // Attach the generated PDF from earlier
		
		// Send the email, and show user message
		if ($mailer-&gt;send($message))
			$success = true;
		else
			$error = true;
		
	}

}
?&gt;</description>
		<content:encoded><![CDATA[<p>I am using dompdf to generate the PDF file and swift to email it to my email address. I am able to generate the PDF file with all the information and I get it in my email but I am having issues with images. For some reason I can’t get the images to appear in my PDF file, I get a small red X.</p>
<p>Here is what I have for my code:</p>
<p> $val)<br />
		$post-&gt;$key = trim(strip_tags($_POST[$key]));</p>
<p>	// Check for blank fields<br />
	if (empty($post-&gt;name) OR empty($post-&gt;dob) OR empty($post-&gt;age) OR empty($post-&gt;address) OR empty($post-&gt;city) OR empty($post-&gt;state) OR empty($post-&gt;zip) OR empty($post-&gt;email) OR empty($post-&gt;phone) OR empty($post-&gt;name2) OR empty($post-&gt;cell2) OR empty($post-&gt;name4) OR empty($post-&gt;phone4) OR empty($post-&gt;signature))<br />
		$error = true;</p>
<p>	else {</p>
<p>		// Get this directory, to include other files from<br />
		$dir = dirname(__FILE__);</p>
<p>		// Get the contents of the pdf into a variable for later<br />
		ob_start();<br />
		require_once($dir.&#8217;/pdf.php&#8217;);<br />
		$pdf_html = ob_get_contents();<br />
		ob_end_clean();</p>
<p>		// Load the dompdf files<br />
		require_once($dir.&#8217;/dompdf/dompdf_config.inc.php&#8217;);</p>
<p>		$dompdf = new DOMPDF(); // Create new instance of dompdf<br />
		$dompdf-&gt;load_html($pdf_html); // Load the html<br />
		$dompdf-&gt;render(); // Parse the html, convert to PDF<br />
		$pdf_content = $dompdf-&gt;output(); // Put contents of pdf into variable for later</p>
<p>		// Get the contents of the HTML email into a variable for later<br />
		ob_start();<br />
		require_once($dir.&#8217;/html.php&#8217;);<br />
		$html_message = ob_get_contents();<br />
		ob_end_clean();</p>
<p>		// Load the SwiftMailer files<br />
		require_once($dir.&#8217;/swift/swift_required.php&#8217;);</p>
<p>		$mailer = new Swift_Mailer(new Swift_MailTransport()); // Create new instance of SwiftMailer</p>
<p>		$message = Swift_Message::newInstance()<br />
				       -&gt;setSubject(&#8216;FODT Registration Form&#8217;) // Message subject<br />
					   -&gt;setTo(array(&#8216;my email <a href="mailto:address@gmail.com">address@gmail.com</a>&#8216; =&gt; &#8216;Registration&#8217;)) // Array of people to send to<br />
					   -&gt;setFrom(array(&#8216;no-reply@gmail.com.org&#8217; =&gt; &#8216;FODT&#8217;)) // From:<br />
					   -&gt;setBody($html_message, &#8216;text/html&#8217;) // Attach that HTML message from earlier<br />
					   -&gt;attach(Swift_Attachment::newInstance($pdf_content, &#8216;DiveRegForm.pdf&#8217;, &#8216;application/pdf&#8217;)); // Attach the generated PDF from earlier</p>
<p>		// Send the email, and show user message<br />
		if ($mailer-&gt;send($message))<br />
			$success = true;<br />
		else<br />
			$error = true;</p>
<p>	}</p>
<p>}<br />
?&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.flashnutz.com/2009/08/images-not-working-in-dompdf/comment-page-1/#comment-11729</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Thu, 03 Nov 2011 16:26:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.flashnutz.com/2009/08/images-not-working-with-dompdf/#comment-11729</guid>
		<description>Thank you guy ! seems I own you a beer too !</description>
		<content:encoded><![CDATA[<p>Thank you guy ! seems I own you a beer too !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wayne</title>
		<link>http://www.flashnutz.com/2009/08/images-not-working-in-dompdf/comment-page-1/#comment-11346</link>
		<dc:creator>Wayne</dc:creator>
		<pubDate>Mon, 26 Sep 2011 12:27:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.flashnutz.com/2009/08/images-not-working-with-dompdf/#comment-11346</guid>
		<description>Thanks... I was pulling the little hair I left out until I found this page!

Geo Paul you are a Legend!</description>
		<content:encoded><![CDATA[<p>Thanks&#8230; I was pulling the little hair I left out until I found this page!</p>
<p>Geo Paul you are a Legend!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leon</title>
		<link>http://www.flashnutz.com/2009/08/images-not-working-in-dompdf/comment-page-1/#comment-11216</link>
		<dc:creator>Leon</dc:creator>
		<pubDate>Mon, 12 Sep 2011 20:40:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.flashnutz.com/2009/08/images-not-working-with-dompdf/#comment-11216</guid>
		<description>Thank you, this post probably saved me a lot of frustration.</description>
		<content:encoded><![CDATA[<p>Thank you, this post probably saved me a lot of frustration.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: abdullah</title>
		<link>http://www.flashnutz.com/2009/08/images-not-working-in-dompdf/comment-page-1/#comment-11183</link>
		<dc:creator>abdullah</dc:creator>
		<pubDate>Thu, 08 Sep 2011 07:51:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.flashnutz.com/2009/08/images-not-working-with-dompdf/#comment-11183</guid>
		<description>I also had this problem and solved it by using absolute image paths instead of relative ones.

For example, instead of:

,  

I changed the html to

</description>
		<content:encoded><![CDATA[<p>I also had this problem and solved it by using absolute image paths instead of relative ones.</p>
<p>For example, instead of:</p>
<p>,  </p>
<p>I changed the html to</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Edeshi</title>
		<link>http://www.flashnutz.com/2009/08/images-not-working-in-dompdf/comment-page-1/#comment-10438</link>
		<dc:creator>Edeshi</dc:creator>
		<pubDate>Tue, 21 Jun 2011 17:44:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.flashnutz.com/2009/08/images-not-working-with-dompdf/#comment-10438</guid>
		<description>Bless You manish =D, i own you a beer</description>
		<content:encoded><![CDATA[<p>Bless You manish =D, i own you a beer</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: manish</title>
		<link>http://www.flashnutz.com/2009/08/images-not-working-in-dompdf/comment-page-1/#comment-10182</link>
		<dc:creator>manish</dc:creator>
		<pubDate>Wed, 01 Jun 2011 05:59:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.flashnutz.com/2009/08/images-not-working-with-dompdf/#comment-10182</guid>
		<description>Gr8 hint.. It saved my brain from just popping out.... I had the images working well in my local system but not on the server... Using getcwd() for the current directory path helped me a lot....</description>
		<content:encoded><![CDATA[<p>Gr8 hint.. It saved my brain from just popping out&#8230;. I had the images working well in my local system but not on the server&#8230; Using getcwd() for the current directory path helped me a lot&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Graccem</title>
		<link>http://www.flashnutz.com/2009/08/images-not-working-in-dompdf/comment-page-1/#comment-9571</link>
		<dc:creator>Graccem</dc:creator>
		<pubDate>Mon, 18 Apr 2011 13:27:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.flashnutz.com/2009/08/images-not-working-with-dompdf/#comment-9571</guid>
		<description>@Geo Paul:
Thanks for the hint.</description>
		<content:encoded><![CDATA[<p>@Geo Paul:<br />
Thanks for the hint.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Evan</title>
		<link>http://www.flashnutz.com/2009/08/images-not-working-in-dompdf/comment-page-1/#comment-7579</link>
		<dc:creator>Evan</dc:creator>
		<pubDate>Sun, 13 Feb 2011 03:58:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.flashnutz.com/2009/08/images-not-working-with-dompdf/#comment-7579</guid>
		<description>Good job! Saved me a load of time. 
THANKS!</description>
		<content:encoded><![CDATA[<p>Good job! Saved me a load of time.<br />
THANKS!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

