Internet Explorer Options

These options control the behavior of the Internet Explorer converter used by Document Conversion Service. Table values in bold text are the default value for that setting.

The default Internet Explorer options are to print no headers or footer information, use margins of 0.75", to print all background color and images and to shrink the page to fit. See Adding Headers, Footers and Fonts to HTML Conversion for instruction on customizing the Internet Explorer converter settings.

There are also application level Internet Explorer settings to control image scaling and browser emulation; see Application Level Configuration Settings to change these options.

 

 

 

Code Sample - C#

 

PNDocConvQueueServiceLib.PNDocConvQueueItem item = null;

 

// Create the conversion item

item = new PNDocConvQueueServiceLib.PNDocConvQueueItem();

 

// Set conversion settings

item.Set("Microsoft.InternetExplorer.PageSetup.Footer",

          "&b&u&b");

item.Set("Microsoft.InternetExplorer.PageSetup.MarginBottom""0.50");

item.Set("Microsoft.InternetExplorer.PageSetup.MarginLeft""0.50");

item.Set("Microsoft.InternetExplorer.PageSetup.MarginRight""0.50");

item.Set("Microsoft.InternetExplorer.PageSetup.MarginTop""0.50");

...

// convert the file

item.Convert("Internet Explorer",

             @"C:\Test\ArchiveReport.mht",

             @"C:\Test\Out\ConvertedReport");

 

Code Sample - VB.NET

 

Dim item As PNDocConvQueueServiceLib.IPNDocConvQueueItem

 

 ' Create the conversion item

item = New PNDocConvQueueServiceLib.PNDocConvQueueItem()

 

' Set conversion settings

item.Set("Microsoft.InternetExplorer.PageSetup.Footer","&b&u&b")

item.Set("Microsoft.InternetExplorer.PageSetup.MarginBottom""0.50")

item.Set("Microsoft.InternetExplorer.PageSetup.MarginLeft""0.50")

item.Set("Microsoft.InternetExplorer.PageSetup.MarginRight""0.50")

item.Set("Microsoft.InternetExplorer.PageSetup.MarginTop""0.50")

 

...

' convert the file

item.Convert("Internet Explorer", _

             "C:\Test\ArchiveReport.mht", _

             "C:\Test\Out\ConvertedReport")

 

 

Conversion Settings - Page Setup

Name:

Microsoft.InternetExplorer.PageSetup.Header

 

The format of the header to print on each page. By default, no page header is printed.

 

Values:

If you do want a header when converting HTML files, follow the instructions here.

 

Name:

Microsoft.InternetExplorer.PageSetup.Footer

 

The format of the footer to print on each page. By default, no page footer is printed.

 

Values:

If you do want a footer when converting HTML files, follow the instructions here.

 

Name:

Microsoft.InternetExplorer.PageSetup.Font

 

The font to use if printing headers and footers. The font is specified as follows, with text in bold specifying the font name, its point size and the color. The last two options, font-style: italic; and font-weight: bold are optional and are only to be included if bold, italic, or bold and italic text is wanted.

 

Values:

String value containing the font definition.

 

font-family: <name>; font-size: <size>pt; color: rgb(0,0,0); font-style: italic; font-weight: bold;

 

Name:

Microsoft.InternetExplorer.PageSetup.MarginBottom

 

The bottom margin in inches. The default is 0.75.

 

Values:

String value of the desired margin height.

 

Name:

Microsoft.InternetExplorer.PageSetup.MarginLeft

 

The left-hand side margin in inches. The default is 0.75.

 

Values:

String value of the desired margin width.

 

Name:

Microsoft.InternetExplorer.PageSetup.MarginRight

 

The right-hand side margin in inches. The default is 0.75.

 

Values:

String value of the desired margin width.

 

Name:

Microsoft.InternetExplorer.PageSetup.MarginTop

 

The top margin in inches. The default is 0.75.

 

Values:

String value of the desired margin height.

 

Name:

Microsoft.InternetExplorer.PageSetup.PrintBackground

 

Determines if background colors and images are printed. By default, they are always printed.

 

Values:

String value "True" or "False".

 

Name:

Microsoft.InternetExplorer.PageSetup.ShrinkToFit

 

Determines if the page is scaled to fit on the the printed page. By default it is always printed with Shrink-to-Fit enabled.

 

By default, the minimum scale factor is 30, meaning the page will shrink to at most 30% of its original size to try and fit the contents on the page. If you need the page to be larger, this scaling factor can be customized in the Internet Explorer section in the ApplicationFactory section of the Document Conversion Service application configuration file. See also Application Level Configuration Settings.

 

