COM Interface

The COM Interface makes it possible for the Rainbow PDF Server Based Converter V3.0 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 "DfvComCtl.DfvObj" as the object class name when invoking from the Create Object statement in Visual Basic.

namespaceDfvComCtl
Object Class NameDfvObj
COM DLL File NameDfvComCtl30.dll

In order to use the COM interface, Windows registration is required. When the Rainbow PDF Server Based Converter V3.0 is installed correctly, the registration of COM is automatically done. To re-register the COM, please run regsvr32 from the console as follows.

> cd [Install directory]
> regsvr32 DfvComCtl30.dll

Properties

DfvObj includes the following properties.

Name Type R/W Functions
Version String R Get the version string of Rainbow PDF Server Based Converter V3.0.
DocumentURI String R/W Specifies the URI of the target documents you will convert.
  • If it is omitted or "@STDIN" is specified, documents are loaded from stdin.
PrinterName String R/W Specifies the output format or the printer name to output.
  • When a printer name is specified, the converted result is outputted to that printer.
  • When "@STDPRN" is specified, the converted result is outputted to the currently used printer.
  • When "@PDF" is specified, the converted result is outputted to PDF.
  • When "@SVG" is specified, the converted result is outputted to SVG.
  • When "@INX" is specified, the converted result is outputted to INX.
  • When "@XPS" is specified, the converted result is outputted to XPS.
  • When "@Flash" is specified, the converted result is outputted to Flash.
  • When "@JPEG" is specified, the converted result is outputted to JPEG.
  • When "@PNG" is specified, the converted result is outputted to PNG.
  • When "@TIFF" is specified, the converted result is outputted to TIFF.
  • When "@MTIFF" is specified, the converted result is outputted to multi-page TIFF.
If this parameter is omitted, -p @PDF is automatically specified. With the Standard Flash version, if this parameter is omitted, -p @Flash is automatically specified. Please refer to "How to specify the printer name" for details.
Please refer to "PDF Output" for the PDF output information.
Please refer to "SVG Output" for the SVG output information.
Please refer to "INX Output" for the INX output.
Please refer to "XPS Output" for the XPS output.
Please refer to "Flash Output" for the Flash output.
JPEG and the PNG output and TIFF output are only available with the Windows version.
OutputFilePath String R/W Specifies the output file path of the converted result. When the printer is specified as an output format by PrinterName, a printing result is saved to the specified file by the printer driver. When 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.
StartPage
EndPage
Long R/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 the specified value exceeds the actual page number, the end page is considered last page. If the setting is inconsistent, (for example, StartPage=5 EndPage=3) an error occurs.
OmitBlankPages Boolean R/W Effective only when the original file is MS Word or MS Excel. Specifies to disregard any empty pages at the beginning of document. By using this parameter with EndPage = 1, it is possible to get the output of the first page which has actual contents. Other operation is not guaranteed.
ExitLevel Long R/W Specifies error level to abort converting process. Rainbow PDF Server Based Converter V3.0 will stop converting when the detected error level is equal to the specified ExitLevel property or higher. The default value is 2 (Warning). Thus if an error occurred and error level is 2 (Warning) or higher, the converting process will be aborted. Legal values are from 1 to 4. When the value of 5 or higher is specified, it is considered to be the value of 4. If an error-level:4 (Fatal error) occurs, the converting process will be aborted unconditionally. Note: Setting this value does not cause an error message to be displayed.
ErrorLevel Long R Indicates the error level that occurred during the converting process.
  1. Information
  2. Warning
  3. Recoverable Error
  4. Fatal Error
ErrorCode Long R Indicates the error code of the error that occurred during the converting process. Zero means no error. Non-zero indicates an error occurred.
ErrorMessage String R Indicates the error message of the error that occurred during the converting process.

Properties – PDF Settings

