pikepdf is a Python library for reading and writing PDF files via the qpdf library
Questions tagged [pikepdf]
31 questions
16
votes
3 answers
Python Data Extraction from an Encrypted PDF
I am an recent graduate in pure mathematics who only has taken few basic programming courses. I am doing an internship and I have an internal data analysis project. I have to analyze the internal PDFs of the last years. The PDFs are "secured." In…

Beginner
- 310
- 1
- 4
- 14
11
votes
3 answers
I had a problem with python library pikepdf
When trying to install the python moduel pikepdf using pip, this error pops up:
Building wheels for collected packages: pikepdf
Building wheel for pikepdf (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for…

duke
- 111
- 1
- 3
5
votes
1 answer
error: Unable to find trailer dictionary while recovering damaged file
PyPDF2 fail sometimes with decryption of some PDF files, and I am trying do decrypt them with pikepdf
but I am getting this error: Unable to find trailer dictionary while recovering damaged file
Any ideas?

Yordan
- 113
- 2
- 7
4
votes
2 answers
PyPDF2 error "PyCryptodome is required for AES algorithm"
I've got hundreds on PDFs I need to set password. I tried to use pyPDF2 to do that but I got an error:
"DependencyError: PyCryptodome is required for AES algorithm".
I've tried to google any other module like pikepdf but I found only how to crack…

rammbb
- 41
- 1
- 1
- 4
4
votes
0 answers
How can I fix my Python pikepdf import error?
I am trying to install the pikepdf package although, I am receiving the below error when I run: import pikepdf.
What do I need to fix in order to have pikepdf import…

santorch
- 151
- 1
- 14
3
votes
3 answers
Python Visual Studio Code Module not found
Have installed Python 3.7.6 and am trying to write a code in Visual Studio Code
Using: import pikepdf
Gets me the error of ModuleNotFoundError: No module named 'pikepdf'
However, I run "pip install pikepdf" and I get:
Requirement already satisfied:…

Mario Garcia
- 189
- 1
- 2
- 10
3
votes
4 answers
How to fix a pyinstaller 'no module named...' error when my script imports the modules pikepdf and pdfminer3?
I've built a working py script using PikePDF and PDFminer3 that will take a PDF off my desktop and create a txt file out of the words available.
The purpose of this is to help my team at work amend legal documents that often cannot be copy-pasted…

Rishabh Aneja
- 33
- 1
- 4
2
votes
0 answers
Send pdf from pikepdf as BytesIO stream - flask send_file content length mismatch
I am trying to send a pdf as an api response using Flask. However, I get a ERR_CONTENT_LENGTH_MISMATCH on the client side of the api.
Maybe this is caused by the stream not being complete while the file is send to the client? Idk
from flask import…

Johann Süß
- 97
- 1
- 12
1
vote
1 answer
deleting and moving elements in pikepdf
I'm trying to create a kind of page break function for pdfs using pikepdf.
Given some vertical position (dotted grey line in the image) I want to split the page into two pages. I want to keep the page size and move the elements under the line to the…

iHnR
- 125
- 7
1
vote
0 answers
Split pdf in more than one page with pikepdf in python
I need to split a pdf file in group of pages specified by the user. For example, I have a pdf with 20 pages, and I want to split it in groups of 5 pages. The output would be 4 pdfs of 5 pages each.
I read the pikepdf documentation and it can only…

Agusms
- 17
- 4
1
vote
1 answer
Add Text/String to PDF with pikepdf
I'd like to add a text/string at a specific position to each page to an existing PDFs (multiple pages) in "PDF/A-1b" standard.
I've read the documentation but I can't work it out (probably do not understand it enough so far) how to use streams and…

Gunnar Kohs
- 31
- 1
- 5
1
vote
2 answers
using pikepdf in python
After installing pikepdf, while trying code with pikepdf, I am getting error messages as below :

Monoj Chakraborty
- 15
- 4
1
vote
1 answer
Edit meta data with Pikepdf
Anyone with experience editing pdf metadata with pikepdf?
I installed this library since other librarys seems to have some issues with table of contents and/or bookmarks. I also tried pdfrw, but this library couldn't overwrite existing values so,…

Zug_Bug
- 186
- 10
1
vote
2 answers
Why does pikepdf fill-in some PDF fields but not others on a PDF created with Acrobat DC
I have a PDF with form fields created with Acrobat DC by my customer. Using Python pikepdf I'm filling those fields programmatically. The strange issue is that some fields are filled, others not. I checked and double-checked with Acrobat DC: All…

user2550842
- 31
- 2
0
votes
0 answers
PikePdf returning incorrect page count, how to get correct page count?
I am using pikepdf to open a pdf file and get the page count for that file. My code is roughly:
import pikepdf
with open(file_uri, "rb") as input_pdf:
input_reader = pikepdf.Pdf.open(input_pdf)
page_count: int = len(input_reader.pages)
Very…

Mason Caiby
- 1,846
- 6
- 17