FLTK PDF Viewer

233 views
Skip to first unread message

Rob McDonald

unread,
Feb 7, 2021, 1:31:00 AM2/7/21
to fltk.general
Does anyone know of any simple open source FLTK PDF Viewers that are actively maintained?

I've found FlaxPDF and flViewer, but both look to be dormant (5-6 years).  
Also uPDF which is a fork of FlaxPDF - more recently dormant (4 years).

FlaxPDF / uPDF uses Poppler and flViewer uses Poppler or MuPDF for parsing, interpreting, etc.  I'm fine with that, just providing info.

I have an idea for an app that will do some novel data extraction from a PDF.  Starting from a working viewer will save a ton of effort.  I'm just looking for the right starting point.

I don't really care what license they've chosen - so long as it is open source.  Need to build on Mac, Linux, Windows.

Rob

Immanuel Litzroth

unread,
Feb 7, 2021, 6:23:27 AM2/7/21
to fltkg...@googlegroups.com
You can get poppler to render to a cairo backend and fltk supports cairo too.
I once hacked something together to do this, but I didn't pursue it.
Immanuel
> --
> You received this message because you are subscribed to the Google Groups "fltk.general" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/86593923-bcde-4033-aee1-63121e3698f5n%40googlegroups.com.



--
-- Researching the dual problem of finding the function that has a
given point as fixpoint.

lifeatt...@gmail.com

unread,
Feb 7, 2021, 12:22:59 PM2/7/21
to fltk.general
flpsed perhaps - https://flpsed.org/flpsed.html

Please post updates, I'd be interested to know what you end up using, why, etc ...

geert karman

unread,
Feb 8, 2021, 3:21:24 AM2/8/21
to fltk.general
I ran into the same problem a few years ago. I wanted a pdf viewer to do image processing. I didn't find anything suitable (I didn't know about flpsed so I didn't check that one out) and wrote my own from scratch. I haven't done anything on it since last summer (too busy with other things) but hope to pick it up again some time in the future. 

What I have now is a working viewer, multithreaded (loading documents and rendering is done in the background), that can load multiple files and append them (pdf and almost all image formats), delete pages, change the order of pages, save as pdf. Uses fltk for GUI, poppler for rendering, podofo for writing pdf-s, opencv for image storage. I developed it on Mac, but didn't use any Mac-specifics, so it should be possible to compile and run it on Windows and Linux. 

Nothing actively maintained at the moment, but if you want to have a look and try at my code, you're welcome.
Geert

Op zondag 7 februari 2021 om 17:22:59 UTC schreef lifeatt...@gmail.com:

Rob McDonald

unread,
Feb 8, 2021, 12:48:23 PM2/8/21
to fltk.general
Geert,

That sounds like a great starting point.  It would be great if you could share it on GitHub or whatever you prefer.

Thanks,

Rob

geert karman

unread,
Feb 8, 2021, 3:19:21 PM2/8/21
to fltk.general
I have made two tar-files available for download from my cloud service (I have no experience with GitHub). The one that's called Sfx is the code for the viewer. The pi_lib_src contains some of my own stuff that I link in, it won't be much, something like a highlight button and my threads library (a wrapper to hide platform specific threading). If anyone wants to use my code, please let me know. I'd appreciate it if we could then find a format so that I can benefit from changes/improvements.

Download from:

https://spideroak.com/browse/share/Geert_Shared/sfx

I think this everything you need from me, if not, let me know. 

Best, Geert

PS. Works only with fltk 1.4.x.


Op maandag 8 februari 2021 om 17:48:23 UTC schreef rob.a.m...@gmail.com:

holm.h...@gmail.com

unread,
Nov 16, 2024, 5:56:31 AM11/16/24
to fltk.general

Hello Geert,

Long time since this post. Do you still have the download mentioned above available ?

Best regards
Håvard

geert karman

unread,
Nov 16, 2024, 7:11:03 AM11/16/24
to fltkg...@googlegroups.com
Hello Håvard,

Yes, it's been a while. In the meantime I've removed the files and the link.