Name Type R/W Functions
PdfVersion Long R/W Specifies PDF version:
0.PDF1.3
1.PDF1.4
2.PDF1.5
3.PDF1.6
4.PDF1.7
Impossible to specify PDF/X with XSL Formatter V4.2 Lite.
PdfEncryptLevel Long R/W Specifies the key length when encrypting the PDF file during outputting. The key length can be specified as follows: (Note: This parameter is effective only when you specify PDF1.4 or later with PdfVersion.)
0.40bit
1.128bit
PdfUserPassword String W Specifies the user password for PDF. The password must be within 32 bytes.
PdfOwnerPassword String W Specifies the owner password for PDF. The password must be within 32 bytes.
PdfNoPrinting Boolean R/W Prohibits printing the PDF file.
It is necessary to specify PdfOwnerPassword so that this parameter is effective.
PdfNoChanging Boolean R/W Prohibits making changes to the PDF file.
PdfNoContentCopying Boolean R/W Prohibits copying the content of the PDF file.
It is necessary to specify PdfOwnerPassword so that this parameter is effective.
PdfNoAddingOrChangingComments Boolean R/W Prohibits adding comments and form fields to the PDF file.
It is necessary to specify PdfOwnerPassword so that this parameter is effective.
PdfNoFillForm Boolean R/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. In order to make this parameter effective, the setting of the other parameter may be required. See also the 'PDF Reference' from Adobe Systems Incorporated for more details.
PdfNoAccessibility Boolean R/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.
PdfNoAssembleDoc Boolean R/W Prohibits inserting, deleting and rotating the PDF pages. This parameter is effective only when you specify PDF1.4 or later for the PdfVersion.
PdfEmbedAllFontsEx Long R/W Specifies whether or not to embed all embeddable fonts used in the file of the conversion result into PDF. However, even if all fonts are specified to embed, the font forbidden embedding or the font which 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
PdfEmbedFonts String R/W Embeds the specified font in the created PDF. If you want to specify plural fonts, put commas between each fonts.
PdfErrorOnEmbedFault Boolean R/W When true is specified, an error is issued when font embedding fails.
PdfErrorOnMissingGlyph Boolean R/W When true is specified, an error is issued when there is a missing glyph.
PdfPrintingAllowed Long R/W Specifies whether and how to permit printing of PDF. This parameter is effective only when you specify PDF1.4 or later with PdfVersion.
0.Not Allowed
1.Low Resolution Printing
2.High Resolution Printing
PdfImageCompression Long R/W When a color image format cannot be stored directly in the PDF, an image is stored after being transformed into a bitmap format which is compatible with PDF. Use one of the following values to specify the compression method of the data stored in a PDF file. 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.
0.Auto
1.JPEG compression
2.ZLIB compression
3.JPEG2000 compression (it is effective only when PdfVersion is PDF1.5 or higher)
PdfJPEGQuality Long R/W For color image formats that cannot be stored directly in PDF, the image quality can be specified by a numerical value within the range of 1-100 when JPEG compression is specified for the image-compression method. The quality becomes higher in proportion to the increase in the number; however the file size also becomes larger. This is the setting for color images. Specify PdfGrayscaleJPEGQuality for grayscale images.
CAUTION: This is not for changing the quality of a JPEG formatted image.
PdfPutImageColorProfile Boolean R/W Specifies whether to embed in the PDF the color profile of the color image that will be embedded.
PdfImageDownSampling Long R/W Specifies either of the following methods to downsample the raster color image in a PDF. When a value other than None is specified, an image that has a resolution larger than 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.
0.None
1.Average
2.Bicubic
3.Subsampling
PdfImageDownSamplingTarget Long R/W Sets the target resolution when a raster color image is downsampled.
PdfImageDownSamplingDPI Long R/W Sets the resolution for which a raster color image is to be downsampled.
PdfGrayscaleImageCompression Long R/W When a raster grayscale image format cannot be stored directly in the PDF, the image is stored after being transformed into a bitmap format which is compatible with PDF. Use one of the following values to specify the compression method of the data stored in a PDF file. 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.
0.Auto
1.JPEG compression
2.ZLIB compression
3.JPEG2000 compression (it is effective only when PdfVersion is PDF1.5 or higher)
PdfGrayscaleJPEGQuality Long R/W For grayscale image formats that cannot be stored directly in the PDF, the image quality can be specified by a numerical value within the range of 1-100 when JPEG compression is specified for PdfGrayscaleImageCompression. The quality becomes higher in proportion to the increase in the number; however the file size also becomes larger. Specify PdfJPEGQuality for color images.
CAUTION: This is not for changing the quality of a JPEG formatted image.
PdfGrayscaleImageDownSampling Long R/W Specifies either of the following methods to downsample raster grayscale images in a PDF. When a value other than None is specified, an image that has a resolution larger than 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.
0.None
1.Average
2.Bicubic
3.Subsampling
PdfGrayscaleImageDownSamplingTarget Long R/W Sets the target resolution when a raster grayscale image is downsampled.
PdfGrayscaleImageDownSamplingDPI Long R/W Sets the resolution for which a raster grayscale image is to be downsampled.
PdfMonochromeImageCompression Long R/W When monochrome image formats cannot be stored directly in the PDF, the image is stored after being transformed into a bitmap format which is compatible with PDF. Use one of the following values to specify the compression method of the data stored in a PDF file. These are the settings for monochrome images. Specify PdfGrayscaleImageCompression for grayscale images and PdfImageCompression for color images.
0.CCITT Group4
1.CCITT Group3
2.Run Length compression
3.ZLIB compression
4.None
PdfMonochromeImageDownSampling Long R/W Specifies either of the following methods to downsample raster monochrome images in a PDF. When a value other than None is specified, an image that has a resolution larger than the one specified by PdfMonochromeImageDownSamplingDPI will be downsampled to the resolution specified for PdfMonochromeImageDownSamplingTarget. These are the settings for monochrome images. Specify PdfImageDownSampling for color images and PdfGrayscaleImageDownSampling for grayscale images.
0.None
1.Average
2.Bicubic
3.Subsampling
PdfMonochromeImageDownSamplingTarget Long R/W Sets the target resolution when a raster monochrome image is downsampled.
PdfMonochromeImageDownSamplingDPI Long R/W Sets resolution for which raster monochrome images are to be downsampled.
PdfCompressContentStream Boolean R/W Specifies whether the text and the line art in PDF are compressed in order to make the size of PDF smaller or not.
PdfUseLaunchForRelativeURI Boolean R/W Specifies whether external links specified by the relative address 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'
PdfRGBConversion Long R/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
PdfRasterizeResolution Long R/W Specifies the value of the rasterised-resolution of the transformed raster images in the range from 70 to 500(DPI). SVG, EMF and WMF are drawn in PDF as vectors without being transformed to raster images.
PdfOutputScale String W Specifies the scaling ratio of the PDF to output. A value with a unit or % value can be specified as length.
PdfOutputHeight String R/W Scales the height of PDF to output. A value with a unit or % value can be specified as length.
PdfOutputWidth String R/W Scales the width of PDF to output. A value with a unit or % value can be specified as length.

