up

FAQ


1
My application is correctly working on the development server but on a production server I get "The URL is not accessible." exception.

A: "The URL is not accessible" message is normally followed by a more detailed message which should clearly indicate the root of the problem. Below is a general description of the possible reasons of this error.

If the application works correctly on your development machine but it's not working on the server then it's very likely to be an issue related to security, permissions or authentication on the server.

First make sure the web page you are converting is accessible for converter. If the page requires server authentication (like IIS authentication - Integrated Windows Authentication) you can provide the correct Username and Password using the AuthenticationOptions property of the PdfConverter.

If your application is using ASP.NET level authentication like Forms Authentication the converter will not be able to authenticate because it doesn't send back to the web server the authentication cookie created during the authentication process between the browser and IIS. If using the forms authentication is a requirement for your application you might try to configure your application to use the cookieless mode for the forms authentication.

Other access restrictions can be introduced by proxy servers or firewalls. When you access the web page from Internet Explorer for example it might work because the proxy server settings are set in the Internet Options of the currently logged user and browser will use those settings to authenticate to the proxy. When you try to convert the same page from an ASP.NET application, the converter, which runs under the ASP.NET user account, is not using the Internet Settings for the currently loged in user and therefore it won't be able to authenticate to the proxy. Firewall servers can be a similar source of access restrictions that you'll have to check.

If you are converting a https URL from your network you can try the same url with http:// instead of https://. Running secured pages require a valid (not a self signed) SSL certificate. 

It is also possible, when converting a web page hosted on the server where you are performing the conversion, that the server cannot resolve the site name to an IP address. To eliminate this possibility try to use an IP address instead of a domain name.

The development servers have a more relaxed internet security configuration then the production servers. For example the Windows 2003 Server defaults to an internet security configuration which may not allow you to access the URL. You may have to relax or disable the enhanced security configuration to allow access to the pages you want to render. If removing the internet enhanced security configuration component is an option, you can do so from the "Add/Remove Windows Components" section of the "Add or Remove Programs" control panel. The internet enhanced security configuration component should be listed as "Internet Explorer Enhanced Security Configuration".

If you don't see any obvious reason for the web page to be inaccessible for the converter try to convert a HTML file from the server disk instead of an URL. You can simply pass to the converter the full path of the HTML file instead of the URL. If it works with a local HTML file then you can further try with an url like http://www.google.com which is likely to be available and accessible from your server. If this URL works then the URL you are trying to convert might not be accessible indeed for the converter and you should keep searching for the possible reasons. If it's not working it means the converter is not allowed to access Internet under the ASP.NET user account and you should further check proxy servers, firewalls, etc.

In general, because we don't know the exact network configuration of your server or of your intranet, we cannot tell exactly which of the possible access problems described above applies to your situation. You should carefully check the possible situations described above and also check with your network administrator about other possible access restrictions before going further.

If your are pretty sure there should be no access problem then make sure the web page you are trying to convert can be correctly loaded in the Internet Explorer browser running on your server while you are logged in as Administrator.  Make sure IE does not block the URL or throws any warnings when loading that page. and you'll have to find the reason with your server administrator.

If none of the recommendations above helped then try to find a permissions issue. The converter runs with the permissions granted to the ASP.NET user which are normally much lower than the permissions under which the IE web browser application runs. You can find out the ASP.NET user under which the converter is running by adding the <%= Environment.UserName %> line in the .ASPX from where the converter is called. The user name should be displayed when the .ASPX page is loaded in browser. 

To make sure it's a permissions issue try to convert the same HTML page using the Free HTML to PDF Converter Windows Forms Application that we provide as a separate download or the one that you have built from the samples folder. This Windows Forms application will run as the currently logged in user, preferable an Administrator. If this application works then it might be a permissions issue. You can temporary add the ASP.NET user (determined as above) to Administrators group on the server or you can use ASP.NET impersonation by adding the following line in the web.config of your application under the <system.web> section : <identity impersonate="true" userName="WindowsDomain\YourUserName" password="YourPassword"/>. If the conversion works you can start looking into what exactly permissions the converter needs from your server and grant those permissions to the ASP.NET user.

