pdf

Does anyone know how I can read PDFs off of a S3 bucket using `pdfplumber`?

Does anyone know how I can read PDFs off of a S3 bucket using `pdfplumber`? Question: I’m trying to read PDF files that are stored in a S3 bucket, using a Python package called pdfplumber. I tried the following approaches, but none of them has worked. Does anyone know how I can read PDFs off …

Total answers: 1

Extract annotations by layer from a PDF in Python

Extract annotations by layer from a PDF in Python Question: I have a PDF with annotations (markups) stored in different layers. Each layer has a specific name. I need to extract the annotations with their layer name. In particular, I’m interested only in the location of the annotation (as in, the bounding box of it) …

Total answers: 2

Align watermark horizontally in the middle in PDF?

Align watermark horizontally in the middle in PDF? Question: i try to align a watermark in a pdf so it is exactly in the middle at the bottom with the following code: from reportlab.pdfgen import canvas from reportlab.lib.units import inch from reportlab.lib import colors from reportlab.lib.pagesizes import A4 from reportlab.pdfbase.pdfmetrics import stringWidth # text = …

Total answers: 1

Issue with loading online pdf in python notebook using langchain PyPDFLoader

Issue with loading online pdf in python notebook using langchain PyPDFLoader Question: I am trying to load with python langchain library an online pdf from: http://datasheet.octopart.com/CL05B683KO5NNNC-Samsung-Electro-Mechanics-datasheet-136482222.pdf This is the code that I’m running locally: loader = PyPDFLoader(datasheet_path) pages = loader.load_and_split() Am getting the following error ————————————————————————— PermissionError Traceback (most recent call last) Cell In[4], line …

Total answers: 2

Scale pdf to DINA4 and then add a 3mm black margin around it (python)

Scale pdf to DINA4 and then add a 3mm black margin around it (python) Question: I have to check if a pdf file has the format of DIN-A4 and if it’s not it should be scaled to DIN-A4 (210mm x 297mm). After this on each side of the pdf should be added a 3mm black …

Total answers: 1

Python – Can I convert values from a pdf to a DataFrame?

Python – Can I convert values from a pdf to a DataFrame? Question: I am trying to convert the values from a PDF into a pandas DataFrame that can be manipulated in Python. I have attached a photo that shows how I currently do it, as well as a sample PDF. Thanks in advance Picture …

Total answers: 2

flask send base 64 encoded pdf string without saving

flask send base 64 encoded pdf string without saving Question: I have a flask application. I am using selenium cdp commands to generate pdfs. I get a base64 encoded string from selenium. Before sending the response as a pdf I save the file in my filesystem. file.write(base64.b64decode(pdf_string[‘data’]) And the response is just send_file(‘path’, ‘name.pdf’) How …

Total answers: 2

How to extract print scaling factor from a PDF file in Python?

How to extract print scaling factor from a PDF file in Python? Question: I would like to extract the PDF scaling factor programmatically using Python. Specifically, I want to extract the scale factor that appears in the "Fit" under "Print Sizing & Handling" when printing the PDF file. For example, if the "Fit" dropdown shows …

Total answers: 2

How to replace a word in pdf with Python

How to replace a word in pdf with Python Question: i want to replace a word in a pdf but when i try to do that it always returns me same pdf. Here is my code block. Currentyle i am using pypdf2 but if is there any suggestion i can switch it. What is the …

Total answers: 1