DEV Community

Cover image for Stirling-pdf Windows Alternatives Using Ironsecuredoc
Mohammed Ibrahim
Mohammed Ibrahim

Posted on

Stirling-pdf Windows Alternatives Using Ironsecuredoc

Introduction

Businesses as well as development in the modern digital world have to deal with process PDF in an efficient way. Solutions about Docker for all merging, splitting, extracting text, adding images from it, encryption, and signing of a PDF are containerized. The approach using Docker helps it to have portable, scalable, and easier deployment with separate server memory and no complexities of dependency on software or system configurations.

PDF Docker containers give users the chance to embed functionalities in PDFs within their applications, automate the workflow of their documents, and ensure smooth performance in different environments. PDF Docker solutions have been categorized into many types, for various operations such as basic management of PDF to advanced security, enterprise-grade, and more comprehensive set of features; some of the popular solutions are Stirling PDF Docker and IronSecureDoc Docker. Understanding the tools helps the organization choose the right combination that makes their work efficient, secure, and well-organized.

What is Stirling pdf?

Stirling PDF Docker is an open-source, containerized PDF toolkit that provides a simple and efficient way for developers to perform various PDF-related tasks, such as merging, splitting, compressing, extracting text, and PDF converts to images. By running Stirling PDF within a Docker container, developers avoid the hassle of dependency management and complex setups, making it easy to integrate these capabilities into their applications or workflows. A lightweight, API-ready toolkit that can be used as a microservice for handling all your PDF needs operations programmatically or locally hosted anywhere.

Image description

How does Stirling pdf Work?

Stirling PDF in Docker, as its name would suggest, runs an instance of the application in a container. This includes a web-based user interface and an API for PDF processing tasks. Once the user uploads the PDF through the web UI or makes an API request to merge, split, compress, or OCR, the request hits the container, which then processes the request based on the operation.

+--------------------+
|  User Interaction  |
|  (Web UI / API)    |
+--------+-----------+
         |
         v
+-----------------------+
|  Stirling PDF Docker  |
|  - Runs in Container  |
|  - Handles Requests   |
+--------+----------+---+
         |
+---------------------------+
| PDF Processing Module     |
+--------+------------------+
         |
+---------------------------+
|  Output Handling          |
| - Download File           |
| - Store in Mounted Volume |
+---------------------------+
Enter fullscreen mode Exit fullscreen mode

Inside the Docker, Stirling PDF processes the input request based on the libraries and tools included in the system. When that is done, the outputted PDF is returned to the user for downloading or stored in a mounted volume if set up so.

The host system's engine managing the container will enable it to be run in isolation with proper management of the system's resources, networking, and storage. The overall workflow would be some kind of sequentially interactive setup with the Web UI or API with regard to handling requests in a Docker container, further processing by Stirling PDF, and finally file output in the form of a download or storing on the mounted volume. This structure will ensure proper scalable document handling within a contained and portable environment.

What is Ironsecuredoc?

IronSecureDoc Docker is a containerized PDF management solution designed to perform secure enterprise-grade document processing. Developed within the IronPDF ecosystem, this solution offers advanced security features such as AES 256 encryption, digital signatures, password protection, and compliance-ready safeguards to process even the most sensitive and confidential files within a safe environment. It is scalable, thereby allowing for robust API integration and hence convenient professional support for businesses wanting reliable high-performance PDF processing within containerized deployments.

Image description
Docker installisation

Docker Compose comes as part of Docker Desktop for Windows. If you have Docker Desktop installed previously, Docker Compose is automatically installed on your computer and you can start using it straight away. Otherwise, here's how to install it:

Install Docker Desktop

  • Download Docker Desktop from the official website.
  • Run the installer, then follow all setup instructions.
  • Ensure that WSL 2 is enabled, for example, to make Windows perform better.
  • Restart the computer once installed.

Once the Docker Desktop is installed, Docker Compose will be included. You can verify it by running:

Image description

Install and Run on docker

Stirling pdf docker

Open up a terminal or command prompt and run the following command to download the latest Stirling PDF image:

docker pull stirlingtools/stirling-pdf
Enter fullscreen mode Exit fullscreen mode

Image description

Below is the docker comment to run the sterling pdf into a container.

docker run -d --name stirling-pdf -p 8080:8090 -e DOCKER_ENABLE_SECURITY=false -e LANGS=en_GB stirlingtools/stirling-pdf:latest
Enter fullscreen mode Exit fullscreen mode

This Docker command will run the Stirling-pdf container in the background (-d) and port map 8090 on the host machine to 8090 inside the container (-p 8090:8090) for access through the Stirling-PDF locally hosted web application service via this port.

Image description

The environment variable DOCKER_ENABLE_SECURITY=false is used here, which is not enabled. That is probably helpful for development purposes but does increase the potential risk of being vulnerable in a production environment. LANGS=en_GB sets the language to British English. The container is based on the latest version of the stirlingtools/stirling-pdf image, which provides a web-based PDF tool for various document-related operations.

Image description
Now we can connect stirling pdf API with any programming language. To know more about the functionality of the document check here. Which to perform various PDF operations. To know more about the installation refer here.

Ironsecuredoc docker

You can pull the IronSecureDoc Docker image from the repository below using the command below in the Command Prompt or an open terminal window.

docker pull ironsoftwareofficial/ironsecuredoc
Enter fullscreen mode Exit fullscreen mode

Image description

The above will download the latest Ironsecuredoc docker.

docker container run --rm -p 8080:8080 -e ENVIRONMENT=Development -e HTTP_PORTS=8080 ironsoftwareofficial/ironsecuredoc:latest
Enter fullscreen mode Exit fullscreen mode

Image description
The following docker command will run a container with the IronSecureDoc from IronSoftware. In this example, the --rm flag automatically removes the container upon its stop, so it does not clutter up your view. -p 8080:8080 means port 8080 on the host will map to port 8080 in the container for the application to be accessible at http://localhost:8080.

The flag -e ENVIRONMENT=Development sets an environment variable within the container. So, that's what the application should be set to: it should run in Development mode, usually really enabling debugging and detailed logging. The flag -e HTTP_PORTS=8080 environment variable indicates the application must listen on port 8080 for HTTP connections. Finally, the container will simply task execution on the most recently available ironsoftwareofficial/ironsecuredoc image, giving the app the latest updates, security improvements, and whatnot.

Image description

Now can access the API using the port name with the hosted server IP.

Secure PDF with password

Using Stirling pdf

Stirling-PDF provides an API endpoint, which will allow users to add password protection to their PDF programmatically. This feature will encrypt PDF documents so that only the correct password owner can access the content. One way to do this is by sending a POST request to the corresponding endpoint.

curl -X 'POST' \
  'http://192.168.1.3:8090/api/v1/security/add-password' \
  -H 'accept: */*' \
  -H 'Content-Type: multipart/form-data' \
  -F 'keyLength=256' \
  -F 'canExtractContent=false' \
  -F 'canModify=false' \
  -F 'ownerPassword=' \
  -F 'fileInput=@demo.pdf;type=application/pdf' \
  -F 'canExtractForAccessibility=false' \
  -F 'canPrintFaithful=false' \
  -F 'canModifyAnnotations=false' \
  -F 'password=demo' \
  -F 'canFillInForm=false' \
  -F 'canPrint=false' \
  -F 'canAssembleDocument=false'
Enter fullscreen mode Exit fullscreen mode

This curl command does a POST to the endpoint http://192.168.1.3:8090/api/v1/security/add-password and has the intent to add the security settings of a PDF called demo.pdf, which has content type as multipart/form-data where both file data and form fields are accepted and each of them is passed as a parameter for the request along with -F flags specifying its respective values. In this example, the filename is uploaded as demo.pdf, but this time the MIME type is explicit as application/pdf.

The password=demo field assigns the user password 'demo' to the PDF file. The boolean fields such as canModify=false and canPrint=false will be set to false to prevent users from modifying or printing this document. The keyLength=256 field sets a 256-bit encryption key for that PDF file. All these settings configure the security of the PDF together by defining its permissions and then applying password protection.

Image description

Using Ironsecuredoc

Below is the ironsecuredoc API link which helps us to secure the pdf documents.

curl -X 'POST' \
  'http://192.168.1.3:8080/v1/document-services/pdfs/encrypt?user_password=demo' \
  -H 'accept: */*' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@test.pdf;type=application/pdf'
Enter fullscreen mode Exit fullscreen mode

This curl command executes a POST request to the API endpoint of the IronSecureDoc at http://192.168.1.3:8080/encrypt, intending to encrypt a PDF document called test.pdf with user password 'demo'. The flags -H in the command determine the request headers, specifying the client will accept any response format and the type of the request content is set to multipart/form-data.

In the case of uploading the file test.pdf using the flag -F, this file's MIME type has to be set up explicitly to application/pdf. The command assigns 'demo' as the password with which to open the encrypted PDF by adding the user_password=demo parameter in the URL. It ensures that, at all costs, the resultant PDF will be protected such that only users having the correct password are allowed access.

Image description

Stirling pdf vs Ironsecuredoc

It is clearly visible that IronSecureDoc is a much better solution for safe, professional PDF handling. Stirling PDF is free and open-source self-hosted software and works inside the Docker container with some basic operations: merge, split, and convert PDFs. However, this application does not support enterprise-grade security lacks official support for the enterprise, and does not also support deep integration with .NET applications.

Image description
Contrasted with that is IronSecureDoc: It is a safe and high-performance Docker package, developed by IronSoftware for use in enterprise companies, requiring high-security encryption, signing digital capability, and easy access to PDF file manipulation with APIs, along with fluent integration with .NET applications. It comes with timely updates, enterprise-class security, and commercial support. For organizations needing reliable, secure, and professionally handled PDF operations within a Docker container, this would be the top pick.

Conclusion

The difference between them in terms of the focus areas lies in which aspects they particularly enhance. Whereas StirlingPDF deals with comprehensive capabilities for processing and manipulating a PDF document, IronSecureDoc's focus falls particularly on enhanced features for secure management of permission-related data that deals with encryption to ensure information security.

IronSecureDoc is the best option when security and advanced protection for all your PDF requirements and files are your priority. It offers powerful enterprise features like encryption, digital signatures, and safe access control. It is for organizations and even for private persons looking for secure documents. To find information about the license of IronSecureDoc, please refer to the licensing page. To find detailed configuration information about the products of Iron Software, follow the library page.

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay