loading words...

Mar 15, 2019 21:00:08

markpdf – a CLI tool for Watermarking PDF @ajaxray

by @OnepostersGems PATRON | 247 words | 🐣 | 174💌

200WaD Research Lab: Oneposters

Current day streak: 0🐣
Total posts: 174💌
Total words: 48536 (194 pages 📄)

Jan 19, 2019 16:46:03 @ajaxray 

" it's written in golang"

I’ve released a PHP library for Adding watermark on image or PDF with PHP last year. As of today, it has 43 stars and 15 forks and 16 issues (10 of which are closed).

The Problem with PHP-Watermark

Most of the issues in PHP-Watermark library were coming from one single point – file size and quality issue when watermarking PDF files. Actually, when using the imagemagick + ghostscript for extraction and joining pdf pages, it has a few drawbacks including file-size issue. And this is how this PHP library works internally with PDFs. Many developers were asking for a solution about the file size and PDF quality since releasing of this library.

The Solution – a new CLI tool

So, I’ve created a command line tool for PDF watermarking that will work without converting pages into images. As a result, you’ll get better PDF quality and dramatically smaller file size.

Here is this tool: markpdf. See the readme for usages, options and examples.

If you’re already a user of php-watermark, please note that it’s not a PHP library. So you’ve to use it using exec, shell_exec or (recommended) Symfony Process Component.

BTW, it's written in golang. But you don't need to install golang because you can just download the compiled, independent binary from release page and use it instantly.

You're welcome to download, test and give your valuable feedback!

This post is also published on my personal blog with minor modifications.

                          Originally published at ajaxray.com

contact: email - twitter / Terms / Privacy