HTML sang PDF

Chuyển HTML sang PDF

Chuyển file HTML hoặc trang web sang PDF. Giữ nguyên định dạng.

HTML và trang web Giữ style PDF chất lượng cao
Thả file của bạn vào đây

hoặc chọn file

Tối đa 100 MB miễn phí • Định dạng Đầu ra: PDF

—
—
Đang chờ tải lên...
0%
File của bạn đã sẵn sàng
Xong!
—
Tải xuống
Chuyển đổi thất bại

Chuyển đổi thất bại

An toàn & Bảo mật
Xóa file sau 2 giờ
Xử lý nhanh
Không cần tài khoản
Cực Nhanh

How to Convert

Chuyển đổi bất kỳ file nào trong vài giây — không cần phần mềm, không cần đăng ký.

01
Tải lên

Tải lên file âm thanh

02
Chọn định dạng

Chọn định dạng đầu ra

03
Tải xuống

Nhận file đã chuyển đổi

Tại sao EasyConv

Why Use EasyConv

Professional-grade conversion with features designed for real-world workflows.

Tất cả định dạng chính

Hỗ trợ tất cả các định dạng phổ biến.

URL-to-PDF Conversion

Enter any public URL and we fetch and render it as a PDF — great for archiving web pages or generating reports from web apps.

Headers & Footers

Add custom header and footer text including page numbers, date, and document title using wkhtmltopdf variables.

A4, Letter & Custom Paper

Choose from standard paper sizes or enter custom width and height. Portrait and landscape orientations supported.

Xử lý an toàn

File được xử lý an toàn và bảo mật.

Print-Ready Output

The generated PDF respects CSS @page rules and print media queries, producing clean paginated output.

300+ Định dạng

Supported Formats

Detailed breakdown of every format supported by this converter.

Format Description Extension Use Case
HTML FILE Uploaded .html file with inline or linked CSS .html Invoice templates, letters, reports
HTML + ZIP ZIP containing HTML + CSS + image assets .zip Complex multi-asset HTML documents
URL INPUT Public web page URL fetched and rendered — Archive web pages, scrape reports
A4 PDF 210×297mm standard international paper size .pdf European documents, reports
LETTER PDF 8.5×11in US standard paper size .pdf US business documents
LANDSCAPE PDF Wider-than-tall orientation .pdf Wide tables, slides, dashboards
CUSTOM PDF Specify exact width and height in millimetres .pdf Receipts, labels, non-standard sizes
3 Bước Đơn giản

Frequently Asked Questions

Everything you need to know about this conversion tool.

wkhtmltopdf is an open-source command-line tool that uses the WebKit rendering engine (the same core as Safari/Chrome) to convert HTML to PDF. It's widely used for invoice generation, report rendering, and web archiving.

Yes. wkhtmltopdf renders CSS3 including Flexbox, Grid (basic), custom fonts, and media queries. CSS print rules (@page, @media print) are honoured for page breaks and margins.

Not automatically. For pages behind authentication, download the HTML source directly and upload the file. Pass any necessary cookies via the options field for basic HTTP auth URLs.

Use CSS page-break rules: `page-break-before: always` or `break-before: page` on any element to force a new PDF page before that element.

Yes — enable "Page Numbers" in the footer option. wkhtmltopdf supports the variables [page] and [topage] for "Page 1 of 10" style footers.

Basic JavaScript executes during a short wait period. Complex SPA frameworks (React, Vue) may not fully render without server-side rendering. For JavaScript-heavy pages, use a headless Chrome approach instead.
12M+ người dùng tin tưởng

Who Uses This Tool

Real-world use cases from professionals across different industries.

Developer
Generate PDF Invoices from HTML Templates

Render an HTML invoice template with customer data and convert it to a pixel-perfect PDF for sending to clients.

Data Analyst
Archive Web-Based Reports as PDF

Convert online dashboard pages or HTML report views to PDF for offline distribution, audit logs, or monthly records.

Archivist
Preserve Web Pages as PDF

Archive news articles, wiki pages, or documentation pages as static PDF files that are immune to link rot.

Print Designer
Print HTML Email Templates

Convert an HTML email template to PDF to verify print rendering and share with non-email-client stakeholders.

