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

docs: add Russian tutorial #272

Closed
wants to merge 10 commits into from
Closed
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
2 changes: 1 addition & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@
"avatar_url": "https://avatars.githubusercontent.com/u/24730417?v=4",
"profile": "https://github.com/Mridulbirla13",
"contributions": [
"doc"
"translation"
]
}
],
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/continuous-integration-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,16 @@ jobs:
# Uploading coverage report to codecov.io
bash <(curl -s https://codecov.io/bash)
- name: Generating HTML documentation 🏗️
# As build_contributors_html_page.py can hang due to GitHub rate-limiting,
# we only execute this on master for now. And it should always be executed for one Python version only.
if: github.ref == 'refs/heads/master' && matrix.python-version == '3.10'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mkdir -p public/
mkdocs build
pdoc --html -o public/ fpdf
cd contributors/ && ./build_contributors_html_page.py PyFPDF/fpdf2
cd contributors/ && PYTHONUNBUFFERED=1 ./build_contributors_html_page.py PyFPDF/fpdf2
cp -t ../public/ contributors.html contributors-map-small.png
- name: Deploy documentation 🚀
# GitHub Pages deployment should not be done for all Python versions,
Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,22 @@ and [PEP 440](https://www.python.org/dev/peps/pep-0440/).
5. [Creating Tables](https://pyfpdf.github.io/fpdf2/Tutorial.html#tuto-5-creating-tables)
6. [Creating links and mixing text styles](https://pyfpdf.github.io/fpdf2/Tutorial.html#tuto-6-creating-links-and-mixing-text-styles)
- New translation of the tutorial in Hindi, thanks to @Mridulbirla13: [हिंदी संस्करण](https://pyfpdf.github.io/fpdf2/Tutorial-हिंदी.html)
- New translation of the tutorial in Russian, thanks to @AABur: [Руководство на русском](https://pyfpdf.github.io/fpdf2/Tutorial-ru.html)
- While images transparency is still handled by default through the use of `SMask`,
this can be disabled by setting `pdf.allow_images_transparency = False`
in order to allow compliance with [PDF/A-1](https://en.wikipedia.org/wiki/PDF/A#Description)
- [`FPDF.arc`](https://pyfpdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.arc): new method added.
It enables to draw arcs in a PDF document.
- [`FPDF.solid_arc`](https://pyfpdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.solid_arc): new method added.
It enables to draw solid arcs in a PDF document. A solid arc combines an arc and a triangle to form a pie slice.
### Fixed
- The exception making the "x2" template field optional for barcode elements did not work correctly, fixed by @gmischler
### Changed
- All template elements now have a transparent default background instead of white, thanks to @gmischler
- To reduce the size of generated PDFs, no `SMask` entry is inserted for images that are fully opaque
(= with an alpha channel containing only 0xff characters)
- The `rect`, `ellipse` & `circle` all have a `style` parameter in common.
They now all properly accept a value of `"D"` and raise a `ValueError` for invalid values.
### Deprecated
- `dashed_line()` is now deprecated in favor of `set_dash_pattern()`

Expand Down Expand Up @@ -71,7 +78,7 @@ and [PEP 440](https://www.python.org/dev/peps/pep-0440/).
- `Template` `background` property is now properly supported - [#203](https://github.com/PyFPDF/fpdf2/pull/203)
⚠️ Beware that its default value changed from `0` to `0xffffff`, as a value of **zero would render the background as black**.
- `Template.parse_csv`: preserving numeric values when using CSV based templates - [#205](https://github.com/PyFPDF/fpdf2/pull/205)
- the code snippet to generate Code 39 barcodes in the documentation was missing the start & end `*` characters.
- the code snippet to generate Code 39 barcodes in the documentation was missing the start & end `*` characters.
This has been fixed, and a warning is now triggered by the [`FPDF.code39`](https://pyfpdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.code39) method when those characters are missing.
### Fixed
- Detect missing `uni=True` when loading cached fonts (page numbering was missing digits)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ To get the latest development version:

```bash
# Linux only:
sudo apt-get install libjpeg-dev libpython-dev zlib1g-dev # libpython3.3-dev #(if necessary)
sudo apt-get install libjpeg-dev libpython-dev zlib1g-dev

# Linux and Windows:
git clone https://github.com/PyFPDF/fpdf2.git
Expand Down Expand Up @@ -81,7 +81,7 @@ Documentation:
--------------

- [Documentation Home](https://pyfpdf.github.io/fpdf2/)
- Tutorial in several languages: [English](https://pyfpdf.github.io/fpdf2/Tutorial.html) - [Spanish](https://pyfpdf.github.io/fpdf2/Tutorial-es.html) - [हिंदी](https://pyfpdf.github.io/fpdf2/Tutorial-हिंदी.html)
- Tutorial in several languages: [English](https://pyfpdf.github.io/fpdf2/Tutorial.html) - [Spanish](https://pyfpdf.github.io/fpdf2/Tutorial-es.html) - [हिंदी](https://pyfpdf.github.io/fpdf2/Tutorial-हिंदी.html) - [Русский](https://pyfpdf.github.io/fpdf2/Tutorial-ru.html)
- Release notes: [CHANGELOG.md](https://github.com/PyFPDF/fpdf2/blob/master/CHANGELOG.md)

You can also have a look at the `tests/`, they're great usage examples!
Expand Down Expand Up @@ -146,7 +146,7 @@ This library could only exist thanks to the dedication of many volunteers around
</tr>
<tr>
<td align="center"><a href="https://github.com/tabarnhack"><img src="https://avatars.githubusercontent.com/u/34366899?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Tabarnhack</b></sub></a><br /><a href="https://github.com/PyFPDF/fpdf2/commits?author=tabarnhack" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/Mridulbirla13"><img src="https://avatars.githubusercontent.com/u/24730417?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Mridul Birla</b></sub></a><br /><a href="https://github.com/PyFPDF/fpdf2/commits?author=Mridulbirla13" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/Mridulbirla13"><img src="https://avatars.githubusercontent.com/u/24730417?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Mridul Birla</b></sub></a><br /><a href="https://github.com/PyFPDF/fpdf2/commits?author=Mridulbirla13" title="Translation">🌍</a></td>
</tr>
</table>

Expand Down
6 changes: 6 additions & 0 deletions contributors/build_contributors_html_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# API DOC: https://developer.github.com/v3/issues/

import argparse
import logging
import os
import sys

Expand All @@ -22,6 +23,11 @@
def main():
if "GITHUB_TOKEN" not in os.environ:
raise RuntimeError("Environment variable GITHUB_TOKEN must be defined")
logging.basicConfig(
level=logging.DEBUG,
format="%(asctime)s - %(filename)s:%(lineno)d [%(levelname)s] %(message)s",
)
logging.getLogger("agithub.GitHub").setLevel(logging.DEBUG)
args = parse_args()
ag = GitHubAPIWrapper(token=os.environ["GITHUB_TOKEN"])
org, repo = args.org_repo.split("/")
Expand Down
26 changes: 26 additions & 0 deletions docs/Shapes.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,29 @@ coords = ((100, 0), (5, 69), (41, 181), (159, 181), (195, 69))
pdf.polygon(coords, fill=True)
pdf.output("polygon.pdf")
```

## Arc ##

```python
from fpdf import FPDF

pdf = FPDF()
pdf.add_page()
pdf.set_line_width(2)
pdf.set_fill_color(r=255, g=0, b=0)
pdf.arc(x=75, y=75, a=25, b=25, start_angle=30, end_angle=130, style="FD")
pdf.output("arc.pdf")
```

## Solid arc ##

```python
from fpdf import FPDF

pdf = FPDF()
pdf.add_page()
pdf.set_line_width(2)
pdf.set_fill_color(r=255, g=0, b=0)
pdf.solid_arc(x=75, y=75, a=25, b=25, start_angle=30, end_angle=130, style="FD")
pdf.output("solid_arc.pdf")
```
Loading