COM Interface

The COM Interface makes it possible for AH Formatter V7.1 to function through applications using COM-supported languages such as Visual Basic, Delphi and VBScript.

Object Class Name

The object class name is shown below. Use “XfoComCtl.XfoObj” as the object class name when invoking from the Create Object statement in Visual Basic.

namespaceXfoComCtl
Object Class NameXfoObj
COM DLL File NameXfoComCtl71.dll

In order to use the COM interface, Windows registration is required. When AH Formatter V7.1 is installed correctly, the registration of COM is automatically done. To re-register the COM, run regsvr32 from the console as follows:

> cd [Install directory]
> regsvr32 XfoComCtl71.dll

When running regsvr32, an error may occur if User Account Control (UAC) function is set to Windows. In such a case, run a command prompt as an administrator by clicking “Run As Administrator” from the context menu, then run regsvr32.

Properties

XfoObj includes the following properties:

NameTypeR/WFunctions
VersionStringRGet the version string of AH Formatter V7.1.
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.
FormatterTypeLongR/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 AH Formatter V7.1 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.
OptionFileCountLongRCounts 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.
  • When “@SVG” is specified, the formatted result is outputted to SVG.
  • When “@PS” is specified, the formatted result is outputted to PostScript.
  • When “@XPS” is specified, the formatted result is outputted to XPS.
  • When “@DOCX” is specified, the formatted result is output to Word(docx). no-LT
  • When “@TEXT” is specified, the formatted result is outputted to a text format file. no-LT
  • When “@AreaTree” is specified, the AreaTree will be outputted. no-LT
If this parameter is omitted, -p @PDF is automatically specified.
See “Printer Name” for the printer name information.
See “PDF Output” for the PDF output information.
See “SVG Output” for the SVG output information.
See “PostScript® Output” for the PostScript output.
See “XPS Output” for the XPS output.
See “Word(docx) Output” for Word(docx) output info.
See “TEXT Output” for the text output information.
@DOCX, @TEXT and @AreaTree are not effective with AH Formatter V7.1 Lite.
PrinterSettingURIStringR/WSpecifies the URI of the Printer Setting File. See “Printer Setting File”.
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 “@STDOUT” is specified, it goes to standard output. When omitted, it goes to standard output. However in cases in which ActiveServerPages requires, PDF data is output to the Web Browser.
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.
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/W Specifies 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.
FormattedPagesLongR 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
LongR/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 less than or equal to 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
TotalVolumeCountLongR Gets the number of all the separate volumes when outputting PDF to multiple separate volumes. no-LT
OutputVolumeCountLongR Gets the number of the actual separate volumes when outputting PDF to multiple separate volumes. no-LT
StartPage
EndPage
LongR/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 or less, 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.
ExitLevelLongR/WSpecifies error level to abort formatting process. AH Formatter V7.1 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.
ErrorLevelLongRIndicates the error level that occurred during the formatting process.
  1. Information
  2. Warning
  3. Recoverable Error
  4. Fatal Error
ErrorCodeLongRIndicates 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.
XMLDOMDocumentObject WSpecifies the target XML document used by the MSXML XMLDOMDocument object.
XMLDOMStylesheetObject WSpecifies the target XSL stylesheet used by the MSXML XMLDOMDocument object.

Properties – PDF Settings

NameTypeR/WFunctions
PdfVersionLongR/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 AH Formatter V7.1 Lite.
PdfEncryptLevelLongR/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
Note: This parameter is effective only when you specify PDF1.4 or later for the PdfVersion property. 128bit AES is effective with PDF1.5 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.
PdfEmbedAllFontsExLongR/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.
PdfEmbedSubsetFontPercentageLongR/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.
PdfPrintingAllowedLongR/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
PdfImageCompressionLongR/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.
PdfJPEGQualityLongR/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 in the PDF the ICC profile of the color image that will be embedded.
PdfImageDownSamplingLongR/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.
PdfImageDownSamplingTargetLongR/W Sets the target resolution when a raster color image is downsampled.
PdfImageDownSamplingDPILongR/W Sets the resolution for the downsampled raster color image.
PdfGrayscaleImageCompressionLongR/W When a raster 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.
PdfGrayscaleJPEGQualityLongR/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.
PdfGrayscaleImageDownSamplingLongR/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.
PdfGrayscaleImageDownSamplingTargetLongR/W Sets the target resolution when a raster grayscale image is downsampled.
PdfGrayscaleImageDownSamplingDPILongR/W Sets the resolution for the downsampled raster grayscale image.
PdfMonochromeImageCompressionLongR/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.
PdfMonochromeImageDownSamplingLongR/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.
PdfMonochromeImageDownSamplingTargetLongR/W Sets the target resolution when a raster monochrome image is downsampled.
PdfMonochromeImageDownSamplingDPILongR/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”.
PdfRGBConversionLongR/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
PdfConvertImageColorSpaceBooleanR/WConverts RGB images automatically into CMYK when outputting PDF/X and PDF/A. no-LT
PdfRasterizeResolutionLongR/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.
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
SvgVersionLongR/W Specifies the SVG version:
0.SVG 1.1
1.SVG Basic
2.SVG Tiny
SvgImageProcessingTypeLongR/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 to copy images to as specified in 1 or 3 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 by 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.
SvgImageConversionLongR/W Selects how to convert the images embedded in SVG from the following:
0.Auto
1.JPEG conversion
2.PNG conversion
SvgJPEGQualityLongR/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.
SvgRasterizeResolutionLongR/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.

Properties – Printer Settings

NameTypeR/WFunctions
PrnCopiesLongR/W Specifies the number of copies when outputting to a printer. If nothing is specified, the value is considered 1.
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.
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.

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 provides the following methods:

NameReturn ValueArgumentsFunctions
ExecuteNoneNoneExecutes the formatting and outputs to a PDF specified in OutputFilePath or printer specified in PrinterName.
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.
GetOptionFileURIStringindex : LongGets 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 AH Formatter V7.1. 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
onMessageNoneerrLevel : Long
errCode : Long
errMsg : String
Events that returns Error Messages in the formatting process.
onFormatPageNonepageNum : Long
The number of pages that formatted during the formatting process can be received as an event.
  • 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.

PDF Output to the Web Browser

It's possible to directly output PDF to the Web Browser, when you use ASP application on a server and output the formatted result in PDF. This output requires the following conditions:

  1. Create a COM instance of AH Formatter using Server.CreateObject("XfoComCtl.XfoObj").
  2. Specify “@PDF” to “PrinterName”.
  3. There is no “OutputFilePath” specified.
  4. Perform “Response.End” after calling “Execute” method.

Programming Example

The following is a VBScript programming sample. In addition, [Install directory]/​samples/​com included some useful sample files for COM.

dim obj
Set obj = CreateObject("XfoComCtl.XfoObj")

obj.DocumentURI = "c:\temp\test.xml"
obj.StylesheetURI = "c:\temp\test.xsl"
obj.OutputFilePath = "c:\temp\test.pdf"
obj.ExitLevel = 4
obj.Execute()

if obj.ErrorCode <> 0 then
 MsgBox "ErrorCode : " & obj.ErrorCode & " " & obj.ErrorMessage
else
 MsgBox "Create PDF : " & obj.OutputFilePath

Set obj = Nothing