Releases: pypdfium2-team/pypdfium2
5.0.0b1
Changes (Release 5.0.0b1)
Summary (pypdfium2)
API changes
- Rendering / Bitmap
- Removed
PdfDocument.render()
(see deprecation rationale in v4.25 changelog). Instead, usePdfPage.render()
with a loop or process pool. - Removed
PdfBitmap.get_info()
andPdfBitmapInfo
, which existed mainly on behalf of data transfer withPdfDocument.render()
. Instead, take the info from thePdfBitmap
object directly. (If using an adapter that copies, you may want to store the relevant info in variables to avoid holding a reference to the original buffer.) PdfBitmap.fill_rect()
: Changed argument order. Thecolor
parameter now goes first.PdfBitmap.to_numpy()
: If the bitmap is single-channel (grayscale), use a 2d shape to avoid needlessly wrapping each pixel value in a list.PdfBitmap.from_pil()
: Removedrecopy
parameter.
- Removed
- Pageobjects
- Renamed
PdfObject.get_pos()
to.get_bounds()
. - Renamed
PdfImage.get_size()
to.get_px_size()
. PdfImage.extract()
: Removedfb_render
option because it does not fit in this API. If the image's rendered bitmap is desired, use.get_bitmap(render=True)
in the first place.
- Renamed
PdfDocument.get_toc()
: ReplacedPdfOutlineItem
namedtuple with method-oriented wrapper classesPdfBookmark
andPdfDest
, so callers may retrieve only the properties they actually need. This is closer to pdfium's original API and exposes the underlying raw objects. Provides signed count as-is rather than splitting inn_kids
andis_closed
. Also distinguishes betweendest is None
and a dest with unknown mode.- Renamed misleading
PdfMatrix.mirror()
parametersv, h
toinvert_x, invert_y
, as the terms horizontal/vertical flip commonly refer to the transformation applied, not the axis around which is being flipped (i.e. the previousv
meant flipping around the Y axis, which is vertical, but the resulting transform is inverting the X coordinates and thus actually horizontal). No behavior change if you did not use keyword arguments. get_text_range()
: Removed implicit translation of default calls toget_text_bounded()
, as pdfium revertedFPDFText_GetText()
to UCS-2, which resolves the allocation concern. However, callers are encouraged to explicitly useget_text_bounded()
for full Unicode support.- Removed legacy version flags.
Improvements and new features
- Added
PdfPosConv
andPdfBitmap.get_posconv(page)
helper for bidirectional translation between page and bitmap coordinates. - Added
PdfObject.get_quad_points()
to get the corner points of an image or text object. - Exposed
PdfPage.flatten()
(previously semi-private_flatten()
), after having found out how to correctly use it. Added check and updated docs accordingly. - With
PdfImage.get_bitmap(render=True)
, addedscale_to_original
option (defaults to True) to temporarily scale the image to its pixel size. Thanks to Lei Zhang for the suggestion. - Added context manager support to
PdfDocument
, so it can be used in awith
-statement, because opening from a file path binds a file descriptor (usually on the C side), which should be released explicitly, given OS limits. - If document loading failed,
err_code
is now assigned to thePdfiumError
instance so callers may programmatically handle the error subtype. - In
PdfPage.render()
, added a new optionuse_bgra_on_transparency
. If there is page content with transparency, using BGR(x) may slow down PDFium. Therefore, it is recommended to set this option to True if dynamic (page-dependent) pixel format selection is acceptable. Alternatively, you might want to use only BGRA viaforce_bitmap_format=pypdfium2.raw.FPDFBitmap_BGRA
(at the cost of occupying more memory compared to BGR). - In
PdfBitmap.new_*()
methods, avoid use of.from_raw()
, and instead call the constructor directly, as most parameters are already known on the caller side when creating a bitmap. - In the rendering CLI, added
--invert-lightness --exclude-images
post-processing options to render with selective lightness inversion. This may be useful to achieve a "dark theme" for light PDFs while preserving different colors, but goes at the cost of performance. (PDFium also provides a color scheme option, but this only allows you to set colors for certain object types, which are then forced on all instances of the type in question. This may flatten different colors into one, leading to a loss of visual information.) - Corrected some null pointer checks: we have to use
bool(ptr)
rather thanptr is None
. - Improved startup performance by deferring imports of optional dependencies to the point where they are actually needed, to avoid overhead if you do not use them.
- Simplified version classes (no API change expected).
Platforms
- Experimental Android support added (cf. PEP 738).
arm64_v8a
,armeabi_v7a
,x86_64
,x86
are now handled in setup and should implicitly download the right binaries. We do not publish any android wheels at this time (for one thing, PyPI/warehouse does not support them yet). However, we might want to packagearm64_v8a
(and maybearmeabi_v7a
) wheels in the future. Note, android support is provided on a best effort basis, and largely untested (only arm64 Termux prior to PEP 738 has been tested on the author's phone). Please report success or failure. - Experimental iOS support added as well (cf. PEP 730).
arm64
device and simulator, andx86_64
simulator are now handled and should implicitly download the right binaries. However, this is untested and may not be enough to get all the way through. In particular, the PEP hints that the binary needs to be moved to a Frameworks location, in which case you'd also need to change the library search path. No iOS wheels will be provided at this time. However, if there are testers and an actual demand, iOS arm64 wheels may be enabled in the future. - Note, we have no intent to package wheels for the simulators (
android x86_64/x86
,ios arm64_simu/x86_64
), as they are only relevant to developers, and installing from source with implicit binary download should be roughly equialvent.
Setup
- Avoid needlessly calling
_get_libc_ver()
. Instead, call it only on Linux. A negative side effect of calling this unconditionally is that, on non-Linux platforms, an empty string may be returned, in which case the musllinux handler would be reached, which uses non-public API and isn't meant to be called on other platforms (though it seems to have passed). - If packaging with
PDFIUM_PLATFORM=sourcebuild
, forward the platform tag determined bybdist_wheel
's wrapper, rather than using the underlyingsysconfig.get_platform()
directly. This may provide more accurate results, e.g. on macOS.
Project
- Made the runfile fail fast and propagate errors via bash
-eu
. This is actually quite important to avoid potentially continuing on a broken state in CI. - CI: Added Linux aarch64 (GH now provides free runners) and Python 3.13 to the test matrix.
- Merged
tests_old/
back intotests/
. - Migrated from deprecated
.reuse/dep5
/.reuse/dep5-wheel
to more visibleREUSE.toml
/REUSE-wheel.toml
. - Docs: Improved logic when to include the unreleased version warning and upcoming changelog.
- Bumped minimum pdfium requirement in conda recipe to
>6635
(effectively>=6638
), due to new errchecks that are not version-guarded. - Cleanly split out conda packaging into an own file, and confined it to the
conda/
directory, to avoid polluting the main setup code.
pypdfium2 commit log
Commits between 4.30.1
and 5.0.0b1
(latest commit first):
8ea3c9f
[autorelease main] update 5.0.0b1c439329
fix typos6d04fac
Take out android for now28ef5b3
docs/conf.py: take out problematic assertion936314f
CI/debugging: addverbose: true
0882a90
conda_raw: fix upload pathefcf088
conda_raw: temporarily comment out schedulee2a760e
fix spelling029327a
v5 devel branch (#307)9e55a45
Comment TestPyPI back in
PDFium commit log
Commits between 6899
and 6996
(latest commit first):
012fe571c
Fix unnecessary tree traversal in SearchNameNodeByNameInternal()3c2bfd785
Refactor SearchNameNodeByNameInternal()a9f2f0f33
Use CIDToGIDMap to fill font widths in FPDFText_LoadCidType2Font()- [
0d2d104ba
](https://pdfium.googlesource.com/pdfium/+/0d2d104ba14aee8d9...
4.30.1
Changes (Release 4.30.1)
Summary (pypdfium2)
PdfPage.get_objects()
: Don't register pageobjects as children, because they don't need to be closed by the caller when part of a page. This avoids excessive caching of weakrefs that are not cleaned up with the object they refer to.- Fixed another dotted filepath blunder in the
extract-images
CLI. (ThePdfImage.extract()
API is not affected this time.) - Adapted setup code to
bdist_wheel
relocation (moved from wheel to setuptools). - Fixed installation with reference bindings (
PDFIUM_BINDINGS=reference
) by actually including them in the sdist and adding a missingmkdir
call. (In older versions, this can be worked around by cloning the repository and creating the missing directory manually before installation.) - Fixed sourcebuild on windows by syncing patches with pdfium-binaries.
- Updated test expectations: due to changes in pdfium, some numbers are now slightly different.
- Fixed conda packaging: It is now required to explicitly specify
-c defaults
with--override-channels
, presumably due to an upstream change. - Autorelease: Swapped default condition for minor/patch update, as pypdfium2 changes are likely more API-significant than pdfium updates. Added ability for manual override.
- Bumped workflows to Python 3.12.
- Updated docs on licensing.
- This is expected to be the last release of the v4 series.
pypdfium2 commit log
Commits between 4.30.0
and 4.30.1
(latest commit first):
b4e4105
[autorelease main] update 4.30.108041a2
publish: disable attestations, tmp comment outfebe1a4
Changelog nits4fe6445
Q&D adaption to bdist_wheel relocation (fixes #326)067847a
Fix reference bindings missing in sdist2ec6bd6
workflows: re-enable conda_raw trigger1320a3f
sourcebuild: sync patches with pdfium-binariesbe173a7
changelog fixupb85745a
Update test expectations5001bf9
Prepare for possible release860bf97
Revert "ClarifyCannot close object; library is destroyed
condition"6736a5d
Update licensing docsce1faba
Add missing mkdir with refbindings (fixes #320)ff2ff4b
ClarifyCannot close object; library is destroyed
condition0f4bba8
PR template: use details summary rather than heading6bb675a
chore: slightly update PR template7dca75c
conda: also add-c defaults
in workflowf250b34
CLI/extract-images: Fix another dotted filepath blunder3fd35cf
Fix conda packaging (upstream behavior change) (#314)a07372d
Update workflows to Python 3.12d8a3128
versioning: swap minor/patch inc default, allow manual override38f5efe
PdfPage.get_objects(): don't register objects as kids6f13da6
Slightly fix up changelog
PDFium commit log
Commits between 6462
and 6899
(latest commit first):
The pdfium commit log is omitted this time because it exceeded GH's character limit. See https://github.com/pypdfium2-team/pypdfium2/actions/runs/12419415378/job/34674787577: Error: Error 422: Validation Failed: {"resource":"Release","code":"custom","field":"body","message":"body is too long (maximum is 125000 characters)"}
.
That's also why this GH release was created manually.
Update: added commit log as attachment (see below)
4.30.0
Changes (Release 4.30.0)
Summary (pypdfium2)
Backported bug fixes / corrections from current development branch to preferably leave v4 in a clean state.
- Fixed blunder in
PdfImage.extract()
producing an incorrect output path for prefixes containing a dot. In theextract-images
CLI, this caused all output images of a type to be written to the same path for a document containing a non-extension dot in the filename. - XFA / rendering CLI: Fixed incorrect recognition of document length.
pdf.init_forms()
must be called beforelen(pdf)
. - Made
get_text_range()
allocation adapt to pdfium version, asFPDFText_GetText()
has been reverted to UCS-2. (See v4.28 changelog for background.) - Updated workflows to include both
macos-13
andmacos-14
in test matrices because v13 is Intel and v14 ARM64 on GH actions. Removed python 3.7 testing because not supported anymore onmacos-14
runners.
pypdfium2 commit log
Commits between 4.29.0
and 4.30.0
(latest commit first):
6bf53c4
[autorelease main] update 4.30.01e9e100
Add changelog entry for workflows5ad40ab
Test both macOS ARM64 and Intel in all workflows600d36c
Try to fix main workflow (GH arch change in macOS-latest)a057218
Add changelog for backports653c38c
textpage: update docs2577f5b
[BP] CLI/render: fix XFA document length recognitioneded6c2
get_text_range(): adapt allocation to pdfium version7ce4d31
PdfImage.extract(): fix for filenames containing non-extension dot5dc2eee
issue templates: reorder commands493742d
Make issue templates slightly nicer391575a
Inhibit autorelease until v5 is merged
PDFium commit log
Commits between 6406
and 6462
(latest commit first):
7b7c83fba
Roll build/ bbc1efa4c..5eb3babb0 (147 commits)9783ba486
Fix one more edited PDF regression01ea79cec
Update hooks for reclient95b1aabea
Add one more pixel test for an edited PDF that regressedaaf2cc937
Roll clang to pick up unsafe_buffer_paths.txt format changes.6abd9f147
Introduce fxcrt::try_spancpy() and fxcrt::try_spanmove().89d9beb11
Roll v8/ 7f0739496..0832ba514 (553 commits; 1 trivial rolls)3a2e1651f
Roll buildtools and libc++2c9060d69
Roll third_party/abseil-cpp/ a64dd87ce..2c1ad970d (2 commits)c07eb97fd
Roll third_party/fp16/src/ 0a92994d7..581ac1c79 (1 commit)32fff0d8c
Update gn_version to f284b6b47039a2d7edfcbfc51f52664f82b5a789fa8edc249
Roll third_party/skia/ 7338f5521..04ee4daae (438 commits)4d6d703eb
Roll third_party/freetype/src/ f42ce2556..1168b1b5b (15 commits)0a3a3ee5c
Roll base/allocator/partition_allocator/ 8a9c3373f..3b0bd80fa (37 commits)ad5237f89
Roll tools/rust/ eaff38a21..8fcf2bf39 (15 commits)95cb40c79
Roll third_party/libc++abi/src/ 1317096ef..51fe35844 (2 commits)2d1bd6c9a
Update reclient_version to 0.138.0.e854224-gomaip8342a586d
Use spancpy() in more places02ff1756c
Fix yet another edited PDF that regressed7d687a0a3
Introduce {Byte,Wide}String::span_with_terminator().64447358e
Mark fx_memcpy_wrappers.h functions UNSAFE_BUFFER_USAGE.7cf8895f6
Enable fuzzing with Skia enabled155028a48
Add yet another pixel test for an edited PDF that regressedff78e42df
Roll Code Coverage from f459fdcdfc6c to 1b0ca9db1266 (3 revisions)926b395d8
Roll Depot Tools from 4a9d989f52e9 to 4246ba023a15 (107 revisions)0b4ff9a49
Roll libpng from 5140e80f1841 to 34954dfe60ef (2 revisions)863c78226
Roll Instrumented Libraries from 0172d67d98df to 682a735d9f5c (18 revisions)8b5bd138e
Roll Catapult from 949df6114f3f to 5fbda23b3a86 (52 revisions)0be533aea
Roll Memory Tools from c6d669e13804 to 2448d81f9741 (1 revision)97c93fd37
Roll abseil-cpp, buildtools, clang, and libc++1a5ec9fb4
Gate GDI APIs behind IsUser32AndGdi32Available in cpdf_interactiveform.cppfde20e170
Deduplicate code in CPDF_Parser and rename some methods763c169be
Fix parsing of PDFs with multiple cross reference streamsbc759a2ae
Add another pixel test for an edited PDF that regressed2c66e07e9
Spanify CFX_SeekableStreamProxyd6a4b27d8
Spanify FPDFText_GetText() and FPDF_GetBoundedText().1a8053c08
Don't allow two-arg span constructor without UNSAFE_BUFFER() annotation.3f197528d
Apply UNSAFE_BUFFERS() to two-arg span ctor in core/f0dc864fb
Put plugin-specific logic in pdfium_common_config.1eb7ddcf1
Apply UNSAFE_BUFFERS() to two-arg span ctor in xfa/590668ba7
Apply UNSAFE_BUFFERS() to two-arg span ctor in testing/3b679fe3f
Apply UNSAFE_BUFFERS() to two-arg span ctor in fpdfsdk/317e40e19
Use new instrumented_libs repo0e4ff8cd8
Roll Zlib from c5bf1b566e5d to d076d8bd0898 (6 revisions)- [
5a49e751e
](https://pdfium.google...
4.29.0
Changes (Release 4.29.0)
Summary (pypdfium2)
pypdfium2 commit log
PDFium commit log
Commits between 6337
and 6406
(latest commit first):
b756612c7
Use the new v8 interceptor APIafc399ff5
Roll v8/ fe4ad3b98..f6f7c6822 (302 commits)6af6c6197
Fix unsafe pointer usage in CJX_HostPseudoModelb9ebffc36
Fix typo in {Byte,Wide}StringView.TrimmedRight tests567dff87b
Avoid unsafe indexing in EncodeURL()7ca0110e3
Use WriteFloat() inside WriteColorToStream()f6df154e3
Fix some unsafe buffer usage in CPDF_Dest.6ddcbf24b
Mark one remaining unsafe function in core/fpdfapi/edit.2855deed0
Do not write out /Page objects that are not in the page treee4cebef61
Roll tools/rust/ 1d0018c65..eaff38a21 (6 commits)b870f6853
Roll third_party/skia/ 32f1cb507..7338f5521 (263 commits)93c8137d8
Roll base/allocator/partition_allocator/ c702699cc..8a9c3373f (30 commits)e707409fc
Roll third_party/libc++abi/src/ fc6253a64..1317096ef (2 commits)6123bc06a
Roll third_party/libunwind/src/ fc505746f..419b03c0b (2 commits)77b0d2a1b
Update reclient_version to 0.134.1.2c9285b-gomaip9dfab8917
Roll third_party/googletest/src/ e4fdb87e7..eff443c6e (7 commits)bf35e1110
Roll third_party/freetype/src/ 2a790a9f4..f42ce2556 (4 commits)483e5e1f5
Change cfx_cmyk_to_srgb code to return struct FX_RGB0095eef10
Improve comments and naming in calculate_pitch.hd43b6ce46
Update gn_version to 93ee9b91423c1f1f53fb5f6cba7b8eef6247a5648ba296abd
Roll Depot Tools from fbb0301f1f70 to 4a9d989f52e9 (81 revisions)027aa4b67
Roll Code Coverage from 10ce382356ce to f459fdcdfc6c (9 revisions)d7ec4201b
Switch CPDF_MeshStream to use FX_RGBffbbea8d3
Add struct FX_RGB2238fbe1b
Add fpdfsdk/{pwl,formfiller,fpdfxfa}/ directories to unsafe buffers.e9b7be916
Make SBThemeData::clrBtnBK a one-dimensional array.008339888
Remove FXSYS_wcstof in favor of system wcstof().e5458325d
Add some FPDFDocEmbedderTests that delete pages and savefb8abcb82
Enforce checking the return value of CFX_DIBitmap::Create()8111f8946
Put unsafe buffer configuration into PDFiumfe581ab87
Roll build/ e9a12f276..e5ff2eff3 (85 commits)e58d4d723
Roll third_party/icu/ 1112fa6b3..d94ab131b (8 commits)278639036
Flag remaining unsafe buffer usage in fxcrt.e21f71a90
Change CPDF_MeshStream::ReadColor() to return an array1f9ae706c
Fix undefined behavior in DrawGouraud()d9a020955
Fix some nits in DrawGouraud()1c2507320
Roll Catapult from 4dc7721a1444 to 949df6114f3f (83 revisions)ec275ee3e
Roll libpng from 3c7486b231c7 to 5140e80f1841 (1 revision)c0800e8bd
Remove Skia Sfntly dependency27062af25
Remove more wide string literals.7df165065
Remove some FXSYS_ functions in favor of std::char_traits<>.11b5f3bdb
Simplify CFXJSE_NodeHelper::CreateNodeForCondition().a9646b460
Fix regression in coverage_report.pyadc1b16a3
Set a default GN enable_safe_libstdcxx value2f6cef867
Avoid a compiler compatibility issue with CPDF_DefaultAppearancee15b92e44
Convert some WideString::CompareNoCase() to EqualsASCIINoCase().71a0c1d89
Replace ptr/size pair with span in FXJSE_CLASS_DESCRIPTOR.e8ef976cb
Remove in-out parameter from GetFontFamily.11f9c8674
Enable UNOWNED_PTR_EXCLUSION checks for debug builds only.b214b50e4
Adjust BUILD.gn files for path-based unsafe buffer warnings.2dc694121
Remove another parameter from CPDF_AnnotList methods7063716b1
Avoid calls to c_str() in cpdf_filespec.cpp.c9f2bf183
Avoid duplicate checks in StringViewTemplate<>::Substr().70e774a94
Remove dead code in RenderPageImpl() calleesb039c387e
Improve generated content stream data in cpdf_generateap.cppb119e4ac5
Make FPDFAnnotEmbedderTest.Bug1206 resiliant to changes1eac2c692
Remove use of string to hold binary data in cgdi_device_driver.cpp.f93971a09
Move some fx_system.h replacements into a C++ only section.- [
49089b8ad
](https://pdfium.googlesource.com/pdfium/+/49089b8ad03587207e...
4.28.0
Changes (Release 4.28.0)
Summary (pypdfium2)
get_text_range()
: Fixed a buffer size regression introduced in v4.26.0, caused by an unexpected behavior change in pdfium (thanks @elonzh for the bug report, {issue}298
). Since that change, it is not possible anymore to tell the exact amount of memory needed, so we have to allocate for the worst case. Therefore, while this problem persists, it is recommended to instead useget_text_bounded()
where possible.
pypdfium2 commit log
Commits between 4.27.0
and 4.28.0
(latest commit first):
6d96769
[autorelease main] update 4.28.08f6ecb0
readme/caller-datafiles: update ctypesgen command02cd006
Reduce some RST indents from 4 to 3cd770e6
Add ability to forceget_text_range()
8daf76b
textpage: fix up some typos380f30f
Changelog for #29847a2b81
Possible workaround against #298 / pdfium bug 2133 (#301)26e7f60
readme: slightly rephrase2f297a5
Add contributions/response policy
PDFium commit log
Commits between 6281
and 6337
(latest commit first):
09fbd30d5
Rename string's raw_span() method to unsigned_span().ef0eeaa9e
Fix wrong matrix outputs in CPDF_PageContentGenerator for path objectsf19f46647
Fix wrong matrix outputs in CPDF_PageContentGenerator for text objects081e8bb68
Fix incorrect current transformation matrix when saving PDFs28483abbe
Add path objects tests for a PDF saving bug78e300622
Change GetColor() to WriteColorToStream()be20f54f3
Update UNSAFE_BUFFER macros to match chromium/src/base71e2229aa
Add text object version of a more complex test for a PDF saving bugff374196e
Remove out-parameters from CPDF_Color::GetRGB()967494c5e
Remove out-parameters from CPDF_ColorState::Set{Color,Pattern}()3189488fe
Do no write out identity matrices in CPDF_PageContentGenerator8ebeb124b
Fix building with GCC504ae0c73
Fix nits in CPDF_PageContentGeneratorTest3055d3857
Make CFX_RenderDevice::GetDIBits() take RetainPtrs by value36cd3f41e
Rename some colorspace methodsac728e5cb
Rename CPDF_ICCBasedCS member variables8fa6a324c
Roll third_party/zlib/ 646b7f569..3787595bb (4 commits)03e96fc9d
Remove the matrix from CPDF_GeneralState624807fbd
Avoid "unsafe" string indexing in PDF_NameEncode().f1805084d
Convert EXPECT_STREQ(x, y.c_str()) to EXPECT_EQ(x, y).0c6ef5db1
Avoid result string with trailing NUL in XFA Decode().82e2c19b8
Roll third_party/skia/ 9832c7722..49f18efdf (331 commits)85589aac0
Roll Catapult from f448d5bf8e57 to 4dc7721a1444 (93 revisions)22f234e4d
Roll libpng from f11b2ae20fa0 to 3c7486b231c7 (2 revisions)530f34f13
Roll third_party/skia/ 6279c88b9..9832c7722 (80 commits)60bcaeb27
Make core/fxcrt compliant with UNSAFE_BUFFERS() macro.0744e71e2
Avoid some UNSAFE_BUFFER noise in fpdf_parser_utility.h.df60f7f4c
Fix incorrect matrix outputs in CPDF_PageContentGenerator074387f08
Add a more complex test for a PDF saving bug88eff81cc
Add a test case for a PDF saving bug314d76477
Simplify PDF_EncodeText() using FX_UTF16Encode()af1239af6
Make CPDF_IccProfile's dependency more direct3771a29b4
Remove CFX_Font::IsEmbedded()050ae79e8
Stop making CPDF_IccProfile an Observable038d39b31
Avoid more future unsafe buffer usage in StringDataTemplate.9108588e6
Move remaining code out of third_party/base and into core/fxcrtb8ea87677
Remove remaining NoDestructor usage01e6d560e
Convert some C-style arrays to std::array<>.a7fca8a4f
Add a way to undo a previous FPDF_SetSystemFontInfo() callb4fb36188
Re-write some unsafe string code prior to UNSAFE_BUFFERS.fec5a9706
Roll v8/ b6fd2f17b..a86e19715 (464 commits)04a9cf6cb
Make CodePointView::Iterator() demonstrably safe.f3209d029
Fix build with chrome plugin enabled but Partition Alloc disabled,7f1ff0f44
Roll MarkupSafe from 0bad08bb207b to e582d7f0edb9 (1 revision)2be9efb5f
Roll Instrumented Libraries from 0011c28c8d35 to 0893d760101b (1 revision)132a5215a
Roll Jinja2 from e2d024354e11 to c9c77525ea20 (1 revision)43bfc30b0
Copy absl::WrapUnique()'s static_asserts into pdfium::WrapUnique()6261e1499
Remove code in the form of "return std::move(local_var);"d72fd575f
Move third_party/base/ptr_util.h to core/fxcrt34e34057a
Merge third_party/base/memory/aligned_memory.h into fx_memory.hee6325efe
Move third_party/base/t...
4.27.0
Changes (Release 4.27.0)
Summary (pypdfium2)
- Added ability to define
$CTYPESGEN_PIN
when building sdist via./run craft pypi --sdist
, which allows to reproduce our sdists when set to the head commit hash ofpypdfium2-team/ctypesgen
at the time of the build to reproduce. Alternatively, you may patch the relevantpyproject.toml
entry yourself and usePDFIUM_PLATFORM=sdist python -m build --sdist
as usual. - Set up Dependabot for GH Actions. Updated dependencies accordingly.
pypdfium2 commit log
Commits between 4.26.0
and 4.27.0
(latest commit first):
4c4c362
[autorelease main] update 4.27.02d165af
readme: remove outdated helper112fb34
Readme: mention prominent embeddersb0352a1
Correctly reland commit 0d1cc2134b356b
Revert "Bump setup-miniconda 2->3 & {upload,download}-artifact 3->4"137b71a
Add dependabot to changeloged32d64
dependabot: ignore broken workflow-dispatch 121d94ee90
build(deps): bump actions/setup-python from 4 to 5ca59682
build(deps): bump actions/upload-pages-artifact from 1 to 300556fe
Bump deploy-pages from 1 to 4 (closes #294)21ca95b
Create dependabot.yml for GH actions0d1cc21
Bump setup-miniconda 2->3 & {upload,download}-artifact 3->49cb5c38
Remove some legacy code for conda_rawa584927
misc improvements0324787
workflows/test_sourcebuild: check version9289258
workflows/test_sourcebuild: fix typo3b4ef4b
Try to fix sourcebuild2e84994
autorelease: remove excessive note/todo/fixme marksa8c3cd3
Removegit status
assertbb68b1a
dirty: pass through previous state via env vardb4ebbb
Add some checks before ignoring dirty state4558229
ctypesgen: allow passing in custom pre-processor7248bc4
build: call into API directlyfab4102
Avoid odd use ofany()
whereor
does the trickd968173
readme/PDFIUM_PLATFORM
: account fornone
->sdist
renaminga2d66dd
Update changelog71b7a20
craft_packages/pypi: allow building sdist/wheels only629bb97
craft_packages: make ctypesgen pin configurableaf5216b
slightly polish manifest / setup.cfgebc8715
Bump copyright year24d438f
fix license of ./run script3e93f56
Amend changelogc72b7a9
Revert "temporarily comment out testpypi upload"
PDFium commit log
Commits between 6233
and 6281
(latest commit first):
7c7a6087e
Add FPDFText_LoadCidType2Font() API41015d113
Encapsulate FT_Get_Glyph_Name() calls in CFX_Face4d00d9737
Fix another typo in ToUnicode template constantf22325c95
Make PDF_USE_SKIA a public build definitionccc38c258
Remove more dead code in CFX_DIBitmap8abe178b4
Clean up CPDF_RenderStatus::LoadSMask()fe586ee39
Remove dead code in CFX_DIBitmape24607c76
Roll base/allocator/partition_allocator/ 72b7e1a3f..42bf756b3 (38 commits)202ebe6ad
Roll Catapult from f2abc0cd0cd8 to f448d5bf8e57 (64 revisions)dfd1ec916
Roll Memory Tools from 216d33bbf954 to 4753a8cbcd7c (4 revisions)9a2b614bd
Roll libpng from 1db23788f5aa to f11b2ae20fa0 (1 revision)bdfe4aa57
Unshare CFX_DIBitmap::SetChannelFromBitmap()4bf70256b
Remove CFX_Face::GetAdjusted{Ascender,Descender} methods6f3cf81a8
Change MultiplyAlphaMask() to take a CFX_DIBitmap82f4360b8
Consolidate code into CPDF_ImageRenderer::CalculateDrawImage()cbf5da504
Refactor LoadCompositeFont() to extract useful helper functionsa88402105
Check for errors first in LoadSimpleFont() and LoadCompositeFont()e06220af3
Rename many variables inside fpdf_edittext.cpp7666160f5
Fix various nits inside fpdf_edittext.cpp (for reals)f689b6a68
Fix various nits inside fpdf_edittext.cppd617c4e8b
Update readme for Reclient instead of Goma32c29e431
Encapsulate more bounding box code in CFX_Face3f7847662
Move NormalizeFontMetric() out of CPDF_Fonta0fd10adf
Rewrite and rename CPDF_Font::TT2PDF()4be416d76
Give variables better names in CPDF_ImageRenderer54f25ce7a
Ensure CPDF_Stream always has a dictionary720ffea6a
Fix typo in ToUnicode template constant8acd78867
Remove the ability to create an u...
4.26.0
Changes (Release 4.26.0)
Summary (pypdfium2)
- Pin ctypesgen in sdist to prevent reoccurrence of {issue}
264
/ {issue}286
. As a drawback, the pin is never committed, so the sdist is not simply reproducible at this time due to dependence on the latest commit hash of the ctypesgen fork at build time.
pypdfium2 commit log
Commits between 4.25.0
and 4.26.0
(latest commit first):
93650f0
[autorelease main] update 4.26.08f45f33
temporarily comment out testpypi uploadd11ed9f
Add changelog regarding sdist7aba111
Presumably fix PyPI upload of sdist (ignore dirty)1e7536f
Add back manylinux2014 to be on the safe sideb774be5
some cleanups2eb90a2
Slightly improve PR templatea1a1d37
conda_helpers: blacklist pdfium 6219a521a6e
readme: move down condaba2db80
setup/bindings: fix flags not being passed throughcf256ee
Adapt to change in pdfium headers6ef3b44
add back srcinfo to bindings file0db98b4
Mark regex as sucha9d6dfc
Adapt to c_void_p -> int auto-cast47857b6
sdist: implement ctypesgen pin7e90ecd
Call into ctypesgen API directly51612d3
Counterpart to ctypesgen library_sharing branch (#285)
PDFium commit log
Commits between 6164
and 6233
(latest commit first):
29ff08e81
Roll v8/ fc242dcac..83ad2aebb (53 commits)a7424743f
Add third_party/fp16 dependencyf6d55c802
Relax pitch check in CFX_DIBitmap::CalculatePitchAndSize()06b951386
Enhance FixedSizeDataVector<>.d7e87b0a6
Roll tools/clang/ dbe34d7b7..2b9d966ec (5 commits)4337c488a
Roll buildtools/ and third_party/libc++/src/2049878d9
Show FPDFBitmap_GetFormat() issue for bitmaps with external buffer950682b99
Use std::vector<> in testing/test_fonts.h43f921adf
Roll v8/ 3469157c0..fc242dcac (66 commits)143c5b262
Update reclient_version to 0.125.0.f3883c2-gomaipfbd64b666
Roll third_party/libunwind/src/ 278e5fbaf..2602aecdf (3 commits)05af9ea18
Roll third_party/libc++abi/src/ 4cb5c2cef..8806fb8bb (5 commits)da14fcb53
Simplify matcher string in fxcrt death tests4821f9fb8
Update android_toolchain_version to wpJvg81kuXdMM66r_l9Doa-pLfR6S26Jd1x40LpwWEoC62938cd83
Update gn_version to 85944ebc24a90ec1e489e85a46fdc68542c3146fa03eebd66
Add missing FontEncoding::kNone value8810061a8
Roll tools/rust/ 9f2ba7f84..e721a72ad (11 commits)dddfd7190
Roll third_party/freetype/src/ 8f255c89e..ca76683b7 (8 commits)3eae66ac2
Roll third_party/skia/ e0768dea5..a9db1213b (208 commits)a2f26cdf4
Roll build/ 9b8bc79c2..9ca0d2ce9 (79 commits)328af3224
Fix Skia + EMF rendering for transparencies899ff64f2
Roll base/allocator/partition_allocator/ 82380dc78..72b7e1a3f (24 commits)f2d10c6cb
Roll third_party/abseil-cpp/ 0764ad493..b7ad4e9ef (9 commits)593dcd2d9
Roll Memory Tools from 884774321e20 to 216d33bbf954 (2 revisions)a7755c59d
Roll Catapult from f0228fa92b0a to f2abc0cd0cd8 (60 revisions)88ad55aba
Make fxge::FontEncoding independent from FT_Encoding7b129a284
Encapsulate FT_Get_First_Char() and FT_Get_Next_Char()704cc481c
Fix regression where FPDFText_FindNext() cannot find the search term471679d54
Use the dedicated ConfigurePartitionsForTesting()3e624ce0f
Roll base/allocator/partition_allocator/ e9591a3fa..82380dc78 (24 commits)9f94a1a4a
Add more FPDFTextEmbedderTests for finding text45a5ea16c
Add FPDFTextEmbedderTest case to show FPDFText_FindNext() regressed3f3cb7b65
Validate width against stride in CFX_DIBitmap::CalculatePitchAndSize().24a713a85
Remove CPDF_CrossRefTable::ObjectType::kObjStream57e284ba2
Roll Zlib from 5daffc716bb6 to 562a4372d176 (12 revisions)a2c91f07a
Encapsulate FT_Get_Sfnt_Table() calls2708849c4
Encapsulate FT_Load_Sfnt_Table() calls592da1277
Encapsulate FT_Get_Char_Index() and FT_Get_Name_Index() calls7f50e6e23
Encapsulate font charmap code inside CFX_Facea9d080a7f
Deduplicate constants / macros between cfx_face.cpp and cfx_font.cpp4870bd3e2
Move some FreeType-specific code from CFX_Font to CFX_Facebd3e9f3d9
Remove unused CFPF_SkiaFont code65dc04dda
Move CFX_GlyphBitmap creation code into CFX_Face::RenderGlyph()4f26084fa
Remove spurious fx_freetype.h includes- [
b2d4f1104
](https:/...
4.25.0
Changes (Release 4.25.0)
Summary (pypdfium2)
- Removed multiprocessing from deprecated
PdfDocument.render()
API and replaced with linear rendering. See below for more info. - setup: Fixed blunder in headers cache logic that would cause existing headers to be always reused regardless of version. Note, this did not affect release workflows, only local source re-installs.
- Show path of linked binary in
pypdfium2 -v
. - conda: Improved installation docs and channel config.
- conda/workflows: Added ability to (re-)build pypdfium2_raw bindings with any given version of pdfium. Fixes {issue}
279
. - Made reference bindings more universal by including V8, XFA and Skia symbols. This is possible due to the dynamic symbol guards.
- Instruct ctypesgen to exclude some unused alias symbols pulled in from struct tags.
- Improved issue templates, added pull request template.
- Improved ctypesgen (pypdfium2-team fork).
Rationale for PdfDocument.render()
deprecation
- The parallel rendering API unfortunately was an inherent design mistake: Multiprocessing is not meant to transfer large amounts of pixel data from workers to the main process.
- This was such a heavy drawback that it basically outweighed the parallelization, so there was no real performance advantage, only higher memory load.
- As a related problem, the worker pool produces bitmaps at an indepedent speed, regardless of where the receiving iteration might be, so bitmaps could queue up in memory, possibly causing an enormeous rise in memory consumption over time. This effect was pronounced e.g. with PNG saving via PIL, as exhibited in Facebook's
nougat
project. - Instead, each bitmap should be processed (e.g. saved) in the job which created it. Only a minimal, final result should be sent back to the main process (e.g. a file path).
- This means we cannot reasonably provide a generic parallel renderer, instead it needs to be implemented by callers.
- Historically, note that there had been even more faults in the implementation:
- Prior to
4.22.0
, the pool was always initialized withos.cpu_count()
processes by default, even when rendering less pages. - Prior to
4.20.0
, a full-scale input transfer was conducted on each job (rendering it unusable with bytes input). However, this can and should be done only once on process creation.
- Prior to
- pypdfium2's rendering CLI cleanly re-implements parallel rendering to files. We may want to turn this into an API in the future.
Due to the potential for serious issues as outlined above, we strongly recommend that end users update and dependants bump their minimum requirement to this version. Callers should move away from PdfDocument.render()
and use PdfPage.render()
instead.
pypdfium2 commit log
Commits between 4.24.0
and 4.25.0
(latest commit first):
45dbb2c
[autorelease main] update 4.25.06f5df31
workflows/main: minor comments cleanup4c0aee6
conda: get rid of effectively dead bundling code816f421
craft_packages: cut overly extensive commentsd140de2
Handle latest version separately for conda pdfium/pypdfium2_raw63a17ba
conda: sync pypdfium2_raw schedule with pdfium-binariescdb1fe4
instruct ctypesgen to exclude some garbage symbolsadf89b0
docs correctionafc4740
reinstall schedule6024f15
Make document-level renderer harmless by linearization (#282)7c53bd1
temporarily inhibit schedule0fe8578
ctypesgen: add --no-macro-guards8f0a425
readme: update ABI bindings section6a0a67b
get_text_range: slightly enhance docs5886522
improve changelog/template, add tasksacd1719
conda/recipes: do not wrap env vars in quotes after allf3cc2dd
continue on refbindings0822682
continue on PR template (setup)e26b24d
Prepare changelogf93532d
setup: avoid explicit mention of clangad56b56
docs: continue on conda54d2ffc
craft/conda: update a code comment59dc178
issue-templates: rename "package" to "install" in titles9a1dcd3
Inline build version handling in craft_packages3b418eb
conda_raw: handle rebuilds (#280)ecb77d2
Add skia to refbindings flags (+ thoughts on external headers)01727fc
setup-miniconda: correct channel prioa5f2c5b
PR template nits100d7e4
Tighten issue template descriptionsddc8abc
refbindings: define feature flags136a655
setup: fix blunder in headers cache logic67de448
Continue on PR templatea1037a3
Add draft pull request template9f54a76
issue template generic: clarify checkbox 2 (CC #277)c5c558a
Add note on version info8b454c0
nits24839ea
conda: slightly improve script and recipes9e73c75
wf/conda: try to make sure we install the built package8a438f8
readme: conda section again2fbac25
workflows/conda: remove a redundant layer of channelsc6dd1d1
readme: rework conda section again28649ad
issues/conda: check python executable07d336e
readme: revise conda instructions45e8f0c
cli/version: show only libpath rather than whole loader info81f24de
dep5-wheel: add helpers version file09d194f
manifest: fix missing reuse/dep5 include blunder1cf9442
req: sunset defaults.txtd95efed
req: test implies converters- [
9e29101
](https://github.com/pypdfium2-team/pyp...
4.24.0
Changes (Release 4.24.0)
Summary (pypdfium2)
- Added GitHub issue templates
pypdfium2 commit log
Commits between 4.23.1
and 4.24.0
(latest commit first):
71d143f
[autorelease] update changelog and version filec49dcca
temporarily comment out testpypi uploada222c06
Fix sdist package getting wrong name1b0a5c6
slightly polish previous commitabd8a4f
sourcebuild: actually fix version (closes #276)13ae34b
Fix generic issue template stylee10f667
Revert "sourcebuild: try to fix version..."01c2355
sourcebuild: try to fix version...4f2d3cc
sourcebuild: add fixme regarding version923e258
sourcebuild: build config correctionsa7e5aa3
readme/install-system-caller: revise origin again51da8a6
workflows/trigger: temporarily comment out main schedule7d31730
setup nits/comments9ca64b9
readme/install-source-caller: change origin format51dab26
readme/issues: continue286294b
readme: add anchor icons to linksd7ef006
Add draft instructions to build with caller-provided files798b02b
sourcebuild: comment outuse_custom_libcxx
a308025
to_full(): use namedtuple, improve sourcebuild version style46e81b1
emplace: add back prettier reprd23b9f8
issue template nitsddab675
Revert "Make conda and prepared detectable"063e4ec
Make conda and prepared detectablef04f757
readme: try to make install sections linkable without heading04c095d
Continue on issue templates44946e2
Add comment regarding to_full()a4fc943
bindings cache: take guard_symbols into account3f3dd40
emplace: improve prints6d860a4
emplace/bindings: use cached headers if availablebe2e25d
emplace: use binary cache if only bindings are missing8a33235
refbindings: allow system library loadingdf54e88
update_pdfium: fix descriptions (CC #272)a397ff7
templates/conda: add call toconda config --get
39e12e0
ctypesgen: add --no-system-libsearch if --runtime-libdirs given0dd8e34
Improve issue templatesdb1e956
Add basic issue templates (#271)a5454bf
Minor style improvements3aa6c15
slightly reorder conda instructions (install line first)5fb49a5
Simplify conda instructions341c360
conda_helpers: avoid embedding test suite
PDFium commit log
Commits between 6097
and 6110
(latest commit first):
0a34b6b28
Convert std::vector<v8::Local> to v8::LocalVector.607c3faa1
Fix potential leak in CGdiplusExt90589d465
Replace const-ref std::vector arguments with pdfium::span in fxjs.fc412acd0
Revert recent C++20 usage in CFX_FillRenderOptions03c04196f
Remove unnecessary LoadLibrary() call in CGdiplusExtfdb409aaf
Roll third_party/freetype/src/ 7b308a29d..55d0287cf (17 commits)9091e26f4
Add a test for rendering a transparency onto a white background647a08001
Add support for the Rust toolchain9cb2d6887
Update gn_version to e4702d7409069c4f12d45ea7b7f0890717ca3f4be5f05d9c6
Roll third_party/libjpeg_turbo/ 30bdb85e3..9b894306e (2 commits)df282a629
Roll third_party/icu/ 985b9a6f7..a622de35a (2 commits)9f182f957
Roll abseil-cpp, libcxx, libcxxabi, clang, buildtools and builda3895af47
Roll Catapult from 4f81c1e29597 to 47efdb4b1428 (70 revisions)