BCL easyConverter SDK HTML
easyConverter SDK Usermanual
PDF-to-HTML 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 PDF2HTMLException
function setSandboxed($newVal)
BCL_BOOL Sandboxed;
Sub Sandboxed(newVal As Bool)

Sandboxing is not applicable.

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.HTML;
...
PDF2HTML pdf2html = new PDF2HTML();
try
{
   pdf2html.Sandboxed = false; // Turn off sandboxing (not recommended)
   pdf2html.ConvertToHTML(@"c:\temp\input.pdf", @"c:\temp\output.html");
}
catch(PDF2HTMLException ex)
{
   Console.WriteLine(ex.Message);
}
finally
{
   pdf2html.Dispose();
}
Imports BCL.easyConverter.HTML
...
Dim pdf2html As New PDF2HTML()
Try
   pdf2html.Sandboxed = False ' Turn off sandboxing (not recommended)
   pdf2html.ConvertToHTML("c:\test\input.pdf", "c:\test\output.html")
Catch ex As PDF2HTMLException
   System.Console.WriteLine(ex.Message)
Finally
   pdf2html.Dispose()
End Try
import PDF2HTML
pdf2html = PDF2HTML.PDF2HTML()
try:
   pdf2html.setSandboxed(False) # Turn off sandboxing (not recommended)
   pdf2html.ConvertToHTML("c:\\test\\input.pdf", "c:\\test\\output.html")
except PDF2HTML.PDF2HTMLException as ex:
   print(ex)
PDF2HTML pdf2html = new PDF2HTML();
try
{
   pdf2html.setSandboxed(false); // Turn off sandboxing (not recommended)
   pdf2html.ConvertToHTML("c:\\temp\\input.pdf", "c:\\temp\\output.html", "", 0, -1);
}
catch(PDF2HTMLException e)
{
   System.out.println(e);
}
finally
{
   pdf2html.dispose();
}
<?php
require("PDF2HTML.php");
$pdf2html = new BCL\easyConverter\HTML\PDF2HTML();
try
{
   $pdf2html->setSandboxed(false); // Turn off sandboxing (not recommended)
   $pdf2html->ConvertToHTML("c:\\test\\input.pdf", "c:\\test\\output.html");
}
catch(BCL\easyConverter\HTML\PDF2HTMLException $ex)
{
   echo $ex->getMessage(), "\n";
}
?>
#include <stdio.h>
#include <windows.h>
#include "easyConverterHTML.h"

int main()
{
   HMODULE hPdf2HtmlDll = LoadLibraryW(L"C:\\Program Files\\BCL Technologies\\easyConverter SDK 5\\Html\\easyConverterHTML.dll");
   if(!hPdf2HtmlDll)
   {
      printf("easyConverter could not be loaded.\n");
      return 1;
   }
   else
   {
      BclWdhrError error;
      BclPDF2HTML* pPdf2Html = CreatePDF2HTML(hPdf2HtmlDll);
      if(!pPdf2Html)
      {
         printf("easyConverter could not be initialized.\n");
         FreeLibrary(hPdf2HtmlDll);
         return 1;
      }
      pPdf2Html->Sandboxed = BCL_FALSE; // Turn off sandboxing (not recommended)
      error = pPdf2Html->ConvertToHTML(pPdf2Html, L"c:\\test\\input.pdf", L"c:\\test\\output.html", L"", 0, -1);
      if(error)
      {
         printf("Conversion failed with error %d.\n", error);
         FreeLibrary(hPdf2HtmlDll);
         return 1;
      }
      pPdf2Html->Dispose(pPdf2Html);
      FreeLibrary(hPdf2HtmlDll);
      return 0;
   }
}
oConverter = CreateObject("EasyConverter.PDF2HTML.5")

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

Sandboxing is not applicable.

set beconvh="C:\Program Files\BCL Technologies\easyConverter SDK 5\Html\beconvh.exe"
%beconvh% -i "c:\test\input.pdf" -o "c:\test\output.html"