Properties – SVG Settings

Name Type R/W Functions
SvgVersion Long R/W Specifies SVG version:
0.SVG 1.1
1.SVG Basic
2.SVG Tiny
SvgImageProcessingType Long R/W Specifies how to treat images contained in the SVG being created.
0.Embeds all image files.
1. Copies all image files to the destination that is specified by SvgImageCopyPath, and then links.
If this parameter is omitted, it is considered as 0 and all images are embedded.
SvgImageCopyPath String R/W Specifies the destination to copy images to as specified in 1 for SvgImageProcessingType.
SvgGzipCompression Boolean R/W Specifies whether to compress the outputted SVG into gzip format or not.
SvgSingleFile Boolean R/W Specifies whether a converted result composed of multiple pages is output as a single SVG file or as multiple SVG files. If the value is true, outputs as a single SVG file. If the value is false, outputs as multiple SVG files. When multiple files are output, the files are named by the format specified by 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, etc.
SvgImageRename Boolean R/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.
SvgImagePrefix String R/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.
SvgSinglePageNumber Boolean R/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.
SvgFormat String R/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.
SvgEmbedAllFonts Boolean R/W Specifies whether to embed fonts in the outputted SVG.
SvgEmbedFonts String R/W Embeds the specified font in the created SVG. If you want to specify multiple fonts, put commas between fonts.
SvgErrorOnEmbedFault Boolean R/W When true is specified, an error is issued when font embedding fails.
SvgImageConversion Long R/W Selects how to convert the images embedded in SVG from the following.
0.Auto
1.JPEG conversion
2.PNG conversion
3.All JPEG conversion
SvgJPEGQuality Long R/W For the image format which cannot be stored directly in SVG, when JPEG conversion is specified in SvgImageConversion, specifies the quality of the image using the range of 1-100. The quality becomes higher in proportion to the increase in the number; however the file size also becomes larger. The initial value is 80.
SvgRasterizeResolution Long R/W Specifies the value of the rasterized-resolution of the raster image which is transformed from vector image in the range from 70 to 500(DPI). SVG, EMF and WMF are drawn in SVG as vectors without being transformed to raster images.
SvgSingleFileMaxHeight Long R/W Specifies the maximum value of the height when assigning two or more pages to a single page when SvgSingleFile=true is specified. The unit must be given and specified. When either SvgSingleFileMaxPages or SvgSingleFileMaxHeight is specified, or both are specified, and the page number exceeds either the maximum size (SvgSingleFileMaxHeight) or the maximum number of pages (SvgSingleFileMaxPages), Server Based Converter V1.2 will stop converting and abort the job as an error. If this parameter is omitted, there is no limitation in the value of height.
SvgSingleFileMaxPages Long R/W Specifies the maximum number of pages outputted when SvgSingleFile=true is specified. When this parameter is omitted If this parameter is omitted, "5000" is considered as 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), Server Based Converter V1.2 will stop converting and abort the job as an error.
SvgImageDownsamplingDPI Long R/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.
SvgImageDownsamplingMethod Long R/W Specifies the method of compression when down sampled. If this parameter is omitted, "IMGDOWNSAMPLING_AVERAGE" is considered as specified.
1.biliner
2.bicubic
3.nearest neighbor

Properties – INX Settings

Name Type R/W Functions
InxOutputMode Long R/W Specifies the INX output mode.
0.Text area output mode
1.Line area output mode
2.Block area output mode

Properties – Flash Settings

Name Type R/W Functions
FlashPartiallyOutput Boolean R/W When an error occurs within the document, the flash file in process will be outputted.
FlashHidePageButton Boolean R/W The buttom to navigate to the previous/next page is not displayed when outputting the flash file.

Properties – Printer Settings

Name Type R/W Functions
PrnCopies Long R/W Specifies the number of copies. Effective when outputting to a printer. If nothing is specified, the value is considered as 1.
PrnCollate Boolean R/W Indicates collation of multiple copies. Effective when outputting to printer and the number of copies is more than 1. 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.
BatchPrint Boolean R/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.
PrnFitPaper Boolean R/W It print at size of paper. Default is false.

Properties – Rasterize Settings

Name Type R/W Functions
RasterDPI Long R/W Specifies the image size by a numerical value within the range of 1-1,440(DPI) when outputting raster image. When the value of this parameter is outside the range or it is omitted, a DPI value specified by the font size in the image is applied with Windows version.
The maximum image size available to output depends on the Windows system resources such as free available memory, etc.
RasterScale String R/W When raster image are output, the reduction ratio is specified by a numerical value within a range that is larger than 0 but equal to or less than 1. It can also be specified by % or px (pixel) value. When the value of this parameter is outside the range or it is omitted, the default is 1.
RasterHeight Long R/W Sets the maximum image height decided by RasterScale when outputting JPEG and PNG. "px" (pixel) is available as the unit.
RasterFormat String R/W Specifies the file naming format when outputting raster image file.
RasterJpegQuality Long R/W Specifies the conversion accuracy by the value with the range of 1-100(%). When this parameter is omitted, it is regarded as 80%.
RasterUseGdiPlus Boolean R/W GdiPlus is used when the file is converted to raster image. This setting is effective only with Windows XP or later / Windows Server2003 or later.
RasterMonochrome Boolean R/W Specifies whether to convert to monochrome image, when outputting raster image.

