Skip to content

Tag: pdf

How to extract Table from PDF in Python? [duplicate]

This question already has answers here: How can I extract tables from PDF documents? (4 answers) Closed 7 days ago. I have thousands of PDF files, composed only by tables, with this structure: pdf file However, despite being fairly structured, I cannot read the tables without losing the structure. I tried PyP…

Writing text over a PDF in python3

I am trying to write some string to a PDF file at some position. I found a way to do this and implemented it like this: It throws me an error at can.save() line The error : Have read up at a lot of places on the internet. Found the same method everywhere. Is it the wrong way to do.

Convert PDF page to image with pyPDF2 and BytesIO

I have a function that gets a page from a PDF file via pyPdf2 and should convert the first page to a png (or jpg) with Pillow (PIL Fork) That results in an error: OSError: cannot identify image file <_io.BytesIO object at 0x0000023440F3A8E0> I found some threads with a similar issue, (PIL open() method …

Download pdf in memory python

I want to open a pdf in my Python program. So far that works. Right now I open the pdf from my local disk, but I want it to fetch the pdf from the internet, instead of opening it from my local drive. Note that I don’t wish to save the existing_pdf, once I fetched it from the internet I

Why PDFKit doesn’t work well with margins?

although I just don’t have the need to ask something normally (internet is just a gold mine, especially this site), this is getting me off, as I had been two days trying to get this working and I don’t find anything useful. Link for similar post would be thanked if founded, as I didn’t found…

Error in the coding of the characters in reading a PDF

I need to read this PDF. I am using the following code: However, the encoding is incorrect, it prints: But I expected How to solve it? I’m using Python 3 Answer The PyPDF2 extractTest method returns UniCode. So you many need to just explicitly encode it. For example, explicitly encoding the Unicode into…