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

ConversionMethod Property

Set conversion method for converting to RTF files.

optConversionMethod ConversionMethod { set; }
Property ConversionMethod As optConversionMethod
def setConversionMethod(self, newVal)
void setConversionMethod(optConversionMethod newVal) throws PDF2WordException
function setConversionMethod($newVal)
BclWdoptConversionMethod ConversionMethod;
Sub ConversionMethod(newVal As Long)
beconv.exe -method flow|spaces|textboxes|reflow

Parameters

newVal

One of optConversionMethod values:

CNV_METHOD_DEFAULT = 0 - Default,
CNV_METHOD_USE_SPACES_AND_TABS = 1 - Preserve layout using spaces and tabs,
CNV_METHOD_USE_TEXTBOXES = 2 - Preserve layout using textboxes,
CNV_METHOD_TEXT_FLOW = 3 - Reflow the document

Feature Matrix

Depending on the value of the ConversionMethod property, certain features are not usable. Here is a chart that indicates which properties and metgods are implemented for flow text (CNV_METHOD_DEFAULT) versus absolute positioning (CNV_METHOD_USE_SPACES_AND_TABS, CNV_METHOD_USE_TEXTBOXES, or CNV_METHOD_TEXT_FLOW).

Flow Text Absolute Positioning
ConvertToWord Yes Yes
ConvertToWord2 Yes Yes
ConvertToWord3 Yes Yes
FileConversionTimeout Yes Yes
JpegQuality Yes Yes
LicenseKey Yes Yes
NumberOfPages Yes Yes
OutputDocumentFormat Yes Partially (no native DOC/DOCX)
WordConversionTimeout Yes Yes
ConnectHyphens Yes No
ConvertBookmarks Yes No
DoNotAdjustFonts Yes No
MatchPDFLineBreaks Yes No
OcrOption Yes No
RemoveHiddenText Yes No
ShrinkCharacterSpacingToPreventWrap Yes No
WordpadImages Yes No
AdjustFontNames No Yes
AdjustSpacing No Yes
DetectHeader No Yes
DocumentType No Yes
ExtractHyperlinks No Yes
ExtractImages No Yes
ExtractText No Yes
MergeParagraphs No Yes
MergeText No Yes
ShrinkFonts No Yes

Exception Handling

Please refer to the list of return exceptions.

Example Usage

using BCL.easyConverter.Word;
...
PDF2Word pdf2word = new PDF2Word();
try
{
   pdf2word.ConversionMethod = optConversionMethod.CNV_METHOD_USE_TEXTBOXES; // Absolutely positioned textboxes
   pdf2word.ConvertToWord(@"c:\temp\input.pdf", @"c:\temp\output.rtf");
}
catch(PDF2WordException ex)
{
   Console.WriteLine(ex.Message);
}
finally
{
   pdf2word.Dispose();
}
Imports BCL.easyConverter.Word
...
Dim pdf2word As New PDF2Word()
Try
   pdf2word.ConversionMethod = optConversionMethod.CNV_METHOD_USE_TEXTBOXES ' Absolutely positioned textboxes
   pdf2word.ConvertToWord("c:\test\input.pdf", "c:\test\output.rtf")
Catch ex As PDF2WordException
   System.Console.WriteLine(ex.Message)
Finally
   pdf2word.Dispose()
End Try
import PDF2Word
pdf2word = PDF2Word.PDF2Word()
try:
   pdf2word.setConversionMethod(PDF2Word.optConversionMethod.CNV_METHOD_USE_TEXTBOXES) # Absolutely positioned textboxes
   pdf2word.ConvertToWord("c:\\test\\input.pdf", "c:\\test\\output.rtf")
except PDF2Word.PDF2WordException as ex:
   print(ex)
PDF2Word pdf2word = new PDF2Word();
try
{
   pdf2word.setConversionMethod(optConversionMethod.CNV_METHOD_USE_TEXTBOXES); // Absolutely positioned textboxes
   pdf2word.ConvertToWord("c:\\temp\\input.pdf", "c:\\temp\\output.rtf", "", 0, -1);
}
catch(PDF2WordException e)
{
   System.out.println(e);
}
finally
{
   pdf2word.dispose();
}
<?php
require("PDF2Word.php");
$pdf2word = new BCL\easyConverter\Word\PDF2Word();
try
{
   $pdf2word->setConversionMethod(BCL\easyConverter\Word\optConversionMethod::CNV_METHOD_USE_TEXTBOXES); // Absolutely positioned textboxes
   $pdf2word->ConvertToWord("c:\\test\\input.pdf", "c:\\test\\output.rtf");
}
catch(BCL\easyConverter\Word\PDF2WordException $ex)
{
   echo $ex->getMessage(), "\n";
}
?>
#include <stdio.h>
#include <windows.h>
#include "easyConverter.h"

int main()
{
   HMODULE hPDF2WordDll = LoadLibraryW(L"C:\\Program Files\\BCL Technologies\\easyConverter SDK 5\\Rtf\\easyConverter.dll");
   if(!hPDF2WordDll)
   {
      printf("easyConverter could not be loaded.\n");
      return 1;
   }
   else
   {
      BclWdhrError error;
      BclPDF2Word* pPdf2Word = CreatePDF2Word(hPDF2WordDll);
      if(!pPdf2Word)
      {
         printf("easyConverter could not be initialized.\n");
         FreeLibrary(hPDF2WordDll);
         return 1;
      }
      pPdf2Word->ConversionMethod = BCL_WD_CNV_METHOD_USE_TEXTBOXES; // Absolutely positioned textboxes
      error = pPdf2Word->ConvertToWord(pPdf2Word, L"c:\\test\\input.pdf", L"c:\\test\\output.rtf", L"", 0, -1);
      if(error)
      {
         printf("Conversion failed with error %d.\n", error);
         FreeLibrary(hPDF2WordDll);
         return 1;
      }
      pPdf2Word->Dispose(pPdf2Word);
      FreeLibrary(hPDF2WordDll);
      return 0;
   }
}
oConverter = CreateObject("EasyConverter.PDF2Word.5")

' Set conversion method
oConverter.ConversionMethod = CNV_METHOD_USE_TEXTBOXES
Call oConverter.ConvertToWord(inFileName, outFileName)
set beconv="C:\Program Files\BCL Technologies\easyConverter SDK 5\Rtf\beconv.exe"
%beconv% -method textboxes -i "c:\test\input.pdf" -o "c:\test\output.rtf"