Viewing Component ProgID, Methods & Properties

You can view the Component ProgID, Methods & Properties for this COM Object using the Microsoft OLE/COM Object Viewer:

  1. Open the OLE/COM Object Viewer (C:\mstools\bin\oleview.exe)
  2. Expand Object Classes; Expand All Objects; Select the registered BCL COM Object.
    The ProgID is listed here
    .


  3. Right-Click the COM Object and select "View Type Information".
    All of the available Methods and Properties are listed here
    .

 

COM Objects in Visual Basic

BCL COM Objects can be accessed from a variety of programming environments. This brief example shows how to access a COM Object from Visual Basic.

  1. Create a new project. Click Project -> References, and select the BCL COM Object:


  2. Create an Object in VB Code:
    Private WithEvents drakeObj As DRAKECOMLib.Drake

    Private Sub Form_Initialize()

    Set drakeObj = CreateObject("DrakeCom.Drake")

    End Sub

  3. Reference COM Method in VB Code:
    drakeObj.Convert(Trim(ifname), Trim(ofname), errMessage)

COM Objects in Visual C++

BCL COM Objects can be accessed from a variety of programming environments. This brief example shows how to access a COM Object from Visual C++.

  1. Create a new project. Click View -> Class Wizard; Click "Add Class..."; Click "From a type library", and select the BCL COM Object:

  2. Include the new header file:
    #include "COMClient.h"
  3. If using MFC, initiate COM ability in InitInstance():
    AfxOleInit();
  4. Create an Object and start the COM in VC++ Code:

    private:
    IDrakePtr m_pDrakeObj;

    m_pDrakeObj = IDrakePtr("DrakeCom.Drake.1");

  5. Reference COM Method in VC++ Code:
    int nResult = m_pDrakeObj->Convert(inFile, outFile, &errMsg);


BCL Drake COM® 7.0 Interface

Instantiation

The COM ID for Drake 7.0 COM is "DrakeCom.Drake". To instantiate a Drake 7.0 COM object, do the following (VB sample):

Dim drakeObj As DRAKECOMLib.Drake
Set drakeObj = CreateObject("DrakeCom.Drake")

 

Methods

Drake 7.0 COM provides these 5 methods:

 

short GetNumPages(string strFileName)

 

short SetOptionsXML(string strOptions)

Note: strOptions is an XML document. Please refer to the Option String section
for details.

 

string GetOptionsXML()

Note: The returned option string is a XML document. Please refer to the Option Option String for details.

Reminder: After you use SetOptionsXML to set the conversion settings, if you use GetOptionsXML to retrace them, you will only see the options that have been set to true. These options are also sorted.
For example:

<bool name="MergeParagraph" value="0"/> will not be shown; however,

<bool name="MergeParagraph" value="1"/> will be shown.

 

void ResetOptions()

 

long Convert(string strInFile, string strOutFile, variant strErrMsg)

0 Successful
-1 Invalid input or output file names
-2 Conversion error. Please report this to bcl-supports.
-3 Eval version of Drake COM has expired.
-4 Invalid page range numbers.
-6 No open permission - User’s and/or owner’s password(s) required.
-7 No copy permission - Owner's password required.
-9999 Unable to load conversion library. Program installed incorrectly, please reinstall.


void CancelConvert()

Events

void OnProgress(long progress, long limit)

 

Command String (XML Document)

The command string is an XML document. Here is an example:

<?XML version="1.0" encoding="ISO-8859-1"?>

<conversion>

<product name="Drake"/>

<options>

<bool name="MergeParagraph" value="0"/>
<bool name="PreserveTextPosition" value="1"/>
<bool name="ShrinkFonts" value="0"/>
<bool name="AdjustFontNames" value="0"/>
<bool name="ExtractText" value="1"/>
<bool name="ExtractImages" value="1"/>
<bool name="UsingPageRange" value="1"/>
<numeric name="ImageFormat" value="0"/>
<numeric name="PageFrom" value="0"/>
<numeric name="PageTo" value="0"/>
<numeric name="PasswordLen" value="11"/>
<string name="Passwords" value="test,test2"/>
<numeric name="PasswordSeparator" value="44"/>
<numeric name="JpegQuality" value="75"/>

</options>

</conversion>


AdjustFontNames

AdjustSpacing

ConversionMethod

DetectHeader

Type – bool
Possible values

• 0: Do not detect

• 1: Detect header and footer

Effect – Select this option to automatically detect the header and footer in a document. This option is only available when ConversionMethod is set to 1 (Preserve layout using spaces and tabs). This option will automatically be set to 1 (TRUE) when DocumentType is set to 3 (Pleading).
 
Default – 1

DocumentType

ExtractHyperlinks

Type – bool
Possible values – 0,1
Effect – Select this option to extract hyperlinks
Default – 1

ExtractImages

ExtractText

ImageFormat

JpegQuality

Type – numeric
Possible values – 1-100
Effect – Set the quality of JPEG images in the output, from 1 to 100%
Default – 50%

MergeParagraph

MergeText

Type – bool
Possible values – 0,1
Effect – Select this option to merge individual words into lines of text. If this option is not selected, each word will be placed in a separate text box. This option is only available when ConversionMethod is set to 2 (Exact placement using textboxes).
Default – 1

PageFrom

PageTo

PasswordLen:

Type – numeric
Possible values – Non-negative number equal to the length of the Passwords string + 1. If PasswordLen is set to 0, Passwords is automatically set to NULL.
Default – 0.

Passwords:

Type – string
Possible values – all valid characters.
Effect – List of passwords for opening and/or setting security permissions of encrypted files (user and/or owner passwords). If you use multiple passwords, you must include a non-NULL character separating the passwords, and specify the separating character in PasswordSeparator.
Default – NULL

PasswordSeparator

Type – numeric
Possible values – any valid ASCII character exclude the null character ‘\0’.
Effect – Character used to separate multiple passwords in the Passwords string.
Default – 44 (‘,’ comma character).

PreserveTextPosition


ShrinkFonts


UsingPageRange

 

 

 

 


www.bcltechnologies.com