Recently I had the need to decode a Base64 string and make a PDF of it. Usually I would've written a small utility app, but this time I rolled with powershell:
I'm impressed with how quickly I can knock out a script like this (yes they are .NET assemblies) without having to load a new VS solution. Of course a lot more could be done to this (file format via an argument for example) but I thought I'd share it raw as I know I'll need to use it again one day.
From Matt's Blog
function decodeBase64IntoPdf([string]$base64EncodedString) { $bytes = [System.Convert]::FromBase64String($base64EncodedString) [IO.File]::WriteAllBytes("C:\Users\medmondson\Desktop\file.pdf", $bytes) }
I'm impressed with how quickly I can knock out a script like this (yes they are .NET assemblies) without having to load a new VS solution. Of course a lot more could be done to this (file format via an argument for example) but I thought I'd share it raw as I know I'll need to use it again one day.
From Matt's Blog
This helped me a lot. Life saving example.
ReplyDeleteThank you.
Manu'S Blog: Convert A Base64 String Into A Pdf File >>>>> Download Now
ReplyDelete>>>>> Download Full
Manu'S Blog: Convert A Base64 String Into A Pdf File >>>>> Download LINK
>>>>> Download Now
Manu'S Blog: Convert A Base64 String Into A Pdf File >>>>> Download Full
>>>>> Download LINK zL