.NET Interface

The .NET Interface makes it possible for Antenna House Formatter V7.4 to function through .NET applications developed using Visual Basic.NET, Visual C#.NET and similar programs.

The .NET interface has been tried and tested in the following Microsoft .NET Framework and .NET environments.

  • Microsoft .NET Framework 4.5.2
  • Microsoft .NET Framework 4.6.x
  • Microsoft .NET Framework 4.7.x
  • Microsoft .NET Framework 4.8
  • .NET 6

Component Registration

Antenna House Formatter .NET component is not registered automatically to the global assembly cache (GAC). It is necessary to create the path either by putting the .NET component in the current folder of the application, or by creating an application configuration file.

To run the .NET interface, you must include [Install directory] in Windows versions and [Install directory]/​lib in non-Windows versions in the search path for shared libraries at runtime. In Windows versions, the above path is added to the environment variable PATH during installation, so no additional settings are required. It is necessary to add [Install directory]/​lib to the search path of the shared library at runtime, such as setting the environment variable LD_LIBRARY_PATH in the Linux version (64-bit version) and the environment variable DYLD_LIBRARY_PATH in the Macintosh version (64-bit version). See also Environment Variables for the necessary environment variables.

.NET Component File Namefor .NET Framework 4.5.2/4.6.x/4.7.x/4.8
(Included in Windows only)
XfoDotNet40Ctl74.dll
for .NET XfoDotNetCore31Ctl74.dll

Confirm the necessary redistributable package for .NET Framework at System Requirements.

Classes

The following classes are contained in the .NET component:

NameFunctions
XfoObjAntenna House Formatter V7.4 class (itself). This class implements an IDisposable interface. When exiting XfoObj class object, call Dispose method in order to release the resource.

Example for C#

XfoDotNetCtl.XfoObj obj = new XfoDotNetCtl.XfoObj();
try {
  // some process
} finally {
  obj.Dispose();
}
XfoExceptionAntenna House Formatter V7.4 exception class. Throws the execute method of XfoObj class.

Properties

XfoException Class includes the following properties:

NameTypeR/WFunctions
ErrorLevelInt32R Indicates the level of the error that occurred during the formatting process.
1.Information
2.Warning
3.Recoverable Error
4.Fatal Error
ErrorCodeInt32RIndicates the code of the exception error that occurred during the formatting process. Zero means no error. Non-zero indicates any error occurred.
MessageStringRGet the message of the exception error that occurred during the formatting process.

XfoObj Class includes the following properties:

NameTypeR/WFunctions
VersionStringRGet the version string of Antenna House Formatter V7.4.
DocumentURIStringR/WSpecifies the URI of the XML/FO/HTML documents you will format.
  • If DocumentURI is omitted or “@STDIN” is specified, FO documents are loaded from stdin.
The documents loaded from stdin are supposed to be FO files.
StylesheetURIStringR/WSpecifies the URI of XSL/CSS stylesheets for formatting. If the specified XML document is FO, or the XML file contains the processing instruction <?xml-stylesheet ...?> and the stylesheet is specified, or the specified document is HTML, there is no need to specify a stylesheet.
If the specified document is CSS, it will be the last user stylesheet. It is applied posterior to the stylesheet added by AddUserStylesheetURI and the Option Setting File specified by AddOptionFileURI.
StylesheetTitleStringR/WSpecify the title of the processing instruction of the preferred stylesheet <?xml-stylesheet title="..."?>.
FormatterTypeInt32R/W Specify formatter type. Use one of the following values to specify the formatter type:
0.AUTO
1.HTML
2.XHTML
3.XML+CSS
4.XSL-FO
If this parameter is omitted or invalid, it is considered AUTO.
HtmlDefaultCharsetStringR/WSpecifies the default encoding of HTML. This setting is applied to HTML whose encoding is unknown.
OptionFileURIStringR/WSpecifies the URI of the XML-format Option Setting File which describes Antenna House Formatter V7.4 options. The contents of the Option Setting File are evaluated immediately. When you set a property that is contrary to an already set property, the existing setting will be overwritten. URI added by AddOptionFileURI will be canceled.
OptionFileCountInt32RCounts the number of Option Setting Files you specified.
PrinterNameStringR/W Specifies the output format or the printer name to output.
  • When a printer name is specified, the formatted result is outputted to that printer.
  • When “@STDPRN” is specified, the formatted result is outputted to the currently used printer.
  • When “@PDF” is specified, the formatted result is outputted to PDF.  PDF Output
  • When “@SVG” is specified, the formatted result is outputted to SVG.  SVG Output
  • When “@PS” is specified, the formatted result is outputted to PostScript.  PostScript® Output
  • When “@XPS” is specified, the formatted result is outputted to XPS.  XPS Output
  • When “@DOCX” is specified, the formatted result is output to Word(docx). no-LT  Word(docx) Output
  • When “@TEXT” is specified, the formatted result is outputted to a text format file. no-LT  TEXT Output
  • When “@AreaTree” is specified, the AreaTree will be outputted. no-LT
  • When “@CSSDebugTree” is specified, CSS Debug Tree will be outputtd. V7.4 no-LT
