Altsoft Xml2PDF Formatter Configuration File Structure

You may apply certain default configuration parameters when using Altsoft Xml2PDF engine. These parameters should be stored in configuration (.conf) file. The structure of this file follows the XML syntax and uses the set of predefined tags to specify default parameters of the formatted document. The description of all supported tags is given below.

 

Configuration File DTD (Document Type Definition)

<!ELEMENT conf (property)*>
<!ELEMENT property EMPTY>
<!ATTLIST property
        name CDATA #REQUIRED
        value CDATA #REQUIRED>

 

Default Properties Description

To set a certain default document property it is necessary to specify its name and value. Each property value belongs to one of four data types:

  • Boolean
  • Length
    • Length in absolute units:
      • Points (pt)
      • Centimeters (cm)
      • Millimeters (mm)
      • Picas (pc)
      • Inches (in)
    • Length in relative units:
      • Font-size (em)
      • Font x-height (xm)
    • Length in percentage.
  • Set of predefined constants
  • String
Here is the list of implemented property names and the desription of the corresponding values.

Property Name Property Value
font.default-font.family Specifies the default font-family to be used in formatting. Value is a string. The default is Times.
font.default-font.stretch Specifies the default font stretch. Value is the string constant (valid constants are: "normal", "wider", "narrower", "ultra-condensed", "extra-condensed", "condensed", "semi-condensed", "semi-expanded", "expanded" extra-expanded", "ultra-expanded"). The default is normal.
font.default-font.variant Specifies the default font variant. Value is the string constant (standard constants are: "normal" or "small-caps"). The default is normal.
font.default-font.weight Specifies the default font weight. Value is the string constant (standard constants are: "normal", "bold", "bolder" or "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900"). The default is normal (400).
font.default-font.style Specifies the default font style. Value is the string constant (valid constants are: "normal", "italic", "oblique" or "backslant"). The default is normal.
font.default-font.size Specifies the default font size. Value is the length.The default is 0pt.
font.selection.std-fonts-preferred Specifies whether the standard PDF fonts should be preferred. Value is boolean. The default is false.
font.selection.make-subsetting Specifies whether only a subset of certain non-standard font is embedded into the resulting PDF document. Value is boolean. The default is true.
font.selection.std-fonts-only Specifies whether only the 14 standard PDF Type 1 fonts are used in formatting. Value is boolean. The default is false.
font.selection.embedd-non-std-fonts Specifies whether non-standard PDF fonts should be embedded or not. Value is boolean. The default is true.
font.selection.analyze-charset Specifies whether font charset is analysed in order to recognize maximum number of symbols. Value is boolean. The default is false.
general.inline.margin-auto Specifies the default width of inline margins in the resulting PDF document. Value is the length. The default is 10pt.
general.inline.border-width-thin Specifies the default width of the thin border for the inlines. Value is the length. The default is 1pt.
general.inline.border-width-medium Specifies the default width of the medium border for the inlines. Value is the length. The default is 5pt.
general.inline.border-width-thick Specifies the default width of the thick border for the inlines. Value is the length. The default is 10pt.
general.inline.use-large-allocation Specifies whether large allocation rectangle of the inline object is used when evaluating outer block allocation rectangle. The default is false.
general.block.margin-auto Specifies the default width of block margins in the resulting PDF document. Value is the length. The default is 10pt.
general.block.border-width-thin Specifies the default width of the thin border for the blocks. Value is the length. The default is 1pt.
general.block.border-width-medium Specifies the default width of the medium border for the blocks. Value is the length. The default is 5pt.
general.block.border-width-thick Specifies the default width of the thick border for the blocks. Value is the length. The default is 10pt.
hyph.path Specifies the path to the folder containing additional resources necessary for formatting. Actually this folder should contain files necessary for the correct implementation of hyphenation service for the language-locale couple used in the source document. Value is a string.
hyph.language Specifies the default language for the language-locale-coupled services. Value is a string. The default is en.
hyph.country Specifies the default country for the language-locale-coupled services. Value is a string. The default is US.
hyph.hyphenate-with-delimeters Specifies whether words with delimiters should be hyphened. Value is boolean. The default is false.
page.crop-bottom Specifies the default width of the bottom page crop in the resulting PDF document. Value is the length. The default is 0cm.
page.crop-top Specifies the default width of the top page crop in the resulting PDF document. Value is the length. The default is 0cm.
page.crop-right Specifies the default width of the right page crop in the resulting PDF document. Value is the length. The default is 0cm.
page.crop-left Specifies the default width of the left page crop in the resulting PDF document. Value is the length. The default is 0cm.
page.width Specifies the default page width. Value is the length. The default is 21cm.
page.height Specifies the default page height. Value is the length. The default is 27.9cm.




Example (standard A4.conf file):

<?xml version="1.0" encoding="utf-8"?>
<conf>
 <property name="font.selection.make-subsetting" value="True" />
 <property name="font.selection.std-fonts-only" value="False" />
 <property name="general.inline.margin-auto" value="10pt" />
 <property name="hyph.hyphenate-with-delimeters" value="False" />
 <property name="page.crop-bottom" value="0cm" />
 <property name="hyph.path" value="\resources" />
 <property name="hyph.language" value="en" />
 <property name="hyph.country" value="US" />
 <property name="font.selection.std-fonts-preferred" value="False" />
 <property name="general.inline.border-width-medium" value="5pt" />
 <property name="font.default-font.stretch" value="normal" />
 <property name="page.width" value="21cm" />
 <property name="font.default-font.variant" value="normal" />
 <property name="general.inline.border-width-thin" value="1pt" />
 <property name="font.default-font.weight" value="400" />
 <property name="font.default-font.style" value="normal" />
 <property name="page.crop-left" value="0cm" />
 <property name="font.default-font.family" value="Times" />
 <property name="page.crop-right" value="0cm" />
 <property name="page.height" value="27.9cm" />
 <property name="general.inline.border-width-thick" value="10pt" />
 <property name="font.selection.embedd-non-std-fonts" value="True" />
 <property name="page.crop-top" value="0cm" />
</conf>




Send comments on this topic.

© Altsoft Company. All rights reserved.