Skip to content
Advertisement

Tag: pdf

Converting PDF to Image without non-python dependencies

I want to create an exe that can be deployed onto other computers. The program needs to be able to read pdf’s and turn them into images, but I don’t want other users to have to download dependencies. My understanding is that py2image and wand both require external dependencies that, if you convert to a exe, other users would also

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 PyPDF2, but the data comes completely messed up. I

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 not working with BytesIO) but I

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 one. Let’s get started. I’m

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 UTF-8. You’re on Python 3, so you

How to rename PDF file, with texts extracted from the PDF file?

I am trying to use Python to rename PDF file using part of the file content. Here is the situation. The PDF file is a commercial invoice, contains wordings “Commercial Invoice” and “Department”. I want to rename the file to “Commercial Invoice” and ” Department “, such as “353624 HR”. Here is what I have so far: it works until

Advertisement