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

Sandboxed Property

Enables or disables sandboxing (worker process isolation).

bool Sandboxed { set; }
Property Sandboxed As Bool
def setSandboxed(self, newVal)
void setSandboxed(boolean newVal) throws PDF2ExcelException
function setSandboxed($newVal)
BCL_BOOL Sandboxed;
Sub Sandboxed(newVal As Bool)

Parameters

newVal

True - Enable sandboxing (default)
False - Disable sandboxing

Explanation

Sandboxing is a technique that isolates the conversion functionality into a separate executable. In case the implementation crashes, it is this external process that blows up, instead of the application or server that is using the SDK. With sandboxing enabled, a corrupt or malicious PDF can't hurt the web server, because easyConverter is not running inside IIS.

The other advantage is that sandboxing enables real timeout functionality by killing the worker process after a certain amount of time.

Finally, sandboxing also increases security by isolating PDF parsing, JPEG decompression and other similarly dangerous tasks in a separate process that has no physical access to the web server's memory. For example, a zero-day vulnerability in easyConverter would only let the hackers break into the current PDF conversion, and nothing else.

With sandboxing each conversion runs in a completely independent executable.

Sandboxing is enabled by default, and it is strongly recommended that every server customer uses this feature, unless they implement their own, independent sandboxing. If sandboxing is turned off, easyConverter runs directly inside the customer's own application, which opens up a lot of vulnerability issues, and makes timing out impossible. For example, a crash in easyConverter due to a broken PDF could kill the entire Java runtime or the whole IIS worker process, unless sandboxing is enabled.

The performance hit due to sandboxing is immeasurable compared to the time it takes to execute a PDF conversion.

Example Usage

using BCL.easyConverter.Excel;
...
PDF2Excel pdf2excel = new PDF2Excel();
try
{
   pdf2excel.Sandboxed = false; // Turn off sandboxing (not recommended)
   pdf2excel.ConvertToExcel(@"c:\temp\input.pdf", @"c:\temp\output.csv");
}
catch(PDF2ExcelException ex)
{
   Console.WriteLine(ex.Message);
}
finally
{
   pdf2excel.Dispose();
}
Imports BCL.easyConverter.Excel
...
Dim pdf2excel As New PDF2Excel()
Try
   pdf2excel.Sandboxed = False ' Turn off sandboxing (not recommended)
   pdf2excel.ConvertToExcel("c:\test\input.pdf", "c:\test\output.csv")
Catch ex As PDF2ExcelException
   System.Console.WriteLine(ex.Message)
Finally
   pdf2excel.Dispose()
End Try
import PDF2Excel
pdf2excel = PDF2Excel.PDF2Excel()
try:
   pdf2excel.setSandboxed(False) # Turn off sandboxing (not recommended)
   pdf2excel.ConvertToExcel("c:\\test\\input.pdf", "c:\\test\\output.csv")
except PDF2Excel.PDF2ExcelException as ex:
   print(ex)
PDF2Excel pdf2excel = new PDF2Excel();
try
{
   pdf2excel.setSandboxed(false); // Turn off sandboxing (not recommended)
   pdf2excel.ConvertToExcel("c:\\temp\\input.pdf", "c:\\temp\\output.csv", "", 0, -1);
}
catch(PDF2ExcelException e)
{
   System.out.println(e);
}
finally
{
   pdf2excel.dispose();
}
<?php
require("PDF2Excel.php");
$pdf2excel = new BCL\easyConverter\Excel\PDF2Excel();
try
{
   $pdf2excel->setSandboxed(false); // Turn off sandboxing (not recommended)
   $pdf2excel->ConvertToExcel("c:\\test\\input.pdf", "c:\\test\\output.csv");
}
catch(BCL\easyConverter\Excel\PDF2ExcelException $ex)
{
   echo $ex->getMessage(), "\n";
}
?>
#include <stdio.h>
#include <windows.h>
#include "easyConverter.h"

int main()
{
   HMODULE hPDF2ExcelDll = LoadLibraryW(L"C:\\Program Files\\BCL Technologies\\easyConverter SDK 5\\Rtf\\easyConverter.dll");
   if(!hPDF2ExcelDll)
   {
      printf("easyConverter could not be loaded.\n");
      return 1;
   }
   else
   {
      BclXlhrError error;
      BclPDF2Excel* pPdf2Excel = CreatePDF2Excel(hPDF2ExcelDll);
      if(!pPdf2Excel)
      {
         printf("easyConverter could not be initialized.\n");
         FreeLibrary(hPDF2ExcelDll);
         return 1;
      }
      pPdf2Excel->Sandboxed = BCL_FALSE; // Turn off sandboxing (not recommended)
      error = pPdf2Excel->ConvertToExcel(pPdf2Excel, L"c:\\test\\input.pdf", L"c:\\test\\output.csv", L"", 0, -1);
      if(error)
      {
         printf("Conversion failed with error %d.\n", error);
         FreeLibrary(hPDF2ExcelDll);
         return 1;
      }
      pPdf2Excel->Dispose(pPdf2Excel);
      FreeLibrary(hPDF2ExcelDll);
      return 0;
   }
}
oConverter = CreateObject("EasyConverter.PDF2Excel.5")

' Turn off sandboxing (not recommended)
oConverter.Sandboxed = False
Call oConverter.ConvertToExcel(inFileName, outFileName)