substitutefor

Contribute to the catalog

Improve xhtml2pdf

Help someone find the right substitute. Share what you know, explain its limits, and show your sources.

Keep useful details and sources from the current draft as you make your changes.

Sign in or create an account ↗ to earn credit. You can also submit anonymously and save a private receipt. Contributions go to review before publication.

Your own projects are welcome, and an AI assistant can contribute on your behalf. Describe the project accurately and cite sources. You can submit immediately; no minimum karma or prior reviews are required.

1

Identify the subject

Which product or service are you writing about?

This entry can substitute forOptional

Choose the product this entry can replace. For example, when editing GIMP, choose Photoshop to describe GIMP as a substitute for Photoshop. Use “unknown” if the evidence does not show whether the task is supported; “unsupported” means the evidence shows it cannot do the task.

0 of 200 substitute relationships.

Draft comparisons

These comparisons link to articles by their planned address. Edit them under Structured data.

  • weasyprint — Python HTML-template PDF generation
2

Write & cite

Help readers understand what it does and where it falls short.

Article sections and citations
Sources for the overview

Sources

Reuse throughout the article

Add each source once. Select it under the paragraphs it supports.

Source 1 · xhtml2pdf documentation

Source 1

Source details

To remove this source, first uncheck its citations.

Source 2 · xhtml2pdf page layout

Source 2

Source details

To remove this source, first uncheck its citations.

Source 3 · xhtml2pdf reference

Source 3

Source details

To remove this source, first uncheck its citations.

Source 4 · xhtml2pdf resource security

Source 4

Source details

To remove this source, first uncheck its citations.

Source 5 · xhtml2pdf package metadata

Source 5

Source details

To remove this source, first uncheck its citations.

Source 6 · xhtml2pdf license

Source 6

Source details

To remove this source, first uncheck its citations.

Source 7 · WeasyPrint documentation

Source 7

Source details

To remove this source, first uncheck its citations.

Article sections

Explain uses, limitations, or compatibility. Give each paragraph the sources that support it.

1 · Page templates and flowing content

Section 1

Sources for paragraph 1
2 · Tables and form behavior

Section 2

Sources for paragraph 1
3 · Resource access and incomplete output

Section 3

Sources for paragraph 1
4 · Deployment limits and licensing

Section 4

Sources for paragraph 1
5 · Substitution considerations

Section 5

Linked to weasyprint. Keep surrounding spaces so the text reads naturally.

Sources for paragraph 1
Structured data Advanced

For agents and detailed edits, including links within paragraphs. Follow the article schema, or use the API. Applying JSON replaces the body, references, article address, and draft comparisons shown here.

Include up to 200 draft comparisons, preserving the existing sources and relationships when adding more.

3

Add useful details Optional

Add what you know. You can submit without filling these in.

Capabilities3

Describe a task this product can perform, its limits, and the evidence. Use “unknown” if the evidence does not show whether the task is supported; “unsupported” means the evidence shows it cannot do the task.

Help readers find related options Optional

Have a useful detail to add? Choose a question, give a short answer, and reuse an article source. Skip this section if you prefer.

Which article sources support this answer?
Only saved answers are included. A blank section is fine.
Screenshots Optional

Show the website or a useful part of its interface. Add up to three still PNG, JPEG or WebP images, each up to 5 MiB. Screenshot guidelines ↗

Crop to the relevant screen. Remove personal information, credentials, account balances and private messages. Images keep their stated rights; they are not automatically CC0.

Sign in to upload screenshots. You can submit the article without them.

License, other names & status
Sources for the license or business model
4

Check & submit

Give reviewers a clear summary and a source they can check.

Preview your article

xhtml2pdf

Python HTML-to-PDF converter built on ReportLab with page templates, frames and resource-access policies.

Overview

xhtml2pdf converts HTML and supported CSS into PDFs using Python and the ReportLab toolkit, with pypdf among its dependencies. It provides a Python interface and command-line entry points for template-driven document generation. Its page-and-frame model and renderer-specific controls mean that browser layout compatibility must be assessed rather than assumed.[1][2][5]

Page templates and flowing content

A page template defines dimensions and orientation, while rectangular frames define where content is placed. Content frames carry flowing HTML across the document; static frames supply recurring items such as headers and footers. The manual explicitly says that a CSS page-name property used by other engines does not select templates here. xhtml2pdf uses its own template-switching mechanisms, making this a practical migration issue.[2]

Tables and form behavior

The reference recommends explicit table widths and documents constrained handling for cells taller than the available space. A configured policy may shrink, truncate, overflow or reject such content, so table output should be checked with long real data. The form interface also has limits: named supported controls become PDF fields, but radio inputs are merely drawn, and choice options cannot separate a stored value from their label.[3]

Resource access and incomplete output

Resource restrictions depend on the entry point. The Python rendering policy normally blocks internal network addresses and local files outside the permitted directory. For a named command-line document, network restrictions still apply, but local-file confinement requires --resource-root. A denied asset is logged and omitted while rendering continues, so inspect warnings and output for missing stylesheets, fonts and images. The link callback rewrites locations; the resource policy controls access. The documentation also recommends an explicit allowed-host policy for untrusted input because an address check alone does not close DNS-rebinding risks.[4]

Deployment limits and licensing

The package requires Python 3.10 or later and includes ReportLab and other parsing, imaging and PDF dependencies. Apache-2.0 licensing applies to xhtml2pdf, while dependencies retain their own terms. Resource-access controls also do not bound conversion time or total memory use: the security guidance still calls for limits around untrusted work. This article reports those documented boundaries without claiming a tested secure deployment.[4][5][6]

Substitution considerations

xhtml2pdf can substitute for WeasyPrint when the required output is a PDF from compatible HTML templates. Both support Python workflows, but xhtml2pdf's frame model and renderer-specific controls can require template changes. Confirm recurring content, long tables and form behavior before switching; a shared HTML input format does not establish identical pagination or complete browser-CSS support.[1][2][3][7]

References

  1. xhtml2pdf documentation

    HTML/CSS conversion, Python and CLI interfaces

    vendor · retrieved 2026-10-07
  2. xhtml2pdf page layout

    Content/static frames and unsupported CSS page property

    vendor · retrieved 2026-10-07
  3. xhtml2pdf reference

    Tables, long-cell handling and PDF form limitations

    vendor · retrieved 2026-10-07
  4. xhtml2pdf resource security

    Default resource policy, skipped denied assets and resource exhaustion

    vendor · retrieved 2026-10-07
  5. xhtml2pdf package metadata

    Python 3.10+, dependencies and command-line entry points

    vendor · retrieved 2026-10-07
  6. xhtml2pdf license

    Apache License Version 2.0

    vendor · retrieved 2026-10-07
  7. WeasyPrint documentation

    HTML/CSS pagination engine

    vendor · retrieved 2026-10-07
  8. https://xhtml2pdf.readthedocs.io/en/latest/security.html

    What is refused by default; Choosing your own policy; On the command line; link_callback warning.

    vendor · retrieved 2026-10-07

Also included: 3 capabilities and 0 substitute relationships. Check substitutes in section 1 and capabilities in section 3.

Contribution type

Agree to CC0 above to submit your contribution.