Legal Professional
Generate Form Letters from HTML

Render mail-merged HTML form letters to PDF for signed delivery, court filing, or compliance documentation.

Web Developer
Test Page Print Rendering

Convert any HTML page to PDF to preview exactly how CSS @media print rules will render before deploying print stylesheets.

Tại sao EasyConv

So sánh

Xem cách chúng tôi so sánh với các giải pháp khác

Feature Our Tool
EasyConv
Adobe Acrobat Other Online
Upload HTML file → PDF
URL → PDF (web page capture)
ZIP with HTML + CSS + images
Kích thước trang tùy chỉnh Limited
Header & footer with page numbers
CSS3 và Google Fonts Limited Limited
No watermark on output
Miễn phí
Technical Specifications

Technical Specifications

Detailed technical information about our conversion engine.

Limits
  • Max file size: 100 MB (free)
  • Input: .html file, .zip (HTML+assets), public URL
  • Output: PDF (all paper sizes)
wkhtmltopdf HTML PDF WebKit CSS URL to PDF
Engine
wkhtmltopdf 0.12.x (WebKit rendering) · Pandoc 3.x (HTML → DOCX fallback)
Chất lượng
WebKit CSS3 rendering — pixel-accurate to browser output; @page and @media print honoured
Speed
Typical: 3–10 s per page; URL captures add network fetch time
Security
HTTPS transfer · isolated temp dir · auto-purged in 2 h
Input
HTML file, HTML+ZIP, public URL
Output
PDF (A4, Letter, Legal, custom)
Headers/Footers
Custom text, page numbers, document title
Hướng dẫn đầy đủ

HTML to PDF with wkhtmltopdf: CSS Rendering, Page Breaks, and When to Use a Headless Browser Instead

Converting HTML to PDF requires a real browser rendering engine — not just a text parser. wkhtmltopdf uses WebKit, the same engine that powers Safari and early Chrome, to produce pixel-accurate PDF output.

How wkhtmltopdf Renders HTML

wkhtmltopdf embeds a headless WebKit rendering engine. When you provide an HTML file or URL, it renders the page exactly as a browser would — processing CSS, loading linked stylesheets, rendering web fonts, and applying JavaScript (within a short execution window). The rendered page is then paginated according to the specified paper size and exported as a PDF using WebKit's PDF print output pipeline. The result is indistinguishable from printing the page from a browser.

Controlling Page Breaks

Pagination in HTML-to-PDF is controlled by CSS. Use page-break-before: always (or the modern break-before: page) on any element to force a new PDF page. Use page-break-inside: avoid to prevent a table, image, or code block from being split across pages. The @page CSS rule sets margins, paper size, and orientation directly from your stylesheet, giving you precise control without needing to configure the conversion tool separately.

The @media print Rule

Browser-based HTML often has navigation menus, advertisements, and interactive elements that should not appear in print. The @media print CSS rule lets you hide these elements and apply print-specific styles. wkhtmltopdf honours @media print fully — add it to your stylesheet to hide sidebars (display: none), change font sizes, remove backgrounds, and apply print-optimised layouts. This is the recommended approach for HTML templates designed for PDF output.

Handling External Resources

When converting an HTML file, any linked CSS, images, and fonts referenced by relative paths must be included in the uploaded ZIP file. Absolute HTTPS URLs are fetched live during conversion. Google Fonts (loaded via <link> tags) work in URL-capture mode since the server can reach external URLs; for uploaded file mode, embed the font CSS and font files in the ZIP to ensure availability.

Limitations and When to Use Headless Chrome

wkhtmltopdf uses WebKit, which is based on an older version of the browser engine. It does not support modern CSS features like CSS Grid Level 2, container queries, or the latest CSS custom property syntax. Complex single-page applications built with React, Vue, or Angular require server-side rendering to produce static HTML before conversion. For these use cases, a headless Chrome/Puppeteer approach captures the full rendered page including all JavaScript-injected content. EasyConv uses wkhtmltopdf for static HTML and simple JavaScript pages.

Sẵn sàng chuyển đổi?

Bắt đầu chuyển đổi miễn phí — không cần đăng ký

Không cần thẻ cho miễn phí Hủy bất cứ lúc nào 12M+ người dùng tin tưởng