Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ This can also be enabled programmatically with `warnings.simplefilter('default',
* leading spaces on new lines inside `<pre>` and `<pre><code>` blocks are no longer dropped - _cf._ [issue #1063](https://github.com/py-pdf/fpdf2/issues/1063)
* `FPDF.set_font()` can restore `current_font` when the selected font state diverged - _cf._ [PR #1872](https://github.com/py-pdf/fpdf2/pull/1872)
* embed CID-keyed CFF fonts as raw CFF programs so browser PDF viewers render them correctly - _cf._ [issue #1874](https://github.com/py-pdf/fpdf2/issues/1874)
* fixed broken links on documentation not directly leading to the API reference - _cf._ [issue #1876](https://github.com/py-pdf/fpdf2/issues/1876)
### Changed
* skip byte-for-byte compressed data comparison when zlib-ng is detected, regardless of OS

Expand Down
2 changes: 1 addition & 1 deletion docs/DocumentOutlineAndTableOfContents.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pdf.insert_toc_placeholder(toc.render_toc, allow_extra_pages=True)
---

## Using Outlines and ToC with HTML
When using [`FPDF.write_html`](HTML.md), a document outline is automatically generated, and a ToC can be added with the `<toc>` tag.
When using [`FPDF.write_html`](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.write_html), a document outline is automatically generated, and a ToC can be added with the `<toc>` tag.

To customize ToC styling, override the `render_toc` method in a subclass:

Expand Down
2 changes: 1 addition & 1 deletion docs/Images.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ _New in [:octicons-tag-24: 2.8.3](https://github.com/py-pdf/fpdf2/blob/master/CH

The dedicated method for adding output intent to a PDF is [`add_output_intent()`](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.add_output_intent).

You can optionally provide a [`PDFICCProfileObject`](https://py-pdf.github.io/fpdf2/fpdf/output.html#fpdf.output.PDFICCProfileObject) as `icc_profile`.
You can optionally provide a [`PDFICCProfileObject`](https://py-pdf.github.io/fpdf2/fpdf/output.html#fpdf.output.PDFICCProfile) as `icc_profile`.

Example:
```python
Expand Down
10 changes: 5 additions & 5 deletions docs/Links.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pdf.multi_cell(
pdf.output("hyperlink.pdf")
```

Links defined this way in Markdown can be styled by setting `FPDF` class attributes `MARKDOWN_LINK_COLOR` (default: `None`) & `MARKDOWN_LINK_UNDERLINE` (default: `True`).
Links defined this way in Markdown can be styled by setting `FPDF` class attributes `MARKDOWN_LINK_COLOR` (default: `None`) & `MARKDOWN_LINK_UNDERLINE` (default: `True`).
Links can also be styled by embedding them in markdown style markers (`**bold**, __italics__, --underlined--, ~~strikethrough~~`):

```python
Expand Down Expand Up @@ -79,7 +79,7 @@ pdf.output("hyperlink.pdf")

## Hyperlink with write_html ##

An alternative method using [`FPDF.write_html`](HTML.md):
An alternative method using [`FPDF.write_html`](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.write_html):

```python
from fpdf import FPDF
Expand Down Expand Up @@ -117,7 +117,7 @@ There are some situations where a user wants to create
an internal link to another page in the PDF document, but
the page number is not known at the time of link creation.
In this case, the link can be created using `pdf.add_link()`
as before, and then later re-reference to a specific page using
as before, and then later re-reference to a specific page using
`pdf.set_link()`. In this example our goal is to link to a
page that occurs after a section with a variable
amount of text, potentially occupying multiple pages:
Expand Down Expand Up @@ -161,7 +161,7 @@ Other methods can also insert internal links:

* [FPDF.multi_cell](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.multi_cell) using `link=` **or** `markdown=True` and this syntax: `[link text](page number)`
* [FPDF.link](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.link)
* [FPDF.write_html](HTML.md) using anchor tags: `<a href="page number">link text</a>`
* [FPDF.write_html](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.write_html) using anchor tags: `<a href="page number">link text</a>`

The unit tests `test_internal_links()` in [test_links.py](https://github.com/py-pdf/fpdf2/blob/master/test/test_links.py) provides examples for all of those methods.

Expand All @@ -184,7 +184,7 @@ Other methods can also insert internal links:

* [FPDF.multi_cell](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.multi_cell) using `link=` **or** `markdown=True` and this syntax: `[link text](other_doc.pdf)`
* [FPDF.link](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.link)
* [FPDF.write_html](HTML.md) using anchor tags: `<a href="other_doc.pdf">link text</a>`
* [FPDF.write_html](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.write_html) using anchor tags: `<a href="other_doc.pdf">link text</a>`

The unit test `test_link_to_other_document()` in [test_links.py](https://github.com/py-pdf/fpdf2/blob/master/test/test_links.py) provides examples for all of those methods.

Expand Down
12 changes: 6 additions & 6 deletions docs/Margins.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ pdf.set_margin(0)

Several methods can be used to set margins:

* [set_margin](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.FPDF.set_margin)
* [set_left_margin](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.FPDF.set_left_margin)
* [set_right_margin](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.FPDF.set_right_margin)
* [set_top_margin](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.FPDF.set_top_margin)
* [set_margins](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.FPDF.set_margins)
* [set_auto_page_break](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.FPDF.set_auto_page_break)
* [set_margin](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.set_margin)
* [set_left_margin](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.set_left_margin)
* [set_right_margin](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.set_right_margin)
* [set_top_margin](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.set_top_margin)
* [set_margins](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.set_margins)
* [set_auto_page_break](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.set_auto_page_break)
2 changes: 1 addition & 1 deletion docs/PageFormatAndOrientation.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Similarly, an `orientation` parameter can be provided to the [`add_page`](https:

## Page layout & zoom level ##

[`set_display_mode()`](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.FPDF.set_display_mode) allows to set the **zoom level**:
[`set_display_mode()`](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.set_display_mode) allows to set the **zoom level**:
pages can be displayed entirely on screen, occupy the full width of the window, use the real size,
be scaled by a specific zooming factor or use the viewer default (configured in its _Preferences_ menu).

Expand Down
14 changes: 7 additions & 7 deletions docs/Tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -519,26 +519,26 @@ with pdf.table(text_align="CENTER") as table:
row = table.row()
row.cell("A1", colspan=2, rowspan=3)
row.cell("C1", colspan=2)

row = table.row()
row.cell("C2", colspan=2, rowspan=2)

row = table.row()
# all columns of this row are spanned by previous rows

row = table.row()
row.cell("A4", colspan=4)

row = table.row()
row.cell("A5", colspan=2)
row.cell("C5")
row.cell("D5")

row = table.row()
row.cell("A6")
row.cell("B6", colspan=2, rowspan=2)
row.cell("D6", rowspan=2)

row = table.row()
row.cell("A7")
...
Expand Down Expand Up @@ -600,7 +600,7 @@ We have dedicated pages about those topics:

## Using write_html

Tables can also be defined in HTML using [`FPDF.write_html`](HTML.md).
Tables can also be defined in HTML using [`FPDF.write_html`](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.write_html).
With the same `data` as above, and column widths defined as percent of the effective width:

```python
Expand Down
6 changes: 3 additions & 3 deletions docs/Text.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ There are several ways in fpdf to add text to a PDF document, each of which come

## Flowable Text Regions

Text regions allow to insert flowing text into a predefined region on the page. It is possible to change the formatting and even the font within paragraphs, which will still be aligned as one text block.
The currently implemented type of text regions is [text_columns()](TextColumns.md), which defines one or several columns that can be filled sequentially or height-balanced.
Text regions allow to insert flowing text into a predefined region on the page. It is possible to change the formatting and even the font within paragraphs, which will still be aligned as one text block.
The currently implemented type of text regions is [text_columns()](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.text_columns), which defines one or several columns that can be filled sequentially or height-balanced.

## Typography and Language Specific Concepts
## Typography and Language Specific Concepts
### Supported Features
With supporting Unicode fonts, `fpdf2` should handle the following text shaping features correctly. More details can be found in [TextShaping](TextShaping.md).

Expand Down
4 changes: 2 additions & 2 deletions docs/TextColumns.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Columns will always be of equal width.
Text columns support all the standard [text region](TextRegion.md) methods, and some extra ones:

* [`.paragraph()`](https://py-pdf.github.io/fpdf2/fpdf/text_region.html#fpdf.text_region.TextColumns.paragraph)
* [`.write()`](https://py-pdf.github.io/fpdf2/fpdf/text_region.html#fpdf.text_region.TextColumns.write)
* [`.ln()`](https://py-pdf.github.io/fpdf2/fpdf/text_region.html#fpdf.text_region.TextColumns.ln)
* [`.write()`](https://py-pdf.github.io/fpdf2/fpdf/text_region.html#fpdf.text_region.Paragraph.write)
* [`.ln()`](https://py-pdf.github.io/fpdf2/fpdf/text_region.html#fpdf.text_region.ParagraphCollectorMixin.ln)
* [`.new_column()`](https://py-pdf.github.io/fpdf2/fpdf/text_region.html#fpdf.text_region.TextColumns.new_column)

A **form feed** character (`\u000c`) in the text will have the same effect as an explicit call to `.new_column()`,
Expand Down
2 changes: 1 addition & 1 deletion docs/TextRegion.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Other types like Table cells, shaped regions and combinations are still in the d
## General Operation ##
Using the different region types and combination always follows the same pattern. The main difference to the normal `FPDF.write()` method is that all added text will first be buffered, and only gets rendered on the page when the context of the region is closed. This is necessary so that text can be aligned within the given boundaries even if its font, style, or size are arbitrarily varied along the way.

* Create the region instance with an `FPDF` method, , for example [text_columns()](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.text_columns).
* Create the region instance with an `FPDF` method, , for example [text_columns()](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.text_columns).
<!--
* future: (_If desired, add or subtract other shapes from it (with geometric regions)_).
-->
Expand Down