Working with PDFs in the Virtual and Physical

How to manipulate pdfs, signing with preview, resizing from commandline and with custom preview filters, giving a digitally signed pdf printed+scanned feel.

[To be prettified later…]

https://ln2.sync.com/dl/9be028810/z6dqkvxh-d3vhdrq4-89eqh74z-wxkqh4z5

I work with pdfs, the first big thing to simplify your life is create signatures, and sometimes even handwritten dates in preview, here is how to do it:

https://www.macrumors.com/how-to/digitally-sign-a-pdf-using-preview-on-mac/

This is the baseline what we all should be doing. There are a few additional problems to tackle:

1. Emulate Print, sign and scan:

Folks explicitly require a printed, physically signed and then scanned copy. That makes a 5min thing much longer. I have to go find a printer, and then scanner. Moreover just wasting physical resource. So there are options:

People made this a service. You can push a digitally signed pdf through lookslike scanned: http://lookslikescanned.com/

A more hands on way is to use some image manipulation tools.You can use sth ike convert for this:

convert Signed.pdf -linear-stretch 1%x0% -rotate 0.5  SignedScanned.pdf

The longer version of this came from here:

https://tex.stackexchange.com/questions/94523/simulate-a-scanned-paper

convert Signed.pdf \( +clone -blur 0x1 \) +swap -compose divide -composite -gamma 0.1 -linear-stretch 1%x0% -rotate 0.5 SignedScanned.pdf

There is a video tutorial with gimp as well:

https://www.youtube.com/watch?v=9RM3WzSvRVc&vl=en

This still requires some work to come up with a good solution, but either approach is workable with some trial and error.

2. Actually Print, Sign, Scan:

For most I end up going this route. I have no way yet to skip the printing with a trip to office printer or library. But scanning with phones has improved a lot. Both notes app & dropbox are good solutions. I use dropbox and it works really well. One new problem that comes with this is, resulting scan pdfs can be large.

3. Resizing pdfs.

There are many ways to do this. You can use convert among other things. One thing I found out, which worked great for me is the Preview>Export. It comes with a default “Reduced Size” filter, but that is hopelessly conservative. Produces really low quality pdfs. However, I came across this really great article on this by chance:

https://www.macworld.com/article/1168311/software/shrink-preview-files-without-ruining-image-quality.html

You can basically create your own filters. I created 2 based on the original filter:

/System/Library/Filters/Reduce File Size.qfilter

I put my custom ones in

/Users/canturk/Library/Filters/Reduce File Size 1MB.qfilter

/Users/canturk/Library/Filters/Reduce File Size 2MB.qfilter

The only changes are as below:

<dict> | <dict>
<key>Compression Quality</key> | <key>Compression Quality</key>
<real>0.0</real> | <real>0.75</real>
<key>ImageCompression</key> | <key>ImageCompression</key>

<key>ImageScaleSettings</key> | <key>ImageScaleSettings</key>
<dict> | <dict>
<key>ImageScaleFactor</key> | <key>ImageScaleFactor</key>
<real>0.5</real> | <real>0.5</real>
<key>ImageScaleInterpolate</key> | <key>ImageScaleInterpolate</key>
<true/> | <true/>
<key>ImageSizeMax</key> | <key>ImageSizeMax</key>
<integer>512</integer> | <integer>2048</integer>
<key>ImageSizeMin</key> | <key>ImageSizeMin</key>
<integer>128</integer> | <integer>128</integer>
</dict> | </dict>

<key>FilterType</key> | <key>FilterType</key>
<integer>1</integer> | <integer>1</integer>
<key>Name</key> | <key>Name</key>
<string>Reduce File Size</string> | <string>Reduce File Size 2MB</string>
</dict> | </dict>
</plist> | </plist>

This is how it surfaces in Preview > Export as the two custom filters added up top.

Leave a Reply

Your email address will not be published. Required fields are marked *