<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Channel 9 Forums - Site Feedback - iTextSharp RAM (memory) overflow</title>
	<atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Forums/rss"></atom:link>
	<image>
		<url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
		<title>Channel 9 Forums - Site Feedback - iTextSharp RAM (memory) overflow</title>
		<link>http://channel9.msdn.com/Forums</link>
	</image>
	<description>Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with. From LINQ to SilverLight – Watch videos and hear about all the cool technologies coming and the people behind them.</description>
	<link>http://channel9.msdn.com/Forums</link>
	<language>en</language>
	<pubDate>Tue, 21 May 2013 17:18:05 GMT</pubDate>
	<lastBuildDate>Tue, 21 May 2013 17:18:05 GMT</lastBuildDate>
	<generator>Rev9</generator>
	<c9:totalResults>2</c9:totalResults>
	<c9:pageCount>-2</c9:pageCount>
	<c9:pageSize>-1</c9:pageSize>
	<item>
		<title>Site Feedback - iTextSharp RAM (memory) overflow</title>
		<description><![CDATA[<p>I'm generating a PDF document based on template. The document has multiple pages. The document can have about 5000 pages. When creating the 500-th page I get an overflow RAM (memory). Any idea?</p><p>Thanks in advance.</p><p><pre class="brush: text">public static void CreateBankBlank2012Year(string pdfTemplatePath, string directoryOutPdf, string nameOutPdf, AnnualReportsFilterParameters filterParametrs, string serverPath)
{
// Get details salary
IEnumerable&lt;SalayDetailsForPdf&gt; dataSalaryDetails = (IEnumerable&lt;SalayDetailsForPdf&gt;) GetSalaryData(filterParametrs); 

String fontPath = Path.Combine(serverPath &#43; &quot;\\Fonts&quot;, &quot;STSONG.ttf&quot;);
Font font = FontFactory.GetFont(fontPath, BaseFont.IDENTITY_H, 8);

using (Document document = new Document())
{
using (PdfSmartCopy copy = new PdfSmartCopy(
document, new FileStream(directoryOutPdf &#43; nameOutPdf, FileMode.Create))
)
{
document.Open();

foreach (var data in dataSalaryDetails) 
{
PdfReader reader = new PdfReader(pdfTemplatePath &#43; @&quot;\EmptyTemplateBankBlank_2012.pdf&quot;);
using (var ms = new MemoryStream())
{
using (PdfStamper stamper = new PdfStamper(reader, ms))
{
stamper.AcroFields.AddSubstitutionFont(font.BaseFont);
AcroFields form = stamper.AcroFields;
form.SetField(&quot;t1_address1&quot;, data.Address1);

form.SetField(&quot;t1_name&quot;, data.NameHieroglyphic);

// Other field ...

stamper.FormFlattening = true;
}
reader = new PdfReader(ms.ToArray());

copy.AddPage(copy.GetImportedPage(reader, 1));
}
}
} 
}
}</pre></p>]]></description>
		<link>http://channel9.msdn.com/Forums/Feedback/iTextSharp-RAM-memory-overflow/34e994c8e7d74425aa69a082011a4552#34e994c8e7d74425aa69a082011a4552</link>
		<pubDate>Mon, 02 Jul 2012 17:07:43 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Feedback/iTextSharp-RAM-memory-overflow/34e994c8e7d74425aa69a082011a4552#34e994c8e7d74425aa69a082011a4552</guid>
		<dc:creator>KapMaximus</dc:creator>
		<slash:comments>2</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/KapMaximus/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Site Feedback - iTextSharp RAM (memory) overflow</title>
		<description><![CDATA[<p>@<a href="/Forums/Feedback/iTextSharp-RAM-memory-overflow#c34e994c8e7d74425aa69a082011a4552">KapMaximus</a>: You'd probably get better responses if you posted this on a page associated with iTextSharp.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Feedback/iTextSharp-RAM-memory-overflow/7cbf90ded7804a46809ca08201345c8b#7cbf90ded7804a46809ca08201345c8b</link>
		<pubDate>Mon, 02 Jul 2012 18:42:42 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Feedback/iTextSharp-RAM-memory-overflow/7cbf90ded7804a46809ca08201345c8b#7cbf90ded7804a46809ca08201345c8b</guid>
		<dc:creator>Scott</dc:creator>
		<slash:comments>2</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/spivonious/Discussions/RSS</wfw:commentRss>
	</item>
</channel>
</rss>