HTML/Markdown PDF Generator | HTML To PDF Converter
🛠️
General Tools+ Agent Template

HTML/Markdown PDF Generator | HTML To PDF Converter

Turn HTML, Markdown, or text into styled PDFs — CJK supported, fully local, no API key. Requires pip dependencies.

Overview

What Is HTML/Markdown PDF Generator?

HTML/Markdown PDF Generator is a professional, high-fidelity local document compilation and rendering skill on EasyClaw. Designed specifically to run entirely locally without requiring internet connections or third-party cloud API keys, it converts HTML files, Markdown documents, and raw text blocks into beautifully styled, print-ready PDF assets — natively supporting CJK (Chinese, Japanese, Korean) characters, customized stylesheets, and page-layout configurations.

The skill is built for developers generating automated invoice databases, HR specialists exporting formatted resumes, and legal operations teams compiling structured contracts.

The expected outcome is a professionally rendered PDF document: written directly to your workspace imports, paired with an instant, local download link, generated headlessly from any raw text or markdown input.

How HTML/Markdown PDF Generator Works

1. Analyze input format and document type. Provide your raw content (as a local Markdown file, an HTML template, or pasted text) and choose your document template style (contract, report, invoice, or resume).

2. Local rendering engine selection. Based on your OS environment (Windows, macOS, or Linux) and dependencies, the skill launches a secure, local document rendering pipeline (such as Python pdfkit, WeasyPrint, or localized C++ PDF engines).

3. CJK font and stylesheet mapping. To prevent scrambled or missing characters in Asian languages, the skill automatically maps and injects CJK-compatible Unicode fonts and applies a clean, corporate CSS stylesheet.

4. Header, footer, and margin calculation. The skill configures standard page parameters: calculating precise top/bottom/side margins, adding dynamic page numbering, and formatting custom headers and footers.

5. Headless compilation. The background script compiles the document into a high-fidelity PDF, writing the asset directly to `public/data/pdf_exports/` and returning a direct local download link.

Key Features

- 100% local rendering: Converts HTML and Markdown to PDF offline with zero API key dependencies.
- Robust CJK font support: Guarantees perfect rendering for Chinese, Japanese, and Korean characters.
- Dynamic CSS templates: Custom styling themes for professional contracts, invoices, and resumes.
- Header and page-numbering tools: Injects running headers and automated "Page X of Y" footers.
- Multi-viewport scaling: Scales tables, images, and visual columns accurately to prevent layout breaks.
- Direct local path save: Writes generated PDFs directly to your workspace exports folder.

What Problems Does HTML/Markdown PDF Generator | HTML To PDF Converter Solve?

1. Converting a Markdown contract to a styled PDF
An HR administrator has drafted an employment contract locally in Markdown format (`workspace/contract.md`). To send it for client signature, they require a clean, unmodifiable PDF that supports Chinese content. The skill compiles the Markdown headlessly, injects standard legal margins and CJK fonts, and outputs a professional, print-ready PDF in seconds.

2. Compiling customer invoices from HTML templates
An e-commerce developer wants to automate weekly customer invoicing. The skill parses a custom HTML invoice template, injects transactional billing details (SKU names, prices, quantities), renders the page using its local layout engine, and generates a crisp, professional billing PDF, ready to link to client emails.

3. Generating a formatted resume from raw text
A job applicant has their work experience and education saved as unstructured, raw text bullet points. The skill applies a clean, executive-resume CSS template: organizing the text into visual grids, bolding job titles and dates, and rendering a highly professional, single-page resume PDF that matches standard hiring expectations.

4. Exporting system performance reports
A DevOps script generates monthly database performance metrics in Markdown. To share the reports with non-technical executives, the skill converts the files to PDF format: parsing the tables, rendering clean border lines, and applying standard corporate styling.

5. Automatically prompting for missing document templates
A user types a vague instruction: *"Help me make a PDF report"* without providing the content format. The skill's context logic intercepts the request and prompts politely: *"To generate your PDF, could you specify: Is your source content an HTML file, a Markdown file, or pasted text? And what template type — invoice, report, contract, or resume — should we apply?"* preventing failed compiles.

Example Workflow

An administrator needs to quickly convert a local Markdown contract file to a styled PDF.

1. They open EasyClaw and activate HTML/Markdown PDF Generator.
2. They run: *"Convert 'workspace/contract.md' to PDF. Content is in Chinese, save as 'contract.pdf' in the same folder."*
3. The skill validates the file path, launches the local rendering engine, and maps Chinese fonts.
4. It compiles the Markdown, applying standard legal margins and clean black-and-white header styles.
5. It writes the compiled asset to `workspace/contract.pdf` and returns the download link in the conversation.

High-fidelity PDF compiled headlessly in under 10 seconds.

Getting Started with HTML/Markdown PDF Generator | HTML To PDF Converter

Add this skill to your EasyClaw workspace
Describe your task in a chat message
Review the output and iterate if needed
Export or share the results directly from EasyClaw
Combine with other skills to build automated workflows

Frequently Asked Questions

What source file formats are supported?

The skill natively supports: HTML files (`.html`), Markdown documents (`.md`, `.markdown`), and raw pasted text blocks.

Is an active internet connection required to convert files?

No. All rendering, compilation, and file writes are executed entirely locally on your machine. You can convert files offline without any network access.

Why do some Chinese characters show up as blank squares?

This occurs if the rendering engine cannot locate a CJK-compatible font on your system. This skill automatically maps and injects standard system fonts (like Microsoft YaHei on Windows or PingFang on Mac) to prevent character rendering failures.

Can I include images inside the PDF?

Yes. The skill supports rendering images. Ensure your source HTML or Markdown files reference local absolute image paths or base64-encoded image strings to guarantee offline image loading.

What is the default output save directory?

All converted PDF documents are written directly to `public/data/pdf_exports/` inside your local workspace exports directory. You can easily access, move, or share files from this folder.

Can I add page numbers automatically?

Yes. The skill's rendering engine can automatically inject running headers and footers containing page numbers (such as "Page X of Y") using standard CSS paged-media selectors.

Do I need to install Python or other pip dependencies?

To execute advanced HTML-to-PDF rendering offline, the skill utilizes local system assets. It will perform an environment check during first run and guide you through installing any required free, local pip libraries (such as `weasyprint` or `pdfkit`) if they are missing.

Can I password-protect the generated PDFs?

Yes. You can instruct the skill to apply a secure password to the compiled PDF during generation to restrict unauthorized viewing.

What is the maximum file size supported?

The local engine can compile documents spanning hundreds of pages. For optimal performance on massive reports (over 200 pages), we recommend rendering the document in separate chapters.

Is my data uploaded to any public servers?

No. In compliance with security and privacy standards, all document reading, font-mapping, and file writes are executed entirely locally in your workspace session, keeping your confidential files private.

Add HTML/Markdown PDF Generator | HTML To PDF Converter to Your Workflow

Get EasyClaw, add this skill, and start building AI agent workflows in minutes.

Get EasyClaw Free →