Skip to content

Instantly share code, notes, and snippets.

View tmsz's full-sized avatar

Tomasz tmsz

  • Wrocław
  • 01:21 (UTC +02:00)
View GitHub Profile
@tmsz
tmsz / MSPrintToPDF_AllowCustomSizes.ps1
Created January 5, 2018 18:51
A script that allows adding custom paper sizes in (forms) through Printer Server Manager for Microsoft Print To PDF virtual printer
# Adds custom paper sizes to Windows 10 'Microsoft print to PDF' virtual printer.
# Based on instructions from:
# https://answers.microsoft.com/en-us/windows/forum/windows_10-hardware/microsoft-print-to-pdf-custom-paper-sizes-possible/90ed3d48-1ece-4ca5-8d3b-ff0af24a7b37?auth=1
# https://franklinheath.co.uk/2015/08/29/custom-page-sizes-for-microsoft-print-to-pdf/
# https://onedrive.live.com/?authkey=%21ABebdrLzeOY7sa4&cid=A34A14B10D9BB9A1&id=A34A14B10D9BB9A1%21854&parId=A34A14B10D9BB9A1%21838&o=OneUp
# This allows to use custom size forms.
# https://technet.microsoft.com/en-us/library/dd759110(v=ws.11).aspx
$GPDCustomSizeMatch = '*DefaultOption: LETTER'