Pdf To Djvu

0 views
Skip to first unread message
Message has been deleted

Kuldip Mansager

unread,
Jul 14, 2024, 7:04:36 PM7/14/24
to xicuphilul

I've downloaded some files from the Internet Archive. They come in different file formats and most of the time I use PDF. However, sometimes the scans are saved in colour instead of black & white. This makes it difficult (or impossible) to read on a dedicated e-book reader. In that case I downloaded the DjVu files, as on the PC you can select which layer (colour, bw, foreground, background) one would like to see.

pdf to djvu


DOWNLOAD https://vittuv.com/2yRSoX



Select black & white in the DjVu viewer on the PC and print to a PostScript file. Followed by a ps2pdf conversion. This works, but generates a fairly large PDF file. Sure, I can again upload it to any2DjVu but it just seems to much manual work for each file.

The program you want is djvups. Just like its name suggests, it'll convert from DjVu to PostScript, with the bonus of letting you select which layers to retain (all, foreground, background, or foreground mask). Try this:

There is a method, that does not involve inflating the file. I'll assume a single page file for simplicity. Maybe the method can be adapted to multiple pages as well. First list the chunks in your file using djvudump. A typical output will look like this:

You could use ddjvu, in a shell script. That said, the output PDFs are much larger (x10), which makes it hardly worth the effort. Ubuntu has no problem reading djvu files, but if your reason is good enough, use the following script.

Warning: Do not try it on 200 files right away. Run a test first on one or two small ones, to get the feel of how long it takes, and to make sure you are satisfied with the result. Press Ctrl + C, in case you want to stop the process.

Simply run that in a folder with djvu files. The -scale=100 option downscales the output images, which makes the process much faster, and the output files' size more reasonable. Without it, the resulting PDFs were much larger then the originals, and took ages to convert, at least in my tests.

Personally I really like Calibre, which is a great for managing, converting, synching, sharing and editing ebooks. You can do batch conversions with it and djvu to PDF is supported.To install, just enter the following via cli:

When Malwarebyte anti-Malware scanned a particular folder, it picked up a file named "DjVuReader.exe" as a Threat (Trojan.Agent) in Category Malware. Googling the file name shows that there is a file, a Windows App, with the same name in Microsoft Store -us/store/apps/djvu-reader/9wzdncrdcsmz. I also uploaded the file to for scan and result suggests that only Malwarebyte marks it as Trojan Agent (all other 56 programs consider it safe).

(c) It's strange that the regular whole computer Malwarebyte scan did NOT pick up this Trojan. It only picked up the file as a Trojan after I selected the folder and did a folder-specific scan. Should I do a folder-by-folder scan, instead of the whole computer scan?

OK, that is the executable itself to allow those study cards to display images in djVU format - it should be safe enough. As long as you submitted that exact file, the djVUReader.exe, to VirusTotal and nothing was found on it, you should be good.

This might also have occurred because that may be an older version of that particular product, something you may want to look into by checking the version number of that program (we're pretty sure it's safe now that I see that it seems that this is a part of your flash cards - note the typeface, though - I'm not 100% sure it is safe, only reasonably sure) from the developer's website. Here is the link for their website:

If you get the above one, you'll need a program that can extract .RAR files (7-zip can do it, so can WinRAR, although WinRAR is a free trial, whereas 7-Zip is free). You can then extract that to a folder, check that folder with MBAM and if it does not cause issues, simply copy that file over the one in your flash cards folder and you should be set.

If you are interested in alternatives, there is this link where you might be able to find another viewing program that you feel safer with - but that might break your flash card application unless you are able to manually specify which djVU reader you want to use in the settings:

If you think the file detection is a false positive, you may wish to upload the scan log AND an archived (zip, rar, etc.) version of the exe in the F/P section HERE.
The Research Team will evaluate the data and adjust the file detection, if needed.
(More information HERE.)

My question is: Can I update glibc and install above dependencies and continue to run Rocky without any clashes in dependencies etc.? I have seen some webpages indicating updating glibc should be OK since versions are supposed to be backward compatible, but I thought I will ask here anyway.

If package has been built for the platform (here Rocky), then that (dnf install) should be the first option.
If package is from unknown source and would replace/remove already installed system packages, then be sceptic.

@tkuraku
thanks for dropping by and offering to help.
I do recall installing either this or snap in the last iteration of my computer and it had been probably too heavy - i.e. too much disk space. I am sorry, my memory fails me.
What I do recall is that uninstalling it was not possible for me, at least with the limited understanding I have of Linux.

For my own and others benefit, I request you to please show/share this method of build/rebuild the binary package for Rocky. I have checked on this forum, but could not locate a discussion on this (basic?) step.
Considering I have build from sources for R-Studio, I will appreciate (as always) your guidance on how to do this for Rocky

@tkuraku
Thank you for clarification. I tried, and installed flatpak and evince via flatpak. My djvu file can now be accessed via the flatpak evince.
Apparently, there was some other evince also - which did not run the djvu file - as you have pointed out from your last message.

For anyone who tries using evince via flatpak,
You will probably install flatpak - using root.
You will also search and install evince on flatpak - using root.
you will fire up evince via flatpak using (in my case) flatpak run org.gnome.Evince (again in root)
You will find that evince opens up and allows you to open a valid djvu file.

For djvu files, I enjoy reading it in djview, because when I search for some words, it can show where all the results are at a glance, and highlight them simultaneously. This is much more convenient than the searching functionality in evince for pdf files.

But for a single file (pdf or djvu), I have to create two files (one in pdf, and the other in djvu) and open them in djview and xournal (and maybe also in evince), in order to achieve the two benefits I outlined above.

I haven't tried many other functionalities of djview, xournal and evince, neither have I tried many applications yet. Do you have some convenience ways to achieve what I hope to do and possibly more which I haven't mentioned yet?

I recommend PDF-Xchange Editor (installable in Linux through Wine). It functions both as a good viewer, allowing you to open multiple files in tabs. The UI is fantastic. And best of all, it stores annotations/comments within the file, unlike Okular. How to install?

Although it is not the easiest way to get started (but still quite easy), if you really like annotation power, then check out Emacs (or Spacemacs) with pdf-tools. It provides a zathura like reading experience (although much more powerful), but with very good annotation features (even more powerful annotation features via pymupdf-mode). Also it provides a djvu reader and djvu annotation features via djvu.el (or the experimental djvu2.el). In addition it provides org-mode, a very powerful note taking library, which can be fully integrated with pdf and djvu note taking (e.g. via org-noter).

Starting from vanilla Emacs it takes probably about an hour before you have all setup for annotating. However, starting with Spacemacs, you can start annotating within 10 minutes just installing Emacs, Spacemacs and the pdf layer.

Spacemacs provides evil, an implementation of the Vim editor, with the Emacs programming platform, to provide a very well intergrated allround computing experience (This sounds a little vague but summing up what Emacs can do here would take too much space. You will see it when you start using it). But you can just use it as a zathura like reader with annotation features (somewhat like mupdf-gl, but less cumbersome).

For PDF files, you can use PDF Studio Viewer. It can review and markup PDFs with different annotations such as text, markup, shapes, etc.. And the advanced search dialog can show all the occurrences of a string in a document.

since last Mac OS Sierra update (10.12.2, on december 14th 2016), finder seems to have a major issue when opening folders containing djvu files: the color wheel appears and finder almost freezes. Are you facing the same issue or is it a local problem from my MacBook Pro?

I have this issue too. That Finder becomes incredibly slow when opening directories that have djvu files. Trying to copy, rename or do anything with the files becomes almost impossible. Someone mentioned that the most recent update to DJView fixed this. But not for me, unfortunately. I have tried various different approaches to resolving this, but nothing has worked. I think it is an issue with the implementation of Finder.

thank you for the answer. Unfortunately, I already tried several times a safe mode reboot, with no improvement. Opening folders containing djvu files always causes troubles to the Finder (but no problem viewing the files themselves with a djvu reader). Before realizing that the problem came from djvu files, I followed other suggestions (as removing some specific files in the Library/Cache/CloudKit directory or the com.apple.finder.plist in Library/Preferences/ directory) with no success. Another Apple Support Communities user seems to face the same issue (djvu file causes iconservicesagent to exhaust cpu on macos sierra).

59fb9ae87f
Reply all
Reply to author
Forward
0 new messages