Prints pdf when page loads
<p>I have this code in my aspx page;</p>

<pre><code>&lt;a href="javascript:void(0);" onclick=&lt;% Print(); %&gt; title="Print listings"&gt;Print&lt;/a&gt;
</code></pre>

<p>which presents a link to print a listings to a pdf when the user clicks on it; as you can note the script calls a function from the behind code.</p>

<p>The problem is that when I coded this it happens that when I go this page it prints to pdf when is loading, I thought it would wait for a click but instead it performs the printing.</p>

<p>What is the problem? thanks in advance.</p>

<p>PD. I'm working with VS2005 and for the pdf creation I use iTextSharp.</p>
