Skip to content

Commit

Permalink
Minor documentation improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas-C committed Dec 16, 2024
1 parent 38dbf73 commit bca0695
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docs/CombineWithRoughJS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
![Graphics produced by Rough.js](RoughJS.png)

[Rough.js](https://roughjs.com/) is able to produce SVG files
that can then be embedded by `fpdf2`.
that can then be embedded by `fpdf2` ([with some limitations regarding SVG support](https://py-pdf.github.io/fpdf2/SVG.html#currently-unsupported-notable-svg-features)).

This documentation page will guide you on how to do so.

Expand Down
2 changes: 1 addition & 1 deletion docs/HTML.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ pdf.output("html_helvetica.pdf")
* `<ol>`, `<ul>`, `<li>`: ordered, unordered and list items (can be nested)
* `<dl>`, `<dt>`, `<dd>`: description list, title, details (can be nested)
* `<sup>`, `<sub>`: superscript and subscript text
* `<table>`: (with `align`, `border`, `width`, `cellpadding`, `cellspacing` attributes)
* `<table>`: (with `align`, `border`, `width`, `cellpadding`, `cellspacing` attributes) those tags are rendered using [fpdf2 Tables layout](https://py-pdf.github.io/fpdf2/Tables.html) and the following sub-tags are supported:
+ `<thead>`: optional tag, wraps the table header row
+ `<tfoot>`: optional tag, wraps the table footer row
+ `<tbody>`: optional tag, wraps the table rows with actual content
Expand Down
6 changes: 3 additions & 3 deletions docs/Maths.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Result:

![](matplotlib.png)

You can also embed a figure as [SVG](SVG.md):
You can also embed a figure as [SVG](SVG.md) ([but there may be some limitations](https://py-pdf.github.io/fpdf2/SVG.html#currently-unsupported-notable-svg-features)):

```python
from fpdf import FPDF
Expand Down Expand Up @@ -82,7 +82,7 @@ Result:

![](plotly_png.png)

You can also embed a figure as [SVG](SVG.md) but this is not recommended because the text data such as the x and y axis bars might not show as illustrated in the result image because plotly places this data in a svg text tag which is currently [not supported](https://github.com/py-pdf/fpdf2/issues/537) by FPDF2.
While you can also embed a figure as [SVG](SVG.md), this is not recommended as text data - such as the x and y axis bars - might not be displayed, because `plotly` places this data in a SVG text tag which is currently [not supported by `fpdf2`](https://github.com/py-pdf/fpdf2/issues/537).

Before running this example, please install the required dependencies:

Expand All @@ -107,7 +107,7 @@ You can install it using: `pip install pygal`
The full list of supported & unsupported SVG features can be found there: [SVG page](SVG.md#supported-svg-features).

You can find documentation on how to convert vector images (SVG) to raster images (PNG, JPG), with a practical example of embedding PyGal charts, there:
[SVG page](SVG.md#converting-vector-graphics-to-raster-graphics).
[SVG page > Converting vector graphics to raster graphics](SVG.md#converting-vector-graphics-to-raster-graphics).


## Mathematical formulas ##
Expand Down
3 changes: 3 additions & 0 deletions docs/PageFormatAndOrientation.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ pdf.output("two-column.pdf")
```

## Viewer preferences ##
Those settings are detailed in the official PDF format specification,
but may not be honored by PDF viewers.
If a setting seems ignored, this is probably not a bug with `fpdf2`, but a choice or a missing feature from your PDF renderer software.

```python
from fpdf import FPDF, ViewerPreferences
Expand Down
10 changes: 4 additions & 6 deletions docs/SVG.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ Additionally, `cairosvg` offers various options for optimizing the rendering per

## Warning logs ##

The `fpdf.svg` module produces `WARNING` log messages for **unsupported** SVG tags & attributes.
The `fpdf.svg` module produces `WARNING` log messages for some **unsupported** SVG tags & attributes.
If need be, you can suppress those logs:

```python
Expand All @@ -209,11 +209,9 @@ Everything not listed as supported is unsupported, which is a lot. SVG is a
very complex format that has become increasingly complex as it absorbs
more of the entire browser rendering stack into its specification.

However,
there are some pretty commonly used features that are unsupported that may
cause unexpected results (up to and including a normal-looking SVG rendering as
a completely blank PDF). It is very likely that off-the-shelf SVGs will not be
converted fully correctly without some preprocessing.
However, there are some pretty commonly used features that are unsupported
and may cause unexpected results, up to and including a normal-looking SVG
rendering as a completely blank PDF.

There are some common SVG features that are currently **unsupported**, but that `fpdf2` could end up supporting with the help of contributors :

Expand Down
2 changes: 1 addition & 1 deletion docs/Tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ TABLE_DATA = (
("Jules", "Smith", "34", "San Juan"),
("Mary", "Ramos", "45", "Orlando"),
("Carlson", "Banks", "19", "Los Angeles"),
("Lucas", "Cimon", "31", "Saint-Mathurin-sur-Loire"),
("Lucas", "Cimon", "31", "Angers"),
)
pdf = FPDF()
pdf.add_page()
Expand Down
2 changes: 1 addition & 1 deletion docs/Templates.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Introduction #

Templates are predefined documents (like invoices, tax forms, etc.), or parts of such documents, where each element (text, lines, barcodes, etc.) has a fixed position (x1, y1, x2, y2), style (font, size, etc.) and a default text.
Templates are a `fpdf2` feature that define predefined documents (like invoices, tax forms, etc.), or parts of such documents, where each element (text, lines, barcodes, etc.) has a fixed position (x1, y1, x2, y2), style (font, size, etc.) and a default text.

These elements can act as placeholders, so the program can change the default text "filling in" the document.

Expand Down
3 changes: 1 addition & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,10 @@ Online classes & open source projects:
* [Undying Dusk](https://lucas-c.itch.io/undying-dusk) : a **video game in PDF format**, with a gameplay based on exploration and logic puzzles, in the tradition of dungeon crawlers
* [OpenDroneMap](https://github.com/OpenDroneMap/ODM) : a command line toolkit for processing aerial drone imagery
* [OpenSfM](https://github.com/mapillary/OpenSfM) : a Structure from Motion library, serving as a processing pipeline for reconstructing camera poses and 3D scenes from multiple images
* [RPA Framework](https://github.com/robocorp/rpaframework) : libraries and tools for Robotic Process Automation (RPA), designed to be used with both [Robot Framework](https://robotframework.org)
* [RPA Framework](https://github.com/robocorp/rpaframework) : libraries and tools for Robotic Process Automation (RPA), designed to be used with both [Robot Framework](https://robotframework.org) : [rpa-pdf](https://pypi.org/project/rpa-pdf/) package
* [Concordia](https://github.com/LibraryOfCongress/concordia) : a platform developed by the US Library of Congress for crowdsourcing transcription and tagging of text in digitized images
* [wudududu/extract-video-ppt](https://github.com/wudududu/extract-video-ppt) : create a one-page-per-frame PDF from a video or PPT file.
`fpdf2` also has a demo script to convert a GIF into a one-page-per-frame PDF: [gif2pdf.py](https://github.com/py-pdf/fpdf2/blob/master/tutorial/gif2pdf.py)
* [csv2pdf](https://github.com/TECH-SAVVY-GUY/csv2pdf) : convert CSV files to PDF files easily
* [Planet-Matriarchy-RPG-CharGen](https://github.com/ShawnDriscoll/Planet-Matriarchy-RPG-CharGen) : a PyQt based desktop application (= `.exe` under Windows) that provides a RPG character sheet generator

### Usage statistics
Expand Down

0 comments on commit bca0695

Please sign in to comment.