If this parameter is omitted, -p @PDF is automatically specified.
See “Printer Name” for the printer name information. The setting of the printer (printer name or @STDPRN) is effective only with Windows versions.
@DOCX, @TEXT, @AreaTree and @CSSDebugTree are not effective with Antenna House Formatter V7.4 Lite.
PrinterSettingURIStringR/WSpecifies the URI of the Printer Setting File. See “Printer Setting File”. This property is effective only with Windows versions.
OutputFilePathStringR/W Specifies the output file path of the formatted result. When a printer is specified as an output format by PrinterName, a printing result is saved to the specified file by the printer driver. When an output format other than a printer is specified, it is saved as the specified file with the specified output format. When omitted, or when “@STDOUT” is specified, it goes to standard output.
OutputFOPathStringR/W Specifies the output FO file as the result of XSLT when the input files are an XML document and an XSL stylesheet.
  • If the input file is FO (or HTML etc.), no file is outputted.
  • When “@STDOUT” is specified, it is considered stdout.
If the setting is omitted, nothing outputs.
HyphenDicPathStringR/W Specifies the directory where the hyphenation dictionary exists.
ExternalXSLTStringR/WCommand-line of External XSLT Processor. If this is omitted, default MSXML will be used. For example:
xslt %param -o %3 %1 %2
These meanings are as follows:
  • %1 : XML document
  • %2 : XSL stylesheet
  • %3 : XSLT output file
  • %param : xsl:param
%1 to %3 are used to express only parameter positions. Do not replace them with actual file names. In case you use xsl:param for an external XSLT Processor, set the parameter in XSLTParamFormat and SetXSLTParam.
XSLTParamFormatStringR/WSpecifies the parameter format of xsl:param when using External XSLT Processor. For example:
-p %p %v
These meanings are as follows:
  • %p : Parameter Name
  • %v : Parameter Value
BaseURIStringR/W Specifies the default base URI.
FormattedPagesInt32R Get the formatted total pages.
TwoPassFormattingBooleanR/WWhen formatting a huge document with a large amount of unresolved <fo:page-number-citation>, a large amount of memories are consumed because the cancellation of the page information is impossible. Therefore, the limit is caused in the number of pages to format. This parameter solves that problem by making the formatting two passes. Although its processing time may be increased, only the page number information which should be solved will consume the memory and the memory consumption will be extremely decreased. See “Formatting Large Document”. This setting is invalid with CSS formatting. no-LT
MultiVolumeBooleanR/W Specifies to output PDF in separate volume. The error occurs when FO doesn't include the <axf:output-volume-info> extension element. When the value false is specified, the StartVolume/EndVolume parameter is invalid, instead the parameter StartPage/EndPage is effective. When the value true is specified, the parameter StartPage/EndPage is invalid, instead the parameter StartVolume/EndVolume is effective. no-LT
StartVolume
EndVolume
Int32R/W Effective when MultiVolume=true is specified. Specifies the start and the end of separate volume to output. If the setting of start for separate volume is omitted or the value true is 0, the start volume is accounted as the first volume. If the setting of start for separate volume is omitted or the value true is greater than actual number of separate volume, the end volume is accounted as the last volume. If the setting is conflicted, an error occurs. (e.g. StartVolume=5 EndVolume=3) no-LT
TotalVolumeCountInt32R Gets the number of all the separate volumes when outputting PDF to multiple separate volumes. no-LT
OutputVolumeCountInt32R Gets the number of the actual separate volumes when outputting PDF to multiple separate volumes. no-LT
StartPage
EndPage
Int32R/W Specifies the start page number or the end page number of a document to output. If the start page is omitted or the specified value is 0, the start page is considered the first page. If the end page is omitted or 0, or the specified value exceeds the actual page number, the end page is considered the last page. If the setting is inconsistent (for example, StartPage=5 EndPage=3), an error occurs.
ExitLevelInt32R/WSpecifies error level to abort formatting process. Antenna House Formatter V7.4 will stop formatting when the detected error level is greater than or equal to the specified ExitLevel property. The default value is 2 (Warning). Thus if an error occurred and error level is greater than or equal to 2 (Warning), the formatting process will be aborted. Legal values are from 1 to 4. When the value of greater than or equal to 5 is specified, it is considered the value of 4. If an error-level:4 (Fatal error) occurs, the formatting process will be aborted unconditionally. Note: Setting this value does not cause an error message to be displayed.
ErrorLevelInt32RIndicates the error level that occurred during the formatting process.
1.Information
2.Warning
3.Recoverable Error
4.Fatal Error
ErrorCodeInt32RIndicates the error code of the error that occurred during the formatting process. Zero means no error. Non-zero indicates an error occurred.
ErrorMessageStringRIndicates the Error Messages of the error that occurred during the formatting process.
ErrorStreamTypeInt32R/WOutputs the Error Messages to standard output or to standard error when the error level is less than the specified error level allowed while formatting. The error message is not outputted in default.
0.Not output
1.Standard output
2.Standard error output
XmlDomDocumentSystem.Xml.XmlDocumentWSpecifies the target XML document used by the System.Xml.XmlDocument class object.
XmlDomStylesheetSystem.Xml.XmlDocumentWSpecifies the target XSL stylesheet by the System.Xml.XmlDocument class object.

