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

WordConversionTimeout Property

Timeout for the Word automation (in milliseconds).

int WordConversionTimeout { set; }
Property WordConversionTimeout As Integer
def setWordConversionTimeout(self, newVal)
void setWordConversionTimeout(int newVal) throws PDF2WordException
function setWordConversionTimeout($newVal)
int WordConversionTimeout;
Sub WordConversionTimeout(newVal As Long)

Not applicable.

Parameters

newVal

Timeout value in milliseconds (Integer).

Comments

When you are generating a DOC/DOCX output via Office automation, the conversion is performed in two phases. First, the PDF is converted into RTF, then the RTF is converted into DOC/DOCX. Each phase has its own independent timeout.

This property controls the RTF to DOC/DOCX conversion phase timeout. You should also set the FileConversionTimeout property. The total timeout per document is FileConversionTimeout + WordConversionTimeout.

Exception Handling

Please refer to the list of return exceptions.

Example Usage

using BCL.easyConverter.Word;
...
PDF2Word pdf2word = new PDF2Word();
try
{
   // Set document conversion timeout value to 5 + 5 minutes 
   pdf2word.FileConversionTimeout = 5 * 60000;  // timeout for the PDF to RTF phase
   pdf2word.WordConversionTimeout = 5 * 60000;  // timeout for the RTF to DOC phase
   pdf2word.OutputDocumentFormat = optOutputDocumentFormat.OPT_OUTPUT_DOC_VIA_OFFICE;
   pdf2word.ConvertToWord(@"c:\temp\input.pdf", @"c:\temp\output.doc");
}
catch(PDF2WordException ex)
{
   Console.WriteLine(ex.Message);
}
finally
{
   pdf2word.Dispose();
}
Imports BCL.easyConverter.Word
...
Dim pdf2word As New PDF2Word()
Try
   ' Set document conversion timeout value to 5 + 5 minutes 
   pdf2word.FileConversionTimeout = 5 * 60000  ' timeout for the PDF to RTF phase
   pdf2word.WordConversionTimeout = 5 * 60000  ' timeout for the RTF to DOC phase
   pdf2word.OutputDocumentFormat = optOutputDocumentFormat.OPT_OUTPUT_DOC_VIA_OFFICE
   pdf2word.ConvertToWord("c:\test\input.pdf", "c:\test\output.doc")
Catch ex As PDF2WordException
   System.Console.WriteLine(ex.Message)
Finally
   pdf2word.Dispose()
End Try
import PDF2Word
pdf2word = PDF2Word.PDF2Word()
try:
   # Set document conversion timeout value to 5 + 5 minutes 
   pdf2word.setFileConversionTimeout(5 * 60000)  # timeout for the PDF to RTF phase
   pdf2word.setWordConversionTimeout(5 * 60000)  # timeout for the RTF to DOC phase
   pdf2word.setOutputDocumentFormat(PDF2Word.optOutputDocumentFormat.OPT_OUTPUT_DOC_VIA_OFFICE)
   pdf2word.ConvertToWord("c:\\test\\input.pdf", "c:\\test\\output.doc")
except PDF2Word.PDF2WordException as ex:
   print(ex)
PDF2Word pdf2word = new PDF2Word();
try
{
   // Set document conversion timeout value to 5 + 5 minutes 
   pdf2word.setFileConversionTimeout(5 * 60000);  // timeout for the PDF to RTF phase
   pdf2word.setWordConversionTimeout(5 * 60000);  // timeout for the RTF to DOC phase
   pdf2word.setOutputDocumentFormat(optOutputDocumentFormat.OPT_OUTPUT_DOC_VIA_OFFICE);
   pdf2word.ConvertToWord("c:\\temp\\input.pdf", "c:\\temp\\output.doc", "", 0, -1);
}
catch(PDF2WordException e)
{
   System.out.println(e);
}
finally
{
   pdf2word.dispose();
}
<?php
require("PDF2Word.php");
$pdf2word = new BCL\easyConverter\Word\PDF2Word();
try
{
   // Set document conversion timeout value to 5 + 5 minutes 
   $pdf2word->setFileConversionTimeout(5 * 60000);  // timeout for the PDF to RTF phase
   $pdf2word->setWordConversionTimeout(5 * 60000);  // timeout for the RTF to DOC phase
   $pdf2word->setOutputDocumentFormat(BCL\easyConverter\Word\optOutputDocumentFormat::OPT_OUTPUT_DOC_VIA_OFFICE);
   $pdf2word->ConvertToWord("c:\\test\\input.pdf", "c:\\test\\output.doc");
}
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;
      }
      // Set document conversion timeout value to 5 + 5 minutes 
      pPdf2Word->FileConversionTimeout = 5 * 60000;  // timeout for the PDF to RTF phase
      pPdf2Word->WordConversionTimeout = 5 * 60000;  // timeout for the RTF to DOC phase
      pPdf2Word->OutputDocumentFormat = BCL_WD_OPT_OUTPUT_DOC_VIA_OFFICE;
      error = pPdf2Word->ConvertToWord(pPdf2Word, L"c:\\test\\input.pdf", L"c:\\test\\output.doc", 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 document conversion timeout value to 5 + 5 minutes 
oConverter.FileConversionTimeout = 5 * 60000  ' timeout for the PDF to RTF phase
oConverter.WordConversionTimeout = 5 * 60000  ' timeout for the RTF to DOC phase
oConverter.OutputDocumentFormat = OPT_OUTPUT_DOC_VIA_OFFICE
Call oConverter.ConvertToWord(inFileName, outFileName)

Not applicable.