[GH-ISSUE #110] Archive Method: WEasyPrint PDF output #76

Open
opened 2026-03-01 14:40:26 +03:00 by kerem · 1 comment
Owner

Originally created by @sbrl on GitHub (Oct 30, 2018).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/110

Since I don't have headless chrome setup yet on my server (there's lot of xvfb fiddling to do there; is Firefox supported?), I was wondering if WEasyPrint support is planned?

Although it doesn't support JS and it only supports, for the most part, CSS 2 (with some additional paged-media-specific CSS modules), the output is, on the whole, pretty decent. Here's a pair of commands that will give some decent example output:

weasyprint --verbose --format png --resolution 300 https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode headless-mode.png
weasyprint --verbose https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode headless-mode.pdf

Since it's a Python library, you can even interface with it directly, IIRC.

Originally created by @sbrl on GitHub (Oct 30, 2018). Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/110 Since I don't have headless chrome setup yet on my server (there's lot of xvfb fiddling to do there; is Firefox supported?), I was wondering if [WEasyPrint](https://weasyprint.org/) support is planned? Although it doesn't support JS and it only supports, for the most part, CSS 2 (with some additional paged-media-specific CSS modules), the output is, on the whole, pretty decent. Here's a pair of commands that will give some decent example output: ```bash weasyprint --verbose --format png --resolution 300 https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode headless-mode.png weasyprint --verbose https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode headless-mode.pdf ``` Since it's a Python library, you can even interface with it directly, IIRC.
Author
Owner

@pirate commented on GitHub (Oct 31, 2018):

Thanks for the suggestion. I'm adding a plugin architecture soon that will allow people to contribute their own archive methods and share them in a central repo.

I'm going to delay adding new archive methods until I've implemented this new plugin system, but I'll definitely put this on the list of future plugins to add!

If you'd like to help speed up that process, you can submit an archive method for weasyprint using the current structure in archive_methods.py and I'll convert it over to the new plugin system when it's released.

<!-- gh-comment-id:434553925 --> @pirate commented on GitHub (Oct 31, 2018): Thanks for the suggestion. I'm adding a plugin architecture soon that will allow people to contribute their own archive methods and share them in a central repo. I'm going to delay adding new archive methods until I've implemented this new plugin system, but I'll definitely put this on the list of future plugins to add! If you'd like to help speed up that process, you can submit an archive method for weasyprint using the current structure in `archive_methods.py` and I'll convert it over to the new plugin system when it's released.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ArchiveBox#76
No description provided.