<AppFactory Name="Internet Explorer"
            Type="PEERNET.PNDocConv.Applications.PNInternetExplorerApplicationFactory"
            Assembly="PNInternetExplorerApplicationFactory">
  <Settings>
    ...
    <add Name="ConverterPlugIn.PNIExplorer.ShrinkToFitScaleMin" Value="30" />
  </Settings>
</AppFactory>

 

Values:

String value "True" or "False".

 

Adding Headers, Footers and Fonts to HTML Conversion

The simplest method to add header and footer information and font information is to use the Page Setup dialog in Internet Explorer to configure the margins, headers, footers and other page setup options and then copy these settings from the registry keys Internet Explorer uses to store this information.

1.Open  Internet Explorer to any web page or html file.

2.In the upper right corner, click the Tools icon ( it looks like a blue gear), then select Print - Page Setup.

a.Alternatively you can press the F10 key to show the application menu and then select File - Page Setup.

3.In the Page Setup dialog, define your margins, any header and footer information, and optionally choose the font you want to use. Click OK, then exit Internet Explorer.

4.Open the registry using RegEdit (type regedit.exe into the Start menu search field or from the Start menu go to Programs - Accessories - Run and type regedit.exe).

5.In the registry editor, go to the HKEY_CURRENT_USER folder, then Software - Microsoft - Internet Explorer - PageSetup.

6.In the right-hand pane, double click any of the values to open the Edit String dialog box. From here you can copy and paste the header and footer formatted strings. When using these strings in the conversion profiles, any & characters need to be replaced with &amp; for the string to be parsed correctly.

Application Level Configuration Settings

Document Conversion Service uses Internet Explorer to convert HTM, HTML and MHT files. When dealing with MHT and HTML files with large images, and older style HTML files formatted for earlier browser versions the options for image scaling and browser emulation may need to be configured to produce the desired output file.

These options are set in the Internet Explorer section of the application configuration file. Changing these options will require a restart of Document Conversion Service for the new settings to take effect.

Setting the Minimum Scale For Internet Explorer

HTML files and MHT files such as email messages from Outlook can sometimes have very wide images. By default, these files are always printed with Shrink-to-Fit enabled and a minimum scale factor of 30. This means that the page will shrink to at most 30% of its original size to fit the image contents on the page.

If you need the images to be scaled larger, the setting ConverterPlugIn.PNIExplorer.ShrinkToFitScaleMin can be adjusted from between 30 to 100 to get the size of image you want.

This option is set at the application level and cannot be changed per file. Changes to this setting require a restart of Document Conversion Service to take effect.

Setting the Browser Emulation for Internet Explorer

In certain cases, older HTML files created for previous versions of Internet Explorer will not convert correctly when printed using the latest version of Internet Explorer.  This is because Internet Explorer runs with Edge compatibility by default and it is this new compatibility and rendering that has a problem with the older style HTML.

If you have these type of files, the setting ConverterPlugIn.PNIExplorer.BrowserEmulation can be used to force Internet Explorer to emulate older versions of the browser so that the files are rendered properly based on the older browsers rendering engine.

This option is set at the application level and cannot be changed per file. Changes to this setting require a restart of Document Conversion Service to take effect.

 

Configuration Section for Internet Explorer

 

<AppFactories>

  <Factories>

 

    <AppFactory Name="Internet Explorer"

                Type="PEERNET.PNDocConv.Applications.PNInternetExplorerApplicationFactory"

                Assembly="PNInternetExplorerApplicationFactory">

        <Settings>

          <add Name="Enabled" Value="auto"/>

          <add Name="MaxInstances" Value="auto"/>

          <add Name="RecycleThreshold" Value="0"/>

          <add Name="DocumentOpenTimeout" Value="360000"/>

 

          <!-- Value range 30 - 100 -->

          <add Name="ConverterPlugIn.PNIExplorer.ShrinkToFitScaleMin" Value="30"/>

 

          <!-- Values: Empty string, IE7, IE8, IE8FORCE, IE9, IE9FORCE, IE10, IE10FORCE, IE11, IE11FORCE -->

          <add Name="ConverterPlugIn.PNIExplorer.BrowserEmulation" Value="" />

 

        </Settings>

      </AppFactory>

    ... 

    

  </Factories>

  <Settings>

    <!-- Global factory settings -->

    <add Name="MaxInstances" Value="auto"/>

    <add Name="RecycleThreshold" Value="0"/>

  </Settings>

</AppFactories>