Properties – PDF Settings

NameTypeR/WFunctions
PdfVersionInt32R/W Specifies PDF version:
0.PDF1.3
1.PDF1.4
2.PDF1.5
3.PDF1.6
4.PDF1.7
10.PDF2.0
101.PDF/X-1a:2001 no-LT
103.PDF/X-3:2002 no-LT
104.PDF/X-1a:2003 no-LT
105.PDF/X-2:2003 no-LT
106.PDF/X-3:2003 no-LT
107.PDF/X-4:2010 no-LT
108.PDF/X-4p:2010 no-LT
200.PDF/A-1a:2005 no-LT
400.PDF/A-1b:2005 no-LT
631.PDF1.4/A-2a:2011 no-LT
632.PDF1.5/A-2a:2011 no-LT
633.PDF1.6/A-2a:2011 no-LT
634.PDF1.7/A-2a:2011 no-LT
641.PDF1.4/A-2b:2011 no-LT
642.PDF1.5/A-2b:2011 no-LT
643.PDF1.6/A-2b:2011 no-LT
644.PDF1.7/A-2b:2011 no-LT
651.PDF1.4/A-2u:2011 no-LT
652.PDF1.5/A-2u:2011 no-LT
653.PDF1.6/A-2u:2011 no-LT
654.PDF1.7/A-2u:2011 no-LT
661.PDF1.4/A-3a:2012 no-LT
662.PDF1.5/A-3a:2012 no-LT
663.PDF1.6/A-3a:2012 no-LT
664.PDF1.7/A-3a:2012 no-LT
671.PDF1.4/A-3b:2012 no-LT
672.PDF1.5/A-3b:2012 no-LT
673.PDF1.6/A-3b:2012 no-LT
674.PDF1.7/A-3b:2012 no-LT
681.PDF1.4/A-3u:2012 no-LT
682.PDF1.5/A-3u:2012 no-LT
683.PDF1.6/A-3u:2012 no-LT
684.PDF1.7/A-3u:2012 no-LT
1002.PDF1.5/UA-1:2014 no-LT
1003.PDF1.6/UA-1:2014 no-LT
1004.PDF1.7/UA-1:2014 no-LT
Impossible to specify PDF/X, PDF/A or PDF/UA with Antenna House Formatter V7.4 Lite.
PdfEncryptLevelInt32R/W Specifies the key length when encrypting the PDF file during output. The key length can be specified as follows:
0.40bit RC4
1.128bit RC4
2.128bit AES
3.256bit AES
This parameter is effective only when you specify PDF1.4 or later for the PdfVersion property. 128bit AES is effective with PDF1.6 or later, 256bit AES is effective with PDF1.7 or later.
PdfTagBooleanR/W Generates Tagged PDF. Ignored if PDF cannot be tagged depending on the PDF versions. no-LT
PdfReversePageBooleanR/WOutputs pages in reverse order.
PdfUserPasswordStringW Specifies the user password to be set for the PDF. Specify up to 32 ASCII characters for PDF1.3 to 1.7 and 127 ASCII characters for PDF2.0 or later.
PdfOwnerPasswordStringW Specifies the owner password to be set for the PDF. Specify up to 32 ASCII characters for PDF1.3 to 1.7 and 127 ASCII characters for PDF2.0 or later.
PdfNoPrintingBooleanR/W Prohibits printing the PDF file.
It is necessary to specify PdfOwnerPassword so that this parameter is effective.
PdfNoChangingBooleanR/W Prohibits making changes to the PDF file.
It is necessary to specify PdfOwnerPassword so that this parameter is effective.
PdfNoContentCopyingBooleanR/W Prohibits copying the content of the PDF file.
It is necessary to specify PdfOwnerPassword so that this parameter is effective.
PdfNoAddingOrChangingCommentsBooleanR/W Prohibits adding comments and form fields to the PDF file.
It is necessary to specify PdfOwnerPassword so that this parameter is effective.
PdfNoFillFormBooleanR/W Prohibits filling in of form fields and signing of the PDF file. This parameter is effective only when you specify PDF1.4 or later for the PdfVersion property. In order to make this parameter effective, other parameter settings may be required. For more details, see also ISO 32000-1 or ISO 32000-2.
PdfNoAccessibilityBooleanR/W Prohibits text access for screen reader devices of the PDF file. This parameter is effective only when you specify PDF1.4 or later for the PdfVersion property.
PdfNoAssembleDocBooleanR/W Prohibits inserting, deleting and rotating the PDF pages. This parameter is effective only when you specify PDF1.4 or later for the PdfVersion property.
PdfEmbedAllFontsExInt32R/W Specifies whether or not to embed all embeddable fonts used in the file of the formatted result into PDF. However, even if all fonts are specified to embed, the font forbidden embedding or the font that is not able to be embedded to PDF cannot be embedded.
0.Specified font
1.All fonts excluding Base14 font
2.All fonts including Base14 font
PdfEmbedFontsStringR/W Embeds the specified font in the created PDF. To specify multiple fonts, put commas between each font.
PdfEmbedSubsetFontPercentageInt32R/WEmbeds all fonts when the percent of characters used is greater than or equal to specified value, subsets embedded fonts when the percent of characters used is less than the specified value. If nothing is specified, it is considered 100 and embedded fonts are always subset.
PdfErrorOnEmbedFaultBooleanR/W When true is specified, an error is issued when font embedding fails.
PdfErrorOnMissingGlyphBooleanR/W When true is specified, an error is issued when there is a missing glyph.
PdfPrintingAllowedInt32R/W Specifies whether and how to permit printing of the PDF. This parameter is effective only when you specify PDF1.4 or later for the PdfVersion property.
0.Not Allowed
1.Low Resolution Printing
2.High Resolution Printing
PdfImageCompressionInt32R/W When a color image format cannot be stored directly in the PDF, an image is stored after being transformed into a bitmap format that is compatible with PDF. Use one of the following values to specify the compression method of the data stored in a PDF file:
0.JPEG or ZLIB compression
1.JPEG compression
2.ZLIB compression
3.JPEG 2000 compression (it is effective only when PdfVersion is PDF1.5 or later)
4.LZW or JPEG or ZLIB compression
5.JPEG 2000 or JPEG or ZLIB compression (it is effective only when PdfVersion is PDF1.5 or later)
6.LZW or JPEG 2000 or JPEG or ZLIB compression (it is effective only when PdfVersion is PDF1.5 or later)
When Auto is selected, the process is automatically done and creates the image data according to the setting of PdfJPEGQuality and PdfRasterizeResolution. Whichever has the smaller compressed size, JPEG or ZLIB, is selected. These are the settings for color images. Specify PdfGrayscaleImageCompression for grayscale images and PdfMonochromeImageCompression for monochrome images.
PdfJPEGQualityInt32R/W With color image formats that cannot be stored directly in a PDF, if JPEG compression is specified for PdfImageCompression the image quality can be specified with a numeric value of 1 to 100. Higher values are proportional to increased image quality. However the file size also becomes larger. This is the setting for color images. PdfGrayscaleJPEGQuality can be specified for grayscale images.
PdfPutImageColorProfileBooleanR/W Specifies whether to embed the ICC profile (of the embedded color image) in the PDF.
PdfImageDownSamplingInt32R/W Specifies either of the following methods to downsample the raster color image in a PDF:
0.None
1.Average
2.Bicubic
3.Subsampling
When a value other than None is specified, an image that has a resolution greater than or equal to the one specified by PdfImageDownSamplingDPI will be downsampled into the resolution specified by PdfImageDownSamplingTarget. These are the settings for color images. Specify PdfGrayscaleImageDownSampling for grayscale images and PdfMonochromeImageDownSampling for monochrome images.
PdfImageDownSamplingTargetInt32R/W Sets the target resolution when a raster color image is downsampled.
PdfImageDownSamplingDPIInt32R/W Sets the resolution for the downsampled raster color image.
PdfGrayscaleImageCompressionInt32R/W When a grayscale image format cannot be stored directly in the PDF, the image is transformed and stored in a bitmap format that is compatible with PDF. Use one of the following values to specify the compression method of the data stored in a PDF file:
0.JPEG or ZLIB compression
1.JPEG compression
2.ZLIB compression
3.JPEG 2000 compression (it is effective only when PdfVersion is PDF1.5 or later)
4.LZW or JPEG or ZLIB compression
5.JPEG 2000 or JPEG or ZLIB compression (it is effective only when PdfVersion is PDF1.5 or later)
6.LZW or JPEG 2000 or JPEG or ZLIB compression (it is effective only when PdfVersion is PDF1.5 or later)
When Auto is selected, the process is automatically done and creates the image data according to the setting of PdfGrayscaleJPEGQuality and PdfRasterizeResolution. Whichever has the smaller compressed size, JPEG or ZLIB, is selected. These are the settings for grayscale images. Specify PdfImageCompression for color images and PdfMonochromeImageCompression for monochrome images.
PdfGrayscaleJPEGQualityInt32R/W For grayscale image formats that cannot be stored directly in the PDF, if JPEG compression is specified in PdfGrayscaleImageCompression the image quality can be specified by a numerical value of 1 to 100. Higher values are proportional to increased image quality, however the file size also becomes larger. These are the settings for grayscale images. Specify PdfJPEGQuality for color images.
PdfGrayscaleImageDownSamplingInt32R/W Specifies either of the following methods to downsample raster grayscale images in a PDF:
0.None
1.Average
2.Bicubic
3.Subsampling
When a value other than None is specified, an image that has a resolution greater than or equal to the one specified by PdfGrayscaleImageDownSamplingDPI will be downsampled into the resolution specified by PdfGrayscaleImageDownSamplingTarget. These are the settings for grayscale images. Specify PdfImageDownSampling for color images and PdfMonochromeImageDownSampling for monochrome images.
PdfGrayscaleImageDownSamplingTargetInt32R/W Sets the target resolution when a raster grayscale image is downsampled.
PdfGrayscaleImageDownSamplingDPIInt32R/W Sets the resolution for the downsampled raster grayscale image.
PdfMonochromeImageCompressionInt32R/W When monochrome image formats cannot be stored directly in the PDF, the image is transformed and stored in a bitmap format that is compatible with PDF. Use one of the following values to specify the compression method of data stored in a PDF file:
0.CCITT Group4
1.CCITT Group3
2.Run Length compression
3.ZLIB compression
4.None
These are the settings for monochrome images. Specify PdfGrayscaleImageCompression for grayscale images and PdfImageCompression for color images.
PdfMonochromeImageDownSamplingInt32R/W Specifies either of the following methods to downsample raster monochrome images in a PDF:
0.None
1.Average
2.Bicubic
3.Subsampling
When a value other than None is specified, an image that has a resolution greater than or equal to the one specified by PdfMonochromeImageDownSamplingDPI will be downsampled into the resolution specified by PdfMonochromeImageDownSamplingTarget. These are the settings for monochrome images. Specify PdfImageDownSampling for color images and PdfGrayscaleImageDownSampling for grayscale images.
PdfMonochromeImageDownSamplingTargetInt32R/W Sets the target resolution when a raster monochrome image is downsampled.
PdfMonochromeImageDownSamplingDPIInt32R/W Sets the resolution for the downsampled raster monochrome image.
PdfLinearizeBooleanR/W Specifies whether to output linearized PDF or not. no-LT
PdfCompressContentStreamBooleanR/W Specifies whether the text and line art in a PDF are compressed in order to reduce the size of PDF.
PdfUseLaunchForRelativeURIBooleanR/W Specifies whether external links specified by the local file are transformed into “Open the file” or into “World Wide Web link” in the PDF link properties. If the value is true, it is transformed to “Open the file”. If the value is false, it is transformed to “World Wide Web link”.
PdfRGBConversionInt32R/W Specifies how to convert the RGB color space (DeviceRGB) to DeviceGray.
0.No Conversion
1.Black to DeviceGray
2.Gray to DeviceGray
3.All RGB to DeviceGray
4.All RGB to CMYK
PdfRasterizeResolutionInt32R/W Specifies the rasterize-resolution value of the transformed raster images from 70 to 500(dpi) when the vector image is converted to the raster image and stored in PDF. SVG, EMF and WMF are rendered in PDF as vectors without being changed to raster images. This property is effective only with Windows versions.
PdfImport3DAnnotationBooleanR/WImports 3D object. no-LT
PdfOutputScaleStringW Specifies the scaling ratio of the PDF to output. A value with a unit or % value can be specified as length.
PdfOutputHeightStringR/W Scales the height of the PDF to output. A value with a unit or % value can be specified as length.
PdfOutputWidthStringR/W Scales the width of the PDF to output. A value with a unit or % value can be specified as length.
PdfErrorOnPDFXFaultBooleanR/W Prevents PDF/X, PDF/A and PDF/UA outputs from being cancelled even when an error occurs while outputting them.

