A modern, extensible document reader built with C++23 and Qt6. Currently supports PDF documents with an architecture designed for easy expansion to other document formats.
- PDF Support: Full PDF viewing capabilities using Poppler library
- Modern UI: Clean, dark-themed interface built with Qt6 and scalable SVG icons
- Zoom Controls: Zoom in/out, fit to width, fit to page, actual size
- Navigation: Page-by-page navigation with thumbnail sidebar
- Extensible Architecture: Designed to easily add support for new document formats
- Cross-Platform: Built with CMake for Windows, macOS, and Linux support
Option 1: Automatic Setup with vcpkg (Recommended)
# Run the setup script to install vcpkg and dependencies
.\setup-dependencies.ps1
# Build the project
.\build.ps1Option 2: Manual vcpkg Setup
# Install vcpkg
git clone https://github.com/Microsoft/vcpkg.git C:\vcpkg
cd C:\vcpkg
.\bootstrap-vcpkg.bat
# Install dependencies (correct package names)
.\vcpkg install qt:x64-windows
.\vcpkg install poppler[qt]:x64-windows
# Set environment variable
$env:VCPKG_ROOT = "C:\vcpkg"
# Build
cd D:\dev\documentreader
.\build.ps1- CMake 3.21 or higher
- Qt6 (Core, Widgets, Gui, PrintSupport)
- Poppler-Qt6 library
- C++23 compatible compiler (GCC 11+, Clang 14+, MSVC 2022+)
-
Install Qt6 and Poppler-Qt6:
# Using vcpkg (recommended) vcpkg install qt:x64-windows vcpkg install poppler[qt]:x64-windows
-
Build the project:
mkdir build cd build cmake .. -DCMAKE_TOOLCHAIN_FILE=<vcpkg-root>/scripts/buildsystems/vcpkg.cmake cmake --build . --config Release
-
Install dependencies:
# Ubuntu/Debian sudo apt install cmake qt6-base-dev qt6-tools-dev libpoppler-qt6-dev # Fedora sudo dnf install cmake qt6-qtbase-devel qt6-qttools-devel poppler-qt6-devel
-
Build the project:
mkdir build cd build cmake .. make -j$(nproc)
-
Install dependencies:
brew install cmake qt6 poppler-qt6
-
Build the project:
mkdir build cd build cmake .. make -j$(sysctl -n hw.ncpu)
- Launch the application
- Use File → Open to load a PDF document
- Navigate using:
- Page Up/Page Down keys
- Navigation buttons in toolbar
- Thumbnail sidebar (click on any thumbnail)
- Zoom using:
- Ctrl + Mouse wheel
- Zoom buttons in toolbar
- View menu options
The project uses a modular, extensible architecture:
- DocumentReader: Abstract base class defining the document interface
- PDFReader: Poppler-based PDF implementation
- DocumentFactory: Factory pattern for creating appropriate readers
- DocumentViewer: Main viewing widget with zoom and navigation
- ThumbnailWidget: Sidebar with page thumbnails
To add support for a new document format:
- Create a new reader class inheriting from
DocumentReader - Implement all virtual methods
- Update
DocumentFactoryto recognize the new format - Add the new format to supported extensions
Example:
class DocxReader : public DocumentReader {
// Implement all DocumentReader methods
};
// In DocumentFactory::createReader()
if (extension == "docx") {
return std::make_unique<DocxReader>();
}This project is licensed under the MIT License. See LICENSE file for details.
- Professional Dark Theme: Modern dark interface that's easy on the eyes
- Scalable SVG Icons: Vector-based icons that look crisp at any size and DPI
- Responsive Layout: Adaptable interface that works well on different screen sizes
- Intuitive Navigation: Familiar keyboard shortcuts and mouse interactions
- Context Tooltips: Helpful tooltips on all interface elements
Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.
- Text search and highlighting
- Bookmarks and navigation history
- Print support
- Export pages as images
- Document metadata viewer
- Support for additional formats:
- Microsoft Word (.docx)
- OpenDocument Text (.odt)
- EPUB (.epub)
- Plain text (.txt)
- Markdown (.md)
- Plugin system for custom document formats