PDFs with PHP using HTML & CSS

What is ?

Typeset.sh is a compliant HTML and CSS renderer that converts your documents into professional-looking PDFs. Unlike traditional browsers, typeset.sh focuses specifically on Print-CSS and paged media, ensuring your documents look great when printed. Built entirely in PHP, typeset.sh doesn't require any external APIs or other applications.

As HTML and CSS are commonly used to create websites, developers can leverage their existing knowledge and experience to produce print-ready PDFs. Even if you're not using PHP for your project, it's easy to install and run typeset.sh as a command-line tool.

Ideal for small documents like invoices, event tickets, and reports, typeset.sh makes it simple to create polished, professional PDFs.

CSS w3.org standards

We focus on supporting the HTML and CSS standards (w3.org).

This makes life easy for web developers and saves them a lot of time. Using the technology and coding language they are already familiar with, they never need to learn any complicated new syntax. See a list of our current supported features.

Standard CSS

Font

Support for the common font formats (.otf, .ttf, .woff)

Implement your fonts via CSS the same way you would on your website. You can even use google fonts out of the box.

Font embedding

Small file size

Smart font and image management.

By only adding the font features and glyphs your document actually uses, typeset.sh keeps your file size small.

Images are only attached once, and you can reference each one multiple times without blowing up the document.

Filesize

Font layout & shaping

Use advanced font rendering for your open-type fonts, resulting in more readable and attractive texts.

Font Layout/Shaping

Supporting international scripts

Displaying text is a complex task that not many are aware of.

Scripts can go from right to left, instead of left to right, and those scripts can get mixed together, creating a bi-directional text. Other scripts then change their glyphs appearance depending on their position and the text surrounding them. Find out more.

Internationalization

Universal Accessibility

Produce PDF files according to the PDF/UA standard.

This requires a little of effort from the author side, but it can be very simple if you follow the HTML5 accessibility guidelines.

Support Accessibility

Security & privacy

Your data never leaves your system.

When you run the application on your own server, you do not need to transfer any data to us. This is important if your product-sensitive customer data needs to conform to GDPR.

Security & privacy

Performance

Sure, PHP is not C++, but it is fast.

From the very start, performance was a key concern, driving many of our architectural design decisions. We try our best to ensure peak performance. Of course, rendering is a complex process, and it does require some work. You can render small documents with a couple of pages within a few hundred milliseconds. Large documents with lots of text can eat up significant time and memory.

Get in touch with us to see if typeset.sh is the right choice for you!

Performance

Supporting PHP frameworks

Simple integration with known PHP frameworks.

We have started to provide and share our framework-specific components on GitHub to make the implementation process as easy as possible. If your framework is missing, let us know! We are looking for new projects to support other frameworks.

Go to GitHub
Support for PHP frameworks

Composer support (PHP package manager)

Easy access to updates with composer.

If your application is written in PHP, then you can implement typeset.sh easily by using composer (a PHP package manager).

Otherwise, you can use a single executable phar file to render your document using your language stack. Read more about this in the documentation.

Composer support (PHP package manager)