Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

learncpp-to-pdf

A modern, high-performance Python script to crawl LearnCPP.com, clean up the content, and convert the entire C++ tutorial series into a professionally formatted, offline-readable PDF.

This project was built to replace older tools which are deprecated and removed from modern distros like Debian Trixie/13. Instead, this uses Playwright (Headless Chromium) for perfect rendering of modern CSS, Flexbox, and JavaScript.

Disclaimer

This tool is for personal educational use only.

All content directly comes from the learncpp.com website, no content changed, some decorative elements and the comment section is removed for better readability.

Please consider supporting the website here learncpp-about.

Since it specifically states that a pdf version should not be spread out by anyone and people should instead make pdf on their own, this tool is hence created.

Use this tool only if you can't use the original website above, e.g. limited internet during commutes in my case.

Prerequisites

  1. Python 3.8+

  2. Install Python Dependencies:

    pip install playwright requests beautifulsoup4 pypdf
  3. Install the Browsers: Playwright needs to download the specific browser binaries it uses.

    playwright install chromium

Usage

Simply run the script:

python3 learncpp_to_pdf.py

The script will:

  1. Fetch the lesson index from LearnCPP.com.
  2. Launch Headless Chromium.
  3. Process chapters in parallel (saving PDFs to ./learncpp_pdfs/).
  4. Merge them into a single file named LearnCPP.pdf.

About

Download and convert learncpp.com pages to PDF.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages