BCL easyConverter SDK
easyConverter SDK Usermanual
PDF-to-Word Programming API  |  Download Free Trial  |  Contact Us to Purchase

ConvertToWord3 Method

Convert a PDF stream to RTF stream. Both input and output are coming from memory stream.

Function ConvertToWord3(InStream As Variant,
                        [Password] As Variant,
                        [From] As Variant,
                        [To] As Variant)
                        As Variant


Parameters

InStream

Input PDF stream.

Password (optional)

Password to open the PDF document if any.

From (optional)

The starting page number to convert.

To (optional)

The ending page number to convert.

Return Values

RTF Stream.

Exception Handling

Please refer to the list of return exceptions.

Example Usage

On Error GoTo Convert_Err

        oConverter = CreateObject("EasyConverter.PDF2Word.4")

        ' convert PDF string into byte array using ADO stream object
        Set oADO = CreateObject("ADODB.Stream")
        oADO.Charset = "Windows-1252"
        oADO.Type = 2 ' 2: adTypeText
        oADO.Open
        oADO.WriteText strPDF
        oADO.Position = 0
        oADO.Type = 1 ' 1: adTypeBinary
        arrPDF = oADO.Read
        oADO.Close
  
        arrRTF = oConverter.ConvertToWord3(arrPDF)

        ' Save binary data To disk using ADO stream object
        Set oADO = CreateObject("ADODB.Stream")
        oADO.Type = 1 ' 1: adTypeBinary
        oADO.Open
        oADO.Write arrRTF
        Call oADO.SaveToFile("C:\output.rtf", 2) ' 2: adSaveCreateOverwrite
        oADO.Close

        MsgBox("Success", vbOKOnly + vbInformation)

Convert_End:

        oConverter = Nothing
        Exit Sub

Convert_Err:

        ' Handle error
         MsgBox("Error(" + CStr(Err.Number) + ")", vbOKOnly + vbInformation)

        Resume Convert_End