I think I haven't worked on it since then. I'll see if I can figure out where I left and will try to make new (a) tar file(s). At least I still have a working executable here (with a few minor glitches), so that's encouraging.

I'm too busy right now but I'll try to get back to you somewhere next week. If not, send me a reminder.

Geert

Albrecht Schlosser

unread,
Nov 16, 2024, 8:05:04 AM11/16/24
to fltkg...@googlegroups.com
What about FlaxPDF?
https://github.com/clbr/flaxpdf

Citation: "FlaxPDF is a fast, nice multithreaded PDF viewer for the desktop."
Requirements: Poppler, LZO, and FLTK 1.3.

AFAICT FlaxPDF is the PDF viewer of TinyCore Linux.
http://tinycorelinux.net/

I can't tell anything about it because I didn't use it - but now I became curious... ;-)
Would be interesting to test it with FLTK 1.4.

Cheers
Albrecht
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral...@googlegroups.com.

Paul Hahn

unread,
Nov 19, 2024, 1:14:28 AM11/19/24
to fltk.general
On Saturday, November 16, 2024 at 7:05:04 AM UTC-6 Albrecht-S wrote:
What about FlaxPDF?
https://github.com/clbr/flaxpdf

Citation: "FlaxPDF is a fast, nice multithreaded PDF viewer for the desktop."
Requirements: Poppler, LZO, and FLTK 1.3.

AFAICT FlaxPDF is the PDF viewer of TinyCore Linux.
http://tinycorelinux.net/

I can't tell anything about it because I didn't use it - but now I became curious... ;-)
Would be interesting to test it with FLTK 1.4.

Cheers
Albrecht


Unfortunately for some of us, it has GPL license. 

Ian MacArthur

unread,
Nov 19, 2024, 5:26:20 AM11/19/24
to fltk.general
On Tuesday, 19 November 2024 at 06:14:28 UTC paul wrote:
On Saturday, November 16, 2024 at 7:05:04 AM UTC-6 Albrecht-S wrote:
What about FlaxPDF?
https://github.com/clbr/flaxpdf

 
Unfortunately for some of us, it has GPL license. 

Hmm, yeah - looks to be GPL-3...
I wonder if the core of it could build as a shared object, load it dynamically - would that help?  (Long shot...)


geert karman

unread,
Nov 23, 2024, 5:38:12 AM11/23/24
to fltkg...@googlegroups.com, holm.h...@gmail.com
Hello,

I found the tar files I made at the time and restored the download link:

https://spideroak.com/browse/share/Geert_Shared/sfx

The Sfx.tar contains the source code of the viewer. There's also a makefile that that might help in getting it to compile and build on your own system (nothing fancy, just plain instructions). In the pi_lib there's some additional code of mine that you'll need as well. The main portion is a wrapper to hide platform specific threading code, but there's also some widgets (like a highlight button) that you can easily replace with standard fltk widgets. It works on Mac, but I never tested it on Windows (or Linux, but that uses posix so I guess it will work there as well).

My code uses openCV for storing images, poppler for rendering and Podofo for creating PDF-s. My goal was to make a PDF viewer, especially for images not so much text, that would allow one to manipulate the images (hence opencv) and save the result (hence Podofo). At the time I had opencv 4.3, poppler 0.87.0 and Podofo 0.9.6. I haven't followed it too much, but poppler has since had a major overhaul, my code might need a new interface for that. The others I don't know. You need fltk 1.4, there was something missing in fltk 1.3, I don't remember what it was.

The executable I have works, although there's a few glitches here and there.

Please let me know if there's anything missing.

If you really take this up and use it for a PDF viewer of your own, please let me know as well.

All the best, Geert




On 16/11/2024 10:56, holm.h...@gmail.com wrote:

Rob McDonald

unread,
Nov 23, 2024, 3:07:52 PM11/23/24
to fltk.general
On Saturday, November 23, 2024 at 2:38:12 AM UTC-8 geert karman wrote:
Hello,

I found the tar files I made at the time and restored the download link:

