Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove transparent link annots from pdfdoc #551

Merged
merged 1 commit into from Oct 24, 2021

Conversation

kbengs
Copy link
Member

@kbengs kbengs commented Oct 21, 2021

Third case in #341 seems to be caused by link annotations in the pdf.
The links are square boxes which link to something. The box can have a visible border but often it is transparent (invisible).
This commit removes the link annotation (box) if it is transparent.

For the pdfs which have transparent links that I have tested this commit with, it does:

  • Lower memory usage by 50-100Mb
  • Slow down rendering by 2-3% first time a pdf is rendered

The improvement can be seen on this file:
https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/pdf_reference_archives/PDFReference.pdf

We could of course just close # 341 and just live with the issue.

Transparent link annotations will not be visible in the thumbnails.
Removing them will lower memory usage.

Close pdfarranger#341
@codecov-commenter
Copy link

Codecov Report

Merging #551 (86849b7) into main (960e340) will increase coverage by 0.01%.
The diff coverage is 76.92%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #551      +/-   ##
==========================================
+ Coverage   72.35%   72.36%   +0.01%     
==========================================
  Files          10       10              
  Lines        2912     2924      +12     
==========================================
+ Hits         2107     2116       +9     
- Misses        805      808       +3     
Impacted Files Coverage Δ
pdfarranger/core.py 87.29% <76.92%> (-0.43%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 960e340...86849b7. Read the comment docs.

@jeromerobert jeromerobert merged commit 75fa6cc into pdfarranger:main Oct 24, 2021
@kbengs kbengs deleted the link-annotations branch November 27, 2021 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants