ENH: With extract-annotated-pages command#98
Conversation
|
Thank you for your contribution @wolfram77 👍 Could you please address the following points, and I'll be happy to merge your PR:
from fpdf import FPDF
pdf = FPDF()
pdf.set_font("Helvetica", size=12)
pdf.add_page()
text = "Link set over an arbitrary area with FPDF.link()"
x, y = 20, 150
pdf.text(x=x, y=y, text=text)
width = pdf.get_string_width(text)
pdf.link(
x=x,
y=y - pdf.font_size,
w=width,
h=pdf.font_size,
link="https://github.com/py-pdf/fpdf2/discussions",
)
pdf.add_page()
pdf.text_annotation(
x=20,
y=150,
text=f"This is a default text annotation.",
)
pdf.output("pdfly_pr_98.pdf")PS: I'll be on holiday for a few days, so I'll get back to you only mid-february. |
|
@all-contributors please add @wolfram77 for code |
|
I've put up a pull request to add @wolfram77! 🎉 |
|
@Lucas-C Thanks for reviewing the PR. To simplify the test, I added a yellow highlight to page 7 of |
|
Nice, good job with the unit test 👍 I think there are issues with the unit tests, on the I won't have the time to fix them today, so you can either have a look at it based on the GitHub Actions logs, or else I'll fix that when I'll be back from holiday. |
|
@Lucas-C From the first failed test, I see the following: # Assert
captured = capsys.readouterr()
> assert exit_code == 0, captured
E AssertionError: CaptureResult(out='', err="\x1b[33mUsage: \x1b[0mpytest update-offsets [OPTIONS] FILE_IN
E \x1b[2mTry \x1b[0m\x1b[2;34m'pytest update-offsets \x1b[0m\x1b[1;2;34m-\x1b[0m\x1b[1;2;34m-help\x1b[0m\x1b[2;34m'\x1b[0m\x1b[2m for help.\x1b[0m
E \x1b[31m╭─\x1b[0m\x1b[31m Error \x1b[0m\x1b[31m─────────────────────────────────────────────────────────────────────\x1b[0m\x1b[31m─╮\x1b[0m
E \x1b[31m│\x1b[0m Got unexpected extra argument \x1b[31m│\x1b[0m
E \x1b[31m│\x1b[0m (/tmp/pytest-of-runner/pytest-0/test_update_offsets0/file-with-offsets-out.p \x1b[31m│\x1b[0m
E \x1b[31m│\x1b[0m df) \x1b[31m│\x1b[0m
E \x1b[31m╰──────────────────────────────────────────────────────────────────────────────╯\x1b[0m
E ")
E assert 2 == 0I am not sure why it seems to expect update-offsets to have only FILE_IN as an argument (no FILE_OUT), so it is failing with |
|
I fixed the
|
|
@Lucas-C please update me when you are back. I have (hopefully) addressed the issues you mentioned above. |
|
@wolfram77 I updated your branch to rebase it and fix the last issue with |
ca9000d to
505ab93
Compare
Seems that the `| None` syntax is not valid with Python 3.8 Co-authored-by: Lucas Cimon <925560+Lucas-C@users.noreply.github.com>
|
Merged! Thank you @wolfram77 👍 🙂 |
Co-authored-by: Lucas Cimon <925560+Lucas-C@users.noreply.github.com>
Co-authored-by: Lucas Cimon <925560+Lucas-C@users.noreply.github.com>
|
This new command has been included in the latest 0.5.0 release: https://github.com/py-pdf/pdfly/releases/tag/0.5.0 |
|
It has been long time. I hope it helps the users of PDF fly :) ... |

This pull request addresses the following issue:
@Lucas-C
This was the issue.