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") |
|
||||
---|---|---|---|---|
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
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 & for the string to be parsed correctly.
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.
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.
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> |