A useful tool for finding permissions issues is the Process Monitor. You can download this tool from Microsoft web site. The ProcessMonitor will monitor every file and registry access on your machine in real time. You have to start the tool and then make the issue to occur. You should look for suspicious FAILURE and ACCESS DENIED messages. You can try to filter the messages by ASP.NET worker process ID to substantially reduce the number of displayed messages. You might find for example that the ASP.NET user cannot create files into the Internet Temporary Folder where the images and CSS files are temporary downloaded or the ASP.NET user has not enough rights to read the Internet Settings from Windows Registry.

If you have followed all the steps above and you could not find the reason of the problem please contact us with the result of all these steps. We'll try to work with you to localize the problem.

2
When I convert a HTML string to PDF, the external CSS files and images are not applied in the rendered PDF document.

A: When you convert a HTML string referencing external CSS files and images by relative URLs, the converter cannot determine the full URLs just looking at the string.

In order to solve this you have to set the baseURL parameter of the HTML string convert function with the full URL of the page from where you have retrieved the HTML string. This requires from the HTML string to have a valid HEAD tag. When the relative paths of your images are textually prefixed with the baseURL parameter the full URL of the images should be produce in order to start getting images in PDF.

As an alternative you can manually insert a BASE tag in the HEAD tag of the HTML page as in the example below or use full URLs in the HTML string:

              <HEAD> <BASE HREF="SiteURL"> </HEAD>

Note: This issue might also indicate an authentication or permissions problem on the server when accessing the external resources like images and CSS files. The HTML string is loaded into converter and the text is converted to PDF but the images and CSS files are still accessed from an URL and they might not be accessible.

If you are sure that the url base you have set is correct but the images still don't appear in PDF you can try to prefix a relative image URL from the HTML string with the the base url to construct a full image URL. Then you can put this url in the IE web browser on the server where you perform the conversion and check that the image is correctly displayed in the browser. After that you can try to convert the image URL to PDF using the GetPdfBytesFromUrl() method. If the image is not accessible you should get a "The URL is not accessible." error. See the question above regarding the 'URL is not accessible' exception to find out more details about how to localize and troubleshoot this problem.

Another special situation where this problem might occur is for ASP.NET applications using forms authentication. The ASP.NET forms authentication implementation usually stores the forms authentication ticket in a cookie which should be sent back to server each time a resource is requested but the converter does not have the ability to automatically send this kind of cookie back to the server and therefore the authentication of the requests of external resources like images and CSS files can fail. A possible workaround for this problm is to store the images and CSS files referenced by the web page to be converted in a location which doesn't require authentication. If this is not an acceptable solution then you can try to set the forms authentication to the cookieless mode. In this mode the encrypted authentication ticket is set in the URL query string and not in a cookie and the base URL parameter of the HTML string convert function should be set accordingly to the URL containing the authentication ticket. You can read more about forms authentication at the following address: Forms Authentication Explained .

3
In rendered PDF document the images and text fonts appear to be smaller than they are in the source HTML document. For other HTML documents the rendered content is not shrunk but it appears in the left side of the document and is not centered. How can I control this?

A: The MagneticPdf HTML to PDF converter allows a very fine control of the PDF rendering process. The default settings of the converter should be acceptable for majority of the situations but sometimes more control and customizations are necessary. If want to learn more about the HTML to PDF rendering please check this article.

The converter internally uses a virtual display where to render the HTML page very similar to what the web browser does on the screen. This virtual display is different from display of your computer and it has a fixed resolution on your computer (which normally is 96 dpi) independent of the resolution of your computer screen. The web page elements dimensions are usually measured in pixels and this is the reason why the virtual display of the converter is also specified in pixels. These are the only dimensions used by the converter which are expressed in pixels. All the other dimensions are specified in points (1 point is 1/72 inches). However, because of the fixed resolution of the virtual display, the pixels dimensions of your web page can be easily converted to dimensions expressed in points . The converter API offers the UnitsConverter class which can be used to convert dimensions from pixels to points and from points to pixels.

You can specify the virtual display width and height in pixels using the PdfConverter.PageWidth and PdfConverter.PageHeight properties or you can specify the same values as parameters when you construct the PdfConverter object.

By default the PageWidth is set to 1024 pixels which should be sufficient to display the majority of the web pages. If the web page you are converting cannot be completely displayed in this width then you can increase this value or you can set the PageWidth to 0 to allow the converter to automatically determine your web page width from the HTML elements width. The PageHeight property is 0 by default which means the virtual display will be automatically resized to display the whole HTML page. There are situations when the converter cannot automatically determine the web page height for example when the web page is a frame set. In this case you can manually set the PageHeight to certain value in pixels such that the page is displayed in the way you expect.

