unrud / djpdf Goto Github PK
View Code? Open in Web Editor NEWCreate small, searchable PDFs from scanned documents
License: GNU General Public License v3.0
Create small, searchable PDFs from scanned documents
License: GNU General Public License v3.0
Hi. Please look for this application (Java) if useful to you or not. It's developer stop from it's development. In fact it need some further new features to be a great application with complete PDF editing powers. It is jPDFTweak:
http://jpdftweak.sourceforge.net/
https://sourceforge.net/projects/jpdftweak/
It is a great crime not to have advanced PDF editor on Linux while we have such great backends like: QPDF & OCRmyPDF & such powerful Java GUI program like jPDFTweak ......
Looks like a nice tool, thanks. I'm running scans2pdf
on the output of scantailor-advanced
. Some exceptions occurred, so here is the output of running it on the first page. I can provide the image if it would be useful.
Note that ubuntu 22.04 has a snap providing jbig2enc
, while you're looking for jbig2
.
$ scans2pdf -v Feigon-001-000.crop_2R.tif scans2.pdf
WARNING:Program not found: jbig2
DEBUG:Using selector: EpollSelector
DEBUG:Running command: ['convert', '-colorspace', 'sRGB', '-profile', '/home/user/.local/pipx/venvs/djpdf/lib/python3.10/site-packages/djpdf/argyllcms-srgb.icm', '-background', '#ffffff', '-alpha', 'remove', '-alpha', 'off', '-type', 'TrueColor', '/home/user/Feigon-001-000.crop_2R.tif', '/var/tmp/djpdf-xwxq05cu/image.png']
DEBUG:convert-im6.q16: profile 'icc': 'RGB ': RGB color space not permitted on grayscale PNG `/var/tmp/djpdf-xwxq05cu/image.png' @ warning/png.c/MagickPNGWarningHandler/1668.
DEBUG:Running command: ['convert', '-fill', '#000000', '-opaque', '#000000', '-fill', '#000000', '-opaque', '#000000', '-threshold', '0', '/var/tmp/djpdf-xwxq05cu/image.png', '/var/tmp/djpdf-nma9ouby/image.png']
DEBUG:Running command: ['identify', '-units', 'PixelsPerInch', '-format', '%x %y', '/var/tmp/djpdf-xwxq05cu/image.png']
DEBUG:Running command: ['convert', '-fill', '#ffffff', '-opaque', '#000000', '-resize', '50%', '/var/tmp/djpdf-xwxq05cu/image.png', '/var/tmp/djpdf-_4oeppyf/image.png']
DEBUG:Running command: ['identify', '-format', '%w %h', '/var/tmp/djpdf-xwxq05cu/image.png']
DEBUG:Running command: ['convert', '-format', '%c', '/var/tmp/djpdf-nma9ouby/image.png', 'histogram:info:-']
DEBUG:Running command: ['convert', '-format', '%c', '/var/tmp/djpdf-_4oeppyf/image.png', 'histogram:info:-']
DEBUG:Running command: ['convert', '-fill', '#000000', '-opaque', '#000000', '-fill', '#000000', '-opaque', '#000000', '-threshold', '0', '/var/tmp/djpdf-xwxq05cu/image.png', '/var/tmp/djpdf-0h9szie5/image.png']
DEBUG:Running command: ['tesseract', '-l', 'eng', '--dpi', '600', '/var/tmp/djpdf-0h9szie5/image.png', '/var/tmp/djpdf-hogdbirb/ocr', 'hocr']
DEBUG:Tesseract Open Source OCR Engine v4.1.1 with Leptonica
INFO:Can't extract textangle from ocr_line: bbox 716 941 826 987; baseline 0 0; x_size 61; x_descenders 15.25; x_ascenders 15.25
DEBUG:Exception occurred:
Traceback (most recent call last):
File "/home/user/.local/pipx/venvs/djpdf/lib/python3.10/site-packages/djpdf/hocr.py", line 46, in extract_text
textangle = textangle_regex.search(line.attrib["title"]).group(1)
AttributeError: 'NoneType' object has no attribute 'group'
INFO:Can't extract textangle from ocr_line: bbox 643 1005 898 1043; baseline -0.008 -6; x_size 37; x_descenders 7; x_ascenders 8
DEBUG:Exception occurred:
Traceback (most recent call last):
File "/home/user/.local/pipx/venvs/djpdf/lib/python3.10/site-packages/djpdf/hocr.py", line 46, in extract_text
textangle = textangle_regex.search(line.attrib["title"]).group(1)
AttributeError: 'NoneType' object has no attribute 'group'
DEBUG:Running command: ['convert', '-alpha', 'remove', '-alpha', 'off', '-colorspace', 'gray', '-threshold', '50%', '-compress', 'fax', '/var/tmp/djpdf-nma9ouby/image.png', '/var/tmp/djpdf-82nt536j/image.pdf']
DEBUG:Running command: ['qpdf', '--stream-data=preserve', '--object-streams=preserve', '--normalize-content=n', '--newline-before-endstream', '--linearize', '/var/tmp/djpdf-1p_vtodx/temp.pdf', '/home/user/scans2.pdf']
I creat .pdf from .jpg but without searchable function. By the way I'd like to ask a polish language in OCR.
Because of limited resources it is not possible for me to install djpdf with the gui-dependencies. As far as I can see, djpdf without gui would be rather small. Would it be possible to make a cli-only version? (I don't know any other cli-tool to generate pdfs from scans with foreground-background-separation. And djvu isn't an option in my workflow.)
djpdf should never use jbig2 to compress. While JBIG2 compression is good, it can produce erroneous document by substituting one shape with another:
See https://en.wikipedia.org/wiki/JBIG2#Disadvantages and the associated references.
Hi. I detect your application from my monitoring for Flathub on GitHub. Your application still not appearing in Flathub & for that I'm still not installing it & not test it yet.
However, I'm very interested in development of advanced PDF editor for Linux. Specially, I'm interested in PDF tools that able to manipulate & optimized scanned PDF files .....
Your application seem to be at heart of my interest ! For that I like to bring your attention to very strong backend I see it useful for your application. I'm not sure since I'm not programmer but externally it seem very useful to you. Please see it:
https://pypi.org/project/ocrmypdf/
https://github.com/jbarlow83/OCRmyPDF
Look for it's options !
Hi. if you are interested in creation an advanced PDF editor for Linux (which currently the only lack of Linux) then please look for this backend:
https://github.com/qpdf/qpdf
http://qpdf.sourceforge.net/
https://sourceforge.net/projects/qpdf/
Look for it's manual:
http://qpdf.sourceforge.net/files/qpdf-manual.html
http://qpdf.sourceforge.net/files/qpdf-manual.pdf
What it will be a GUI for this backend including ALL it's powers & functions ? It will be what Linux currently miss ....
It will be very helpful for peoples if you expand your application from just an OCR & optimizer for scanned PDF to full featured PDF editor.
How can translations be provided to this project?
Can translations for this project be hosted on Weblate?
Thank you
I can't find where to set the default settings in the UI to keep the images are 100%.
I also expected this to be the default.
Two parts were the is very little feedback from the UI:
Please add keyboard shortcuts/accelerators.
For example:
&Remove
&Quality
&Language
Apply to &all
Apply to &following
&Load default settings
&Save default settings
&Cancel
&OK
What do you think?
Thank you
After I installed via snap on ubuntu 18.04 all I have is a blank window see image
I ran it with the command line djpdf
and got the following
QStandardPaths: XDG_RUNTIME_DIR points to non-existing path '/run/user/1000/snap.djpdf', please create it with 0700 permissions.
QStandardPaths: XDG_RUNTIME_DIR points to non-existing path '/run/user/1000/snap.djpdf', please create it with 0700 permissions.
file:///snap/djpdf/7/lib/python3.6/site-packages/PySide2/Qt/qml/QtQuick/Dialogs/DefaultFileDialog.qml:102:33: QML Settings: Failed to initialize QSettings instance. Status code is: 1
file:///snap/djpdf/7/lib/python3.6/site-packages/PySide2/Qt/qml/QtQuick/Dialogs/DefaultFileDialog.qml:102:33: QML Settings: The following application identifiers have not been set: QVector("organizationName", "organizationDomain")
file:///snap/djpdf/7/lib/python3.6/site-packages/PySide2/Qt/qml/QtQuick/Dialogs/DefaultFileDialog.qml:102:33: QML Settings: Failed to initialize QSettings instance. Status code is: 1
file:///snap/djpdf/7/lib/python3.6/site-packages/PySide2/Qt/qml/QtQuick/Dialogs/DefaultFileDialog.qml:102:33: QML Settings: The following application identifiers have not been set: QVector("organizationName", "organizationDomain")
Can anyone help please?
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.