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
20
votes
2 answers

How to build qpdf on Windows?

When running the checks for my R-package (via devtools::check()) I face the warning ''qpdf' is needed for checks on size reduction of PDFs. I found this question were it was suggested (if I understood the answer correctly) to run…
Qaswed
  • 3,649
  • 7
  • 27
  • 47
9
votes
2 answers

Split a PDF file into another two PDF files using qpdf

Is it possible to split a PDF file into two parts or n parts using qpdf tool? The docs say so but I couldn't find the exact command to do it. I'm using qpdf version 10.0.1.
Alen Paul Varghese
  • 1,278
  • 14
  • 27
5
votes
2 answers

Is it possible to execute QPDF through Python script

I'm working on a python script that processes PDF files, though some of them contain encryption that restricts usage to only printing, which I have to manually remove before I can process them. For that I have been manually using QPDF to remove…
Matt
  • 972
  • 3
  • 11
  • 22
4
votes
1 answer

What different options for password protection does PDF support?

In pdftk I can see three options: 1$ pdftk input.pdf output protected-userpw.pdf userpw very_secret 2$ pdftk input.pdf output protected-ownerpw.pdf ownerpw very_secret 3$ pdftk input.pdf input_pw very_secret output protected-input.pdf When I open…
Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
3
votes
3 answers

Can I bulk-remove links from a pdf from the command line?

I'm downloading some newspapers as pdf (for posterity). One title is a pain, it includes URI links in the pdf itself, if you accidentally click these it opens a browser tab to a page that 500s. It's not so bad on a desktop computer, but a pain in…
John O
  • 4,863
  • 8
  • 45
  • 78
3
votes
2 answers

Using QPDF with C#

I am attempting to translate this qpdf command: qpdf --qdf --object-streams=disable input.pdf editable.pdf into the equivalent method calls I would need when using the qpdf dll (available from here: https://sourceforge.net/projects/qpdf/). I ran the…
prw56
  • 326
  • 2
  • 12
3
votes
1 answer

Qpdf fails to encrypt without passwords

I'm trying to add restriction to a pdf file, but don't need a user password. I fail to get this right for some reason. qpdf.exe --encrypt 40 -modify=y -extract=y -annotate=y -- in.pdf out.pdf The help states that: Either or both of the user…
xcskilab
  • 189
  • 1
  • 9
3
votes
2 answers

In PDF, if Encoding and ToUnicode are both present in PDF, how to map the text extraction?

I used qpdf to uncompress a PDF file and below is the output. You can see that there both, encoding and ToUnicode, are present. If there is only ToUnicode I know how to map individual characters with Cmap file. But if you see output of Content…
2
votes
2 answers

Can I tag a PDF programmatically?

Can an unstructured PDF be tagged using any tools/libraries? Only source of tagging a PDF was using Adobe Acrobat or Auto-Tag APIs (Not something which I am looking forward to + not so great results imo) I know the bounding boxes and semantics of…
2
votes
2 answers

How can I merge pdf files together and take only the first page from each file?

I am using qpdf to merge all pdf files in a directory and I would like to merge only the first page of multiple inputfiles. According to the qpdf documentation on page selection this should be possible. I have tried couple variants without…
Human
  • 726
  • 8
  • 27
2
votes
1 answer

Build a TOC when Concatenating PDFs

I have a dozen essays as PDFs which I want to combine to one concatenated master PDF with a table of content where each entry is a clickable link to the first page of each essay. The TOC could be either a page with internal links or a proper PDF…
halloleo
  • 9,216
  • 13
  • 64
  • 122
1
vote
0 answers

Merge >300 PDF files to a single PDF, error: too many open files

I would like to merge 500 PDF files in R. Usually qpdf::pdf_combine worked fine for a few PDFs, but now I get the error: Too many open files. I found that this error is related to the fact that qpdf opens the files during the process:…
captcoma
  • 1,768
  • 13
  • 29
1
vote
0 answers

QPDF how to detect pages size (or ratio)

How can be detected page size (height x width) with qpdf? I know that it could be that size is something relative, but at least I could know ratio between height and width (eg. a3, a4).
Michele Carino
  • 1,043
  • 2
  • 11
  • 25
1
vote
1 answer

Tool / Command for decrypting in source code of a PDF file?

I am using the qpdf command to view the raw code (source code) of PDF files. Specifically I am using the command: qpdf --qdf original.pdf unpacked.pdf However a lot of PDF metadata is encrypted in this unpacked file and has a lot of unprintable…
Anon
  • 381
  • 1
  • 2
  • 13
1
vote
1 answer

How to decode PDF file and encode it back?

My overall goal is to make some PDF files conform to the PDF/A standard for archival purposes. They fail one requirement, namely that some glyph mappings map to 0, which they should not. My usual strategy was to use an old software called "Pdfedit"…
Smogshaik
  • 180
  • 2
  • 13
1
2 3 4