After the HTML content is displayed in the virtual display the virtual display content will be transfered into PDF as you would take a picture of the virtual display and put that picture into a PDF document. The PDF documents pages have a fixed size in points. For example, the A4 page is 595 points in width and 842 points in height. If the virtual display width is more than 595 points then the rendered HTML content would be shrinked to fit the PDF page width and display the whole HTML content in the PDF document.  If the virtual display width is less than 595 points then the rendered HTML content will not be resized and will be rendered in the top left corner of the PDF page at real size.

The dimension of the A4 portrait page in virtual device pixels is 793x1122 pixels. This means that at a default virtual display width of 1024 pixels the HTML content will be shrunk to fit the PDF page. This is the reason why you see smaller fonts and images in PDF.

The converter has a property called FitWidth that was added to the PdfConverter.PdfDocumentOptions. The default value is true which makes the HTML content to be resized if necessary to fit the PDF page width. When false, the HTML content will not be resized and it will be rendered at the real size in PDF (the size it has in the virtual display at the usual resolution of 96 dpi).

When the FitWidth property is false the HTML content could be wider than the PDF page width and the therefore the HTML content will be cut off to the right in PDF. In this case, in order to get the whole content in PDF you have to set a wider page for the PDF document. You can first try to set landscape orientation for the PDF page by setting PdfConverter.PdfDocumentOptions.PdfPageOrientation = PDFPageOrientation.Landscape. If this not enough you can choose a wider standard page like A3 or A2. You can even set a custom size for the PDF page. Also you can set the PdfConvert.PdfDocumentOptions.PdfPageSize=PdfPageSize.Custom and in this case the custom size of the PDF page will be taken from PdfConverter.PdfDocumentOptions.CustomPdfPageSize property.  

The HTML to PDF Converter product also has a called property PdfConverter.PdfDocumentOptions.AutoSizePdfPage which is has effect only when the FitWidth property is false. When FitWidth is false and AutoSizePdfPage is true, the PDF page width will automatically be resized to a custom value such that all the HTML content is displayed in PDF at real size.

If you don't want to resize the PDF page but you want to keep it A4 portrait for example, then you have to decrease the virtual display width. If your page can be correctly and entirely displayed in 793 pixels (which is the width of the A4 portrait page in pixels) you can set this value for PdfConverter.PageWidth property and you should get the whole HTML rendered at real size in PDF.

The HTML content centering in PDF problem can be observed when the HTML content can be normally displayed at a width less than 1024 pixels. In this case there will normally be an empty space in the right side of the virtual display. When the virtual display content is transfered to PDF the content will appear as not centered in PDF. You can also solve this if you set the PdfConverter.PageWidth to a value of 793 pixels or less.

4
How can I obtain the HTML string from a web page and convert it to PDF?

A: If you are trying to convert a ASP.NET page you can use the Server.Execute method from to obtain the HTML string. Here is some C# code to obtain the HTML string from a page of your application:

        StringWriter sw = new StringWriter();
        Server.Execute("PageToConvert.aspx", sw);
        string htmlCodeToConvert = sw.GetStringBuilder().ToString();

You can also use the methods from ConverterUtils class that we provide in the library to get the HTML code from a web page from Internet.

The converter library offers a set of methods for converting a HTML string to PDF. See the WebLibrary_DynamicInvoiceDemo for a complete sample of how to retrieve the HTML code and convert it to PDF. 

5
Is the ASP.NET session data available in the converted ASP.NET page during conversion?

A: The converter executes the web page to be converted in a new session , different from the session in which your ASP.NET application runs. This basically happens because the converter does not send the session cookie from the browser back to the server. Therefore, the data currently stored in the session is not available in the converter web page even if the page is part of your application.

See the InvoicesDemo application for ASP.NET for a complete sample of how to retrieve the HTML code from a ASP.NET page, pass the session data to the converted page and convert the HTML string to PDF. This application is also installed as a live demo in our website.

Basically you have 2 options to consider when trying to overcome this situation : to send the necessary data for loading the page to be converted in the query string of the converted page URL or to get the web page HTML code using the Server.Execute(Url) method as we do in the InvoicesDemo sample . The Server.Execute method is executed in your application session so all the session data and existing authentication should be valid.

