All Projects → paulovap → Qtpdfium

paulovap / Qtpdfium

Licence: bsd-3-clause
Pdf Redening on Qt

Programming Languages

cpp
1120 projects

Projects that are alternatives of or similar to Qtpdfium

Nheko
No longer maintained - Desktop client for the Matrix protocol (active fork https://github.com/Nheko-Reborn)
Stars: ✭ 410 (+177.03%)
Mutual labels:  qt, desktop
Vue Nodegui
Build performant, native and cross-platform desktop applications with native Vue + powerful CSS like styling.🚀
Stars: ✭ 575 (+288.51%)
Mutual labels:  qt, desktop
Mirage
A fancy, customizable, keyboard-operable Qt/QML & Python Matrix chat client for encrypted and decentralized communication.
Stars: ✭ 257 (+73.65%)
Mutual labels:  qt, desktop
Phantomstyle
Cross-platform QStyle for traditionalists
Stars: ✭ 179 (+20.95%)
Mutual labels:  qt, desktop
Qode
Qode is a lightly modified fork of Node.js that merges Node's event loop with Qt's event loop. It is designed to be used together with @nodegui/nodegui.
Stars: ✭ 84 (-43.24%)
Mutual labels:  qt, desktop
React Nodegui
Build performant, native and cross-platform desktop applications with native React + powerful CSS like styling.🚀
Stars: ✭ 5,914 (+3895.95%)
Mutual labels:  qt, desktop
Zettlr
A Markdown Editor for the 21st century.
Stars: ✭ 6,099 (+4020.95%)
Mutual labels:  pdf, desktop
Toggldesktop
Toggl Desktop app for Windows, Mac and Linux
Stars: ✭ 1,663 (+1023.65%)
Mutual labels:  qt, desktop
Mlde.d.moonlightde
Modular and Qt5 light new behavior desktop environment
Stars: ✭ 40 (-72.97%)
Mutual labels:  qt, desktop
Nodegui
A library for building cross-platform native desktop applications with Node.js and CSS 🚀. React NodeGui : https://react.nodegui.org and Vue NodeGui: https://vue.nodegui.org
Stars: ✭ 7,324 (+4848.65%)
Mutual labels:  qt, desktop
Nodegui Starter
A starter repo for NodeGui projects
Stars: ✭ 93 (-37.16%)
Mutual labels:  qt, desktop
React Nodegui Starter
Starter repository for react based native desktop apps using react-nodegui
Stars: ✭ 132 (-10.81%)
Mutual labels:  qt, desktop
Huggle3 Qt Lx
Huggle is an anti-vandalism tool for use on MediaWiki based projects
Stars: ✭ 143 (-3.38%)
Mutual labels:  qt
Openauto
AndroidAuto headunit emulator
Stars: ✭ 1,926 (+1201.35%)
Mutual labels:  qt
Directxtk
The DirectX Tool Kit (aka DirectXTK) is a collection of helper classes for writing DirectX 11.x code in C++
Stars: ✭ 1,918 (+1195.95%)
Mutual labels:  desktop
Appleseed
A modern open source rendering engine for animation and visual effects
Stars: ✭ 1,824 (+1132.43%)
Mutual labels:  qt
Qt Virt Manager
Qt Virtual machines manager
Stars: ✭ 146 (-1.35%)
Mutual labels:  qt
Mac Hanguldesktop Clock
Hangul Desktop Clock for Mac
Stars: ✭ 146 (-1.35%)
Mutual labels:  desktop
Qtpromise
Promises/A+ implementation for Qt/C++
Stars: ✭ 137 (-7.43%)
Mutual labels:  qt
Doctron
Docker-powered html convert to pdf(html2pdf), html to image(html2image like jpeg,png),which using chrome(golang) kernel, add watermarks to pdf, convert pdf to images etc.
Stars: ✭ 141 (-4.73%)
Mutual labels:  pdf

QtPdfium

QtPdfium is a Qt module that renders PDF files using the pdfium project by google. It render PDF pages into QImage.

Installation

To use the library you must first install it in the same location as your Qt installation. Here is an example on Linux/Mac:

git clone --recursive https://github.com/paulovap/qtpdfium
cd qtpdfium
qmake
make
make install (might need sudo)

After that you are ready to use it. Remember to build for each platform you want. (Desktop, Android, iOS...)

Usage

The API consists in only two classes: QPdfium and QPdfiumPage.

To load a PDF file, simply do:

#include <QtPdfium/QPdfium>

QPdfium pdf("mypdf.pdf");
qDebug() << pdf.isValid(); //should return true

You can get the number of pages with QPdfium::pageCount()

You can access pages by index:

#include <QtPdfium/QPdfium>

QPdfium pdf("mypdf.pdf");
QPdfiumPage page =  pdf.page(0);
qDebug() << page.width(); // should show something!

To generate the image:

#include <QtPdfium/QPdfium>

QPdfium pdf("mypdf.pdf");
QPdfiumPage page =  pdf.page(0);
QImage image = page.image(3); //renders it 3 times bigger

And for extracting text:

#include <QtPdfium/QPdfium>

QPdfium pdf("mypdf.pdf");
QPdfiumPage page =  pdf.page(0);
QString pageText = page.text();

Note: On iOS you need to initialize QtPdfium manually since it is statically linked. Just create a global object like this:

#ifdef Q_OS_IOS
    //Since it's static library on IOS we need to initialize it by hand
    PdfiumGlobal global;
#endif

And that's it.

Future work

  • Load pdf with encryption (passwords)
  • Text manipulation (find, extract, cursor..)
  • Partial rendering
  • Render to other devices (gl surface, so on..)

Contributing

Feel free to help. :)

License

BSD

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].