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
8
votes
6 answers

How to edit editable pdf using the pdfrw library?

I been doing research on how to edit PDF using Python and i have found this article: How to Populate Fillable PDF's with Python However there is a problem once the program runs and you open the PDF the document is not populated only when you click…
John
  • 81
  • 1
  • 3
6
votes
2 answers

How to Save io.BytesIO pdfrw PDF into Django FileField

What I am trying to do is basically: Get PDF from URL Modify it via pdfrw Store it in memory as a BytesIO obj Upload it into a Django FileField via Model.objects.create(form=pdf_file, name="Some name") My issue is that when the create() method…
Hybrid
  • 6,741
  • 3
  • 25
  • 45
6
votes
1 answer

How to extract images and image BBox coordinates using python?

I am trying to extract images in PDF with BBox coordinates of the image. I tried using pdfrw library, it is identifying image objects and it have an attribute called media box which have some coordinates, i am not sure if those are correct bbox…
Satyaaditya
  • 537
  • 8
  • 26
5
votes
1 answer

ReportLab and pdfrw: Importing Scanned PDF

Using the code below, I am trying to import a pdf page into an existing canvas object and save to PDF. This usually works just fine, but I noticed that when I try it with a PDF generated from a scanned document, it results in a blank page. Any…
Dance Party
  • 3,459
  • 10
  • 42
  • 67
4
votes
2 answers

Using a font while filling in a pdf form using pdfrw

I managed to fill in a pdf form using Python and pdfrw, I was wondering if it is possible to specify a font for the text that is being filled in, since the filled in texts doesn't match the font of the rest of the file. I am making use of…
4
votes
1 answer

Python Django PDF Flattening of Form Fields

I have a project where I need to fill out pre-made PDFs and the most logical solution that comes to mind to accomplish this is to make the pre-made PDFs into PDF forms so there are tags where input values are supposed to go, then I can look through…
ViaTech
  • 2,143
  • 1
  • 16
  • 51
4
votes
5 answers

How to fill PDF forms using Python

I have a PDF form created using Adobe LiveCycle Designer ES 10.4. I need to fill it using Python so that we can reduce manual labor. I searched the web and read some article most of them were focused around pdfrw library, I tried using it and…
Atinesh
  • 1,790
  • 9
  • 36
  • 57
4
votes
3 answers

How to extract a PDF's text using pdfrw

Can pdfrw extract the text out of a document? I was thinking something along the lines of from pdfrw import PdfReader doc = PdfReader(pdf_path) page_texts = [] for page_nr in doc.numPages: page_texts.append(doc.getPage(page_nr).parse_page()) #…
Roman
  • 8,826
  • 10
  • 63
  • 103
4
votes
1 answer

How To Extract Data From PDF In Python Using PDFrw

I am trying to use PDFrw to get data from a certain PDF (Let's say the one at the top right of the page HERE). I am using PDFrw to do this. I have looked through the documentation that they provide (I couldn't find much) and looked at the example…
Nick
  • 181
  • 1
  • 17
3
votes
1 answer

Serving dynamic PDF through Flask, generated with pdfrw

I'm trying to serve a dynamic PDF to my users through Flask. They fill a form to get some calculations presented, but they would like to auto-fill the values to a PDF-template and then print it on paper. I got it working locally, just filling the…
mag37
  • 45
  • 6
3
votes
1 answer

How to make fillable pdf to read only pdf using python pdfrw package

I am using pdfrw package to fill pdf file and i am looking for make the pdf to read only but i am not able to create can any one help me with this def write_fillable_pdf(input_pdf_path, output_pdf_path, data_dict): template_pdf =…
3
votes
1 answer

Updated pdf fields don't show up when page is written

I updated the pdf fields by using Python package pdfrw and created a new pdf. But the updated fields don't show up when I open it with Adobe Reader. However, the fields are able to show with manual clicks. I've tried the…
3
votes
0 answers

Python: Insert image into signature field of a PDF

I have a PDF 'template' file and a PNG image. I've been able to insert text into the PDF using the pdfrw library where I created a dictionary of the fields in the PDF with values for it, but I was wondering if there's a way I can insert an image in…
Ron
  • 31
  • 2
3
votes
2 answers

Working with streams in PDFrw for Python?

I'm trying to read in an example PDF with PDFrw. The PDF contains the phrase Hello Matthew in the bottom left corner at coordinates (100, 100). When I attempt to output the text (if I even can?) I get a stream of data. I can't seem to figure out how…
Matthew
  • 837
  • 3
  • 18
  • 33
3
votes
2 answers

ghostscript or python : how to combine pdf of different page sizes into a pdf of same page sizes?

I searched the stackoverflow for the problem. The nearest link is: How to set custom page size with Ghostscript How to convert multiple, different-sized PostScript files to a single PDF? But this could NOT solve my problem. The question is plain…
BhishanPoudel
  • 15,974
  • 21
  • 108
  • 169
1
2 3 4 5 6