Sparticuz / node-qpdf2

A Content Preserving transformations on PDFs wrapped around QPDF
MIT License
20 stars 16 forks source link

docs: Actually a qpdf wrapper or just PDF encryption lib that uses qpdf? #41

Closed mattpr closed 10 months ago

mattpr commented 10 months ago

A very simple wrapper for qpdf which is performs content-preserving transformations on PDF files. It includes encrypting and decrypting PDF files...

For instance I need to linearize a PDF. Read the top of your readme and figured this was the ticket.

The docs were sparse and I looked in the code and realized you only support encrypt and decrypt and there is no general wrapper pass-through type stuff to take care of managing running qpdf in flexible ways.

It would be nice if the top of the readme made it clear that this isn't a qpdf wrapper but rather a PDF encryption/decryption lib that happens to use qpdf under the hood.

Or maybe

It ONLY includes encrypting...

?

Would be cool if the API was more generalized to support a fuller qpdf feature set with option overrides, etc...but none of us have enough time.

Maybe look at this one for inspiration? https://github.com/photostructure/exiftool-vendored.js

Sparticuz commented 10 months ago

Feel free to send in a PR supporting the features that you need. It's pretty simple to add new options.

mattpr commented 10 months ago

Well to turn this into an actual qpdf "wrapper" would be a complete re-write/architecture: for wrappers it doesn't make sense to hard-code a bunch of js/ts code one-to-one to CLI features, but rather support more general APIs with parameter pass-through for less common cases.

Anyway, the point here was more that the readme and package name are both misleading. This isn't a qpdf wrapper, it is a pdf encryption/decryption lib that happens to use qpdf under the hood for those 2 functions.

I will open a PR for the README if you want. :)

Just trying to save other people looking for a qpdf wrapper from also wasting their time trying to figure out the wrapper APIs (that don't exist) due to this ^^^.

All good.