Font size #610
Larbo53
started this conversation in
Ask for help with specific PDFs
Font size
#610
Replies: 1 comment
-
I changed the measurements with a satisfactory result. Thank you for your help. Sincerely New measruremenets |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I am extracting several areas from the attached pdf and some areas are empty. I think the problem is the size of the font.
What is the solution?
Thanks for any help.
Sincerely
My code 👍
import pdfplumber
path='/Users/yves/Documents/Factures/'
fichier=path+'MILLBAKERFV_21090117.pdf'
Zones_extraire={}
pdf = pdfplumber.open(fichier)
print(set(char["fontname"] for char in pdf.chars))
Zones_entete={'Num_facture': (482.0, 50.0, 566.0, 68.0), 'Avoir_facture': (482.0, 32.0, 566.0, 50.0),
'Date_facture': (482.0, 77.0, 566.0, 95.0),'Identifiant_client': (416.0, 140.0, 509.0, 155.0)
}
for b in Zones_entete.items():
Valeur=pdf.pages[0].within_bbox(b[1], relative = True).extract_text() # ne lit que la 1ière page
Zones_extraire[b[0]]=Valeur # ajouter à un dictionnaire clé (row[1]) le nom de colonne : valeur = contenu du rectangle
MILLBAKERFV_21090117.pdf
Code_client=Zones_extraire['Identifiant_client']
Num_facture=Zones_extraire['Num_facture']
Date_facture=Zones_extraire['Date_facture']
Type_document=Zones_extraire['Avoir_facture']
Beta Was this translation helpful? Give feedback.
All reactions