When getting the HTML string with the Server.Execute(Url) method the resulted HTML code should reference the external CSS, images and JavaScript code by a full URL not  by a relative URL. Here is some C# code to obtain the HTML string from a page of your application:

        StringWriter sw = new StringWriter();
        Server.Execute("PageToConvert.aspx", sw);
        string htmlCodeToConvert = sw.GetStringBuilder().ToString();

To instruct the converter how to automatically turn all the relative URLs into absolute URL you have to pass the baseURL parameter of the convert function with the full URL of the page from where you have taken the HTML string.

6
Does the converter use during conversion the session cookies stored in the current web browser session when the converter is called from an ASP.NET application?

A: The session cookies stored by the browser are not automatically sent to the web server by the converter when the converter is called from an ASP.NET page.

With our converter it is possible to send custom HTTP headers when a page is requested from the web server. A cookie can be sent to the web server using such a custom HTTP header. The syntax to configure the converter to send a cookie to the web server is:

        
            pdfConverter.HttpRequestHeaders = String.Format(
                "Cookie : {0}={1}\r\n", cookieName, cookieValue
            );

7
Does the HTML to PDF converter support authentication when used in ASP.NET application?

A: The converter offers support for server authentication, for example any type of IIS authentication (Integrated Windows Authentication, Basic Authentication, etc). To enable server authentication you have to set the PdfConverter.AuthenticationOptions property with the username and password. The server authentication is usually necessary when accessing Intranet resources.

Please do not confound the server authentication with the authentication implemented at the level of your application (usually implemented as a login page in your application ). If you need to deal with application level authentication please read below.

The converter executes the web page to be converted in a new session, different from the session in which your ASP.NET application runs. Therefore, the data currently stored in the session is not available in the converter web page even if the page is part of your application. Also the converter does not have any built-in support for authentication.

You have 2 options to consider  when trying to overcome this situation : to send the necessary data for loading the page to be converted in the query string of the converted page URL or to get the web page HTML code using the Server.Execute(Url) method from ASP.NET and then convert that string to PDF as we do in the dynamic invoices sample. The Server.Execute() method is executed in your application session so all the session data and existing authentication should be valid.

See the InvoicesDemo application for ASp.NET for a complete sample of how to retrieve the HTML code, pass the session data to the converted page and convert the HTML string to PDF. 

When getting the HTML string with the Server.Execute(Url) method the resulted HTML code should reference the external CSS, images and JavaScript code by a full URL not  by a relative URL. Here is some C# code to obtain the HTML string from a page of your application:

        StringWriter sw = new StringWriter();
        Server.Execute("PageToConvert.aspx", sw);
        string htmlCodeToConvert = sw.GetStringBuilder().ToString();

To instruct the converter how to automatically turn all the relative URLs into absolute URL you have to pass the baseURL parameter of the convert function with the full URL of the page from where you have taken the HTML string.

8
How do I insert a page break in the resulted PDF document?

A: The HTML to PDF converter supports custom page breaks with standard CSS styles like page-break-before:always and page-break-after:always applied to any HTML object. The page-break-inside:avoid style can be applied to a element to prevent splitting the content inside the element between pages. 

9
How can I specify to the converter to not break (keep together on the same page) a HTML region between PDF pages?

A: You can apply inline the page-break-inside:avoid CSS style to the HTML element you want to keep appear in the rendered PDF document on same page. Of course the element height must be less than the page height, otherwise the style will be ignored by the converter. Please note that unlike the page-break-before and page-break-after , the page-break-inside:avoid style must be specified inline as in the example below:

<table>
        <tr style="page-break-inside : avoid">
            <td>
                <img width="100" height="100" src="img1.jpg">
            </td>
            <td>
                My text 1
            </td>
        </tr>
    
        <tr style="page-break-inside : avoid">
            <td>
                <img width="100" height="100" src="img2.jpg">
            </td>
            <td>
                My text 2
            </td>
        </tr>
</table>

In this example the table can contain a large number of rows, each row containing an image in the left and a text in the right and we don't want such a row to span on two pages. This can be easily achieved by specifying the page-break-inside:avoid style inline for the table row.

10
Can I disable the HTTP links from the generated PDF document?

A: The PdfConverter.PdfDocumentOptions.LiveUrlsEnabled controls the rendering of http links in the resulted PDF document. By default this property is true.