https://spideroak.com/browse/share/Geert_Shared/sfx

The Sfx.tar contains the source code of the viewer. There's also a makefile that that might help in getting it to compile and build on your own system (nothing fancy, just plain instructions). In the pi_lib there's some additional code of mine that you'll need as well. The main portion is a wrapper to hide platform specific threading code, but there's also some widgets (like a highlight button) that you can easily replace with standard fltk widgets. It works on Mac, but I never tested it on Windows (or Linux, but that uses posix so I guess it will work there as well).

My code uses openCV for storing images, poppler for rendering and Podofo for creating PDF-s. My goal was to make a PDF viewer, especially for images not so much text, that would allow one to manipulate the images (hence opencv) and save the result (hence Podofo). At the time I had opencv 4.3, poppler 0.87.0 and Podofo 0.9.6. I haven't followed it too much, but poppler has since had a major overhaul, my code might need a new interface for that. The others I don't know. You need fltk 1.4, there was something missing in fltk 1.3, I don't remember what it was.

The executable I have works, although there's a few glitches here and there.

Please let me know if there's anything missing.

If you really take this up and use it for a PDF viewer of your own, please let me know as well.

All the best, Geert


Thanks a ton for sharing.

I have a long-standing desire to make a special PDF tool (*) -- a simple FLTK based viewer would be a great place to start.  Of course, the way things have been going, I'll never have time to get around it it...

One thing I would really like is the ability to click on an individual (or group of) element(s) in the PDF (say a line, box, or text) and then manipulate them -- delete, no-show, isolate, etc.  So, I'll need to take mouse XY, convert to page XY, and then search the PDF data for entities on or near the mouse click.  Then I need to be able to manipulate individual entities from the PDF file.

In general, I haven't been able to figure out which PDF rendering and manipulating libraries are going to support that kind of use case -- any experience you have in this are would be very valulable.

I didn't notice any license declaration in Sfx.tgz or any of the files in that bundle.  Would you mind picking a license, including it in the bundle, and re-uploading?

Thanks again,

Rob

(*) The tool would be a way to extract the original data from technical plots (mostly line graphs) stored in vector format in PDF files.

There are lots of tools like this for raster images (search Plot Digitizer) -- but I have never found one for vector images.  I have done this many times by converting the PDF page to EPS and then editing that text file in an editor and decoding the PostScript commands.  It is a slow and tedious process that is ripe for automation...


 

geert karman

unread,
Nov 25, 2024, 4:13:44 AM11/25/24
to fltkg...@googlegroups.com
Hello,


Thanks a ton for sharing.

I have a long-standing desire to make a special PDF tool (*) -- a simple FLTK based viewer would be a great place to start.  Of course, the way things have been going, I'll never have time to get around it it...

One thing I would really like is the ability to click on an individual (or group of) element(s) in the PDF (say a line, box, or text) and then manipulate them -- delete, no-show, isolate, etc.  So, I'll need to take mouse XY, convert to page XY, and then search the PDF data for entities on or near the mouse click.  Then I need to be able to manipulate individual entities from the PDF file.
In general, I haven't been able to figure out which PDF rendering and manipulating libraries are going to support that kind of use case -- any experience you have in this are would be very valulable.
If I'm not mistaken you can have poppler output a list of all elements on the page with their respective (x,y) coordinates on the page. When moving around stuff you'd just have to keep track of all the changes in translation (and rotation) / suppression of the elements. I'm not sure however how you would display the new layout on the screen, whether you'd do that by manipulating the image you keep in memory (with openCV, defeating the vector approach) or whether poppler allows you to change these coordinates in memory and render anew. To create a PDF file with the elements in their new locations you can use Podofo.



I didn't notice any license declaration in Sfx.tgz or any of the files in that bundle.  Would you mind picking a license, including it in the bundle, and re-uploading?
Does it need one? As far as I'm concerned you can do with the code as you please. The viewer is working but there's still lot of work to do before it would be ready for a release. And also, I'm just an amateur programmer, I don't think the code meets any serious standards. I'd already be happy if anyone can do something useful with it. If you think it needs a license, can you suggest one and I'll include it. Something with as few restrictions as possible.