Properties – SVG Settings

NameTypeR/WFunctions
SvgVersionInt32R/W Specifies the SVG version:
0.SVG 1.1
1.SVG Basic
2.SVG Tiny
3.SVG 2.0
SvgImageProcessingTypeInt32R/W Specifies how to treat images contained in the output SVG.
0.Embeds all image files.
1. Copies all image files to the destination specified by SvgImageCopyPath, and then links.
2. Links images that can be linked and embeds images that have to be embedded. Raster images other than JPEG and PNG are always embedded.
3. Copies images that have been linked to the destination that is specified by SvgImageCopyPath, and links. The embedded image are embedded.
If this parameter is omitted, the default is 0 and all images are embedded.
SvgImageCopyPathStringR/W Specifies the destination for the copied images if 1 or 3 is specified for SvgImageProcessingType.
SvgGzipCompressionBooleanR/W Specifies whether to compress the outputted SVG into gzip format.
SvgSingleFileBooleanR/W Specifies whether a formatted result composed of multiple pages is output as a single SVG file or as multiple SVG files. If the value is true, output is as a single SVG file. If the value is false, output is as multiple SVG files. When multiple files are output, the files are named as specified in SvgFormat. This takes effect only when outputting to a file and is not valid when output is without a file name such as when streaming.
SvgImageRenameBooleanR/W When images are copied to the directory specified by SvgImageCopyPath etc., specifies whether to rename all file names to the prefix specified in SvgImagePrefix, or use the original name. When the file name is duplicated, a sequential number is added. When true is specified, all files are renamed.
SvgImagePrefixStringR/W When images are copied to the directory specified by SvgImageCopyPath, specifies the prefix of the file name. The file name will be prefixed followed by a sequential numbers only if the Default is empty.
SvgSinglePageNumberBooleanR/W When SvgSingleFile=false is specified, specifies whether to add sequential number to the output SVG even if it has only one-page. If false it is not added to the output SVG.
SvgFormatStringR/W When the original document has multiple pages and false is specified in SvgSingleFile, each page will be output as an SVG file that has a consecutive number at the end of the file name. This parameter specifies the format of those consecutive numbers. For example, when “document.svg” is specified as the name for the output file, by specifying “-01” for SvgFormat the output files will be document-01.svg, document-02.svg and so on. If this parameter is omitted then “1” is considered to have been specified.
SvgImageConversionInt32R/W Selects how to convert the images embedded in the output SVG to the following:
0.Auto
1.JPEG conversion
2.PNG conversion
SvgJPEGQualityInt32R/W For image formats which cannot be stored directly in SVG, if JPEG conversion is specified in SvgImageConversion, specifies the quality of the image from 1 to 100. Higher values are proportional to increased image quality, however the file size also increases. The initial value is set at 80.
SvgRasterizeResolutionInt32R/W Specifies the rasterize-resolution value of the raster image (Changed from a vector image) from 70 to 500(dpi). SVG, EMF and WMF are rendered in SVG as vectors without being changed to raster images. This property is effective only with Windows versions.
SvgSingleFileMaxHeightInt32R/W Specifies the maximum value of the height when assigning two or more pages to a single page when SvgSingleFile=true is specified. A unit must be assigned and specified. When SvgSingleFileMaxPages or SvgSingleFileMaxHeight is specified, (or both are specified), and the page exceeds either the maximum size (SvgSingleFileMaxHeight) or the maximum number of pages (SvgSingleFileMaxPages), Antenna House Formatter V7.4 will stop converting and abort the job as an error. If this parameter is omitted, there is no limitation in the value of height.
SvgSingleFileMaxPagesInt32R/W Specifies the maximum number of pages outputted when SvgSingleFile=true is specified. If this parameter is omitted If this parameter is omitted, “5000” is considered to be specified. When either SvgSingleFileMaxPages or SvgSingleFileMaxHeight is specified, or both are specified, and the page exceeds either the maximum size (SvgSingleFileMaxHeight) or the maximum number of pages (SvgSingleFileMaxPages), Antenna House Formatter V7.4 will stop converting and abort the job as an error.
SvgImageDownsamplingDPIInt32R/W Specifies the resolution of the down sampling when embedding an image with 1 or more integers. When the resolution of the original image is lower than specification, it's embedded with the lower resolution.
SvgImageDownsamplingMethodInt32R/W Specifies the method of compression when down sampled. If this parameter is omitted, “IMGDOWNSAMPLING_AVERAGE” is considered to be specified.
1.biliner
2.bicubic
3.nearest neighbor

