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

OutputDocumentFormat Property

Determines the output document file format: RTF, DOC, or DOCX.

optOutputDocumentFormat OutputDocumentFormat { set; }
Property OutputDocumentFormat As optOutputDocumentFormat
def setOutputDocumentFormat(self, newVal)
void setOutputDocumentFormat(optOutputDocumentFormat newVal) throws PDF2WordException
function setOutputDocumentFormat($newVal)
BclWdoptOutputDocumentFormat OutputDocumentFormat;
Sub OutputDocumentFormat(newVal As Long)
beconv.exe -output docx|doc|rtf



One of optOutputDocumentFormat values:

OPT_OUTPUT_RTF = 1 - Native RTF output (Default),
OPT_OUTPUT_DOC_VIA_OFFICE = 2 - DOC output through RTF via Microsoft Office,
OPT_OUTPUT_DOCX_VIA_OFFICE = 3 - DOC output through RTF via Microsoft Office,
OPT_OUTPUT_DOC = 10 - Native DOC output. No Microsoft Office involved,
OPT_OUTPUT_DOCX = 11 - Native DOCX output. No Microsoft Office involved.


By default, easyConverter tries to use the output file extension to automatically deduce the output document format.

Let's suppose that the OutputDocumentFormat property is not set. If the output file's extension is .rtf, an RTF file is automatically produced. If the extension is .doc, a DOC file is generated. If the extension is .docx, a DOCX file is generated. It is not possible to override this behavior, because the file extension overrules the OutputDocumentFormat setting.

If the output file extension is not .rtf, .doc or .docx, then setting the OutputDocumentFormat property is essential. For example, if your extension is .tmp, .temp, .bin, .dat, OutputDocumentFormat defaults to an RTF document type. If you want a DOC output, you must explicitly set OutputDocumentFormat to OPT_OUTPUT_DOC.

Please do not use an obviously incorrect file extension, such as .txt or .docx for an RTF or DOC file. If a DOCX file has an extension of .rtf or .doc, Word can't open it.

The functions ConvertToWord2 and ConvertToWord3 do not provide an output file name, therefore the OutputDocumentFormat setting should be explicitly set, otherwise the default output format will be RTF.

The OPT_OUTPUT_RTF, OPT_OUTPUT_DOC and OPT_OUTPUT_DOCX values produce a native document output, which means easyConverter directly generates an RTF, DOC or DOCX output, respectively.

The OPT_OUTPUT_DOC_VIA_OFFICE and OPT_OUTPUT_DOCX_VIA_OFFICE values are based on Microsoft Office automation. That means the conversion executes in two stages. In stage 1, easyConverter produces a temporary RTF document. In stage 2, Microsoft Office is used to convert the RTF file into DOC or DOCX format. Finally, the temporary RTF file gets deleted. This requires Microsoft Office to be installed on the computer.

Native conversion is preferred to Microsoft Office automation.

Note that if you are running easyConverter on the server side, and OutputDocumentFormat is explicitly set to OPT_OUTPUT_DOC_VIA_OFFICE or OPT_OUTPUT_DOCX_VIA_OFFICE, you must execute easyConverter via Loader.

Here is the feature matrix summary:

Output file extension
.rtf .doc .docx other
OPT_OUTPUT_RTF native RTF native DOC native DOCX native RTF
OPT_OUTPUT_DOC native RTF native DOC native DOCX native DOC
OPT_OUTPUT_DOCX native RTF native DOC native DOCX native DOCX
OPT_OUTPUT_DOC_VIA_OFFICE native RTF DOC via Office DOCX via Office DOC via Office
OPT_OUTPUT_DOCX_VIA_OFFICE native RTF DOC via Office DOCX via Office DOCX via Office

Note: The horizontal axis is the file extension (red). The vertical axis is the OutputDocumentFormat setting (blue). If not specified, OutputDocumentFormat behaves like OPT_OUTPUT_RTF.

Exception Handling

Please refer to the list of return exceptions.

Example Usage

using BCL.easyConverter.Word;
PDF2Word pdf2word = new PDF2Word();
   pdf2word.OutputDocumentFormat = optOutputDocumentFormat.OPT_OUTPUT_DOC; // Use .DOC format for .tmp file
   pdf2word.ConvertToWord(@"c:\temp\input.pdf", @"c:\temp\output.tmp");
catch(PDF2WordException ex)
Imports BCL.easyConverter.Word
Dim pdf2word As New PDF2Word()
   pdf2word.OutputDocumentFormat = optOutputDocumentFormat.OPT_OUTPUT_DOC ' Use .DOC format for .tmp file
   pdf2word.ConvertToWord("c:\test\input.pdf", "c:\test\output.tmp")
Catch ex As PDF2WordException
End Try
import PDF2Word
pdf2word = PDF2Word.PDF2Word()
   pdf2word.setOutputDocumentFormat(PDF2Word.optOutputDocumentFormat.OPT_OUTPUT_DOC) # Use .DOC format for .tmp file
   pdf2word.ConvertToWord("c:\\test\\input.pdf", "c:\\test\\output.tmp")
except PDF2Word.PDF2WordException as ex:
PDF2Word pdf2word = new PDF2Word();
   pdf2word.setOutputDocumentFormat(optOutputDocumentFormat.OPT_OUTPUT_DOC); // Use .DOC format for .tmp file
   pdf2word.ConvertToWord("c:\\temp\\input.pdf", "c:\\temp\\output.tmp", "", 0, -1);
catch(PDF2WordException e)
$pdf2word = new BCL\easyConverter\Word\PDF2Word();
   $pdf2word->setOutputDocumentFormat(BCL\easyConverter\Word\optOutputDocumentFormat::OPT_OUTPUT_DOC); // Use .DOC format for .tmp file
   $pdf2word->ConvertToWord("c:\\test\\input.pdf", "c:\\test\\output.tmp");
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");
      printf("easyConverter could not be loaded.\n");
      return 1;
      BclWdhrError error;
      BclPDF2Word* pPdf2Word = CreatePDF2Word(hPDF2WordDll);
         printf("easyConverter could not be initialized.\n");
         return 1;
      pPdf2Word->OutputDocumentFormat = BCL_WD_OPT_OUTPUT_DOC; // Use .DOC format for .tmp file
      error = pPdf2Word->ConvertToWord(pPdf2Word, L"c:\\test\\input.pdf", L"c:\\test\\output.tmp", L"", 0, -1);
         printf("Conversion failed with error %d.\n", error);
         return 1;
      return 0;
oConverter = CreateObject("EasyConverter.PDF2Word.5")

' Set the option to save as native .DOC file
oConverter.OutputDocumentFormat = OPT_OUTPUT_DOC
Call oConverter.ConvertToWord(inFileName, outFileName)
set beconv="C:\Program Files\BCL Technologies\easyConverter SDK 5\Rtf\beconv.exe"
REM Use .DOC format for .tmp file
%beconv% -output doc -i "c:\test\input.pdf" -o "c:\test\output.tmp"

Compatibility Note

Previous versions of easyConverter had properties SaveAsDoc and SaveAsDocx. They had been replaced by the OutputDocumentFormat property.