summaryrefslogtreecommitdiff
path: root/poppler
AgeCommit message (Collapse)AuthorFilesLines
10 daysUpdate (C)HEADmasterAlbert Astals Cid3-2/+3
11 daysFix text position in drawSignatureFieldTextNicolas Fella1-1/+1
When centering vertically we calculate the y offset based on the height of the text and the annotation When doing that we must ignore the border width, otherwise the text is offset downwards
11 daysTake border into account also for height when determining signature font sizeNicolas Fella1-2/+3
The border reduces the available height, so take it into account for the height too, not only the width
13 daysAssume "Adobe-Identity" for character collectionNelson Benítez León1-9/+13
When 'CIDSystemInfo' dictionary is absent or has invalid content, instead of aborting the font because we cannot read the character collection, let's assume in that case character collection to be "Adobe-Identity". Fixes #1465 - Does not show text of Apple-edited PDFs
2024-04-05Update (C)Albert Astals Cid3-3/+3
2024-04-04Remove GooString::startsWith and GooString::endsWithOliver Sander3-6/+6
Starting with C++20, the std::string class has methods starts_with and ends_with, which do the same thing. Use those instead.
2024-03-31reset clipping path when the state is restoredNelson Benítez León1-0/+1
According to the specification, see NOTE 2 in https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf#G7.3882161 it appears that the clipping path should be reset when the restore (Q) operator is encountered. Fixes #739
2024-03-31CI: Use Fedora for clazy, it's newer and built against a newer clangAlbert Astals Cid1-1/+1
2024-03-31Update (C)Albert Astals Cid2-1/+3
2024-03-30Reduce worst case algorithmic complexity of TextBlock::coalesceStefan Brüns1-49/+60
The old algorithm restarts the inner loop for the RHS word from the beginning on each match, i.e. the worst case complexity approaches O(N^3), while O(N^2) is obviously sufficient for a pairwise compare of all words. Fortunately, O(N^2) is hardly ever happening, as the inner N is limited by a) the maxBaseIdx, b) removing duplicates from the set. For some pathological cases this changes the runtime from minutes to seconds. See poppler#1173.
2024-03-30Reduce TextWord space and allocation overheadStefan Brüns2-223/+197
Currently, the word characters are allocated as a struct of arrays, e.g. text and charcode are allocated separately. This causes some space (6 pointers, 6 malloc chunk management words (size_t/flags), alignment, ...) and runtime overhead (6 allocs/ frees per word). Changing this to an array of struct reduces this overhead. It also allows to be more conservative with allocations, as resizing is less costly, i.e. starting with a single character allocation instead of 16. It is also more efficient, as most accesses affect multiple or all attributes, i.e. values in the same or neighboring CPU cache lines. Using a std::vector instead of separate raw arrays also reduces code and manual data management. The "charPos end index" and trailing "edge" attributes are no longer stored as an additional entry entry in the array, but as dedicated data members, `charPosEnd` and `edgeEnd`. The memory saving is most notably for short words, but even for words with 16 characters there are small savings, and still less allocations (1 + 4 allocations instead of 6. Growing is fairly cheap, as the CharInfo struct is trivially copyable.) See poppler#1173.
2024-03-30Fix clang-tidy-17 "unnecessary temporary object created while calling ↵Albert Astals Cid1-2/+2
emplace_back" Says modernize-use-emplace No need to pass the c, we will set it later so we can just use the default constructed CharCodeToUnicodeString
2024-03-30Fix text search across lines between paragraphsNelson Benítez León1-24/+36
This commit fixes the "across lines" text search feature of TextPage::findText() when the match happens from the last line of a paragraph to the first line of next paragraph. Includes tests for this bug. Fixes #1475 Fixes https://gitlab.gnome.org/GNOME/evince/-/issues/2001
2024-03-30Fix regression on issue #157Nelson Benítez León1-12/+14
Redo the fix for issue #157 which is about doing transparent selection for glyphless documents (eg. tesseract scanned documents) because it stopped working after commit 29f32a47
2024-02-22Update (C)Albert Astals Cid1-0/+1
2024-02-22Fix regression on encrypted files being repairedNelson Benítez León1-1/+1
Some encrypted files which need repairing (see links below) failed to open due to a regression introduced in commit b3e86dbdba where an 'if condition' was added that's hit by encrypted files which need repairing. The removal of this 'if condition' does not affect the original buggy file that commit b3e86dbdba targeted[1]. This commit also adds Qt5 and Qt6 tests for opening an encrypted pdf file affected by this issue. Fixes #1447 Fixes https://gitlab.gnome.org/GNOME/evince/-/issues/1889 Regression issue: https://bugs.freedesktop.org/show_bug.cgi?id=14303 [1] which can be found in this duplicate: https://bugs.freedesktop.org/show_bug.cgi?id=14399
2024-02-22Update (C)Albert Astals Cid3-3/+3
2024-02-20Gfx::doImage(): avoid integer overflow if width * height > INT_MAXEven Rouault1-1/+1
Related to https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=66523
2024-02-20SplashOutputDev::drawImageMask(): early break if getLine() failsEven Rouault1-1/+3
Related to https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=66523
2024-02-20ImageStream::getLine(): check that imgLine is not nullEven Rouault1-1/+1
Related to https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=66523
2024-02-18Update (C)Albert Astals Cid5-2/+5
2024-02-18DateInfo: Add timeToStringWithFormat for using a custom format stringErich E. Hoover2-8/+31
2024-02-18Form: Allow signDocumentWithAppearance to autocalculate the font sizeErich E. Hoover1-1/+33
2024-02-18Annot: Pull out the font size calculator into a separate routineErich E. Hoover2-23/+33
2024-02-13Update (C)Albert Astals Cid1-0/+1
2024-02-13Gfx::doImage: skip drawing image when it has singular matrixNelson Benítez León1-1/+6
otherwise it will result in broken output in Cairo backend. Splash backend already works fine for this case because it checks for singular matrix in Splash::drawImage(). This commit adds that check early in Gfx::doImage() which fixes the Cairo backend and for Splash backend means a perf improvement by avoiding lot of color computation and image preparation done in SplashOutputDev::draw{Image,ImageMask,MaskedImage,softMaskedImage} prior to calling Splash::drawImage which is the one that checks singular matrix and skips. Note: singular matrix case is not mentioned in PDF spec but Xpdf and other pdf readers de-facto do as in here i.e. skip drawing an image when it has a singular (non invertible) matrix. Fixes issue #1114
2024-02-08Update (C)Albert Astals Cid2-0/+2
2024-02-08Fix directory traversal in pdfdetachSune Vuorela2-3/+3
A carefully crafted pdf file could lead to writing files in wrong places of the file system by using pdfdetach. Thanks to jwilk for spotting the issue. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1026908
2024-02-08Use an enum for Function getTypeAlbert Astals Cid3-21/+24
2024-02-06Use more vectors and less owning pointers + lengthSune Vuorela2-156/+35
Also remove a couple of unreferenced functions.
2024-02-05Microoptimization in parsehexSune Vuorela1-3/+4
parsehex is quite a hot codepath when loading documents. Various experiments shown that this let the compiler generate slightly faster code.
2024-02-02inline UnicodeIsValidSune Vuorela2-6/+4
While profiling document loading, a lot was hitting this function; try let the compiler be smarter.
2024-02-01Update (C)Albert Astals Cid9-2/+9
2024-02-01More unicode vectors; fewer raw pointersSune Vuorela9-160/+100
2024-01-31Update (C)Albert Astals Cid1-0/+1
2024-01-31Use FcPatternGetCharSet to fast skip fonts in findSystemFontFileForUCharKeyu Tao1-1/+6
2024-01-26Fix setting annotpolygon interior color to emptyAlbert Astals Cid1-1/+4
2024-01-26Fix saving annotgeometry interior color when it's emptyAlbert Astals Cid1-0/+1
KDE bug #479732
2024-01-26Remove unneeded commentNelson Benítez León1-1/+0
2024-01-25Update (C)Albert Astals Cid1-0/+1
2024-01-25Fix small oversight from b8de1a191Nelson Benítez León1-0/+1
There was one 'bytecounter increase' case that was not imported from the Xpdf code. That caused some JPEG streams fail to render when hitting that codepath, like the file 'p1.blank_with_poppler.pdf' posted on issue #1319 Fixes #1319
2024-01-25Update (C)Albert Astals Cid1-1/+1
2024-01-24Make stream compression non-optionalSune Vuorela1-2/+4
Requires the users to think if their stream is compressed or not and if it is a good idea to compress or not, rather than default to 'not compressed'
2024-01-23Update (C)Albert Astals Cid1-0/+1
2024-01-23Compress images when addedSune Vuorela1-3/+3
2024-01-23Update (C)Albert Astals Cid1-0/+1
2024-01-18TextPage::takeText: reset actualText for the new pageAdam Sampson1-0/+2
actualText has an internal pointer to the TextPage it's writing to, so if you called takeText and then continued to output more pages to the TextOutputDev, their text would be written to the page you'd taken rather than the new one.
2024-01-02Welcome 2024Albert Astals Cid1-1/+1
2023-12-29Fix infinite loop in HorizontalTextLayouter if there's not enough space to ↵Albert Astals Cid1-1/+1
layout text #2 Happens only if the first chracter we're asking to draw can't be drawn with the given font and we need to find a new one and the given available space is negative (as said this function must always layout at least one character)
2023-12-28Fix infinite loop in HorizontalTextLayouter if there's not enough space to ↵Albert Astals Cid1-1/+3
layout text Happens only if the first chracter we're asking to draw can't be drawn with the given font and we need to find a new one