Properties – Printer Settings

NameTypeR/WFunctions
PrnCopiesInt32R/W Specifies the number of copies when outputting to a printer. If nothing is specified, the value is considered 1. This property is effective only with Windows versions.
PrnCollateBooleanR/W Indicates collation of multiple copies when outputting to a printer. If it is not specified or the value false is specified, the same page is multi-copied continuously. If true is specified, the pages specified print from start to end repeatedly. This property is effective only with Windows versions.
BatchPrintBooleanR/W When the value false is specified, the print dialog box is displayed when printing. If the setting is omitted or the value true is specified, the print dialog is not displayed. This property is effective only with Windows versions.

Properties – Smoothing Settings

NameTypeR/WFunctions
GdiTextAntialiasBooleanR/W Performs the smoothing processing to text when true is specified. This property is effective only with Windows versions.
GdiLineartSmoothingBooleanR/W Performs the smoothing processing to borders when true is specified. This property is effective only with Windows versions.
GdiImageSmoothingBooleanR/W Performs the smoothing processing to images when true is specified. This property is effective only with Windows versions.

Properties – Watermark-Text Settings

NameTypeR/WFunctions
WatermarkTextStringR/W Displays the specified watermark text on each page. Possible to make it multiple lines by delimiting with the line feed \n. This setting is invalid with the evaluation version.
WatermarkFontFamilyStringR/W Specifies the font family to the character string which you set to WatermarkText.
WatermarkFontWeightStringR/W Specifies the font weight to the character string which you set to WatermarkText. Possible to specify normal, bold or the numerical value from 100 to 900.
WatermarkFontStyleStringR/W Specifies the font style to the character string which you set to WatermarkText.
WatermarkOpacityStringR/W Specifies the opacity to the character string which you set to WatermarkText.

Values can be added using the following units:

RepresentationMeanings
cmcentimeter
mmmillimeter. 1mm = 0.1cm
ininch. 1in = 2.54cm
ptpoint. 1pt = 1in/72
pcpica. 1pc = 12pt
jpt1jpt = 0.3514mm
q1q = 0.25mm

Methods

XfoObj Class provides the following methods:

NameReturn ValueArgumentsFunctions
DisposeNoneNoneReleases the resource. Call this method when you exit the object.
ExecuteNoneNoneExecutes the formatting and outputs to a PDF specified in OutputFilePath or printer specified in PrinterName.
RenderNoneinputStream : Stream
outputStream : Stream
outDevice : String
Executes the formatting of XSL-FO document specified for inputStream, and outputs it to outputStream in the output form specified for outDevice. If the outDevice parameter is omitted, @PDF is automatically specified.
RenderNoneinputDoc : XmlDocument
outputStream : Stream
outDevice : String
Executes the formatting of XSL-FO document specified for inputDoc, and outputs it to outputStream in the output form specified for outDevice. If the outDevice parameter is omitted, @PDF is automatically specified.
RenderNoneinputStream : Stream
xsltStream : Stream
outputStream : Stream
outDevice : String
Transforms an XML document specified to inputStream using an XSL stylesheet specified to xsltStream, then executes the formatting of XSL-FO document and outputs it to outputStream in the output form specified for outDevice. If the outDevice parameter is omitted, @PDF is automatically specified. A standard XSLT Processor of .NET Framework is used for the XSLT conversion. The ExternalXSLT property and the setting of XSLT Processor in the Option Setting File is disregarded.
ClearNoneNoneInitializes the formatting engine.
SetXSLTParamNonename : String
value : String
Sets parameter name and value for xsl:param.
ClearXSLTParamNoneNoneClears all parameter names and values for xsl:param.
SetFontAliasNonefontName : String
aliasName : String
Sets the substitution of font name. This substitution acts on the font names existing in FO. The font name fontName is replaced to aliasName.
EraseFontAliasNonefontName : StringErases the substitution of font name fontName.
ClearFontAliasNoneNoneClears all substitutions of font name.
GetFormattingErrorNoneerrlist : Collections.ArrayList Possible to call it after the formatting is completed. Acquires error information with an error level less than ExitLevel that occurred during formatting and stores it in Collections.ArrayList specified in the argument. The error information is stored in the ArrayList as an object of the XfoErrorInformation class. The XfoErrorInformation class has three properties as error information: ErrorLevel, ErrorCode, and ErrorMessage.
GetOptionFileURIStringindex : Int32Gets the URL of Option Setting File from the index you specified.
AddOptionFileURINonefileURI : StringAdds the URL of the XML-based Option Setting File that indicates the options for Antenna House Formatter V7.4. The contents of Option Setting File are evaluated immediately and if new properties are set, the former setting will be overwritten.
AddUserStylesheetURINonefileURI : StringSpecifies the CSS user stylesheet you want to add. AddUserStylesheetURI can be specified any number of times. It is applied by specified order prior to the stylesheet specified by StylesheetURI.

