[Unity asset · Asset Store · Coming soon]

PDF Maker for Unity

Create PDF files from C# code, at runtime or in the Editor: text, images, shapes and tables, laid out for you.

It is plain managed C#: no native plugins, no third-party libraries and no setup. The package adds no permissions and nothing to your Android manifest or Gradle files.

Unity 6000.0.84f1+ · Run on Windows 11 and on Android emulators only

This opens your email app. If nothing opens, write to luanrobs@gmail.com. I will reply once, on launch day. I will not add you to a list.

OVERVIEW

Canvas

Draw at exact positions: text, lines, rectangles, rounded rectangles, ellipses, arcs, polygons, bezier paths and images, with opacity, dashes, clipping and transforms.

Layout

Add headings, paragraphs (left, centre, right or justified), lists, tables and images one after the other. Pages are added as the content fills them, table headers repeat on every page, and headers and footers can show "Page X of Y".

Fonts

Twelve of the fourteen standard PDF fonts (Helvetica, Times and Courier, four styles each) work with no setup. Embed a TrueType font to write Unicode text that can be copied and searched.

Output

A byte[], a Stream or a file.

PDF Maker writes PDF files. It does not show them. To show a result inside your game, use it together with PDF Viewer, a separate luanrobs package that the demo scenes use when it is installed.

QUICK START

using System.IO;
using Luanrobs.PdfMaker;
using UnityEngine;

public class HelloPdf : MonoBehaviour
{
    private void Start()
    {
        var document = new PdfDocument();
        document.Metadata.Title = "Hello";

        document.AddHeading("Hello, PDF");
        document.AddParagraph("This file was created by PDF Maker while the game was running.");

        string path = Path.Combine(Application.persistentDataPath, "hello.pdf");
        document.Save(path);
        Debug.Log("Saved " + path);
    }
}

Without a file, document.ToBytes() returns the same PDF as a byte[], and document.Save(stream) writes it to any Stream.

TESTED ON

Platform Status
Windows Editor Unity 6000.3.12f1 and 6000.0.84f1 on Windows 11: all 768 EditMode tests pass on both, in new projects that installed the package from its .tgz file. On 6000.3.12f1, Play mode worked three times in a row with Domain Reload disabled.
Windows player (Mono) Unity 6000.3.12f1 (Direct3D 12) and 6000.0.84f1 (Direct3D 11) on Windows 11: a test driver loaded the five demo scenes, made their PDFs from code and built an 11-page document with shapes, text, images, tables, lists, links, headers and footers.
Windows player (IL2CPP, managed stripping High) Unity 6000.3.12f1 on Windows 11: the same test driver passed.
Android (IL2CPP, managed stripping High) x86-64 emulators only: the test driver passed on Android 16 (API 36) and 7.1.1 (API 25) with Unity 6000.3.12f1, and on Android 7.0 (API 24) and 7.1.1 (API 25) with Unity 6000.0.84f1. No physical device was used.
WebGL not run yet
Other platforms (macOS, Linux, iOS and the rest) not run yet

Tested with version 1.0.0

What was tested and what was not

WHAT IT DOES NOT DO

  • PDF Maker only writes PDF files. It does not read, edit or merge existing ones.

  • Not included: forms, digital signatures, encryption, PDF/A, internal links, bookmarks and outlines, gradients and patterns, even-odd fill.

  • Text: no Arabic or Indic shaping, no right-to-left or vertical text, no kerning or ligatures, and no mixed fonts or styles inside one paragraph. HTML and rich text are not read.

  • Fonts: only TrueType outlines can be embedded. OpenType fonts with CFF outlines, font collections (.ttc) and WOFF files are rejected, and so are fonts whose license flags forbid embedding. Standard fonts are not embedded, and some viewers do not draw them.

  • Tables: no cells that span columns or rows, no images in cells. Rows are never split between pages.

Full list in the manual

WHAT IS IN THE PACKAGE

  • C# source for the runtime and for the Editor tooling (the font asset menu and Inspector), with EditMode tests.

  • The demo sample: six scenes.

  • The manual, as Markdown.

  • Unity built-in modules used: Image Conversion and Screen Capture. No other package is required.

  • No native code and no third-party code. The width tables of the standard fonts are data derived from Adobe's Core 14 AFM files; the notice is in Third-Party Notices.txt.

QUESTIONS

Can I read, edit, merge, fill in or sign a PDF?

No. PDF Maker only writes PDF files. Forms, signatures, encryption and PDF/A are not included.

Does it work on iOS, WebGL, consoles?

The package is managed C# with no native code, but it was run only on Windows and on Android emulators. iOS, WebGL and consoles were not run; see Platform support.

Can I write Arabic, Hebrew or Hindi?

No. Arabic and Indic text needs shaping, and right-to-left text needs bidirectional layout; neither is done. Each character is drawn with its own glyph from left to right.

Does the package add permissions or SDKs to my build?

No. It adds no permission, no native plugin and no SDK. It uses the Image Conversion and Screen Capture built-in modules.

Does it use third-party code?

No. The width tables of the twelve standard fonts are data derived from Adobe's Core 14 AFM files; the notice is in the Third-Party Notices.txt file in the root folder of the package. The package contains no font file.

SUPPORT

I answer the support email myself, in English or Portuguese: luanrobs@gmail.com

To reproduce a problem I need: Unity version, package version, platform and OS version, the Console log, and the steps to reproduce it.

Purchases, licenses and refunds are handled by the Unity Asset Store.

HOW IT WAS BUILT

This package was developed with the assistance of generative AI tools.

The code, the tests, the documentation and the sample content were generated with Claude (through Claude Code) under my direction, then run and tested as listed under "What was tested".

luanrobs is one developer: me. If something doesn't work for you, email me and I'll do my best to fix it.

CHANGELOG

1.0.0 · 2026-10-08

  • PdfDocument: writes PDF 1.7 files in C#, to a byte[] (ToBytes), to a Stream (Save(Stream)) or to a file (Save(string)). No native plugin and no third-party library.
  • Pages: A3, A4, A5, Letter, Legal and custom sizes (PdfPageSize), portrait or landscape, margins (PdfMargins), and PdfUnit to convert millimetres, centimetres, inches and pixels to points.
  • Canvas (PdfCanvas): text at a position, lines, rectangles, rounded rectangles, ellipses, circles, arcs, polygons and bezier paths; fill and stroke colours with opacity; line width, caps, joins and dashes; clipping; SaveState and RestoreState; translate, rotate and scale.

Full changelog