11
What type of fonts does the converter support and how can I embed the fonts in the generated PDF document?

A: The converter supports any true type font preinstalled in Windows operating system. It also supports the open type fonts with the condition that the open type font has TrueType outlines not PostScript outlines. To check what type of outlines has an installed font, you can open the font from the Fonts folder in Control Panel. When a font is not supported by the converter the MS Sans Serif font is used by default.

The converter also supports custom true type fonts you can install from a .ttf or a .otf file. After you have installed a font it becomes available only for the currently logged in Windows user who installed the font. In order to make the font available for all the users, including the ASP.NET user in the case you are using the converter from an ASP.NET application, you have to reboot the computer after font installation.

To embed the true type fonts in the generated PDF you have to set PdfConverter.PdfDocumentOptions.EmbedFonts=true. By default this property is false. The same property is also available in the HtmlToPdfElement class defined by the PDF Creator and HTML to PDF Converter libraries.

12
I installed a true type font on the server but the converter is still using a default font instead of the installed font.

A: First make sure that you restarted the server after true type font installation. After you have installed a font it becomes available only for the currently logged in Windows user who installed the font. In order to make the font available for all the users, including the ASP.NET user, in case you are using the converter from an ASP.NET application, you have to restart the server after font installation.

If the server restarting didn't solve the problem then make sure you installed a supported type of font. The converter supports any true type font preinstalled in Windows operating system. It also supports the open type fonts with the condition that the open type font has TrueType outlines not PostScript outlines. To check what type of outlines has an installed font, you can open the font from the Fonts folder in Control Panel. When a font is not supported by the converter the MS Sans Serif font is used by default.

Another situation when the default font is used occurs when the style used for a font is not supported by that font. The true type fonts have separate glyphs for different styles. For example a font can have separate glyphs for the normal, italic or bold styles. Some fonts can support only the normal style other fonts can support only the italic style. You have to use only the styles supported for a true type font. You can see what styles are available for a font in the Fonts folder of the Control Panel. If a font does not have the required style the converter first tries to use a supported style and if it is not possible then a default font is used.

13
Some images are cut off between PDF pages? Is there any option to avoid this?

A: Set the PdfConverter.AvoidImageBreak property on true. By default this property is false and the images might get cut off between PDF pages. You can also set the page-break-inside:avoid CSS style inline on the IMG tag to achive the same result.

14
How can I control the images quality in PDF?

A: By default the the converter is using JPEG to compress images in PDF and to reduce the size of the generated PDF document. The compression level of the images is controlled by the PdfConverter.PdfDocumentOptions.JpegCompressionLevel property. When the JpegCompressionLevel is 0, the compression rate is the lowest and the quality of the images is the best. When the JpegCompressionLevel is 100, the compression rate is the highest and quality of the images in PDF is the worst. The default JPEG compression level is 10, which should offer a good balance between the compression rate and the quality of the images in PDF.

It is also possible to completely disable the JPEG compression and store the images as bitmaps in PDF if you set PdfConverter.PdfDocumentOptions.JpegCompressionEnabled to false. This produces the best quality of the images but the generated PDF document can be very large and the conversion process is slower.

15
The JavaScript code from HTML page is not executed during conversion. How can I activate JavaScript code execution during conversion?

A: The PdfConverter has the following properties controlling the JavaScript, Java Applets and ActiveX download and execution during conversion: ScriptsEnabled, ScriptsEnabledInImage, ActiveXEnabled, ActiveXEnabledInImage. By default these properties are false which means the JavaScript code is not enabled during conversion. To activate JavaScript simply set PdfConverter.ScriptsEnabled = true when converting to PDF with selectable text or set PdfConverter.ScriptsEnabledInImage = true when converting to PDF with embedded image.

If you already set the PdfConverter.ScriptsEnabled on true and the JavaScript code is still not executed it means the Internet Security Settings on your server don't allow the JavaScript execution. JavaScript code could work when you load the page in Internet Explorer because the browser runs under the currently logged in user and for this user the JavaScript execution is allowed by the Internet Security Settings for the security zone of the page you are trying to convert. When you run the converter from an ASP.NET application the JavaScript execution might not be allowed for the ASP.NET user and for the security zone of the web page you are converting. A simple thing you can do is to move the web page in a more permisive Internet Security Zone like Local Machine. You can achieve this if you set the PdfConverter.InternetSecurityZone property with the InternetSecurityZone.LocalMachine value. If it's still not working you might have to modify directly into the Windows Registry the ASP.NET user Internert Security profile to allow JavaScript execution. The following technical article from Microsoft shows how to configure the internet security zones registry, including the JavaScript and ActiveX execution.

