AzSDK PDF To Word ActiveX DLL: Easy Integration Guide for Windows Developers

Convert PDFs to Word with AzSDK PDF To Word ActiveX DLL — Quick Setup & Examples

This guide shows a concise, practical setup and example-driven workflow to convert PDF files to Word documents using the AzSDK PDF To Word ActiveX DLL on Windows. It assumes a developer familiar with basic COM/ActiveX usage and either VB6, VBA, or a .NET language that can consume COM components.

Prerequisites

  • Windows development machine.
  • AzSDK PDF To Word ActiveX DLL installer or DLL file and license (if required).
  • Administrative privileges to register the ActiveX DLL (regsvr32) or an installer.
  • Development environment that supports COM (Visual Studio, VB6, Excel/VBA, etc.).

Installation & Registration

  1. Place the DLL in a folder (e.g., C:\Program Files\AzSDK).
  2. Open an elevated Command Prompt.
  3. Register the DLL:
    • regsvr32 “C:\Program Files\AzSDK\AzSDKPdfToWord.dll”
  4. Confirm registration succeeded (regsvr32 success dialog).

If the SDK provides an installer, run it and follow the prompts; it typically registers the COM component automatically.

Importing/Referencing the ActiveX in Your Project

  • VB6 / VBA: In the IDE, go to Project → References → check the AzSDK PDF To Word ActiveX reference.
  • .NET (C# / VB.NET): Add a COM reference via Project → Add Reference → COM → select the AzSDK component. Visual Studio will create an interop assembly.

Basic Usage Overview

Typical workflow:

  1. Create an instance of the AzSDK PDF To Word ActiveX object.
  2. Set input PDF path and output DOC/DOCX path.
  3. Optionally set conversion options (layout retention, images, OCR for scanned PDFs).
  4. Call the conversion method and check the returned status or exceptions.

Example: VBA (Excel) — Simple Conversion

vb

Sub ConvertPdfToWord() Dim converter As Object

Set converter = CreateObject("AzSDKPdfToWord.Converter") Dim inputPath As String Dim outputPath As String inputPath = "C:\Temp\sample.pdf" outputPath = "C:\Temp\sample.docx" ' Optional settings (names may vary by SDK) converter.KeepLayout = True converter.ConvertImages = True converter.EnableOCR = False Dim result As Long result = converter.ConvertToWord(inputPath, outputPath) If result = 0 Then     MsgBox "Conversion succeeded: " & outputPath Else     MsgBox "Conversion failed. Error code: " & result End If 

End Sub

Example: C# (.NET) — Console App

csharp

using System; class Program { static void Main() { // The ProgID depends on the registered COM component name Type comType = Type.GetTypeFromProgID(“AzSDKPdfToWord.Converter”); dynamic converter = Activator.CreateInstance(comType); string inputPath = @“C:\Temp\sample.pdf”; string outputPath = @“C:\Temp\sample.docx”; // Optional properties converter.KeepLayout = true; converter.ConvertImages = true; converter.EnableOCR = false; int result = converter.ConvertToWord(inputPath, outputPath); if (result == 0) Console.WriteLine(“Conversion succeeded: “ + outputPath); else Console.WriteLine(“Conversion failed. Error code: “ + result); } }

Example: Command-Line Wrapper (PowerShell)

powershell

\(converter</span><span> = </span><span class="token" style="color: rgb(57, 58, 52);">New-Object</span><span> </span><span class="token" style="color: rgb(57, 58, 52);">-</span><span>ComObject AzSDKPdfToWord</span><span class="token" style="color: rgb(57, 58, 52);">.</span><span>Converter </span><span></span><span class="token" style="color: rgb(54, 172, 170);">\)converter.KeepLayout = \(true</span><span> </span><span></span><span class="token" style="color: rgb(54, 172, 170);">\)converter.EnableOCR = \(false</span><span> </span> <span></span><span class="token" style="color: rgb(54, 172, 170);">\)in = “C:\Temp\sample.pdf” \(out</span><span> = </span><span class="token" style="color: rgb(163, 21, 21);">"C:\Temp\sample.docx"</span><span> </span><span></span><span class="token" style="color: rgb(54, 172, 170);">\)result = \(converter</span><span class="token" style="color: rgb(57, 58, 52);">.</span><span>ConvertToWord</span><span class="token" style="color: rgb(57, 58, 52);">(</span><span class="token" style="color: rgb(54, 172, 170);">\)in, \(out</span><span class="token" style="color: rgb(57, 58, 52);">)</span><span> </span> <span></span><span class="token" style="color: rgb(0, 0, 255);">if</span><span> </span><span class="token" style="color: rgb(57, 58, 52);">(</span><span class="token" style="color: rgb(54, 172, 170);">\)result -eq 0) { Write-Output “Success: \(out</span><span class="token" style="color: rgb(163, 21, 21);">"</span><span> </span><span class="token" style="color: rgb(57, 58, 52);">}</span><span> </span><span class="token" style="color: rgb(0, 0, 255);">else</span><span> </span><span class="token" style="color: rgb(57, 58, 52);">{</span><span> </span><span class="token" style="color: rgb(57, 58, 52);">Write-Output</span><span> </span><span class="token" style="color: rgb(163, 21, 21);">"Failed. Code: </span><span class="token" style="color: rgb(54, 172, 170);">\)result }

Common Conversion Options (typical)

  • KeepLayout / PreserveLayout: retain original PDF layout.
  • ConvertImages / ExtractImages: include embedded images.
  • EnableOCR / OCRMode: run OCR for scanned PDFs (may require additional language files).
  • OutputFormat: DOC or DOCX.
  • Password: supply password for protected PDFs. Names and availability vary by SDK—use the component’s documentation for exact property/method names.

Error Handling & Troubleshooting

  • Registration errors: ensure you run regsvr32 as administrator and the DLL matches OS bitness (32-bit vs 64-bit). Register 32-bit COM on 64-bit Windows using the SysWOW64 regsvr32 if needed.
  • Interop exceptions in .NET: confirm the COM reference was added and platform target (x86/x64) matches the registered DLL.
  • OCR failures: install required OCR language packs or enable OCR engine if separate.
  • Permission issues: ensure read access to input PDF and write access to output folder.
  • If conversion returns nonzero codes, consult SDK docs for code meanings or inspect an ErrorMessage property if available.

Deployment Notes

  • Redistribute the COM DLL per the vendor license.
  • Register the DLL on target machines (installer or regsvr32).
  • Match application bitness to the COM

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *