epub_open wants an utf8 in Windows
It probably also wants utf8 in Linux, but the qPrintable already gives
us an utf8 in most of the normal Linux locales, so don't touch that
BUGS: 448274
Turns out some files contain images saved in the xps archive as a directory containing multiple pieces, the first one being the image itself and the second one being empty.
Of course this is quite a weird way to save an image, but it seems that it still is valid and other viewers are able to load it correctly.
This change fixes the loading of multipiece images.
(cherry picked from commit 3506fb2ea8)
Turns out some files contain images saved in the xps archive as a directory containing multiple pieces, the first one being the image itself and the second one being empty.
Of course this is quite a weird way to save an image, but it seems that it still is valid and other viewers are able to load it correctly.
This change fixes the loading of multipiece images.
e.g. the ones in poppler issue 824
The PDF spec doesn't say (or I couldn't find it) how a user entered
string is converted to the byte array needed for password checking, so
we try both latin1 and utf8
I'm going to need to break binary compatibility to add a new feature
so may as well cleanup all the TODOs regarding that
Changes:
* Moving a few destructors to the header
* Removing a few unnecessary & in params
* Adding a few necessary & in params
* Making print return an enum instead of a bool and then having another
function that returns the enum
* Make Generator::requestFontData be a virtual
* Remove unused enum
* Remove a few filePrinter unneeded functions
* Remove unused TextDocumentGenerator::addMetaData signal
If we have code like <a><img></a><a><img></a> and the img has alt text
The old code did
remove image
insert alt text
but when we remove the image, the qtextdocument says
"i don't need the <a> anymore since there's nothing inside"
and then everything breaks because the layout has changed and we're
iterating over "unexisting" text blocks
So instead we just insert the alt text and
since we have selected the image with the cursor it will
replace it correctly
BUGS: 444971
By using Poppler 20.10 new custom image stamps APIs
Instead of the incompatible hack we used before that only worked for Okular.
This is done by modifying the update function used by PopplerAnnotationProxy in order to load the image in
the correct dimensions and send it to the poppler-Qt5 frontend.
We temporarily store the stamp annotation appearance when deleting it so that we can set it again when doing an undo undo.
This is sub-optimal since will not check if the certificate has been
revoked but is more privacy friendly since doesn't leak to the
certificate authority server that you're trying to validate a given
certificate
Okular implements various print scaling options that require the use of
the "Force rasterization" feature or else they have no effect. However
this is not communicated in the UI anywhere or handled automatically,
leading to users being confused and frustrated when the print scaling
option they chose didn't work. It wastes paper too.
This commit causes the "Force rasterization" checkbox to become checked
automatically whenever the user selects a print scaling option that
requires it, and unchecked if they return to the default scaling mode
that does not require it.
BUG: 434247
FIXED-IN: 21.08.2