PyPDF2 Crash Course - Working with PDFs in Python [2023]

PyPDF2 Crash Course - Working with PDFs in Python [2023]

JCharisTech

1 год назад

42,381 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Niv88
Niv88 - 15.08.2023 17:50

I really really need to know how to flatten a pdf. Ghostscript doesn't work, Magick merges all my pages onto the first. I can't use pdftk on a Silicon Mac, roads all lead to nowhere!

Ответить
Priyanshu BH
Priyanshu BH - 11.08.2023 19:51

HI, you Video was very Helpful !!

Please Please create Video to code to put an image and / or a user defined text as a watermark into a pdf !!!????!!!!!
if not video then please share the code ??

the other videos use the old libraries and not the new ones...

Ответить
Andrew Marty
Andrew Marty - 25.07.2023 18:35

Fantastic Turtorial

Ответить
Mr Inka Hok
Mr Inka Hok - 22.07.2023 12:59

I have a file with 15 pages and I want to write page 2 through page 15 to another file because I no longer need page 1. So I want to throw away page 1.

Ответить
Mr Inka Hok
Mr Inka Hok - 22.07.2023 12:52

Can you help me with this?

Ответить
Mr Inka Hok
Mr Inka Hok - 22.07.2023 12:51

for root, dirs, files in os.walk(main_data_path):
for dir1 in dirs:
huidige_file = path + "\\" + dir1 + "\\" + FILE
if os.path.exists(huidige_file):
pdf = PdfReader(huidige_file)

with open(huidige_file, "rb") as pdf_reader:
file_new = path + "\\" + dir1 + "\\" + outpdffilename

pdfreader = PdfReader(pdf_reader)
for i in range(1, len(pdfreader.pages)):
selected_page = pdfreader.pages[i] # page = pdfreader.pages(i, num_of_pages)
pdf_writer = PdfWriter()
pdf_writer.add_page(selected_page)
with open(file_new, "wb") as outPdf:
pdf_writer.write(outPdf)
print("Created a pdf: '{}'".format(file_new)), print(i)
# pdf_writer.write(outPdf)

Ответить
Mr Inka Hok
Mr Inka Hok - 22.07.2023 12:51

Hello,
I almost succeeded in this. I have one more problem. I want to add more pages to the pdf file. But it overwrites the previous page. I want to add it but I can't.

Ответить
Nazeer Ahmad
Nazeer Ahmad - 18.07.2023 20:54

Thanks

Ответить
Wasim A
Wasim A - 14.07.2023 18:09

you did not cover the real scenarios, when extracted text from research paper pdfs contain weird fonts, non homogeneous spacing, newlines and sometime letters overlap on each other. Can pypdf2 deal with that?

Ответить
Harshit Singh
Harshit Singh - 13.07.2023 18:13

@JCharis Tech how to read number of sections in PDF files ?

Ответить
imthebear imthebear
imthebear imthebear - 01.06.2023 16:43

excellent variable names and clean display really helps with the example

Ответить
lucasmonta1
lucasmonta1 - 03.05.2023 03:48

what is the IDE you are using?

Ответить
Francesco Vecchio
Francesco Vecchio - 26.04.2023 17:24

I have a simple problem; I have to read a pdf and change some words of text and then save to a new pdf that keeps thesame layoutc of originale pdf. I don't need anything else, but I can't find working examples on the web! Can you help me, Thanks, Francesco

Ответить
Shreenath S
Shreenath S - 25.04.2023 16:34

Hi awesome video. I have one question, where i want create replica of pdf through automation python script and save it on cloud. Can u suggest for same?
Advance Thanks

Ответить
Abhijit Phadke
Abhijit Phadke - 01.04.2023 16:04

How to extract embedded files information from a pdf file?

Ответить
Cheong Lily
Cheong Lily - 18.03.2023 18:23

very good video. I have a question if I have a pdf file , i only want 3 things from the pdf. airway bill no, total amount and if it's goods coming in for eg. then it import. how can i extract ?

Ответить
drunkpy
drunkpy - 01.03.2023 08:56

Great video!

Ответить
drunkpy
drunkpy - 28.02.2023 15:03

How do you extract data from PDF to text then systematically show the extracted text on excel?

Ответить
USHA SINGH
USHA SINGH - 20.02.2023 08:55

best tutorial i have ever taken with lots of exercises and detailed explaination. Thank you so much💗💗💗♥

Ответить
Jon
Jon - 08.02.2023 17:20

Really thorough and updated methods, thank you!

Ответить
B C
B C - 09.01.2023 08:24

Awesome!

Ответить
Hugo Ricardo Tapia Garza
Hugo Ricardo Tapia Garza - 08.01.2023 22:50

Great tutorial! Thank you so much!

Ответить
LAuzDev
LAuzDev - 08.01.2023 16:56

do you know how to convert XML in PDF? i was looking for pyxml2pdf but i kinda don't get it at all, i don't know if its a stopped project or i get it wrong

Ответить
Munichandra Reddy
Munichandra Reddy - 08.01.2023 16:42

I want to build one donation website, Please help me,
how to do, and how to add upi option in that website, and I want to store the data web excel or SQL server database ,and how to give that website my friends , please explain me and Don't Skip it , please help me by using Streamlit, please teach the code

Ответить