Giter Site home page Giter Site logo

sgerwk / pdftoroff Goto Github PK

View Code? Open in Web Editor NEW
18.0 1.0 1.0 1.13 MB

view pdf on X11 and the Linux framebuffer; resize pdf; convert pdf to text, html, TeX, groff

License: GNU General Public License v3.0

Makefile 0.43% Roff 14.52% C 82.40% Shell 2.65%
extract-text groff pdf html pdf-viewer linux-framebuffer two-columns framebuffer small-screen accessibility pdf-files pdf-scale tex small-page pdf-resize

pdftoroff's Introduction

pdftoroff

pdf viewer, scaler, converter (to text, html, etc.) by blocks of text

  • hovacui: a pdf viewer for the Linux framebuffer and X11
  • pdffit: scale a pdf file to fit a given page size with given margins
  • pdftoroff: convert from pdf to roff, html, text, TeX

hovacui

The hovacui pdf viewer for the Linux framebuffer and X11 automatically zooms to the blocks of text. It is aimed at viewing files on small screens, and is especially handy for multiple-columns documents. Details in the hovacui web page.

  • a screenshots of hovacui with the goto page dialog:

    hovacui: screenshot of the goto to page field

  • the main menu:

    hovacui: screenshot of the main manu

pdffit

The pdffit scaler shrinks or enlarges the pages of a pdf file so that their text fits into a given paper size (e.g., A4 or letter) with a given margin. It can also be used to reduce or increase the margin in the document (the white area around the text).

The related program pdfrects finds the bounding box or the text area of the pages of a pdf file.

pdftoroff

The pdftoroff program extracts text from pdf files, trying to undo page, column and paragraph formatting while retaining italic and bold faces. It outputs text in various text formats: groff, html, plain TeX, text, or user-defined format. It is used by the included pdftoebook script to reformat a pdf file to a smaller page, so that it becomes suited to be read on a small tablet or e-ink ebook reader.

pdfrecur

The pdfrecur filter removes page numbers, headers and footers.

installation

Generic instructions:

make
make install

archlinux

This package is in AUR. Still, the PKGBUILD file is also accessible as an asset from github.

  • go to the release page and download the latest PKGBUILD file to an empty directory
  • in that directory, run makepkg
  • install: sudo pacman -U pdftoroff...tar.xz

opensuse

If the latest release in the release page is for example 1.0.0:

  • download sources: curl -L -o $HOME/rpmbuild/SOURCES/pdftoroff-1.0.0.tar.gz https://github.com/sgerwk/pdftoroff/archive/v1.0.0.tar.gz (replace 1.0.0 with the latest version number)
  • download pdftoroff.spec from the release page
  • make the package: rpmbuild -bb pdftoroff.spec
  • install: sudo rpm -i $HOME/rpmbuild/RPMS/pdftoroff-version-etc.rpm

debian

  • download the sources, unpack and compile them (do not install yet)
  • make a directory somewhere/pkg/DEBIAN
  • download there the control file from the release page
  • check and possibly replace the field Architecture: in control
  • in the pdftoroff source directory run make DESTDIR=somewhere/pkg install
  • create the package: dpkg-deb -b somewhere/pkg .
  • install: sudo dpkg -i pdftoroff...deb

what's new

  • optionally show the current time (Sept. 2022)
  • select only the visible part of the current textbox (Sept. 2022)
  • night mode: show pdf in reverse colors (Apr. 2023)
  • key 'G': move back to the position prior to jumping or searching (Apr. 2023)
  • cache position and search string (Apr. 2023)
  • key 'x' to position a cursor on the page (May 2023)
  • some editing via an external script (May 2023)
  • pdffit can try to ignore headers and footers (June 2023)

pdftoroff's People

Contributors

sgerwk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

idle-meerkat

pdftoroff's Issues

Help to add invert color option in hovacui

Hi there. Thanks for the great work, I have been a big fan of this project, especially the hovacui reader (its simple and minimal yet functional, along with X and fb support).

Is it possible to add an option to invert the colors of the pdf (like mupdf/zathura do)?
I'm not great with poppler headers, and need some help figuring out if possible to add an invert-color option.

Please check this out when you have the time to do so.
Thank you.

NetBSD support (for xhovacui)

Hi,

thanks for you great work, hovacui works wonderfully on small screens and low-end devices.

I got xhovacui to compile (and it seems to run fine) on NetBSD (which doesn't have <linux/fb.h>), by removing the fb dependency and adding few headers:

diff --git a/Makefile b/Makefile
index 1202e05..9215db4 100644
--- a/Makefile
+++ b/Makefile
@@ -27,7 +27,7 @@ pdftoroff pdffit pdfrects pdfrecur: pdfrects.o
 hovacui fbhovacui drmhovacui xhovacui: pdfrects.o
 fbhovacui: cairofb.o vt.o cairoio-fb.o cairoui.o hovacui.o fbhovacui.o
 drmhovacui: cairodrm.o vt.o cairoio-drm.o cairoui.o hovacui.o drmhovacui.o
-xhovacui: cairofb.o vt.o cairoio-x11.o cairoui.o hovacui.o xhovacui.o
+xhovacui: cairoio-x11.o cairoui.o hovacui.o xhovacui.o
 hovacui: cairofb.o cairodrm.o vt.o cairoio-x11.o cairoio-fb.o cairoio-drm.o \
 cairoui.o hovacui.o hovacui-main.o
 cairoui: cairofb.o vt.o cairoio-fb.o cairoio-x11.o cairoui.o cairoui-main.o
diff --git a/cairoio-x11.c b/cairoio-x11.c
index aa2afec..ac91ac8 100644
--- a/cairoio-x11.c
+++ b/cairoio-x11.c
@@ -1,6 +1,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
+#include <sys/time.h>
 #include <X11/Xlib.h>
 #include <X11/keysym.h>
 #include <X11/Xatom.h>
@@ -8,7 +9,6 @@
 #include <cairo.h>
 #include <cairo-xlib.h>
 #include "cairoio.h"
-
 /*
  * name of the program, as used in the window title
  */
diff --git a/cairoui.c b/cairoui.c
index 33b6766..9407cf6 100644
--- a/cairoui.c
+++ b/cairoui.c
@@ -260,6 +260,7 @@
 #include <string.h>
 #include <signal.h>
 #include <time.h>
+#include <stdarg.h>
 #include <ctype.h>
 #include "cairoio.h"
 #include "cairoui.h"

Was there a reason to link against vt.o and cairofb.o for the xhovacui target?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.