Thanks again,

Rob

(*) The tool would be a way to extract the original data from technical plots (mostly line graphs) stored in vector format in PDF files.

There are lots of tools like this for raster images (search Plot Digitizer) -- but I have never found one for vector images.  I have done this many times by converting the PDF page to EPS and then editing that text file in an editor and decoding the PostScript commands.  It is a slow and tedious process that is ripe for automation...


 
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral...@googlegroups.com.

Daniel Harding

unread,
Nov 25, 2024, 9:38:53 AM11/25/24
to fltk.general
On Monday, November 25, 2024 at 3:13:44 AM UTC-6 geert karman wrote:
>> I didn't notice any license declaration in Sfx.tgz or any of the files in that bundle.  Would you mind picking a license, including it in the bundle, and re-uploading?
> Does it need one? As far as I'm concerned you can do with the code as you please.

I am not a lawyer, but: When you create a(n original) work, you retain all copyrights by default. You do not have to "opt-in" to declare your ownership; you get it automatically. This means no one can rightfully steal your work.

If you want others to be allowed to copy your work, you have to declare it (typically with a license). Since it seems you want a very permissive license, you have many options; like MIT, BSD 3-clause, or even Public Domain.
I think recommending a specific license to you would be too presumptuous, because it's a very personal choice. Also be aware that your choice may be limited by the terms of the licenses of any software you used to create your own software.

It's recommended that you do your own research and come to your own decision: https://en.wikipedia.org/wiki/Permissive_software_license

-Dan

Rob McDonald

unread,
Nov 27, 2024, 1:46:39 AM11/27/24
to fltk.general
On Monday, November 25, 2024 at 1:13:44 AM UTC-8 geert karman wrote:
Hello,

I didn't notice any license declaration in Sfx.tgz or any of the files in that bundle.  Would you mind picking a license, including it in the bundle, and re-uploading?
Does it need one? As far as I'm concerned you can do with the code as you please. The viewer is working but there's still lot of work to do before it would be ready for a release. And also, I'm just an amateur programmer, I don't think the code meets any serious standards. I'd already be happy if anyone can do something useful with it. If you think it needs a license, can you suggest one and I'll include it. Something with as few restrictions as possible.

I took a bit of a closer look.

Poppler is GPL v2 or v3.  So that pretty much forces any code using Poppler to be GPL too.

I didn't check if you had any other dependencies to ensure they were all self-consistent.

Rob


 

Ian MacArthur

unread,
Nov 29, 2024, 3:37:25 AM11/29/24
to fltk.general
On Wednesday, 27 November 2024 at 06:46:39 UTC rob wrote:
I took a bit of a closer look.

Poppler is GPL v2 or v3.  So that pretty much forces any code using Poppler to be GPL too.

I didn't check if you had any other dependencies to ensure they were all self-consistent.

I haven't looked at Poppler in a long time, but ISTR that you could build it as a SO/DLL back in the day - so that might allow you to work with the GPL dependency somewhat without binding it to your code.

geert karman

unread,
Dec 2, 2024, 5:05:11 AM12/2/24
to fltkg...@googlegroups.com
And I am definitely not a lawyer either. I also don't have much time to investigate all the possible options and find out what the differences are. I chose for the MIT license and also included a reference to FLTK as requested by their license. As far as dependencies on other software, I think it does not limit me in this case to apply my own on the code that I have written, because one can (and is allowed) to adapt my code for other packages. For example, Poppler is apparently GPL, but the calls to it are very few (open the file and render pages) so it can easily be replaced by another package. In fact, I used mupdf when I started (which is a bit different license). (I switched because it is written in C and was a bit cumbersome to use in my code. It was, for one, not straightforward to have various files open at the same time. One advantage however was that you can either render pages with or without attributes, which at the time Poppler couldn't. I don't know how it's now)

I hope this solves the issue.

Best, Geert
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages