Set the application configuration section.




void SetConfigSection(ConfigSection section)

[Visual Basic]
Sub SetConfigSection(section As ConfigSection)



Name Description
section The ABCpdf configuration section.
return None.




Use this method to change ABCpdf's configuration section object.

Normally, you will not need to call this method because ABCpdf automatically detects the presence of the default configuration file. It does so by calling System.Configuration.ConfigurationManager.GetSection("ABCpdf12.Section"). So, as long as you have a valid ABCpdf12.Section in your configuration file, there should be no need to call this method.

For local applications, configuration files are normally stored in the same folder as the application and are called <application.exe>.config, where <application.exe> is the file name of the application. For web applications, the configuration section is stored in Web.config.

The ABCpdf section name should be ABCpdf12.Section. The type is WebSupergoo.ABCpdf12.ConfigSection. Refer to the example below for details. ConfigSection is an opaque class that contains an array of Preferences.

Each preference has a Key and a Value.

If a preference is not found in the configuration file, it is read from the registry.

The preference key is the same as the registry key name. For example, <add Key="LogErrors" Value="1" /> is equivalent to a DWORD registry key called LogErrors and with Value set to 1. Refer to Registry Keys in Concepts for further details. Make sure that the value matches the type as specified in Registry Keys.

Warning: changing preferences from ABCpdf events/callbacks for operations that use those preferences may cause problems.




Here is an example of a .config file that contains a valid ABCpdf config section. The illustrated ABCpdf preferences are LogErrors, UserName and Password. Other preferences will be read from the Registry.

Important: <configSections> must appear before <startup> if <startup> exists. Also note that the type is used to load the assembly DLL so the 'ABCpdf' entry below may need to be changed to 'ABCpdf.NET5' if you are using .NET 5.0.

<?xml version="1.0" encoding="utf-8"?>
    <section name="ABCpdf12.Section" type="WebSupergoo.ABCpdf12.ConfigSection, ABCpdf" allowLocation="true"
allowDefinition="Everywhere" allowExeDefinition="MachineToLocalUser" overrideModeDefault="Allow"
restartOnExternalChanges="true" requirePermission="true" />
      <clear />
      <add Key="TempDirectory" Value="C:\Temp" />
      <add Key="LogErrors" Value="1" />
      <add Key="MakeURLsUnique" Value="0" />
      <add Key="MSOfficeShow" Value="1" />