<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-14109931</id><updated>2011-06-16T14:56:29.371-05:00</updated><title type='text'>Alan Dennis' Blog</title><subtitle type='html'>Alan Dennis' random thoughts and ideas.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://alandennis.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14109931/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://alandennis.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Alan Dennis</name><uri>http://www.blogger.com/profile/11857838195023606946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-14109931.post-112024755262339233</id><published>2005-07-01T14:47:00.000-05:00</published><updated>2005-07-01T14:52:32.626-05:00</updated><title type='text'>Streaming PDF using iTextSharp and ASP.NET</title><content type='html'>I've been looking at &lt;a href="http://itextsharp.sourceforge.net/"&gt;iTextSharp&lt;/a&gt; and &lt;a href="http://www.ujihara.jp/iTextdotNET/en/"&gt;iTextDotNet&lt;/a&gt; for a while now and I must say I'm very impressed with both.&lt;br /&gt;&lt;br /&gt;One thing you may want to do if you're doing dynamic PDF generation is stream a PDF back from an ASP.NET page.  The following simple example shows the basic elements using iTextSharp v3.0.3.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;using iText = iTextSharp.text;&lt;br /&gt;....&lt;br /&gt;&lt;br /&gt;Response.Clear();&lt;br /&gt;Response.ContentType = "application/pdf";&lt;br /&gt;System.IO.MemoryStream m = new System.IO.MemoryStream();&lt;br /&gt;iText.Document document = new iText.Document();&lt;br /&gt;iText.pdf.PdfWriter writer = iText.pdf.PdfWriter.GetInstance(document, m);&lt;br /&gt;document.Open();&lt;br /&gt;&lt;br /&gt;document.Add(new iText.Paragraph(DateTime.Now.ToString()));&lt;br /&gt;document.NewPage();&lt;br /&gt;document.Add(new iText.Paragraph("Hello World"));&lt;br /&gt;document.Close();&lt;br /&gt;&lt;br /&gt;writer.Flush();&lt;br /&gt;Response.OutputStream.Write(m.GetBuffer(), 0, m.GetBuffer().Length);&lt;br /&gt;Response.OutputStream.Flush();&lt;br /&gt;Response.OutputStream.Close();&lt;br /&gt;Response.End();&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14109931-112024755262339233?l=alandennis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://alandennis.blogspot.com/feeds/112024755262339233/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14109931&amp;postID=112024755262339233' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14109931/posts/default/112024755262339233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14109931/posts/default/112024755262339233'/><link rel='alternate' type='text/html' href='http://alandennis.blogspot.com/2005/07/streaming-pdf-using-itextsharp-and.html' title='Streaming PDF using iTextSharp and ASP.NET'/><author><name>Alan Dennis</name><uri>http://www.blogger.com/profile/11857838195023606946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry></feed>
