Referencing the Assemblies

You can install DynamicPDF HTML Converter through Nuget or manually.

NuGet Installation

To install the NuGet Package, simply navigate to Visual Studio's Package Manager and install it from there. The DynamicPDF HTML Converter relies on the NuGet package "ceTe.DynamicPDF.HtmlToPDFResources" as a dependency, which contains the essential Chromium files necessary for the conversion process.

However, please note that you also have the flexibility to utilize locally installed Edge, Chromium, or similar resources instead of relying solely on the ones provided by us.

We recommend installing using the NuGet package, as this is the easiest and least error-prone installation method.

Manual Installation

To install manually, download the assembly from the DynamicPDF website. The downloaded zip file (DynamicPDFHTMLConverterForNETv2.XX.zip) contains the following files.

Linux Deployment

You can also deploy DynamicPDF HTML Converter on the Linux operating system. The following instructions outline the steps required.

The following instructions require DynamicPDF HTML Converter v2.0 or higher.

chromium --no-sandbox --disable-gpu --headless

Linux deployment requires Chrome or a Chromium based browser.

Container Deployment

You can deploy DynamicPDF HTML Converter within a Docker container and deploy it to an Azure App Service or any other similar environment. The following steps create a Docker container and deploy it to an Azure App Service.

Debian or Ubuntu based images can be used, however Alpine is not supported.

  1. Add Docker support to the ASP.NET project that is using DynamicPDF HTML Converter.

  2. This sample uses Debian. Ubuntu can also be used, however the commands may vary.

  3. Add these lines of code in the docker file to install chromium under the base image.

    # Install chromium  
    RUN apt-get update && apt-get install chromium -y
    # Install required fonts. [Optional step]  
    # RUN apt update && apt install fonts-indic -y  
    # && fc-cache -f 
    
  4. Set the TemporaryDirectory and ChromiumProcessPath properties in code when the application starts. If the temporary directory is not preset, it will be created as long as the process has the required permissions.

    Converter.ChromiumProcessPath = "/usr/bin/chromium"; 
    Converter.TemporaryDirectory = "/dpdfTemp";
    
  5. Running the application creates the Docker image.

  6. Push the Docker image to the Azure Container registry or Docker Hub and create an App Service using the image.

Refer to https://code.visualstudio.com/docs/containers/app-service to Deploy to Azure App Service using VS Code.

In this topic