OpenPDF banner

OpenPDF

2 devlogs
2h 40m

A security-focused PDF engine that builds PDF 1.4 documents from scratch and applies 128-bit AES encryption.

Demo Repository

Loading README...

fjordenzo

DEVLOG: OPENPDF 2026

Date: April 19, 2026
Project Lead: Fjord Enzo Bertrand-Helmgens
License: GNU GPL v3.0


Infrastructure Update: Transition from Binary to PyPI

I have moved the project from a standalone binary distribution model to a Python Package (PyPI) structure. This change allows for standard installation and better dependency management across different environments.

Project Resources:

Changes and Fixes:

1. Distribution Model

I have transitioned the architecture to use the src/ layout and pyproject.toml standards. The tool is now installed via pip, which provides the ‘openpdf’ command directly to the system path.

2. Encryption and Security

I have standardized the encryption logic on 128-bit AES. I also updated the command-line interface to require the –password=“PASSWORD” format to ensure the shell correctly handles special characters during the encryption process.

3. PDF Compliance and Stability

I refactored the object registry and trailer generation to resolve a crash occurring when accessing Document Properties in certain PDF viewers. The output now strictly follows the PDF 1.4 specification for cross-reference tables and metadata dictionaries.

4. Interface and Documentation

I replaced the default help output with a custom manual. I organized the arguments into logical groups and added specific descriptions for each flag. I also included practical usage examples within the help menu to clarify the syntax for new users.


Technical Specifications

  • Runtime: Python 3.8+
  • License: GNU GPL v3.0 (Updated in project metadata and headers).
  • Dependencies: pypdf (utilized for trailer and metadata normalization).
  • Command Syntax: Professional CLI with grouped argument parsing.

Roadmap

  • (x) Upload to PyPI.
  • (x) Resolution of metadata property crashes.
  • ( ) Support for standard input (stdin) piping.
  • ( ) Directory-wide batch processing.
  • ( ) Native image embedding support.
  • ( ) Custom TrueType (TTF) and OpenType (OTF) font support.
  • ( ) Fully transition away from pypdf for password encryption.
Attachment
0
fjordenzo

Dev Log: Initial Commit (OpenPDF 2026)

What i built: A secure, portable Text-to-PDF engine. The goal was to keep the core logic lightweight and custom while ensuring the final binary is a single file that works on any machine.

Technical Highlights:

  • The Engine: I manually built the PDF 1.4 object tree and XREF tables. It handles its own pagination (52 lines per page) and text wrapping so the output looks clean.
  • Glyph Handling: Refined the character processing to handle typography correctly. Since standard PDF Helvetica can be picky with Unicode, the engine now catches and converts special characters like the em dash into a compatible single-dash format to ensure it renders properly across all PDF viewers.
  • The Security: Integrated 128-bit encryption. It’s the only part that uses a dependency because standard PDF encryption is picky; this way, the passwords actually work in Adobe and Chrome.
  • Cross-Platform: While I primarily use Linux, the entire codebase is written to be OS-agnostic. The build system is designed to compile native binaries for Linux, Windows, and macOS.

Roadblocks & Fixes:

  • Syntax Headache: Caught a tricky bug where Python was trying to mix strings and bytes in the PDF stream. Fixed it by forcing everything into raw binary.
  • Silent Crashes: PyInstaller was being quiet about errors. I added a --verbose flag to the builder to dump raw logs if something breaks during compilation.
  • OS Restrictions: Dealt with PEP 668 and modern environment locks by making the builder “environment aware” so it doesn’t fight the OS.

Where we are: The project is stable.

https://github.com/intelliscience/OpenPDF

0