XSettings SetConfigSection Function. Set the application configuration section. ABCpdf .NET PDF Library.

ABCpdf .net

 
   

Set the application configuration section.

 

   
Syntax  

[C#]
void SetConfigSection(ConfigSection section)

[Visual Basic]
Sub SetConfigSection(section As ConfigSection)

 

   

Params
 
Name Description
section The ABCpdf configuration section.
return None.

 

   

Notes
 

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("ABCpdf10.Section"). So, as long as you have a valid ABCpdf10.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 ABCpdf10.Section. The type is WebSupergoo.ABCpdf10.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.

 

   

Example
 

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.

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