XHtmlOptions RetryCount Property. The number of times a page should be retried if unavailable or invalid. ABCpdf .NET PDF Library.

ABCpdf .net

 
   

 

Type Default Value Read Only Description
[C#] int

[Visual Basic]
Integer
5 No The number of times a page should be retried if unavailable or invalid.

 

   

Notes
 

This property controls how many times ABCpdf will attempt to obtain a page.

HTML rendering may fail one time but succeed the next. This is often for reasons outside the control of ABCpdf.

So ABCpdf may attempt to re-request a page if it is not immediately available. This is analogous to clicking on the refresh button of a web browser if the page is failing to load.

See the ContentCount and the Timeout properties for how ABCpdf determines if a page is unavailable or invalid.

 

   

Example
 

The following example shows the effect that this parameter has on HTML rendering.

[C#]
Doc theDoc = new Doc();
string theURL = "http://www.nasa.gov/multimedia/imagegallery/image_feature_313.html";
// Set minimum number of items a page of HTML should contain.
// Otherwise the page will be assumed to be invalid.
theDoc.HtmlOptions.ContentCount = 20;
// Try to obtain html page 10 times
theDoc.HtmlOptions.RetryCount = 10;
// The page must be obtained in less then 10 seconds
theDoc.HtmlOptions.Timeout = 10000;
try
{
  theDoc.AddImageUrl(theURL);
}
catch
{
  // Page couldn't be loaded
}
// Save the document
theDoc.Save(Server.MapPath("HtmlOptionsRetryCount.pdf"));
theDoc.Clear();

[Visual Basic]
Dim theDoc As Doc = New Doc()
Dim theURL As String = "http://www.nasa.gov/multimedia/imagegallery/image_feature_313.html"
' Set minimum number of items a page of HTML should contain.
' Otherwise the page will be assumed to be invalid.
theDoc.HtmlOptions.ContentCount = 20
' Try to obtain html page 10 times
theDoc.HtmlOptions.RetryCount = 10
' The page must be obtained in less then 10 seconds
theDoc.HtmlOptions.Timeout = 10000
Try
  theDoc.AddImageUrl(theURL)
Catch
  ' Page couldn't be loaded
End Try
' Save the document
theDoc.Save(Server.MapPath("HtmlOptionsRetryCount.pdf"))
theDoc.Clear()


HtmlOptionsRetryCount.pdf