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
0 answers

Question about filling forms in an editable PDF file

As title says I'm trying to fill some PDF fields via Python script, here are the things I used for it: [My working environment properties] 0 - Operating system : Windows 7 32-bit 1 - Python version 3.8.3. 2 - An Editable PDF file, you can get it…
Smile
  • 19
  • 1
  • 3
1
vote
0 answers

PDFRW can't find pdf form fields

I am trying to fill PDF using the python library pdfrw. After an initial scan of the pdf file using Master PDF 4 or Adobe Acrobat DC, I get some fields highlighted while a few are left out. So basically I would try to add EditText/Textbox where the…
Anurag-Sharma
  • 4,278
  • 5
  • 27
  • 42
1
vote
2 answers

PDF form data not visible unless clicked after filling using pdfrw

I am trying to fill form data using pdfrw library in Python 3.x. So basically I followed this tutorial - link to create the script for the task. import os import pdfrw INVOICE_TEMPLATE_PATH = 'TATA AIG.pdf' INVOICE_OUTPUT_PATH =…
Anurag-Sharma
  • 4,278
  • 5
  • 27
  • 42
1
vote
0 answers

Xref error while parsing PDF using PyPDF2 and pdfrw?

I am trying to extract the text from the following PDF. First, I used the PyPDF2 library. I used the following code: from PyPDF2 import PdfFileReader pdf = PdfFileReader('March_5_8000/1.pdf',strict=False) information = pdf.getDocumentInfo() This…
Shawn
  • 261
  • 1
  • 7
  • 25
1
vote
0 answers

Insert image to the fillable pdf using pdfrw in specific position

I am able to delete the image from the pdf. using pdfrw as follow template_pdf.pages[0]['/Resources']['/XObject'].pop("/Im2")
1
vote
1 answer

How to make a pdf non editable using python library pdfrw

I'm using pdfrw python library to fill pdf fields from a web form. Then I have to pass it to an e-signature webservice, but they want the pdf to be non editable (flatten). I've tried to flatten it using Adobe, it works but then I can't fill it…
paul.ruelle
  • 132
  • 2
  • 11
1
vote
1 answer

Editing PDF metadata fields with Python3 and pdfrw

I'm trying to edit the metadata Title field of PDFs, to include the ASCII equivalents when possible. I'm using Python3 and the module pdfrw. How can I do string operations that replace the metadata fields? My test code is here: from pdfrw import…
philshem
  • 24,761
  • 8
  • 61
  • 127
1
vote
1 answer

pdfrw - fill pdf with python, trouble using slice for multiple pages

Hi I'm having trouble using pdfrw for python. I'm trying to fill a PDF with pdfrw and I can fill one page. The obj.pages will only accept an integer and not a slice. Currently it will only fill one page specified. When I enter page two in obj.page…
Matthew
  • 13
  • 5
1
vote
1 answer

Placing PDF Art on Reportlab Canvas at Specific Location

I am currently working on a project where I would like to place art which I have in PDF format onto a ReportLab canvas page at a specific location. The idea is that I will be dynamically placing 4 separate pieces of art to create one of the pdf…
Tranqodile
  • 68
  • 5
1
vote
2 answers

PDF glyph spacing and TJ operator

I am new to PDF, and i want to manipulate the space between the characters in a file. I have read the PDFReference and understood some of it. Now, the problem I have is how to calculate the spaces for the text rendering. I have for example: 1 0 0 1…
1
vote
0 answers

TextColor set to invisible in python generated pdf after filling fields from a pdf template with pdfrw

After following these instructions I ended up with a working script that generates a pdf as I desire. Unfortunately, the text is only visible upon clicking the filled fields! (this only happens when using adobe reader, not when viewing the page…
1
vote
0 answers

PDF images unscaled to PDF document using pdfrw/ReportLab

This question is very similar to PDF image in PDF document using ReportLab (Python), but I seem unable to adapt it to my needs: I want to add vectorized images (available in SVG oder PDF format) to an A4 PDF output. The images must not get scaled!…
damada
  • 95
  • 8
1
vote
1 answer

Finding and identifying streams in PDF using python

I've been trying for about a week to automate image extraction from a pdf. Unfortunately, the answers I found here were of no help. I've seen multiple variations on the same code using pypdf2, all with ['/XObject'] in them, which results in a…
user1999728
  • 913
  • 1
  • 8
  • 25
1
vote
2 answers

ReportLab Add Multi-page PDF to Canvas

Using PdfReader along with ReportLab, I am attempting to pull in a PDF page, save it (both successful), then pull in a multi-page PDF and do the same. I know how how to pull in a PDF one page at a time, but I'm struggling to pull in more than one…
Dance Party
  • 3,459
  • 10
  • 42
  • 67
1
vote
1 answer

Using pdfrw and ReportLab to add text to an existing PDF and insert

I want to use pdfrw and ReportLab to: open an existing PDf and add a line of text to it based on x and y coordinates (via ReportLab - drawCentredString(x,y,string) insert the resulting pdf into my report. So far, here's what I've tried as a…
Dance Party
  • 3,459
  • 10
  • 42
  • 67