Events

XfoObj provides the following events:

NameReturn ValueArgumentsFunctions
OnFormatPageNonepageNum : Int32
The page number that has already been outputted during the formatting process can be received as an event. A value cannot be specified when you use ASP.NET application.
  • Greater than or equal to 1 : Page number that has already been outputted.
  • 0 : All page formatting has finished.
  • -1 : Start of the first pass of 2 pass formatting.
  • -2 : Start of the second pass of 2 pass formatting.
OnRenderPageNonepageNum : Int32
The page number that has already been outputted during the formatting process can be received as an event. A value cannot be specified when you use ASP.NET application.
  • Greater than or equal to 1: Page number that has already been outputted.
  • 0 : All page has been outputted.

PDF Output to the Web Browser

It's possible to directly output PDF to the Web Browser, when you use ASP.NET application on a server and output the formatted result in PDF. The following is its sample of program.

public class TestPage : Page
{
    public void OnStreamPDF(Object sender, EventArgs ea)
    {
        XfoDotNetCtl.XfoObj obj = new XfoDotNetCtl.XfoObj();
        obj.ExitLevel = 4;
        FileStream fs = null;
        try
        {
            fs = File.Open("c:\\temp\\sample.fo", FileMode.Open, FileAccess.Read);
            Response.Clear();
            Response.ContentType = "application/pdf";
            obj.Render(fs1, Response.OutputStream);
            Response.End();
        }
        catch(Exception e)
        {
            throw e;
        }
        finally
        {
            if (fs != null)
                fs.Close();
        }
    }
}

