<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dream House &#187; Attachment</title>
	<atom:link href="http://sajjadhossain.com/tag/attachment/feed/" rel="self" type="application/rss+xml" />
	<link>http://sajjadhossain.com</link>
	<description>Courage to do something...</description>
	<lastBuildDate>Sun, 07 Nov 2010 06:45:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>DOMPDF Attachment issue in IE (Internet Explorer)</title>
		<link>http://sajjadhossain.com/2008/05/30/dompdf-attachment-issue-in-ie-internet-explorer/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://sajjadhossain.com/2008/05/30/dompdf-attachment-issue-in-ie-internet-explorer/#comments</comments>
		<pubDate>Fri, 30 May 2008 11:06:35 +0000</pubDate>
		<dc:creator>Mohammad Sajjad Hossain</dc:creator>
				<category><![CDATA[DOMPDF]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Attachment]]></category>
		<category><![CDATA[code igniter]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[issue]]></category>
		<category><![CDATA[pdf]]></category>

		<guid isPermaLink="false">http://sajjadhossain.com/2008/05/30/dompdf-attachment-issue-in-ie-internet-explorer/</guid>
		<description><![CDATA[I have used DOMPDF in my project. But I was facing problem with Attachment. In FireFox it was working fine. But in Internet Explorer (I used IE 6) it ended with an error. In IE it was showing the download dialogue box offering the script page I used to generate the PDF file. When I [...]
Related posts:<ol>
<li><a href='http://sajjadhossain.com/2008/06/21/dompdf-without-pdflib-as-back-end-pdf-support/' rel='bookmark' title='DOMPDF without PDFLib as back-end PDF support'>DOMPDF without PDFLib as back-end PDF support</a></li>
<li><a href='http://sajjadhossain.com/2008/06/21/codeigniter-plugin-for-dompdf/' rel='bookmark' title='CodeIgniter &#8211; Plugin for DOMPDF'>CodeIgniter &#8211; Plugin for DOMPDF</a></li>
<li><a href='http://sajjadhossain.com/2009/05/14/internet-explorer-developer-toolbar/' rel='bookmark' title='Internet Explorer Developer Toolbar'>Internet Explorer Developer Toolbar</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal"><img class="alignleft size-full wp-image-124" style="padding:0 5px 5px 0;" title="dompdf_ie" src="http://sajjadhossain.com/wp-content/uploads/2008/05/dompdf_ie.png" alt="dompdf ie DOMPDF Attachment issue in IE (Internet Explorer)" width="150" height="108" />I have used DOMPDF in my project. But I was facing problem with Attachment. In FireFox it was working fine. But in Internet Explorer (I used IE 6) it ended with an error. In IE it was showing the download dialogue box offering the script page I used to generate the PDF file. When I tried to download the file it showed an error.</p>
<p class="MsoNormal">I searched the web and found no suitable solution. I followed the instruction given in <a href="http://www.corenettech.com/blog/index.php/2008/04/06/using-dompdf-with-windows-and-ie/">http://www.corenettech.com/blog/</a> but it didn’t work <img src='http://sajjadhossain.com/wp-includes/images/smilies/icon_sad.gif' alt="icon sad DOMPDF Attachment issue in IE (Internet Explorer)" class='wp-smiley' title="DOMPDF Attachment issue in IE (Internet Explorer)" /> . But I got an idea from this post. I started digging the code and have done following changes to PDFLib_Adapter class (available in DOMPDF_DiRECTORY/include/pdflib_adapter.cls.php).</p>
<p class="MsoNormal">I have removed the following line (line 829):</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Cache-Control: private&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p class="MsoNormal">and added</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">strstr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_USER_AGENT'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;MSIE&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
     <span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Expires: 0'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Cache-Control: must-revalidate, post-check=0, pre-check=0'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-Transfer-Encoding: binary&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Pragma: public'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-Length: &quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span>
<span style="color: #009900;">&#123;</span>
     <span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Cache-Control: private&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-Transfer-Encoding: binary&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Expires: 0'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Pragma: no-cache'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-Length: &quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p class="MsoNormal">After</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-type: application/pdf&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-Disposition: <span style="color: #006699; font-weight: bold;">$attach</span>; filename=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #006699; font-weight: bold;">$filename</span><span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>That’s it! My code started working <img src='http://sajjadhossain.com/wp-includes/images/smilies/icon_smile.gif' alt="icon smile DOMPDF Attachment issue in IE (Internet Explorer)" class='wp-smiley' title="DOMPDF Attachment issue in IE (Internet Explorer)" /> .</p>
<p>Hope this will save your time of surfing the net <img src='http://sajjadhossain.com/wp-includes/images/smilies/icon_wink.gif' alt="icon wink DOMPDF Attachment issue in IE (Internet Explorer)" class='wp-smiley' title="DOMPDF Attachment issue in IE (Internet Explorer)" /> .</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsajjadhossain.com%2F2008%2F05%2F30%2Fdompdf-attachment-issue-in-ie-internet-explorer%2F&amp;title=DOMPDF%20Attachment%20issue%20in%20IE%20%28Internet%20Explorer%29" id="wpa2a_2"><img src="http://sajjadhossain.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="share save 120 16 DOMPDF Attachment issue in IE (Internet Explorer)"  title="DOMPDF Attachment issue in IE (Internet Explorer)" /></a></p><p>Related posts:<ol>
<li><a href='http://sajjadhossain.com/2008/06/21/dompdf-without-pdflib-as-back-end-pdf-support/' rel='bookmark' title='DOMPDF without PDFLib as back-end PDF support'>DOMPDF without PDFLib as back-end PDF support</a></li>
<li><a href='http://sajjadhossain.com/2008/06/21/codeigniter-plugin-for-dompdf/' rel='bookmark' title='CodeIgniter &#8211; Plugin for DOMPDF'>CodeIgniter &#8211; Plugin for DOMPDF</a></li>
<li><a href='http://sajjadhossain.com/2009/05/14/internet-explorer-developer-toolbar/' rel='bookmark' title='Internet Explorer Developer Toolbar'>Internet Explorer Developer Toolbar</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://sajjadhossain.com/2008/05/30/dompdf-attachment-issue-in-ie-internet-explorer/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

