fpdf2
is a simple & fast PDF creation library for Python that I have been maintaining since mid-2020.
In this article, I'm going to present some of the new features that landed since my last post on the subject. Hence, this will cover versions 2.5.0, 2.5.1 & 2 …
Added
- new parameters
new_x
andnew_y
forcell()
andmulti_cell()
, replacingln=0
, thanks to @gmischler - new
add_highlight()
method to insert highlight annotations: documentation - new
offset_rendering()
method: documentation - new
.text_mode
property: documentation - the page structure of the documentation has been revised, with a new page about adding text, thanks to @gmischler
- a warning is now raised if a context manager is used inside an
unbreakable()
section, which is not supported
Changed
local_context()
can now "scope" even more properties, likeblend_mode
: documentation
Fixed
- No font properties should be leaked anymore after using markdown or in any other situations (cf. #359), thanks to @gmischler
- If
multi_cell(align="J")
is given text with multiple paragraphs (text followed by an empty line) at once, it now renders the last line of each paragraph left-aligned,
instead of just the very last line (cf. #364), thanks to @gmischler - a regression: now again
multi_cell()
always renders a cell, even iftxt
is an empty string - cf. #349 - a bug with string width calculation when Markdown is enabled - cf. #351
- a few bugs when parsing some SVG files - cf. #356, #358 & #376
- a bug when using
multi_cell(..., split_only=True)
inside anunbreakable
section - cf. #359
Deprecated
- The parameter
ln
tocell()
andmulti_cell()
is now deprecated, usenew_x
andnew_y
instead. - The parameter
center
tocell()
is now deprecated, usealign="C"
instead.
Displaying deprecation warnings
DeprecationWarning
s are not displayed by Python by default.
Hence, every time you use a newer version of fpdf2
, we strongly encourage you to execute your scripts
with the -Wd
option (cf. documentation)
in order to get warned about deprecated features used in your code.
This can also be enabled programmatically with warnings.simplefilter('default', DeprecationWarning)
.
Cette année j'ai participé pour la première fois au défi trois fois forgé organisé par le site PtgPtb.fr.
Le principe ? Un défi d'écriture où chaque auteur participe successivement à la création de trois jeux de rôle (JdR).
Nous avons débuté en octobre : chaque participant a soumis une première forge …
Last month, I realized late that October was hacktoberfest month!
This online event is a month-long celebration (October 1-31) of open source software run in partnership with different software companies, with a focus on encouraging contributions to open source projects.
While I participated in the 2019 edition as a contributor …
fpdf2
is a minimalist PDF creation library for Python that I am maintaining.
With the release yesterday of its v2.4.0
, I'm going to present some of its notable new features since the latest minor version.
https://github.com/pyfpdf/fpdf2/
Doc: https://pyfpdf.github.io/fpdf2/
JPEG images …
Undying Dusk is a video game in a PDF format, with a gameplay based on exploration and logic puzzles, in the tradition of dungeon crawlers.
A curse set by the Empress keeps the world in an eternal dusk. You are have recently found shelter in an eerie monastery.
Featuring:
- ~ 200 …
Today, I am happy to announce version 2.3.0 of fpdf2, code name: Unbreakable!
https://github.com/pyfpdf/fpdf2/
Doc: https://pyfpdf.github.io/fpdf2/
Why Unbreakable?
- As a tribute to M. Night Shyamalan movie
- Because using
fpdf2
, your Python code can never break!
...
Just kidding, I would be …
fpdf2
, the library I mentioned in my previous post, cannot parse existing PDF files.
However, other Python libraries can be combined with fpdf2
in order to add new content to existing PDF files.
This page provides several examples of doing so using pdfrw
,
a great zero-dependency pure Python library dedicated …
Today, I am happy to announce a new version 2.2.0 of fpdf2 !
https://github.com/alexanderankin/pyfpdf/
Doc: https://alexanderankin.github.io/pyfpdf/
During the last few months, I contributed a few improvements to fpdf2
,
David Ankin fork of PyFPDF
,
the user-friendly Python library to generate PDFs:
from …
Script to install Datalogics PDF Checker CLI on a Linux system:
curl https://raw.githubusercontent.com/Lucas-C/dotfiles_and_notes/master/bin/install-pdfchecker.sh | bash
PDF_Checker/pdfchecker --profile PDF_Checker/CheckerProfiles/everything.json --input $pdf

The scenario introduces a new Action - Social Distancing - which allows players to explore the costs and benefits of this activity in a cooperative game environment, perhaps giving additional reason to what we are doing in society during the coronavirus pandemic of 2020
Interesting overview of French policy, initiatives & organizations fostering the usage of free/libre/open-source software :
Adullact, CNLL, Etalab, Mutualisation Interministérielle, Direction Interministérielle de la Transformation Publique, Socle Interministériel de Logiciels Libres...
The CNIL seems to be missing in this landscape though.
Source: https://joinup.ec.europa.eu/collection/open-source-observatory-osor/knowledge-centre
Dans la continuité des trois articles précédents, voici 3 derniers scénarios de 30min chacun formant un tryptique inspiré des jeux vidéos Splinter Cell, Metal Gear & Prototype :
- Cthulhu fhtagn
- Évasion
- Labyrinthe
- La Grande Guerre
- Invasion
- La chute du colosse
- Hitman
- Spec Ops [#1](https://chezsoi.org/shaarli/./add-tag/1) - Infiltration
- Spec Ops [#2](https://chezsoi.org/shaarli/./add-tag/2) - Prototype
- Spec Ops [#3](https://chezsoi.org/shaarli/./add-tag/3) …
Funny & well written
Here is a patch to the pdfjam
shell script to make it work under Cygwin:
--- pdfjam.original 2019-01-07 16:12:47.894523500 +0100
+++ pdfjam.patched-for-cygwin 2019-01-07 16:12:33.492142300 +0100
@@ -949,6 +949,9 @@
(umask 077 && mkdir "$PDFJAM_TEMP_DIR")
fi
umask $original_umask
+case `uname` in
+ *CYGWIN*) PDFJAM_TEMP_DIR=`cygpath -w "$PDFJAM_TEMP_DIR"`;;
+esac
##
## TEMPORARY DIRECTORY ALL DONE
##
@@ -1073,7 +1076,10 @@
sourceFullPath="$sourceDir"/"$pdfName"
uniqueName="source-$counter.pdf"
uniqueName="$PDFJAM_TEMP_DIR"/"$uniqueName"
- ln -s "$sourceFullPath" "$uniqueName"
+ case `uname` in
+ *CYGWIN*) cp "$sourceFullPath" "$uniqueName";;
+ *) ln -s "$sourceFullPath" "$uniqueName";;
+ esac
;;
esac
filePageList="$filePageList","$uniqueName","$pageSpec"
@@ -1123,6 +1129,7 @@
texFile="$fileName".tex
msgFile="$fileName".msgs
tempFile="$PDFJAM_TEMP_DIR"/temp.tex
+backslashsafe_filePageList=$(echo $filePageList | sed 's~\\~/~g')
(cat <<EndTemplate
\batchmode
\documentclass[$documentOptions]{article}
@@ -1137,7 +1144,7 @@
\usepackage{pdfpages}
$preamble
\begin{document}
-\includepdfmerge[$miscOptions]{$filePageList}
+\includepdfmerge[$miscOptions]{$backslashsafe_filePageList}
\end{document}
EndTemplate
) > $texFile
Quelques autres sites où trouver des ebooks gratuits et/ou libres de droits :
- https://framabookin.org/b/
- https://fr.wikisource.org/wiki/Wikisource:Accueil
- http://www.gutenberg.org/wiki/FR_Page_d%27Accueil
- https://archive.org/details/frenchbooks
- http://www.livrespourtous.com
- http://www.bouquineux.com
- https://www.ebooksgratuits.com/ebooks.php
- https://pix-geeks.com/ebook-gratuit/
La montée d’un management à distance creuse le hiatus entre le langage des prescripteurs,
qui est visible dans les dispositifs, d’une part, et celui des autres travailleurs, forgé progressivement
dans l’expérience de l’activité elle-même, d’autre part.
Or les dispositifs, pour être des produits sur le marché du management, sont renouve-lés au rythme de sa logique
commerciale. Nous assistons alors à sa sophistication et à son renouvellement effréné, dans une circulation rapide
entre les offreurs de «solutions» managériales, leurs clients, les revues spécialisées et les écoles.
Anglicismes («balanced scorecards», «reporting», «wording»), néologismes («employabilité», «leader naturel»,
«coachabilité»), acronymes («ERP», «CODIR»...) et mots politiques sortis de leur contexte («responsabilité»,
«diversité», «liberté»), laissent régulièrement les travailleurs perplexes dans la mesure où
ces termes ne permettent pas toujours de décrire, de coordonner et de penser leur propre travail.
La dérive des continents langagière est ainsi très fréquente dans les grandes organisations.Nous assistons également à la multiplication de termes visant à euphémiser ou contourner les choses qu’ils désignent,
comme dire «plan social» pour désigner un «licenciement massif», ou «faible diversité» au lieu de «racisme».
La grandiloquence tutoie régulièrement le discours de l’absolu («zéro défaut», «satisfaction totale», «excellence»).
Parfois, les mots disent l’inverse de ce que l’on fait (lorsque cette action est moralement douteuse),
ou bien sont exhibés pour cacher l’absence de la chose désirée.
Sometimes, it's useful to print some source code on paper. And PDF is a very common file format, that you can be sure your printer will accept, and that will let you preview the final page layout. But how to quickly perform syntax-coloring and export to PDF ?
I've been experimenting …