Have you ever ordered a bunch of Fortinet gear... Full Story
By Manny Fernandez
May 22, 2025

Extracting Registration Codes from PDF
Have you ever ordered a bunch of Fortinet gear or services and forgot to add FortiDeploy to you order and now you are sitting with sometimes hundreds of PDF files containing the registration numbers you need to add to support.fortinet.com. How much easier would it be to dump the contents of all the PDF Contract Registration Code
Into a CSV file so you can add the codes faster and identify location, device name, serial number, date, etc.
As you can see in the graphic, It says Contract Registration Code
however if you look at it using pdfplumber
, it displays ContactRegistrationCode
without the spaces. The idea is to have a folder containing all the PDFs. Then we run the script and it will create an output csv
file named contract_codes.csv
(obviously you can modify the script to change it). It will show the file name and the registration code. In my example I ran it from my desktop in a folder named lic2
(For reference, I tried to run Optical Character Recognition (OCR)
against the file and it did not work.
python3 get.py /Users/fernandezm/Desktop/lic2
Recent posts
-
-
Had a customer with over 200 static routes on... Full Story
-
This is a work in progress, I will be... Full Story