Properties – Smoothing Settings

Name Type R/W Functions
GdiTextAntialias Boolean R/W Performs the smoothing processing to text when true is specified.
GdiLineartSmoothing Boolean R/W Performs the smoothing processing to borders when true is specified.
GdiImageSmoothing Boolean R/W Performs the smoothing processing to images when true is specified.
These Properties is effective only with Windows XP or later / Windows Server 2003 or later.

Properties – Watermark-Text Settings

Name Type R/W Functions
WatermarkText String R/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.
WatermarkFontFamily String R/W Specifies the font family to the character string which you set to watermark-text.
WatermarkFontWeight String R/W Specifies the font weight to the character string which you set to watermark-text. Possible to specify normal, bold or the numerical value from 100 to 900.
WatermarkFontStyle String R/W Specifies the font style to the character string which you set to watermark-text.
WatermarkOpacity String R/W Specifies the opacity to the character string which you set to watermark-text.

Properties – Text Settings

Name Type R/W Functions
TextPaperWidth
TextPaperHeight
String R/W Specifies the paper size when the text format is specified to the input data.
TextMarginLeft
TextMarginTop
TextMarginRight
TextMarginBottom
String R/W Specifies the margin size when the text format is specified to the input data.
TextFontFamily String R/W Specifies the font family name to output when the text format is specified to the input data.
TextFontSize String R/W Specifies the font size to output when the text format is specified to the input data.
TextShowPageNumber Boolean R/W Adds page numbers to the outputs when the text format is specified to the input data.
TextShowLineNumber Boolean R/W Adds line numbers to the outputs when the text format is specified to the input data.
TextLineNumberOffset String R/W Specifies the distance from the body text in the case of adding line numbers to the outputs when the text format is specified to the input data.
TextLineNumberFormat String R/W Specifies the format of line numbers in the case of adding line numbers to the outputs when the text format is specified to the input data.
When the original file is small, the encoding cannot be recognized and the program may fail to read the file.

Some values can be added one of the following units.

Representation Meanings
cm centimeter
mm millimeter. 1 mm = 1/10 cm
in inch. 1 in = 2.54 cm
pt point. 1 pt = 1/72 in
pc pica. 1 pc = 12 pt
jpt 1 jpt = 0.3514 mm
q 1 q = 0.25 mm

Methods

DfvObj provides the following methods.

Name Return Value Arguments Functions
Execute None None Executes the conversion and outputs to a PDF specified in OutputFilePath or printer specified in PrinterName.
Clear None None Initializes the conversion engine.
GetOptionFileURI String index : Long Gets the URL of Option Setting File from the index you specified.
AddOptionFileURI None fileURI : String Adds the URL of the XML-based Option Setting File that indicates the options for Rainbow PDF Server Based Converter V3.0. The contents of the Option Setting File are evaluated immediately. When you set a property which is contrary to a previously set property, the former setting will be overwritten.

Event

DfvObj provides the following event.

Name Return Value Arguments Functions
onMessage None errLevel : Long
errCode : Long
errMsg : String
Events that returns error information (error level, error code, error message) in the conversion process.
onFormatPage None pageNo : Long
The number of pages that converted during the conversion process can be received as an event.

Programming Example

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

dim obj
Set obj = CreateObject("DfvComCtl.DfvObj")

obj.DocumentURI = "c:\temp\test.doc"
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