So, here is how I decided it.
First of all, I need the height of the HTML page that will be passed to the pdf generation method, so I added this on the page that will be pdf-ed:
<asp:HiddenField ID="hfHeight" runat="server" />
and in the code behind:
protected void Page_Init(object sender, EventArgs e)
{
if (!IsPostBack)
{
string scriptKey = "WidhtHeightForPdf";
if (!Page.ClientScript.IsClientScriptBlockRegistered(scriptKey))
{
StringBuilder sb = new StringBuilder();
sb.AppendLine("<script>")
.AppendLine("document.getElementById('" + hfHeight.ClientID + "').value = document.body.clientHeight;")
.AppendLine("</script>");
Page.ClientScript.RegisterStartupScript(typeof(Page), scriptKey, sb.ToString());
}
}
}
, pdf, HTML. , "pdf", pdf:
int intHTMLWidth = height.Value * Convert.ToInt32(theDoc.Rect.Width / theDoc.Rect.Height);
BrowserWidth HtmlOptions theDoc:
theDoc.HtmlOptions.BrowserWidth = intHTMLWidth;
url theDoc:
int theID = theDoc.AddImageUrl(url, true, intHTMLWidth, true);
EDIT: , . - pdf HTML, pdf .