Skip to content

Commit

Permalink
Fixing links in table cells - close #1031
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas-C committed Nov 20, 2023
1 parent 1aa87bf commit fc044db
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/continuous-integration-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies ⚙️
if: matrix.platform == 'ubuntu-latest'
run: sudo apt-get update && sudo apt-get install ghostscript libjpeg-dev
run: sudo apt-get update --allow-releaseinfo-change && sudo apt-get install ghostscript libjpeg-dev
- name: Install qpdf ⚙️
if: matrix.platform == 'ubuntu-latest' && matrix.python-version != '3.9'
# We run the unit tests WITHOUT qpdf for a single parallel execution / Python version:
run: sudo apt-get update && sudo apt-get install qpdf
run: sudo apt-get update --allow-releaseinfo-change && sudo apt-get install qpdf
- name: Install Python dependencies ⚙️
run: |
python -m pip install --upgrade pip setuptools wheel
Expand Down
2 changes: 1 addition & 1 deletion docs/Tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ Result:
## Adding links to cells

```python
row.cell(..., link="https://py-pdf.github.io/fpdf2/")
row.cell(..., link="https://py-pdf.github.io/fpdf2/")
row.cell(..., link=pdf.add_link(page=1))
```

Expand Down
3 changes: 3 additions & 0 deletions fpdf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* `fpdf.enums.XPos`
* `fpdf.enums.YPos`
* `fpdf.errors.FPDFException`
* `fpdf.fonts.FontFace`
* `fpdf.fpdf.TitleStyle`
* `fpdf.prefs.ViewerPreferences`
* `fpdf.template.Template`
Expand All @@ -24,6 +25,7 @@
FPDF_FONT_DIR as _FPDF_FONT_DIR,
FPDF_VERSION as _FPDF_VERSION,
)
from .fonts import FontFace
from .html import HTMLMixin, HTML2FPDF
from .prefs import ViewerPreferences
from .template import Template, FlexTemplate
Expand Down Expand Up @@ -51,6 +53,7 @@
# Classes:
"FPDF",
"FPDFException",
"FontFace",
"Align",
"TextMode",
"XPos",
Expand Down
1 change: 1 addition & 0 deletions fpdf/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ def _render_table_cell(
output=MethodReturnValue.PAGE_BREAK | MethodReturnValue.HEIGHT,
wrapmode=self._wrapmode,
padding=padding,
link=cell.link,
**kwargs,
)

Expand Down
Binary file modified test/table/table_with_links.pdf
Binary file not shown.

0 comments on commit fc044db

Please sign in to comment.