Balázs Szücs 9fbb0325b5
Add EML to PDF conversion functionality (#3650)
This pull request introduces a new feature for converting EML (email)
files to PDF format, along with various customization options. It
includes backend support for the conversion process, frontend
integration for user interaction, and updates to localization and
navigation.

### Backend Changes:
* **Added EML to PDF Conversion Logic**: Implemented a new controller
`ConvertEmlToPDF` with an endpoint `/api/v1/convert/eml/pdf` to handle
EML-to-PDF conversion requests. This includes validation, support for
HTML intermediate files, and enhanced options such as attachment
handling and size limits.
(`src/main/java/stirling/software/SPDF/controller/api/converters/ConvertEmlToPDF.java`)
* **New Model for Conversion Requests**: Introduced `EmlToPdfRequest`
class to encapsulate request parameters like attachment inclusion,
maximum attachment size, and HTML download options.
(`common/src/main/java/stirling/software/common/model/api/converters/EmlToPdfRequest.java`)
* **Dependency Update**: Added `jakarta.mail:jakarta.mail-api:2.1.3` to
the project dependencies for handling EML files. (`common/build.gradle`)


![image](https://github.com/user-attachments/assets/34c5755a-d58d-4fc6-8a51-e83ac9f4afae)


### Frontend Changes:
* **New Web Form**: Created a new HTML page `eml-to-pdf.html` for the
EML-to-PDF conversion tool, allowing users to upload EML files and
configure options.
(`src/main/resources/templates/convert/eml-to-pdf.html`)
* **Navigation Update**: Added a navigation entry for the EML-to-PDF
tool in the sidebar.
(`src/main/resources/templates/fragments/navElements.html`)


![image](https://github.com/user-attachments/assets/afbd929d-7745-4d52-8aeb-a88d21662ca6)


### Localization and UI Enhancements:
* **Localization Strings**: Added support for the EML-to-PDF tool in the
`messages_en_GB.properties` file, including titles, descriptions, and
help texts. (`src/main/resources/messages_en_GB.properties`)
* **Web Controller Update**: Added a new route `/eml-to-pdf` in
`ConverterWebController` to serve the EML-to-PDF form.
(`src/main/java/stirling/software/SPDF/controller/web/ConverterWebController.java`)

### Highlights:
* Attachment support: and Attachment section is created with fully
working PDFAnnotations, which enable users to click paperclip and
redirects to the attachment. (Requires PDF.js)
*  If attachments are present creates a catalog of attachments
* Encoding support inside the body and header for local charachters e.g:
ö,ő,ü etc..
* Optional: Users can download HTMLs, aswell as PDFs
* Advanced features for conversion that: keep links, keep as much
formatting as possible, keep images incl relative sizes, popular fonts
and many more.

### Known limitations
* Generally EML-to-HTML is very reliable however emails with complicated
layout cause problem for Weasyprint, so not all emails can reliably
converted to PDF.
* Users need PDF.js and PDFCatalog support for best attachment/embedding
support (but is not strict requirement)

### Challanges
* Embedding was a large headache, not the Embedding itself per se more
so the additional niceties such as: links, the catalog, consistent
symbols (replaced the paperclip that is generated by pdf viewer with
emoji paperclip that is consistent for everybody) and it was generally
prone all sorts of hard to diagnose issues.
* Encoding issues
* Formatting issues

However I think addressed these so shouldn't cause any additional
headache. :)

### Examples:


![image](https://github.com/user-attachments/assets/9b560216-984d-4b9f-9ae7-8975723c894d)


![image](https://github.com/user-attachments/assets/98c7a67d-82d4-4f5a-bf42-8ebc4be18b42)


![image](https://github.com/user-attachments/assets/30a53fc9-9636-4090-b5b0-0866cc054c6c)


![image](https://github.com/user-attachments/assets/80c2d109-5259-4d3f-b97a-00b513d547e9)



Closes #503

---

## Checklist

### General

- [x] I have read the [Contribution
Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md)
- [x] I have read the [Stirling-PDF Developer
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md)
(if applicable)
- [x] I have read the [How to add new languages to
Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md)
(if applicable)
- [x] I have performed a self-review of my own code
- [x] My changes generate no new warnings

### Documentation

- [ ] I have updated relevant docs on [Stirling-PDF's doc
repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/)
(if functionality has heavily changed)
- [ ] I have read the section [Add New Translation
Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags)
(for new translation tags only)

### UI Changes (if applicable)

- [x] Screenshots or videos demonstrating the UI changes are attached
(e.g., as comments or direct attachments in the PR)

### Testing (if applicable)

- [x] I have tested my changes locally. Refer to the [Testing
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing)
for more details.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-08 21:26:01 +01:00
2025-06-05 11:02:53 +01:00
2025-06-05 11:02:40 +01:00
2025-06-05 11:02:53 +01:00
2025-02-04 11:24:35 +00:00
2025-06-05 11:02:53 +01:00
2025-06-05 11:02:53 +01:00
2025-06-03 17:48:17 +01:00
2025-05-20 12:02:10 +01:00
2024-12-30 15:49:28 +00:00
2024-12-17 23:23:16 +01:00
2025-06-05 11:02:53 +01:00
2025-05-27 17:25:41 +01:00
2025-06-05 11:02:53 +01:00
2025-01-14 15:32:15 +00:00

Stirling-PDF

Docker Pulls Discord OpenSSF Scorecard GitHub Repo stars

Stirling PDF - Open source locally hosted web PDF editor | Product Hunt Deploy to DO

Stirling-PDF is a robust, locally hosted web-based PDF manipulation tool using Docker. It enables you to carry out various operations on PDF files, including splitting, merging, converting, reorganizing, adding images, rotating, compressing, and more. This locally hosted web application has evolved to encompass a comprehensive set of features, addressing all your PDF requirements.

All files and PDFs exist either exclusively on the client side, reside in server memory only during task execution, or temporarily reside in a file solely for the execution of the task. Any file downloaded by the user will have been deleted from the server by that point.

Homepage: https://stirlingpdf.com

All documentation available at https://docs.stirlingpdf.com/

stirling-home

Features

  • 50+ PDF Operations
  • Parallel file processing and downloads
  • Dark mode support
  • Custom download options
  • Custom 'Pipelines' to run multiple features in a automated queue
  • API for integration with external scripts
  • Optional Login and Authentication support (see here for documentation)
  • Database Backup and Import (see here for documentation)
  • Enterprise features like SSO see here

PDF Features

Page Operations

  • View and modify PDFs - View multi-page PDFs with custom viewing, sorting, and searching. Plus, on-page edit features like annotating, drawing, and adding text and images. (Using PDF.js with Joxit and Liberation fonts)
  • Full interactive GUI for merging/splitting/rotating/moving PDFs and their pages
  • Merge multiple PDFs into a single resultant file
  • Split PDFs into multiple files at specified page numbers or extract all pages as individual files
  • Reorganize PDF pages into different orders
  • Rotate PDFs in 90-degree increments
  • Remove pages
  • Multi-page layout (format PDFs into a multi-paged page)
  • Scale page contents size by set percentage
  • Adjust contrast
  • Crop PDF
  • Auto-split PDF (with physically scanned page dividers)
  • Extract page(s)
  • Convert PDF to a single page
  • Overlay PDFs on top of each other
  • PDF to a single page
  • Split PDF by sections

Conversion Operations

  • Convert PDFs to and from images
  • Convert any common file to PDF (using LibreOffice)
  • Convert PDF to Word/PowerPoint/others (using LibreOffice)
  • Convert HTML to PDF
  • Convert PDF to XML
  • Convert PDF to CSV
  • URL to PDF
  • Markdown to PDF

Security & Permissions

  • Add and remove passwords
  • Change/set PDF permissions
  • Add watermark(s)
  • Certify/sign PDFs
  • Sanitize PDFs
  • Auto-redact text

Other Operations

  • Add/generate/write signatures
  • Split by Size or PDF
  • Repair PDFs
  • Detect and remove blank pages
  • Compare two PDFs and show differences in text
  • Add images to PDFs
  • Compress PDFs to decrease their filesize (using qpdf)
  • Extract images from PDF
  • Remove images from PDF
  • Extract images from scans
  • Remove annotations
  • Add page numbers
  • Auto-rename files by detecting PDF header text
  • OCR on PDF (using Tesseract OCR)
  • PDF/A conversion (using LibreOffice)
  • Edit metadata
  • Flatten PDFs
  • Get all information on a PDF to view or export as JSON
  • Show/detect embedded JavaScript

📖 Get Started

Visit our comprehensive documentation at docs.stirlingpdf.com for:

  • Installation guides for all platforms
  • Configuration options
  • Feature documentation
  • API reference
  • Security setup
  • Enterprise features

Supported Languages

Stirling-PDF currently supports 40 languages!

Language Progress
Arabic (العربية) (ar_AR) 72%
Azerbaijani (Azərbaycan Dili) (az_AZ) 72%
Basque (Euskara) (eu_ES) 42%
Bulgarian (Български) (bg_BG) 80%
Catalan (Català) (ca_CA) 79%
Croatian (Hrvatski) (hr_HR) 71%
Czech (Česky) (cs_CZ) 82%
Danish (Dansk) (da_DK) 72%
Dutch (Nederlands) (nl_NL) 70%
English (English) (en_GB) 100%
English (US) (en_US) 100%
French (Français) (fr_FR) 81%
German (Deutsch) (de_DE) 98%
Greek (Ελληνικά) (el_GR) 79%
Hindi (हिंदी) (hi_IN) 78%
Hungarian (Magyar) (hu_HU) 90%
Indonesian (Bahasa Indonesia) (id_ID) 72%
Irish (Gaeilge) (ga_IE) 80%
Italian (Italiano) (it_IT) 98%
Japanese (日本語) (ja_JP) 80%
Korean (한국어) (ko_KR) 79%
Norwegian (Norsk) (no_NB) 77%
Persian (فارسی) (fa_IR) 75%
Polish (Polski) (pl_PL) 84%
Portuguese (Português) (pt_PT) 80%
Portuguese Brazilian (Português) (pt_BR) 85%
Romanian (Română) (ro_RO) 67%
Russian (Русский) (ru_RU) 85%
Serbian Latin alphabet (Srpski) (sr_LATN_RS) 51%
Simplified Chinese (简体中文) (zh_CN) 85%
Slovakian (Slovensky) (sk_SK) 60%
Slovenian (Slovenščina) (sl_SI) 83%
Spanish (Español) (es_ES) 87%
Swedish (Svenska) (sv_SE) 76%
Thai (ไทย) (th_TH) 69%
Tibetan (བོད་ཡིག་) (bo_CN) 76%
Traditional Chinese (繁體中文) (zh_TW) 85%
Turkish (Türkçe) (tr_TR) 86%
Ukrainian (Українська) (uk_UA) 85%
Vietnamese (Tiếng Việt) (vi_VN) 67%
Malayalam (മലയാളം) (ml_IN) 85%

Stirling PDF Enterprise

Stirling PDF offers an Enterprise edition of its software. This is the same great software but with added features, support and comforts. Check out our Enterprise docs

🤝 Looking to contribute?

Join our community:

Description
#1 Locally hosted web application that allows you to perform various operations on PDF files
Readme MIT 110 MiB
Languages
Java 57.3%
HTML 19.6%
JavaScript 14.7%
CSS 3.8%
Rich Text Format 1.4%
Other 3.2%