weasyprint

Convert PDF to HTML and HTML to PDF while preserving layout.

Updated May 20, 2026
One-click install
npx skills add https://github.com/vaclavbenes/skills --skill weasyprint
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: weasyprint
Source: https://github.com/vaclavbenes/skills/tree/main/weasyprint
Command: npx skills add https://github.com/vaclavbenes/skills --skill weasyprint

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires weasyprint, and includes scripts (resource) and assets (resource) components.

What problem does it solve?

This Skill helps to convert PDF documents to high-quality HTML and vice versa, ensuring that the layout and formatting are retained, which is essential for maintaining consistency in print and web content.

Core Features & Use Cases

  • PDF to HTML: Convert PDF files into HTML documents for easier editing and web accessibility.
  • HTML to PDF: Generate PDF files from HTML, ensuring that the design matches the original PDF precisely.
  • Use Case: If you have a PDF design and want to make it web-accessible, use this Skill to convert it to HTML. Conversely, if you have HTML content and want a PDF version, use this Skill to create a PDF with the same layout.

Quick Start

Convert the 'report.pdf' to HTML and open in your preferred browser: weasyprint report.pdf report.html

Frequently Asked Questions about weasyprint

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert HTML to PDF while retaining layout and formatting?▼

To convert HTML to PDF with layout retention, this Skill renders HTML content into a PDF file that precisely matches the original design formatting. It uses WeasyPrint to ensure pixel-perfect fidelity for print-to-web workflows.

Can I convert a PDF document to HTML for web accessibility?▼

Yes, you can convert PDF files to HTML for web accessibility. This Skill transforms PDF documents into editable HTML, making them web-compatible for digital archiving while retaining the original layout.

Do I need WeasyPrint installed to perform PDF and HTML conversions?▼

Yes, WeasyPrint is required as the underlying rendering dependency to achieve PDF-like fidelity in HTML. It provides the core engine for converting documents between PDF and HTML formats while maintaining formatting.

What is the best way to ensure pixel-perfect layouts when converting PDF to HTML?▼

The best way to ensure pixel-perfect layouts during PDF to HTML conversion is using a dedicated rendering engine. This Skill leverages WeasyPrint to maintain strict layout retention and formatting consistency for digital archiving.

Does this PDF to HTML conversion approach work well for digital archiving?▼

Yes, this PDF to HTML conversion approach works well for digital archiving by retaining layout and formatting. It ensures long-term web compatibility and consistent document presentation across print and web platforms.