Preparing documentation for the European Court of Human Rights: Org Mode, pdftk and Latex to the rescue

Autoría: Javier de la Cueva.
Tags: ECHRLatexOrg Modepdftk.

Last week I had to file an application at the European Court of Human Rights. I have to say that it is a really peculiar system for 2026. According to the Court website,

The application form should be downloaded, completed, printed out and sent by post to the Court with the necessary documents. No other form must be used.

https://www.echr.coe.int/apply-to-the-court

The application form is a pdf, where you have to fill the appropriate information. It can be downloaded from several links, depending on the language you will use to initiate the proceeding. This is the link for the English language form:

https://www.echr.coe.int/documents/d/echr/application_form_eng

Once you have downloaded it, it is worth mentioning the admonition you will find at the right top part of the form in red font colour and inside a frame with also red borders. It states:

Please note that this form will work correctly only with Adobe Reader 9 Upwards (download available from www.adobe.com).

Please save a copy of this form locally before filling it in using Adobe Reader, then print it and post it to the Court.

Adobe Reader only runs on Windows, OsX and Android. There is no version for Linux nor for *BSD, so I solved this issue with a Windows 10 I have installed in a Virtual Box inside Debian. I opened Adobe, filled the form, printed it as a pdf file inside a shared directory, and finally printed it from Debian.

It is really funny (or is it a tragedy?) that the European Court of Justice, the pinnacle of the protection of Human Rights in the 46 States members of the Council of Europe, forces us to accept terms and conditions of Adobe proprietary and closed format to be able to exercise our rights. It is paradoxical that the access to the jurisdiction of a Human Rights Court imposes the acceptance of terms and conditions set forth by a company which business does not comply with a human right such as privacy (for a complete idea, read the terms and conditions).

And here comes the Org Mode and Latex item. In Section I of the form, entitled “List of accompanying documents”. Your obligation as an applicant is clearly described:

You MUST:

In my case, I had 22 pdf documents I had to enclose, which meant around 300 pages, that I had to print and number consecutively.

As I drafted the facts in the application, I copied the relevant documents inside a new directory and renamed the file with the pattern doc-01.pdf to doc-22.pdf. Nonetheless, after finishing your work you may decide that something is not clear, it is not relevant or you decide to include other items, altering the initial composition.

Instead of using pdftk command in a terminal to produce the final pdf, where you have included all the files so then you will be able to number them, I find it more useful to use an org mode file where I write the command. I prefer that a new document begins in an odd page. Therefore, all documents should have even number of pages. Obtaining this result is easy, you just have to produce a blank pdf (with Libreoffice, for example) and add it at the end of the documents with odd number of pages. The final command is something like this:

#+beginsrc sh
cd ~/work/included-documentation;
pdftk doc-01.pdf \ <— even page document
    doc-02.pdf blank.pdf \ <— odd page document
    doc-03.pdf blank.pdf \ <— odd page document
    doc-04.pdf \ <— even page document
    doc-05.pdf blank.pdf \ <— odd page document
    doc-06.pdf \ <— even page document
    doc-07.pdf \ <— even page document
    …
    doc-22.pdf \ <— even page document
cat output all-documents.pdf
#+endsrc

Once you have produced the final big document (301 pages in my case), you need to number it. The best advice I could read was by Neverdimed (based on an initial solution of Soul Singin’ in Debian Forums):

https://unix.stackexchange.com/questions/693863/add-page-numbers-to-pdf

\documentclass[twoside, a4paper, 12pt]{article}
\usepackage{pdfpages}
\usepackage{changepage}
\usepackage{fancyhdr}

\setlength\topmargin{-0.675in}
\setlength\textheight{7.0in}
\setlength\textwidth{7.0in}
\setlength\oddsidemargin{-0.25in}
\setlength\evensidemargin{-0.25in}
\setlength{\headheight}{13.59999pt}

\strictpagecheck

\fancypagestyle{mystyle}{%
\fancyhf{}
\fancyhead[LE,RO]{\small\thepage}
}

\begin{document}
    \includepdf[pages=-,pagecommand={\thispagestyle{mystyle}}]{i-need-numbers.pdf}
\end{document}

I changed the {i-need-numbers.pdf} of the latex code into the name of my file, all-documents.pdf, saved the latex code as ‘numbering.pdf’ and executed the command ‘pdtlatex numbering.pdf’ to obtain a marvellous document with the pages 1 to 301 on the upper left corner. Impressive.

I printed the application, printed the 301 pages and went to the post office to send it by certificate mail, giving a big itadakimasu to all the developers, forum participants and other unknown people that made me save such a long time.