Internet Explorer security zones registry entries

The key 1400 in each security zone should be set to 0 both in HKEY_LOCAL_MACHINE and in HKEY_USERS for the user running the converter. After you have modified the registry you have to reboot the computer to make sure the new configuration is applied.

16
The flash images and ActiveX controls are not rendered in the PDF document. Is there any option I should set?

A: The flash images and movies are rendered by an external flash player which is an ActiveX control. First you have to make sure a flash player is installed on your server and the flash image or movie is displayed when the web page is loaded in the IE browser running on your server without any warnings. Then you have set the PdfConverter.ActiveXEnabled=true when converting to PDF with selectable text or PdfConverter.ActiveXEnabledInImage=true when converting to PDF with embedded image. Please note that the converter could automatically switch to a PDF with embedded image when ActiveXEnabled property is true. Sometimes the ActiveX control are written in HTML using JavaScript. In this case the JavaScript execution should also be enabled during conversion as explained in the answer to the previous question.

If you already activated ActiveX controls during conversion but your flash image still doesn't appear in PDF or is empty then this probably happens  because the flash control did not finish to initialize the image when the converter detected the web page was completely loaded. You can try to manually set a delay before starting the PDF conversion using the PdfConver.ConversionDelay and setting it to a small value in seconds (you can start with a 3 seconds delay for example).

If the flash images still don't appear in PDF it means the Internet Security Settings on your server don't allow the ActiveX execution. The ActiveX can work when you load the page in Internet Explorer because the browser runs under the currently logged in user and for this user the ActiveX execution is allowed by the Internet Security Settings for the security zone of the page you are trying to convert. When you run the converter from an ASP.NET application the ActiveX execution might not be allowed for the ASP.NET user and for the security zone of the web page you are converting. A simple thing you can do is to move the web page in a more permisive Internet Security Zone like Local Machine. You can achieve this if you set the PdfConverter.InternetSecurityZone property with the InternetSecurityZone.LocalMachine value. If it's still not working you might have to modify directly into the Windows Registry the ASP.NET user Internert Security profile to allow ActiveX execution. The following technical article from Microsoft shows how to configure the internet security zones registry, including the JavaScript and ActiveX execution.

Internet Explorer security zones registry entries

The key 1200 in each security zone should be set to 0 both in HKEY_LOCAL_MACHINE and in HKEY_USERS for the user running the converter. After you have modified the registry you have to reboot the computer to make sure the new configuration is applied.

17
How can I use the HTML to PDF converter library from .NET 1.1 applications or from PHP applications?

A: The HTML to PDF converter library is a .NET 2.0 or above library and it is not working with .NET 1.1 directly. The workaround for this is to create an HTML to PDF Converter Web Service which exposes a simple method to return the rendered PDF document bytes from a specified URL. The web service internally should make calls to the converter library. 

Note: Another possible solution is to create a .NET 2.0 or above command line tool to be called from your application but there might be some additional overhead with this approach to execute the command line and retrieve the generated PDF document. We provide a sample console application Console_HtmlConvertDemo_CS in the HTML to PDF Converter archive that might be a good starting point.

18
When I converted a web page containing a frameset tag only the top part of the page was rendered in PDF.

A: This indicates the converter was not able to correctly determine the height of the web page. The work around is to explicitly set the web page in pixels or to convert directly the web pages referred by the frameset frames. For example you can set pdfConverter.PageHeight = 2000;

19
Can I deploy my ASP.NET application using the HTML to PDF Converter on a shared server?

A: The converter requires Full Trust level for the ASP.NET application calling it. The default trust level for an ASP.NET applications is Full Trust but the shared hosting providers usually modify the trust level to Medium Trust which makes our converter to not run properly in such environments. In order to solve this issue you can ask you shared hosting provider to give Full Trust level for you ASP.NET application. Another possibility is to create a ASP.NET web service around the converter library, install that web service on a machine where the full trust is allowed and call the web service from your application. You have to ensure that the web service you create can be used only from your application.

20
The exception "Could not get image from url. Could not initialize the html converter object.Request failed.." or the exception "Required permissions cannot be acquired." or the exception "Operation could destabilize the runtime" is thrown during the HTML to PDF conversion.

