CourtBouillon

Authentic people growing open source code with taste

WeasyPrint v58: Beta Time

WeasyPrint v58 is the next major version of WeasyPrint. We released a beta, you can give it a try and help us to have a nice stable major release! In this new version, WeasyPrint now supports PDF forms.

PDF forms support has been added thanks to the financial support of Personalkollen. It has been a real pleasure to develop this feature with them.

You would love to get a new feature, a bug fix, or some support on WeasyPrint? Don’t hesitate to get in touch with us! Or if you simply want to see the project grow beautifully, you can donate on OpenCollective 😉.

How to Use PDF Form Feature?

For a long time, it’s been possible to include forms in your HTML documents and gather information. For a long time, the "Form/Form Fields" issue has been opened in the WeasyPrint repository.

This issue is now closed!

Which Inputs Are Supported?

WeasyPrint supports text-based input tags, check-boxes and textarea tags. Your inputs have default value? No problem, they’ll be in your PDF!

A checkbox, a text input and a textarea
Form fields supported by WeasyPrint

And now that WeasyPrint supports form fields, a default style for form elements has also been added!

How to Activate the Feature?

To enable this feature, you can use the --pdf-forms option or use the appearance CSS property. The --pdf-forms option will enable all of the form fields of your documents, and the appearance property can manage them more finely.

When set to auto on a form field, appearance will generate a PDF form input for this field. When set to none, it will disable the PDF form input and display it as normal PDF content.

<!-- Check-boxes inputs are disabled -->
input[type="checkbox"] {
  appearance: none;
}

What Are the Next Steps?

The next step is yours! Don’t hesitate to try this beta and report bugs you may find 🐞.

The one after is to fix the reported bugs and release a nice WeasyPrint version 58.

Have fun with this beta 💜.