Skip to content

turgu1/uPDF2

Repository files navigation

This software is licensed under Gnu General Public License Version 3. Please look at the COPYING file for further details.

uPDF (micro PDF) - Qt Creator - Version 2.4.0 Update (2022/07/14)

  • Now using Qt 6.3, Poppler 22.07.0

  • CMakefile.txt based build instead of qmake

  • LZO no longer required

  • The following bugs where corrected

    • Crash when closing a tab for witch the pdf was still being loaded

    • Column count mixup when loading a document from a Bookmark

    • Memory leak while loading a pdf

I have tried to use the QtPDF class, but it is too restrictive compared to poppler.

uPDF (micro PDF) - Qt Creator - Version 2.3.0

uPDF is a PDF Viewer specifically designed to minimize keyboard interaction requirements. It’s being used by the author as a tool to display musical scores on a dedicated Raspberry Pi and a monitor on top of a piano. A mouse is the only tool available for interaction with the device. A keyboard is supported by uPDF if available. The software is usable as a general, fast PDF file viewer.

Main caracteristics:

  • Multi-columns document display (up to 5 columns)

  • Open selection from the last 30 viewed documents

  • Automatically open the last viewed document with last display parameters

  • Fullscreen mode

  • Text selection and copy to clipboard (from FlaxPDF)

  • 5 different automatic view modes to optimize screen space asset (some from FlaxPDF)

  • 1 customizable trim mode to set the view portion of the document

    • even/odd page trim management

    • specific page to page trimming selection

  • Fast background document retrieval through multithreading (from FlaxPDF)

  • Whole document caching in memory (no delay in going from a page to other once loaded) (from FlaxPDF)

  • Controls pane can be hidden to maximize document screen usage (from FlaxPDF)

  • Bookmarking capability as a kind of index inside documents. They can be seen as table of content of multiple documents managed inside a single SQLite database.

  • Tabulation for multiple opened documents

  • Qt based application

  • Free and open source (Gnu General Public License V3.0)

This is a spinoff made from the excellent piece of software FlaxPDF (see http://github.com/clbr/flaxpdf). The original announcement page of FlaxPDF is available below under the FlaxPDF header below.

uPDF is being developped using Qt Creator 4.11.0 (the free version) and Qt Library 5.14. In particular, it is used on MacOS, Windows 10, Ubuntu, Linux Mint and Rasbian platforms.

Screenshot

Planned development

  • Installation packages for MacOS, Windows 10, Linux and Raspberry Pi

  • Hyperlink connections

  • Text search tool

  • Printing

Some of the new capabilities have been sent to the original author of FlaxPDF for potential integration in his own application at the time uPDF was using FLTK as the GUI framework. Since then, the decision was made to go with Qt creator for further development.

Build

The following packages are required and may need to be built and installed if not available as a package:

Linux

The following packages are usually available via package management under linux and are required by poppler when installation from the source code distribution is required:

  • curl (package curl)

  • nss (package libnss3-dev)

  • jpeg (package libjpeg-dev)

  • png (package libpng12-dev)

  • tiff (package libtiff5-dev)

  • cairo (package libcairo-dev)

  • icu (package libicu-dev)

  • lcms2 (package liblcms2-dev)

  • fontconfig (package libfontconfig1)

  • freetype (package libfreetype6-dev)

  • build-essential (package build-essential)

  • cmake (package cmake)

  • gobject-introspection (package gobject-introspection)

  • boost (package libboost-all-dev)

The following package is required by Qt and may not be already installed:

  • OpenGL (package libgl-dev)

For example with the apt-get command, they can be installed as follow:

  $ sudo apt-get install \
  curl libnss3-dev libjpeg-dev libpng12-dev libtiff5-dev \
  libcairo-dev libicu-dev liblcms2-dev \
  libfontconfig1 libfreetype6-dev build-essential \
  cmake gobject-introspection libboost-all-dev

  $ sudo apt-get install libgl-dev

Poppler

To properly build poppler, some libraries are required to be installed. That’s the case for libjpeg, libpng and libtiff to manage embedded images in PDFs. Other libraries are required and are often already installed. Here is a page to get some more information about dependencies:

Once the popper library is untared, you need to build it with the following commands from the main poppler folder:

$ mkdir build
$ cd build
$ cmake .. \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=release \
-DENABLE_UNSTABLE_API_ABI_HEADERS=on
$ make
$ sudo make install

uPDF

To build uPDF, you will need Qt Creator V 4.11.0 and Qt library Version 5.14 or later under Unix or MacOS. The file uPDF2.pro need to be opened with Qt Creator. All the previously indicated libraries must have been installed before building the application.

Insallation packages for MacOS, Linux and Rapsberry Pi are under development.

Here is the original announcement for the FlaxPDF application. uPDF is fast, but due to the use of Qt and the added functionalities, it is a bit slower than FlaxPDF:

FlaxPDF

FlaxPDF is a fast, nice multithreaded PDF viewer for the desktop.

As long as there are more pages than cores, every core will get a workout.

Light on dependencies, trimming borders, and aggressive caching are its major points. Okular and Evince are nice but heavy; and the point for starting this project, ePDFview, is dead.

EPDFview was nice and light, but lacking in a couple ways:

  • no caching, if you wanted to backtrack one page, it reloaded slowly

  • no automatic zoom to content/trim

Now with my main PDF viewer being dead, why not build a fresh one with those two itches scratched?

Requirements

Poppler, LZO, and FLTK 1.3.

Comparison

Evince 3.10.3, FlaxPDF 0.6.1 and ePDFview 0.1.8 were tested. The same document was scrolled repeatedly to check the cpu usage, the binary size was measured, as well as RAM use.

		CPU		RAM		Binary
Evince		90%		56.8 MB		507 KB (evince + libpdfdocument.so)
ePDFView	72%		46.3 MB		124 KB
FlaxPDF		57% (5% *)	36.5 MB		45 KB
  • To be fair to all, these measurements were done using the Vesa driver. FlaxPDF, as the only one of the three, is able to take advantage of the GPU, dropping its CPU use when scrolling to 5% (tested on radeon).

About

PDF Viewer built with Qt

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published