A: The converter needs a full trust level for your ASP.NET 2.0 application in order to correctly execute. The default trust level is full but some of the hosting providers set this to medium or lower. The trust level can be set in the Web.config of the application ( <trust level="Full"/> under the <system.web> config section ) but the hosting provider could also forbid overriding the trust level from the web site configuration file.  

If your application already has full trust that means more security restrictions are imposed by the Windows to the assembly. Adding the assembly to the GAC (Global Assembly Cache) usually makes the assembly more trusted and solves the problem.

A special situation when this exception can occur is on Windows Vista family of operating systems (Windows Vista SP2, Windows 7). When you download the assembly from Internet the operating system marks the file as "Blocked". You can check the assembly was blocked if you right click on the file in Windows Explorer and select Properties. At the bottom of the Properties tab there should be an "Unblock" botton if the assembly was blocked and the message "This file came from another computer and might be blocked to help protect this computer" should be displayed near that button. To unblock the assembly and allow its execution simply click the "Unblock" button and restart the IIS application pool of your application to make sure the change was applied.

Another solution in this situation is to change the identity of the IIS pool of your application to a less restrictive account. The Network Service account should normally allow the execution of the assembly.

21
The HTML to PDF converter throws the following exception: "HtmlConvertException: Could not generate the PDF document. Could not get image from url. Could not initialize the html converter object. Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))."

A: This error indicates the WebBrowser control could not access the COM interface of the Internet Explorer. You can try to use the dcomcnfg utility to allow the user running the application to access the interface. In Start->Run type dcomcnfg and under Component Services -> Computers -> My Computer -> DCOM Config select Internet Explorer. Right click on it and from tabbed properties select Security. To customize the access permissions select Customize radio button and give access to the user running the application ( for ASP.NET this should be the IUSR_{MACHINE_NAME} if your application is using impersonation to execute )

22
Can the converter convert HTTPS (SSL secured) URLs?

A: In general, yes. There are a few situations when a HTTPS URL cannot be converted to PDF. The most common situation is when using self-signed test SSL certificates or invalid SSL certificates. When you are using a test certificate or an invalid SSL certificate the IE browser will display a page containing an warning about an invalid certificate being used. Similar to the browser behavior, the converter will also fail to convert the web page when an invalid certificate is used to secure the web page.

Other situation when the converter can fail is when various security restrictions are set on your computer or in your network. For example we have found situations when the firewall set in a network was blocking the access to the Certificate Revocation List file (a file with .crl hosted on the certificate issuer website). The converter was failing to retrieve the revocation list for the certificate and therefore the whole conversion was failing.

We have found also situations when the network architecture was designed in such a way that only computers from the Internet were allowed to access secured web pages hosted inside the internal network while the accesses coming from clients inside the internal network were rejected. To eliminate such a possibility you can try to convert a secured web page from Internet like https://www.paypal.com.

There might other restrictions in your network, some of them based on the Windows user credentials. If you can access a HTTPS web page from the IE web browser on the server but the same URL is reported as inaccessible by the converter then you can try to convert that URL using our Windows Forms sample application (in the Bin folder of the installation). The IE web browser and the Windows Forms application should run under the same Windows user account and should present the same credentials in your network. If the conversion works from the Windows Forms application but it's not working from an ASP.NET application then probably there is a restriction somewhere based on the Windows user account and you should contact your network administrator to learn more about the architecture of your network. The ASP.NET applications run in general under a less privileged Windows account. You can try to use a more privileged user account like NetworkService or even an Administrator to run the IIS application pool of your website.

To avoid this kind of issues with HTTPS URL try to use HTTP instead HTTPS when this is possible. You can also consider to get the HTML string of the web page (as explained in the next section) and set the base URL parameter to be a HTTP address if accessing the images and the CSS style files by a normal HTTP address is possible. This way you can have a secured access to the text in the web page while the access to images and CSS files is not secured.

23
After I have installed IE9 (or newer) on the computer where the converter runs the generated PDF does not contain anymore searchable text.

A: MagneticPdf v2.0 fixes this problem.

24
After I have installed IE9 (or newer) some of the transparent PNG images are rendered blurred in PDF and some of the table borders are rendered as black in PDF even if they have a different color in the HTML document.
A: MagneticPdf v2.0 fixes this problem.