A backend for mdbook in Python for generating PDF based on Chrome DevTools Protocol.

Overview

mdbook-pdf

last-commit mdbook-pdf test

Followers watchers stars forks

Open Source Love GPL Licence Repo-Size

A backend for mdbook written in Python for generating PDF based on Chrome DevTools Protocol.

Python library dependency

Usage

Put mdbook-pdf in PATH. Have google-chrome/chromium available (in PATH or location configured).

Ensure you have installed python selenium library, corresponding chromedriver is in PATH or in the book repo or location configured.

Build it with mdbook build command. Make sure the following exists in your book.toml:

[output.html]

[output.html.print]
enable = true

[output.pdf]

if you are using Windows, Put this script in the book repo, add the following line to [output.pdf] in your book.toml:

command = "python ../../mdbook-pdf"

Configuration

Check book.toml for available configurations of [output.pdf].

Known issue

Sometimes the program may crash with errors like this:

selenium.common.exceptions.WebDriverException: Message: unknown error: session deleted because of page crash
from unknown error: cannot determine loading status
from tab crashed

This may be led by resources outrage.

To-do

Rewrite the whole thing in Rust, directly call to Chrome DevTools Protocol instead of using selenium.

You might also like...
Python script that split PDF files.

Automatic PDF Splitter This script can create new single-page PDFs files from multipaged PDFs. Requirements Python 3.0+ # Debian distros sudo apt-get

borb is a library for reading, creating and manipulating PDF files in python.
borb is a library for reading, creating and manipulating PDF files in python.

borb is a library for reading, creating and manipulating PDF files in python.

Python lib for Simple PDF text extraction

Python lib for Simple PDF text extraction

x-ray is a Python library for finding bad redactions in PDF documents.
x-ray is a Python library for finding bad redactions in PDF documents.

A tool to detect whether a PDF has a bad redaction

This book will take you on an exploratory journey through the PDF format, and the borb Python library.
This book will take you on an exploratory journey through the PDF format, and the borb Python library.

This book will take you on an exploratory journey through the PDF format, and the borb Python library.

Simple python tool created for downloading PDF.

PDFdownloader Usage Open PDF in full-screen mode Run scan.exe Enter how many pages you want to scan Focus PDF After scanning is done, run merge.exe En

A simple pdf size compressing telegram robot witten in python.
A simple pdf size compressing telegram robot witten in python.

Pdf Compressor Telegram Bot ##About : A simple pdf size compressing telegram robot witten in python. Mostly useful for digital documentation. Deploy t

Converting Html files to pdf using python script, pdfkit module and wkhtmltopdf.

Html-to-pdf-pdfkit-wkhtml- This repository has code for converting local html files and online html resources into pdf. It is an python script which u

Small python-gtk application, which helps the user to merge or split pdf documents and rotate, crop and rearrange their pages using an interactive and intuitive graphical interface
Small python-gtk application, which helps the user to merge or split pdf documents and rotate, crop and rearrange their pages using an interactive and intuitive graphical interface

Small python-gtk application, which helps the user to merge or split pdf documents and rotate, crop and rearrange their pages using an interactive and intuitive graphical interface

Comments
  • Update mdbook to 0.4.21 and publish to crates.io

    Update mdbook to 0.4.21 and publish to crates.io

    Would it be possible to update mdbook to version 0.4.21 and update the release on crates.io? This version contains a fix for https://github.com/rust-lang/mdBook/issues/1860 to enable building using Rust 1.64. In the meantime, I'm creating a patch for this in nixpkgs but would love to be able to pick it up just by updating the version.

    opened by tjni 1
  • feature request: Generate PDF with page outlines

    feature request: Generate PDF with page outlines

    I'm not sure what you mean by "outlines"?

    Maybe adding a new keyword in output.html.print, like outline = true/false

    [output.html.print]
    enable = true
    page-break = true
    outline = true # new keyword to include the 'ToC' in pdf print.
    

    Originally posted by @schwrzstrbn in https://github.com/rust-lang/mdBook/issues/1817#issuecomment-1163854290

    duplicate 
    opened by schwrzstrbn 1
Releases(v0.1.4)
Owner
Hollow Man
Pursuing LZU BEng CS | '20 @alibaba SoC & @linuxfoundation LiFT Scholarship China | '21 GSoC @openSUSE | '20 & '21 @isrc-cas OSPP Summer
Hollow Man
Trata PDF para torná-lo compatível com PDF/X e com impressoras em escala de cinza.

tratapdf Trata PDF para torná-lo compatível com PDF/X e com impressoras em escala de cinza. dependências icc-profiles ghostscript visualizador de PDF

null 1 Nov 30, 2021
PDFSanitizer - Renders possibly unsafe PDF files and outputs harmless PDF files

PDFSanitizer Renders possibly malicious PDF files and outputs harmless PDF files

null 9 Jan 30, 2022
Compare-pdf - A Flask driven restful API for comparing two PDF files

COMPARE-PDF A Flask driven restful API for comparing two PDF files. Description

Karthikeyan JC 3 Mar 13, 2022
Convert PDF to AudioBook and Audio Speech to PDF

In this Python project, we will build a GUI-based PDF to Audio and Audio to PDF converter using the Tkinter, OS, path, pyttsx3, SpeechRecognition, PyPDF4, and Pydub libraries and the messagebox module of the Tkinter library.

RISHABH MISHRA 1 Feb 13, 2022
pystitcher stitches your PDF files together, generating nice customizable bookmarks for you using a declarative markdown file as input

pystitcher pystitcher stitches your PDF files together, generating nice customizable bookmarks for you using a declarative input in the form of a mark

Nemo 387 Dec 10, 2022
Simple HTML and PDF document generator for Python - with built-in support for popular data analysis and plotting libraries.

Esparto is a simple HTML and PDF document generator for Python. Its primary use is for generating shareable single page reports with content from popular analytics and data science libraries.

Dom 76 Dec 12, 2022
Python PDF Parser (Not actively maintained). Check out pdfminer.six.

PDFMiner PDFMiner is a text extraction tool for PDF documents. Warning: As of 2020, PDFMiner is not actively maintained. The code still works, but thi

Yusuke Shinyama 4.9k Jan 4, 2023
A python library for extracting text from PDFs without losing the formatting of the PDF content.

Multilingual PDF to Text Install Package from Pypi Install it using pip. pip install multilingual-pdf2text The library uses Tesseract which can be ins

Shahrukh Khan 49 Nov 7, 2022
A Python tool to generate a static HTML file that represents the internal structure of a PDF file

PDFSyntax A Python tool to generate a static HTML file that represents the internal structure of a PDF file At some point the low-level functions deve

Martin D. 394 Dec 30, 2022
Performing the following operations using python on PDF.

Python PDF Handling Tutorial Python is a highly versatile language with a huge set of libraries. It is a high level language with simple syntax. Pytho

Prajwol Lamichhane 131 Dec 16, 2022