Questions tagged [qpdf]

QPDF is a free command-line program that can convert one PDF file to another equivalent PDF file.

QPDF is a command-line program that does structural, content-preserving transformations on PDF files. It could have been called something like pdf-to-pdf. It also provides many useful capabilities to developers of PDF-producing software or for people who just want to look at the innards of a PDF file to learn more about how they work.

QPDF is capable of creating linearized (also known as web-optimized) files and encrypted files. It is also capable of converting PDF files with object streams (also known as compressed objects) to files with no compressed objects or to generate object streams from files that don't have them (or even those that already do). QPDF also supports a special mode designed to allow you to edit the content of PDF files in a text editor.

49 questions
0
votes
1 answer

How can I optimize my pdf repository after splitting it by page?

I have about 20 large pdfs which I have split by pages for easier access. When I split it by pages using qpdf I am observing an inflation of 10x in total size, meaning that I have some redundant data in all per-page pdfs. It is very likely stored…
pkgitlab
  • 3
  • 2
0
votes
1 answer

How to invert pdf even and odd pages?

I have good amount of PDFs, and I noticed that some of them, have pages in a wrong order: Right Order: 1-2-3-4-5-6-7-8-9-10...120-121 Wrong order: 1-2-4-3-6-5-8-7-10-9...121-120 The first 2 pages are ok, but the other ones, are totally messed up. As…
0
votes
1 answer

Bash script qpdf to split multiple pdfs in 1 directory

I wrote a simple bash script as I need to split multiple pdfs into 2 pdfs on a regular basis. I need them to be split in the same sequence each time (pages 1-5 and 6 to last page). I need the newly split pdfs to be named uniquely so I can keep them…
PonH
  • 11
  • 3
0
votes
1 answer

pdf how to batch list pdf having annotations? qpdf? pdfinfo?

I was surprised when I printed a pdf which I annotated with Okular that print was without the annotations eventhough it does show on the screen. I have to save the annoted file as printed pdf, then print it. Question: how can I list all pdfs having…
user2718593
  • 111
  • 8
0
votes
1 answer

How to reference text content in preformatted PDF (QDF)?

When editing the source of a PDF file with a text editor, I can use an object more than once by referencing it multiple times. This example is a reference to object 15: /Resources << /XObject << /Fm0 15 0 R >> >> If object 15 is…
mabam
  • 3
  • 2
0
votes
1 answer

QPDF giving file not found error in python

I am using qpdf to decrpyt pdf files (encrytpted but without password) as pypdf2 decryption doesn't work. It is working on command line but with python giving FileNotFoundError qpdf --decrypt --replace-input test.pdf # it's working; replacing…
ggaurav
  • 1,764
  • 1
  • 10
  • 10
0
votes
2 answers

Using Zsh and QPDF to decrypt multiple PDFs

From this answer https://stackoverflow.com/a/59688271/7577919 I was able to decrpypt multiple PDFs in place using this bash script: temp=`ls`; for each in $temp; do qpdf --decrypt --replace-input $each; done However, I had initially attempted to…
CT Hall
  • 667
  • 1
  • 6
  • 27
0
votes
1 answer

Unable to decrypt PDF in node using node-qpdf

We need to decrypt the password protected PDF file using node. We are using the node-qpdf. Here is our scenario. 1). We are getting the password protected PDF file as input. 2). using the QPDF , with available password ,we are trying to decrypt…
Shiv
  • 11
  • 1
  • 5
0
votes
1 answer

Sending password protected attachments via SendGrid

I want to send password protected pdfs as email attachments using SendGrid for nodejs. I tried to password protect my pdf using qpdf. This outputs a new pdf file that is password protected locally. I then try to read data from this file and send it…
0
votes
0 answers

Different cmaps for different pdfs, how to make a global cmap, so as to process many pdfs with same fontmap to /toUnicodemap

I have many pdfs, which when copied render incorrect text, due to bad fontmap to unicodemapping Something like this : Original - निर्वाचक Rendered when copied : ननरररचक I have gone through various answers : Unable to copy exact hindi content from…
aspiring1
  • 344
  • 1
  • 13
  • 32
0
votes
1 answer

PDF: obfuscating text encoding to prevent automatic parsing and copy+paste

I want to make a PDF available on my website, but want to prevent the automatic parsing by bots that might not respect the normal PDF "security". The reason is that this is also commercially published and I am allowed to share for "personal use",…
Rob Hall
  • 1,358
  • 3
  • 11
  • 17
0
votes
1 answer

qpdf has started throwing "External component has thrown an exception" on qpdf_init()

As of today, qpdf stopped working on my server. It's been running for a few weeks without any issues, but today I am getting a "External component has thrown an exception" error, I am not getting this issue on my dev machine, only on the server once…
0
votes
1 answer

check checkBox using ffh.getFieldType() == "/Btn" with qpdf lib

I use the qpdf it works when I use /Tx for filling text field. But it doesn't work for checking a checkBox : Lib header : https://github.com/qpdf/qpdf/blob/aa602fd107a622a3f12e6530220bb0303b95b520/include/qpdf/QPDFFormFieldObjectHelper.hh My code …
smawell
  • 43
  • 10
0
votes
1 answer

How to check if Encoding and ToUnicode are properly done for a pdf?

I am using qpdf to check if Encoding and ToUnicode is properly set up (encoded) for a PDF file by using the following command and look for 'ToUnicode' word in the text file. The purpose is to make sure that ligatures within a file can be decoded…
Jun
  • 2,942
  • 5
  • 28
  • 50
0
votes
1 answer

How to setup linearized PDF(web fast view property) using qpdf in asp.net application

QPDF could convert a pdf to linearized pdf(web fast view property). I could use the command line: qpdf --linearize input.pdf output.pdf to transfer a pdf to a linearized pdf. How could I use it on asp.net program? My code is like that private…
wbing520
  • 1,501
  • 1
  • 9
  • 9