zilverline / apache-fop-server

Simple webserver that exposes apache fop over HTTP (for instance for non JVM projects)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UserPassword protected PDF files (and possibly PDFInfo properties in general)

ztmr opened this issue · comments

commented

Hi, I like your project so I've decided to reuse it somewhere else which required some changes -- currently only quickly hacked in -- most notable is a support for userPassword. It currently assumes that the call is made via a secure channel but we can improve that later.

In general, I think it would be better if we could pass multiple parameters with various document properties (simply all PDF Info dictionary properties, plus PDF Security properties at least) but this didn't fit my time for experimenting yet.

The application I needed this for generates XSL-FO directly so I am simply using an identity transform (that might be also made optional [for improved performance?] some time later).

There is also demo/gen_pdf.rb -- a modified version of your original script that can be used as a naive performance test.

In addition, I have created a little GitLab CI pipeline to get it all continuously built, dockerized and security-scanned. That also shows some security issues worth resolving.

My fork is here: https://gitlab.com/ztmr/pdf-server -- feel free to cherry-pick whatever you like

Note that I am neither Ruby nor Scala developer so take it more like inspiration than anything serious :) If the time allows, I might keep improving the current code towards the ideas mentioned above but no guarantee.