1、读写PDF from PyPDF2 import PdfFileReader, PdfFileWriter readFile = 'read.pdf' writeFile...
PyPDF2is a Python module that we can use to extract a PDF document’s information, merge documents, split a document, crop pages, encrypt or decrypt a PDF file, and more. We open the PDF document in read binary mode usingopen('document_path.PDF', 'rb').PDFFileReader()is used to cr...
split_pdf_1(filename, file[0], file[1], file[2]) File "C:/Users/oqur2c/.spyder-py3/temp.py", line 22, in split_pdf_1 page_count = pdf_input.getNumPages() File "D:\ProgramData\Anaconda\lib\site-packages\PyPDF2\pdf.py", line 1150, in getNumPages raise utils.PdfReadError(...
PdfFilewWrite对象可以创建一个新的PDF文件。但PyPDF2不能将任意文本写入PDF,PyPDF2写入PDF的能力,仅限于从其他PDF中拷贝页面、旋转页面、重叠页面和加密文件。 模块不允许直接编辑PDF。必须创建一个新的PDF,然后从已有的文档拷贝内容。 import PyPDF2 #打开PDF,创建File对象,还有创建PdfFileReader对象,从打开的PDF...
I get an mysterious error with the PDF Reader using python3 on the file "Werner - Fragen und Antworten zu Werkstoffen.pdf". My Code: import fnmatch import os from PyPDF2 import PdfFileReader for file in os.listdir('.'): if fnmatch.fnmatc...
However, the image is not shown in the terminal, which cannot be obtained using pyPDF2. Merging Multiple PDF Files into one PDF You will be merging two different pdf files into a single pdf file. The old PDF file is previous that you've worked with, whereas a new PDF file can be ...
I made this mistake when I reproduced the case Contributor anakin87 commented Dec 1, 2020 Please read this. It seems that your document is not valid. Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment Assignees No one assigned Labels None...
【最新代码,更新PyPDF2后可用】用的3.8的python 2023.1.25更新 #-*- coding: utf-8 -*-'''本脚本用来合并pdf文件,支持带一级子目录的 每章内容分别放在不同的目录下,目录名为章节名 最终生成的pdf,按章节名生成书签'''importosimportsysimportcodecsfromPyPDF2importPdfReader, PdfFileWriter, PdfMergerimport...
raise utils.PdfReadError("Illegal character in Name Object")PyPDF2.utils.PdfReadError:Illegal characterinName Object 找到对应的报错文件 代码语言:javascript 复制 File"D:\projects\myproject\venv\lib\site-packages\PyPDF2\generic.py",line484
原博文 PyPDF2 编码问题 PyPDF2.utils.PdfReadError Illegal character in Name Object 2020-04-18 16:34 −... 活捉火星人 0 2025 java.lang.IllegalArgumentException: Invalid character found in method name. HTTP method names must be tokens ...