Skip to content

PKBLN/phpBB2PDF

Repository files navigation

PHPBB Forum to PDF/HTML Converter

A powerful command-line tool to convert PHPBB forum MySQL dumps into well-formatted PDF and HTML documents. Perfect for archiving forums, creating backups, or preserving online communities.

Features

  • Full MySQL to SQLite Conversion - No external tools (AWK, sqlite3) required
  • Multi-Language Support - English and German interface (easily extensible)
  • Rich BBCode Processing - Handles quotes, images, lists, formatting, URLs
  • Automatic Table Prefix Detection - Detects your forum's table prefix automatically
  • Private Messages Support - Optional export of private messages with email addresses
  • Forum Hierarchy - Preserves forum structure and organization
  • Professional PDF Output:
    • Cover page with statistics
    • Table of contents
    • Thread titles in page headers
    • Styled quote boxes with color coding
    • Green theme throughout
  • Eye-Friendly HTML - Dark gray background for comfortable reading
  • Smiley Support - Includes forum smileys when available

Requirements

  • Windows x64
  • .NET Framework 4.8
  • MySQL dump file from PHPBB forum

Installation

  1. Download the latest release
  2. Extract to a folder
  3. double click build.bat
  4. Place your MySQL dump file (.sql) in the same folder
  5. Run PHPBB2PDF.exe

Usage

PHPBB2PDF.exe

The tool will guide you through:

  1. Language selection (de/en)
  2. MySQL to SQLite conversion (automatic)
  3. Table prefix detection (with option to override)
  4. PDF creation (yes/no)
  5. Private messages (yes/no)
  6. Smiley folder setup (optional pause to copy smileys)

Output is saved to ForumExport/ folder.

Example Output

=== Forum to PDF/HTML Converter ===

SQL file found: myforum_backup.sql
Converting MySQL dump to SQLite...
Statistics:
  Successful: 15420 statements
  Errors: 0 statements

Detected table prefix: phpbb
Using prefix: phpbb

✓ HTML created: ForumExport/myforum_backup.html
✓ PDF created: ForumExport/myforum_backup.pdf

✓ 42 smiley files found in smileys folder

Smileys

To include forum smileys in your export:

  1. The tool creates ForumExport/smileys/ folder
  2. Copy smiley images from your PHPBB forum's images/smilies/ folder
  3. Smileys will appear in HTML (PDF displays smiley paths as text)

Building from Source

git clone https://github.com/yourusername/phpbb2pdf.git
cd phpbb2pdf
dotnet build -c Release

The executable will be in bin/Release/net48/win-x64/

Technical Details

  • MySQL Conversion: Custom AWK-to-C# port for reliable MySQL→SQLite conversion
  • BBCode Parser: Regex-based parser handling nested quotes, lists, formatting
  • PDF Generation: QuestPDF library for high-quality PDF output
  • Quote Rendering: Color-coded nested quotes (green, purple, blue, orange, pink)
  • HTML Entities: Full decoding of ", :, etc.

Troubleshooting

"No .sql file found"

  • Place your MySQL dump file in the same folder as the executable

"Table prefix 'xyz' incorrect"

  • The tool auto-detects the prefix, but you can manually enter it when prompted

"PDF creation failed"

  • The HTML is always created successfully
  • Open the HTML in a browser and use Ctrl+P → "Save as PDF"

Private messages table not found

  • Your forum may not have private messages enabled
  • Answer "no" when asked to include private messages

License

This project is licensed under the MIT License - see the LICENSE file for details.

Third-Party Licenses

This software uses the following libraries:

QuestPDF

System.Data.SQLite

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Acknowledgments

  • Original MySQL-to-SQLite AWK script authors: @esperlu, @artemyk, @gkuenning, @dumblob
  • PHPBB community for the forum software
  • QuestPDF team for the excellent PDF library

Roadmap

  • Linux/macOS support
  • Additional languages (French, Spanish, etc.)
  • Embedded smiley images in PDF
  • Custom themes/styling options
  • Direct database connection (without MySQL dump)
  • Attachment export

Support

For issues, questions, or feature requests, please open an issue on GitHub.

Author

Created for forum archiving and preservation projects.

About

Converts phpBB mySQL-dumps to PDF

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published