aligrudi / fbpdf Goto Github PK
View Code? Open in Web Editor NEWA small framebuffer pdf, djvu, epub, xps, and cbz viewer
Home Page: http://litcave.rudi.ir/
License: BSD 3-Clause "New" or "Revised" License
A small framebuffer pdf, djvu, epub, xps, and cbz viewer
Home Page: http://litcave.rudi.ir/
License: BSD 3-Clause "New" or "Revised" License
FBPDF ===== Fbpdf is a framebuffer pdf and djvu viewer. There are three make targets: fbpdf uses mupdf library for rendering pdf, fbpdf2 uses poppler for the same purpose, and fbdjvu uses djvulibre library for rendering djvu files. The following options are available in all three programs: fbpdf [-r rotation] [-z zoom_x10] [-p page_number] file.pdf The following table lists the commands available in fbpdf. Most of them accept a numerical prefix. For instance, '^F' tells fbpdf to show the next page while '5^F' tells it to show the fifth next page. ============== ================================================ KEY ACTION ============== ================================================ ^F/J next page ^B/K previous page G go to page (the last page if no prefix) o set page number (for 'G' command only) O set page number and go to current page z zoom; prefix multiplied by 10 (i.e. '15z' = 150%) r set rotation in degrees i print some information I invert colors q quit ^[/escape clear the numerical prefix mx mark page as 'x' (or any other letter) 'x jump to the page marked as 'x' `x jump to the page and position marked as 'x' j scroll down k scroll up h scroll left l scroll right [ align with the left edge of the page ] align with the right edge of the page { align with the leftmost character on the page } align with the rightmost character on the page H show page top M centre the page vertically L show page bottom C centre the page horizontally ^D/space page down ^U/^H/backspace page up ^L redraw e reload current file f zoom to fit page height w zoom to fit page width W zoom to fit page contents horizontally Z set the default zoom level for 'z' command d sleep one second before the next command ============== ================================================
When you open a document in fbpdf and then try to switch ttys with alt arrow keys, it freezes up the system. I found that I had to force poweroff.
Disclaimer: IANAL, *GPL is horribly controversial and I might be wrong (but I don't think I am)
mupdf is licensed under AGPL terms. Per these terms, any program linking against it (either statically or dynamically), must also be released as AGPL. Releasing fbpdf under BSD is a violation of mupdf license. For this reason, Artifex could extort you or your users into buying a commercial mupdf license.
Now, I'm not sure how to fix it. The 'obvious' solution would be to license fbpdf separately as AGPL. However, I'm not sure if AGPL doesn't require covering other files in the package, particularly the Makefile. Since you have poppler-based fbpdf2, removing fbpdf or splitting it to a separate package may be a better option.
Back again, maybe an install readme with dependencies listed would help etc?
I have done
git clone https://github.com/aligrudi/fbpdf.git
make 2> mybuild.txt
and I get on screen
cc -c -Wall -O2 -I./include fbpdf.c
cc -c -Wall -O2 -I./include mupdf.c
cc -c -Wall -O2 -I./include draw.c
cc -o fbpdf fbpdf.o mupdf.o draw.o -L./lib -lmupdf -lmupdf-third -lmupdf-pkcs7 -lmupdf-threads -lm
and in mybuild.txt
/usr/bin/ld: cannot find -lmupdf-pkcs7
/usr/bin/ld: cannot find -lmupdf-threads
collect2: error: ld returned 1 exit status
make: *** [Makefile:14: fbpdf] Error 1
if I remove -lmupdf-pkcs7 -lmupdf-threads get a load of undefined.
btw Buster is using mupdf 1.14 (whereas on Debian 9 I had issue with older muppdf)
There are no include, or lib folders.
Am I missing a step or a dependency?
Hello, just wanted to say how much I enjoy your FBPDF, FBFF, and NEATCC projects. Very well done!
I thought you might be interested to know that I ported both FBPDF and FBFF to Microwindows (a small-footprint graphical windowing system that runs on framebuffer, as well as other environments).I took your nicely-designed fb_ api in draw.c and made a few changes so they are identical across FBPDF and FBFF, and moved the keyboard input processing out of the main application into it as well so they are now portable across both environments.
Then, nxdraw.c was added to replace draw.c for the Nano-X environment, which handles some basic window creation, but uses the Nano-X capability of drawing directly into a memory-mapped window framebuffer such that the main application still uses the original fb_ api. All in all, pretty cool and very fast thanks to your neat design.
Now, the nxdraw.c and draw.c files are identical across the FBFF/FBPDF applications, and allow running on framebuffer or Nano-X with a quick change to the Makefile. I forked both projects and the code is there, in case you're interested. A couple bug fixes were made that causes core dumps with no audio playback, and width and height seperate zooms added.
Here's a screenshot of FBPDF running on OSX on Nano-X on SDL, no need to do anything, just wanted to say thanks!!
Please explain this error and how to work around it. Thank you.
(It is on a raspberry pi zero)
Git version. Any idea ?
mupdf.c: In function ‘doc_draw’:
mupdf.c:22:8: error: too many arguments to function ‘fz_new_pixmap_from_page_number’
pix = fz_new_pixmap_from_page_number(doc->ctx, doc->pdf, p - 1, &ctm, fz_device_rgb(doc->ctx), 0);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/mupdf/fitz.h:58:0,
from mupdf.c:3:
/usr/include/mupdf/fitz/util.h:22:12: note: declared here
fz_pixmap *fz_new_pixmap_from_page_number(fz_context *ctx, fz_document *doc, int number, const fz_matrix *ctm, fz_colorspace *cs);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mupdf.c:30:43: error: ‘fz_pixmap {aka struct fz_pixmap_s}’ has no member named ‘stride’; did you mean ‘storable’?
unsigned char *s = &pix->samples[y * pix->stride];
^~
Makefile:8 : la recette pour la cible « mupdf.o » a échouée
make: *** [mupdf.o] Erreur 1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.