Page 4 of 5

pdf reader: which one?

Posted: 09 Nov 2023, 06:59
by Rava
quoting myself to get to the point of this post:
Rava wrote:
07 Nov 2023, 08:51
and would these 2 packages are all that is needed to get it running in XFCE?
rych wrote:
08 Nov 2023, 10:09
Rava wrote:
07 Nov 2023, 08:51
212 MB is quite large
Well, that's Java. Java UI is also going to be somewhat unusual
Is zulu-openjdk8 the needed Java dependency, then?

Code: Select all

root@rava:/# slapt-mod -M zulu-openjdk8
Reading Package Lists...Done
The following NEW packages will be installed:
  zulu-openjdk8 
0 upgraded, 0 reinstalled, 1 newly installed, 0 to remove, 0 not upgraded.
Need to get 82.3MB of archives.
Do you want to continue? [y/N] N
Abort.
root@rava:/# slapt-mod -s zulu-openjdk8
zulu-openjdk8-8.0.322-x86_64-1salix15.0  (Open Implementation of JDK)
root@rava:/# 
Seems like so, and it is 82.3MB out of the 212 MB overall.

pdf reader: which one?

Posted: 09 Nov 2023, 09:01
by i3slkiller
I found that Foxit Reader freezes when tries to auto check update (enabled by default), that I didn't know about when created module (although anyway it worked normally some time...). Or at least that's what it looks like, seeing that after writing these lines program hangs:

Code: Select all

After 20s waiting ,UpdateMgr::startUpdater(). 

strURL: "http://us-request.foxitservice.com/addons/get_addons.php/get_addons.php?addon=Update%20List&product=ReaderLite4Linux&version=2.4&build=4.0911&platform=x64&EmbededLanguage=en-us"
Maybe it will help:
Go to Edit > Preferences, in Updater apply "Do not check for updates" and restart program
OR just delete /opt/foxitsoftware/foxitreader/fxplugins/libupdater.so

pdf reader: which one?

Posted: 10 Nov 2023, 00:16
by Rava
^
Could be it is just a bug when updating to the currently recent version.

But when it's a bug in the current module version that will apply to any more recent version it tries to update to, then altering the module my removing /opt/foxitsoftware/foxitreader/fxplugins/libupdater.so would be the best option, and having the info somewhere prominent that updating it would fail (thus editing/changing the module).

...

Unless you create a new module with the current version, and that works even when updating, but I presume then one has to wait once more until a new update is available to see if that works now.

Does foxit have a bug tracing method, like there is on github where one could report the error? Or look up the error, maybe it already got reported?

pdf reader: which one?

Posted: 10 Nov 2023, 18:13
by Kulle
Firefox has a good built-in PDF reading and editing tool

Mozilla has updated the PDF viewer in Firefox 119
You could already add text and drawings when editing PDFs , the latter of which was helpful for signing documents.
But now you can add images to PDFs too. Firefox even lets you add alt text to images, ensuring the PDF remains readable to people using screen readers or other accessibility tools.

Look also here:
https://www.theregister.com/2023/10/26/ ... 9_and_120/

pdf reader: which one?

Posted: 10 Nov 2023, 19:42
by i3slkiller
@Rava
I suspect from what they wrote that they won't fix it.
https://kb.foxit.com/hc/en-us/community/posts/9086964485780-Foxit-reader-freeze-on-Ubuntu-20-04 wrote: [...]due to human resources limited,our developers have stopped fixing issues and developing new features for Foxit Reader for Linux. But our Dev team will We will produce a brand-new version of Foxit PDF Editor for Linux which will be based on our existing Foxit PDF Editor for windows desktop to be a substitute version of the current one.
This is one problem. Second problem I found and someone wrote about, eg. here https://forums.linuxmint.com/viewtopic.php?t=374765 is less noticeable.
Imagine that you open some PDF in Foxit Reader. Process starts, window appears and displays opened PDF. And you read it. When you finish reading, then you close that window. But this process is still alive in background and wastes some memory, but you aren't aware it unless you check list of running processes. Running 2nd, 3rd, nth instance creates new process which won't be terminated when closed window. They rather won't fix it either.

So in addition of deleting libupdater.so maybe I will also make workaround involving a script, which starts process (FoxitReader), reads standard output error of it and if finds specific string in it, then terminates process after few seconds. This script will also end if that process is somehow killed. I found that these lines always outs from process standard output error after closing window:

Code: Select all

~CReader_AppEx() begin
~CJS_Runtime()
~CJS_Module()
 CJS_Module::ExitEnumJSPlugThread()
and stops here. No shell prompt. It will only out something else after starting new instances, but that's not relevant.

Third problem is that if you double click PDF file in file manager, it is opened in new instance, even if another instance is already running. This also may be not fixed. Surprisingly suddenly its now opens new PDFs in new tabs on the same instance, but not always :hmmm:

That's all applies to newest version, ie. 2.4.5.0727.

pdf reader: which one?

Posted: 10 Nov 2023, 22:27
by Rava
@i3slkiller
Interesting approach, please tell us how your idea
I will also make workaround involving a script, which starts process (FoxitReader), reads standard output error of it and if finds specific string in it, then terminates process […]. This script will also end if that process is somehow killed.
works out.

pdf reader: which one?

Posted: 11 Nov 2023, 08:58
by i3slkiller
I have already written such workaround and looks like this:

