Table of Contents

Property UseSandbox

Namespace
BitMiracle.Docotic.Pdf.HtmlToPdf
Assembly
BitMiracle.Docotic.Pdf.HtmlToPdf.dll

UseSandbox

Gets or sets the value indicating whether the engine should run in a sandbox.

public bool UseSandbox { get; set; }

Property Value

bool

true if the engine should run in a sandbox; otherwise, false.

Remarks

Default value: true.

When a sandbox is used, the HTML engine works within a very restrictive environment. The only resources a sandboxed process can freely use are CPU cycles and memory. A sandboxed process cannot write to disk or display windows.

Read more about what is limited when the engine runs in a sandbox in this document.

For a brief overview here is a quote from there: Sandbox leverages the OS-provided security to allow code execution that cannot make persistent changes to the computer or access information that is confidential. The architecture and exact assurances that the sandbox provides are dependent on the operating system.

Depending on the environment, the engine might be unable to provide sandboxing. When this happens, it won't work without setting this property to false. There is a list of environments that are known to require setting this property to false:

  • Container-based environments
  • Google Cloud Functions
  • Azure App Services
  • Some Linux distributions when Chromium process starts with administrator privileges

Read the Convert HTML to PDF in Azure Functions and Azure App Services article for examples of using this property.