Programming Example

The following is a C# programming sample. In addition, you can download simple sample programs from our website.

using System;

public class MainApp
{
    static public void Main()
    {
        XfoDotNetCtl.XfoObj obj = new XfoDotNetCtl.XfoObj();
        obj.DocumentURI = "c:\\temp\\test.xml";
        obj.StylesheetURI = "c:\\temp\\test.xsl";
        obj.OutputFilePath = "c:\\temp\\test.pdf";
        obj.ExitLevel = 4;
        try
        {
            obj.Execute();
        }
        catch(XfoException e)
        {
            Console.WriteLine("ErrCode : " + e.ErrorCode + "\n" + e.Message);
        }
        catch(Exception e)
        {
            Console.WriteLine(e.Message);
        }
        finally
        {
            obj.Dispose();
        }
    }
}

Running the Sample Program

Simple sample programs can be downloaded from our website. The downloaded sample programs include sample files for C#, VisualBasic.NET and a sample project file for .NET. To run the .NET interface, you need to register components and add search paths for shared libraries. You also need to set environment variables to run the sample on Linux version (64-bit version), Macintosh version (64-bit version). See Component Registration and Environment Variables for more information.

.NET Framework

To run the sample for C#.NET in the .NET Framework, specify as follows:

The current directory in the following example is the directory containing the dotnet directory where the sample is unzipped.

> cd dotnet\cs
> C:\Windows\Microsoft.NET\Framework64\[.NET version]\csc sample.cs /r:[Install directory]\XfoDotNet40Ctl74.dll
> copy [Install directory]\XfoDotNet40Ctl74.dll .
> sample.exe sample.fo sample.pdf

When you install the Windows x86 version on Windows (64-bit version) and use the .NET Framework, specify /platform:x86.

> cd dotnet\cs
> C:\Windows\Microsoft.NET\Framework\[.NET version]\csc sample.cs /platform:x86 /r:[Install directory]\XfoDotNet40Ctl74.dll
> copy [Install directory]\XfoDotNet40Ctl74.dll .
> sample.exe sample.fo sample.pdf

.NET

This is an example of running the sample for C#.NET on .NET. When you install the Windows x86 version on Windows (64-bit version) and use .NET, install .NET Runtime of the 32-bit version and set x86 to PlatformTarget in the project file. At this time, the project file (csproj) is required in the directory to be executed.

The current directory of the following samples is the directory containing the dotnet directory where the sample is unzipped.

> cd dotnet\cs
> copy [Install directory]\XfoDotNetCore31Ctl74.dll .
> dotnet run --runtime=win-x64 --no-self-contained sample.fo sample.pdf

When you install the Windows x86 version on Windows (64-bit version) and use .NET, you can also run it by specifying --runtime=win-x86 without setting x86 to PlatformTarget in the project file as follows:

> cd dotnet\cs
> copy [Install directory]\XfoDotNetCore31Ctl74.dll .
> dotnet run --runtime=win-x86 --no-self-contained sample.fo sample.pdf

This is an example of running the sample in the Linux 64-bit environment. At this time, the project file (csproj) is required in the directory to be executed.

$ cd dotnet/cs
$ cp [Install directory]/lib/XfoDotNetCore31Ctl74.dll .
$ AHF74_64_FONT_CONFIGFILE=[Install directory]/etc/font-config.xml
$ export AHF74_64_FONT_CONFIGFILE
$ AHF74_64_LIC_PATH=[Install directory]/etc
$ export AHF74_64_LIC_PATH
$ LD_LIBRARY_PATH=[Install directory]/lib:${LD_LIBRARY_PATH}
$ export LD_LIBRARY_PATH
$ dotnet run --runtime=linux-x64 --no-self-contained sample.fo sample.pdf

This is an example of running the sample in the Macintosh 64-bit environment. At this time, the project file (csproj) is required in the directory to be executed.

$ cd dotnet/cs
$ cp [Install directory]/lib/XfoDotNetCore31Ctl74.dll .
$ AHF74_64_FONT_CONFIGFILE=[Install directory]/etc/font-config.xml
$ export AHF74_64_FONT_CONFIGFILE
$ AHF74_64_LIC_PATH=[Install directory]/etc
$ export AHF74_64_LIC_PATH
$ DYLD_LIBRARY_PATH=[Install directory]/lib:${DYLD_LIBRARY_PATH}
$ export DYLD_LIBRARY_PATH
$ dotnet run --runtime=osx-x64 --no-self-contained sample.fo sample.pdf

This is an example of the project file (csproj) required by .NET. In Include in Reference, specify the path to XfoDotNetCore31Ctl74.dll.

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net6.0</TargetFramework>
  </PropertyGroup>
 <ItemGroup>
  <Reference Include="./XfoDotNetCore31Ctl74.dll" />
 </ItemGroup>
</Project>