Code: Select all

#!/bin/sh
appname="FoxitReader"
selfpath="/opt/foxitsoftware/foxitreader"
pidfile="/tmp/.foxitreader.$RANDOM.pid"

("$selfpath/$appname" "$@" 2>&1 & echo $! > $pidfile) | grep -m 1 -q "~CReader_AppEx() begin
~CJS_Runtime()
~CJS_Module()
 CJS_Module::ExitEnumJSPlugThread()"
kill $(cat $pidfile)
rm $pidfile
I will try to explain clearly what workaround does.

In brackets, program is started with any entered parameters, standard error is redirected to standard output (2>&1), process goes to background according to the script (&). Process ID is saved to temporary file ($! - PID of last started process in background). I am basing on this example I found https://gist.github.com/MatrixManAtYrSe ... 05a3dd88e9 (15th line).
Standard output is piped to grep which will stop reading pipe if finds one matching string (-m 1) or standard output ends because process is killed (depends on what happens first), no output will be from grep (-q).
Reads PID from temporary file and tries to terminate that PID (may fail if that PID is not exist, because that proccess was killed earlier).
In the end deletes temporary file.

The only disadvantage I see that no output from this program will be printed in terminal.

And third problem was my fault. It now opens PDFs in the same instance.

pdf reader: which one?

Posted: 13 Nov 2023, 08:47
by rych
Kulle wrote:
10 Nov 2023, 18:13
Firefox has a good built-in PDF reading and editing tool
Mozilla has updated the PDF viewer in Firefox 119
Wow, it's now very nice indeed. Good rendering! Feels better and lighter than the one in Chrome for example. And there is no need for the ff-pdf customized launch in my opinion (ff-pdf didn't "install" for me, didn't uninstall properly either so I had to manually clean my /changes off its traces). Just specify Firefox as the system default pdf viewer and it'll open as a new tab on a double click in your File manager. If you want to hide the tabbar etc. there keyboard shortcuts for that, also for a full-screen. Press "H" or "S" to switch between hand/selection pointer. Bookmarks are supported as well as entering text or scribble. And since the FIrefox is always running anyway, the opening of a pdf takes less than an instant.

pdf reader: which one?

Posted: 13 Nov 2023, 09:17
by M. Eerie
rych wrote:
13 Nov 2023, 08:47
ff-pdf didn't "install" for me,
Hi rych.
You need the resources folder along with the install script. I did the same mistake :roll:

In other words, download the zip file from the green "Code" button, unpack it and install.

Of course, you can do as you've done, but having a launcher comes handy.

pdf reader: which one?

Posted: 13 Nov 2023, 09:32
by rych
M. Eerie, Yes, I had the resources folder and all: it just didn't like running under root :) It expected a normal user's Home folder paths etc. Anyway, I actually prefer my pdfs to open along my other tabs in my current Firefox session. I don't want a separate customized Firefox window and a new Firefox profile messing with my userChrome.css, user.js and so on trying to make it resemble a standalone pdf viewer -- too hacky. In my new integrated workflow, I open web pages, web-based pdfs, and local pdfs as tabs in the same browser.

pdf reader: which one?

Posted: 13 Nov 2023, 15:01
by Kulle
rych wrote: ↑
Just specify Firefox as the system default pdf viewer
How is that to be done?

pdf reader: which one?

Posted: 14 Nov 2023, 05:29
by Rava
Kulle wrote:
13 Nov 2023, 15:01
How is that to be done?
Open your DE's file browser as guest.
In my case - xfce - that is by default thunar, but I use nemo instead. In both cases it works the same. Go with your file browser into any folder that contains a pdf file, right-click on that pdf file (aka "context menu") unless your mouse is set to left-handed, then it should be a left-click I presume and select this:
Image
and choose the "other application" you want to open pdf files.

pdf reader: which one?

Posted: 14 Nov 2023, 09:24
by rych
Kulle wrote:
13 Nov 2023, 15:01
Just specify Firefox as the system default pdf viewer
How is that to be done?
Yes, I did same as Rava, using the SpaceFM context menu right-clicking on a pdf. Easy. Actually that's the only way I've learnt so far after 10 years using Linux. For example, I've tried to be thorough by amending the firefox.desktop with

Code: Select all

MimeType=...;application/pdf;
but that didn't even make Firefox appear in the context list of registered pdf handlers. So I had to go to Choose...>All Apps> Firefox ticking the "Save as default application for this file type". Now it does appear, and is the first choice, default for double-clicking.

pdf reader: which one?

Posted: 14 Nov 2023, 10:52
by Kulle
Thanks Rava and rych,
that's simple.
I should have known that myself

pdf reader: which one?

Posted: 18 Nov 2023, 04:18
by rych
rych wrote:
13 Nov 2023, 08:47
Kulle wrote: ↑
10 Nov 2023, 19:13
Firefox has a good built-in PDF reading and editing tool
Mozilla has updated the PDF viewer in Firefox 119

Wow, it's now very nice indeed.
I was perhaps too enthusiastic. While it handles simple textual pdfs nicely, the graphics heavy magazine pdfs fail to render past a few pages, then those pages are forever busy loading too. I guess it runs out of cache or memory to handle heavy pdfs. At least it didn't crush the whole Firefox, just needed to close that tab. So, for fast opening of simple pdfs -- Firefox is great. Otherwise, use a dedicated PDF viewer/editor.