Questions tagged [pdfrw]

pdfrw is a pure-Python library that reads and writes PDF files

pdfrw is developed on github, and installable from PyPI. It works with Python 2 and 3, and has an extensive set of examples.

80 questions
1
vote
1 answer

pdfrw - How to trim white space around the page

How can I find the space around a PDF page that is unused (white) with pdfrw in order to be able to trim it? Maybe if I can go through all the objects and find the closest coordinates to the border of the page...
Magen
  • 33
  • 1
  • 1
  • 7
1
vote
1 answer

reportlab, find position/coordinates for last paragraph in page

I need to insert some text after last paragraph on last page, am not sure if it is possible to find coordinates for last paragraph. As I know reportlab is most robust library for dealing with pdf, however if that is possible via another library will…
1
vote
1 answer

How can I insert a pdf file as a figure inside of another pdf in python?

I'm trying to automatically generate some pdf format reports in Python. I have figures that I want in the reports, but the figures are currently saved as pdfs. Saving the figures as something else is an option, but not ideal for what I'm trying to…
Kyle Heuton
  • 9,318
  • 4
  • 40
  • 52
0
votes
0 answers

How to get an image from pdfrw to be readable for Pillow

I am trying to rebuild an update a script, which finds all images in a pdf and finally saves them. I am able to make out all the images in pdf via pdfrw, but when I want to make them a Pillow Obj I get an Error. I tried different approaches. I know…
0
votes
0 answers

Pdfrw and Fillpdf error while reading XFA pdf in python

I am trying open this file in python https://www.canada.ca/content/dam/ircc/migration/ircc/english/pdf/kits/forms/imm5709e.pdf import pdfrw pdfrw.PdfFileReader('form.pdf') but getting this error (same error with fillpdf) 304 …
Coding Dog
  • 18
  • 4
0
votes
0 answers

Issue with Opening Print Dialog in Adobe Acrobat Automation

encountering a problem while automating PDF form filling and attempting to open the print dialog in Adobe Acrobat using Python. Despite ensuring the correct installation of Adobe Acrobat and validating the code, we encountered difficulties accessing…
0
votes
0 answers

How can I create a signature box on the first page of a PDF file in Python using pdfrw and pdfrw.PdfWriter?

I am trying to create a signature box on the first page of the PDF file. I am getting the following error. pdfrw.PdfWriter().write(pdf_file, pdf_file.getobject(), signature_box) ^^^^^^^^^^^^^^^^^^ AttributeError: '_io.BufferedReader' object has no…
Sapar
  • 1
  • 1
0
votes
0 answers

How to highlight empty cells of a table in a pdf that contains tables

from PyPDF2 import PdfReader, PdfWriter import pdfrw from google.colab import files from google.colab import patches def highlight_empty_cells_in_pdf(table, pdf_path, output_pdf_path): pdf_reader = PdfReader(pdf_path) pdf_writer = PdfWriter() …
anon
  • 1
  • 1
0
votes
0 answers

The link/URL vanishes when pdfrw is used in conjunction with ReportLab

Trying to some add contents to PDF file using pdfrw and ReportLab. If I use PDF file with text having hyperlink, the link just disapperes from the document. Link to pdf File. # split_with_rl.py from pdfrw import PdfReader from pdfrw.buildxobj…
0
votes
0 answers

Placing STAMP/Watermark on a specific position in PDF

I am working on a script that loops through a directory of PDF files, checks if they contain a stamp with the subject 'Brick - Entered by Justin', removes that stamp, and replaces it with a stamp from a variable called 'stamp_path'. The 'stamp_path'…
Merkator
  • 11
  • 5
0
votes
0 answers

Error when filling PDF forms using 'fillpdf' library

When using the fillpdf library in Python to fill a PDF, the output PDF has the checkmarks for the radio buttons off center. Why is this? Template I'm using to fill out: Checkmarks are centered on radiobuttons Python Code: from fillpdf import…
0
votes
0 answers

Merging PDF files from list of files with full path : input1.pdf ; input2.pdf ; output.pdf

I would like to get a script able to to merge many PDF (but 2 by 2) into a single pdf from a list (XLS, TXT, CSV...) like this one…
0
votes
1 answer

Merge multiple pdf with the acroform

I have a pdf file with two pages and on the first page a form field. I successfully fill out the form from the csv file and save as separate files approximately 400pdf files. Now I need to merge them into one file so I can print them in bulk. I have…
cinkim
  • 1
  • 1
0
votes
1 answer

How do you fix an attribute error when using "fillpdfs.write_fillable_pdf"?

I am trying to fill out the rest of a partially filled out pdf form, however, when I try to update some of the values in the form using "fillpdfs", I receive a Attribute Error stating: 'NoneType' object has no attribute 'update'. Any help in…
TheStone
  • 11
  • 2
0
votes
0 answers

duplicate filed name after merge pdf file make field invisible in python pdfrw

I want to make two pages of pdf file which read from the original cc.pdf. file cc.pdf is only has 1 field, named "zip". After merging, the second page is invisible (due to duplicate field) writer = pdfrw.PdfWriter() test1_pdf=…