Franklin Heath Ltd

I don’t usually post Windows tips and tricks, but I thought this might be useful as I haven’t seen it mentioned anywhere else. Briefly, the Windows 10 Print to PDF support doesn’t allow custom page sizes as it comes, but there is a simple way to enable it.

I’ve been setting up a new office PC with Windows 10 (while checking out the security and privacy settings, which have been well covered elsewhere). I use PDF a lot, for delivering clean versions of reports to clients and distributing presentation notes, so I was pleased to see Microsoft have built PDF creation in to Windows 10. It would be good if I didn’t need to install Acrobat any more, as it’s expensive, uses a lot of disk space, and is one more thing you have to keep up to date with security patches. However, one thing we currently use PDF for is preparing electronic payslips, for which we use a custom, small page size, and this wasn’t working with the Microsoft implementation.

It turns out that Windows printer drivers need to explicitly specify that they will support custom page sizes, and for some reason Microsoft Print to PDF doesn’t do that. Being an incurable tinkerer, I thought I’d try modifying it and see if it worked.

First you need to find the GPD file for the driver, which is installed under C:\Windows\System32\spool\V4Dirs . I was able to find the folder and file names by using regedit and looking in the registry key HKEY_LOCAL_MACHINE\SOFTWARE\ Microsoft\Windows NT\ CurrentVersion\Print\Printers\ Microsoft Print to PDF\PrinterDriverData . On my system it is \74e1846.gpd ; you will probably find you have the same file name but a different folder name.

Now, make a backup copy of the GPD file, so you can restore it if you fumble the editing. Then you need to edit the original file and add the following section, immediately after the line *DefaultOption: LETTER :

*Option: CUSTOMSIZE
*rcNameID: =USER_DEFINED_SIZE_DISPLAY
*MinSize: PAIR(936000, 1332000)
*MaxSize: PAIR(5346000, 7560000)
*MaxPrintableWidth: 5346000
>

The values for MaxSize are copied from the largest page size already defined (A3) and the values for MinSize are scaled down proportionately from that to represent A8 size. Save the new file somewhere, then copy it over the top of the original file.

Now you can define a custom page size in the normal way: go to Devices and Printers in the control panel, select the printer Microsoft Print to PDF, click Print Server properties on the ribbon menu, tick Create a new form, give it a name and enter the dimensions you want, then click Save Form. Now when you print something, select Microsoft Print to PDF as the printer, click Preferences, then Advanced and you should see your new page size in the pulldown menu.

This seems to be producing correct output for me, so the puzzle is why Microsoft didn’t do this themselves. Perhaps they didn’t want to go through the extra testing for arbitrary page sizes, or maybe they did test it and saw problems with some specific page sizes, I don’t know. If this would be useful for you, please give it a go and let us know how it worked out for you in the comments!

Share this:

Like Loading.

Related

This entry was posted on 29 August 2015 at 1:53 pm and is filed under IT Tips. Tagged: PDF, Printing, Windows 10. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

76 Responses to “Custom Page Sizes for Microsoft Print to PDF”

Craig H said

28 December 2015 at 3:16 pm Just to note: the recent Windows 10 Version 1511 cumulative update included a new GPD file for this driver with a different file name, but repeating the process described above gets the custom page sizes working again.

David F said

25 March 2016 at 9:43 pm Thank you so much. I make my living as a music engraver, editor, printer. MSPDF would work for European publishing houses but here we need 9×12, 9.5×12.6666 (don’t ask), 10×13, and more. Of course, for 12×16 I needed to alter your MaxPrintSize and MaxPrintableWidth, but you showed the way. I’m with you; I see no reason for MS to have left this out of the code.

Robert Herman (@rhrmn) said

29 March 2016 at 3:25 pm Would you please consider adding some screenshots of this process? I have followed your instructions on Windows 10 Pro version 1511 and unfortunately have not been able to get the page size pull-down menu to display my custom form size of 11×17.

Craig H said

29 March 2016 at 10:38 pm I think 11×17 is just very slightly too big for the “MaxSize” parameters. Noting that I used A3 as the measure for my MaxSize, which is roughly 11.7 x 16.5 inches, you should probably increase the second number in the MaxSize pair to allow for the 17 inch height. Try: *Option: CUSTOMSIZE
*rcNameID: =USER_DEFINED_SIZE_DISPLAY
*MinSize: PAIR(936000, 1332000)
*MaxSize: PAIR(5346000, 7780000)
*MaxPrintableWidth: 5346000
> The units for MaxSize work out at 18000 per mm (457200 per inch) so you could experiment with even bigger sizes, do please let me know if that works for you!

Alex said

30 March 2016 at 12:22 pm Thanks a lot Craig. Worked like a charm! I need to print in SRA3 size and that is not available by default. I was experiencing issues trying to install Acrobat 8 in a Windows 10 laptop just to get this size on a PDF printer, and now I don’t have to install it anymore. You helped me solve a big problem. I owe you a beer!

williamjehle said

15 April 2016 at 1:11 am Thank you Craig! I usually have success with CutePDF, but I had issues printing a long document in 8.5″x8.5″ format. Your tweaks did the trick. I did have two copies of 74e1846.gpd, and I had to edit both of them. When I just edited the first one, it showed the new page size but I could not select it. Well done mate!

Mike Shawaluk said

28 April 2016 at 1:31 pm Just a quick note: there shouldn’t be a need to add 11″ x 17″ as a custom size, since that is already present as “Tabloid”. That said, thank you very much for publishing this information. I have been trying to create 7.5″ x 12″ PDFs, which will scale to fill the full display on a 16:10 tablet device.

kbellis said

23 June 2016 at 11:21 am Hello, Craig. Thank you for this narrative. Top marks for your tinker! It’s a pity Microsoft hasn’t satisfactorily addressed this issue. “The values for MaxSize are copied from the largest page size already defined (A3) and the values for MinSize are scaled down proportionately from that to represent A8 size.” FYI & FWIW – ARCH D as a maximum *Option: CUSTOMSIZE
*rcNameID: =USER_DEFINED_SIZE_DISPLAY
*MinSize: PAIR(936000, 1332000)
*MaxSize: PAIR(109728000, 164592000)
*MaxPrintableWidth: 109728000
> On a related MS PDF niggle; when prompted to save the PDF file, the default name ideally should echo the name of the file being printed appended with the pdf suffix. Instead, the default is blank. When dealing with lengthy arcane file names, this becomes tiresome. Has this been addressed by another one of your in-depth examinations?

Rick said

22 February 2023 at 6:27 pm Why not use the largest and smallest per the ISO216 international paper standard.
The largest, B0 is 1000mm x 1414mm or 39.4in x 55.7in
The smallest, A10 is 26mm x 37mm or 1.2in x 1.7in
Which would be
*MinSize: PAIR(468000,666000)
*MaxSize: PAIR(18000000, 25452000)
MaxPrintableWidth: 25452000 This would give the capability to cover all available paper sizes, and any weird custom ones in between.

Mike said

12 September 2016 at 7:08 pm Arch E1 maximum landscape & portrait orientation: *Option: CUSTOMSIZE
*rcNameID: =USER_DEFINED_SIZE_DISPLAY
*MinSize: PAIR(936000, 1332000)
*MaxSize: PAIR(192024000, 192024000)
*MaxPrintableWidth: 192024000
>

Margaux said

30 September 2016 at 5:02 am Screenshots please

Craig H said

30 September 2016 at 7:54 am I’m sorry I don’t have time to do that at the moment; if you would care to follow the instructions and make screenshots of the process, I will be happy to add them here for the benefit of others. Thanks!

Kent Slaughter said

Kent Slaughter said

27 December 2017 at 12:02 am (screenshots here)

Charlotte Nash-Stewart said

2 November 2016 at 2:54 am Fantastic solution. Thanks. I had to reboot before the new page settings took effect. Otherwise, this worked flawlessly.

Simon said

3 November 2016 at 4:54 pm I have had absolutely no luck at all. I went through as explained, but nothing turns up in the scroll down menu. I’ve tried rebooting and everything else, I started from scratch again with the back-up file, but still absolutely nothing happens. I used the explained code, inserted it after the line *DefaultOption: LETTER :
I went to printer server settings made a new setting called e-book.
But I never get the option to choose anything in the advanced settings in the scroll down menu when printing. Anybody has a clue to fix this.
Got Windows 10, Home Edition. MS Word 2010.

John Domogalla said

24 September 2022 at 11:07 pm I was trying to expose the ISO A0 size so I could have a single page in the pdf file.
The units for MaxSize work out at 18000 per mm (457200 per inch) so I fiqured out the inches x inches needed for printing the application data at 1/4 scale which was 100ft wide and 150ft tall then multiply by scale of 1/4 ( 100ft scales to 25 inches ) and 25 inches * 457200 = 15137892
—-
*Option: CUSTOMSIZE
*rcNameID: =USER_DEFINED_SIZE_DISPLAY
*MinSize: PAIR(936000, 1332000)
*MaxSize: PAIR(15137892, 21396960)
*MaxPrintableWidth: 15137892
>
then the custom frame creation worked.

Leandro M said

22 March 2023 at 3:18 pm Hi John, I have been trying to add A0 and A1 sizes as well but I couldn’t manage to do so. I’ve just read your explanation but I am struggling to understand it. Actually, in my case the string is a little bit different: *Option: A1
*rcNameID: =RCID_DMPAPER_SYSTEM_NAME
*PrintSchemaKeywordMap: “ISOA1”
*PrintableOrigin: PAIR(0, 0)
*PrintableArea: PAIR(10692000, 15138000)
> To find the pairs I multiplied 59,4cm/84,1 by 180,000, as I notice from the already inserted format ones: *Option: A4
*rcNameID: =RCID_DMPAPER_SYSTEM_NAME
*PrintSchemaKeywordMap: “ISOA4”
*PrintableOrigin: PAIR(0, 0)
*PrintableArea: PAIR(3780000, 5346000)
> 3780000/180,000= 21cm
5346000/180,000= 29,7cm — I also made the changes in the pdc.xml file: 0,0,594000,841000
841000
594000 Here I also followed the example already set: 0,0,210000,297000
297000
210000 In this case I just multiplied the mm value by 1000. However, I still could not manage to add the A1 option… I found an example to add the A6 size, and it works smootly: *Option: A6
*rcNameID: =RCID_DMPAPER_SYSTEM_NAME
*PrintSchemaKeywordMap: “ISOA6”
*PrintableOrigin: PAIR(0, 0)
*PrintableArea: PAIR(1890000, 2664000)
> and 0,0,105000,148000
148000
105000 Maybe there’s something I’m missing? Can you or anyone help me. Thanks in advance!

Osama said

21 November 2016 at 8:03 am Thank so much it works great in latest Windows 10 Anniversary Update.

mike Bellemans said

23 January 2017 at 11:53 am Interesting article.
I still have the problem that my PDF files are 5x bigger since the new PDF printerr of Windows.
Before we used the Amyuni 450 driver that comes with our ERP software.
Now on Windows X the ERP uses the standard windows PDF printer and explodes all my files.
I did some testing and i figured ou this is because the Amyuni driver uses “FONT EMBEDDING” when making pdf files. Do you konw if it possible to enable this feature through the uses of registry hacks? Kind regards.

john fisher said

27 February 2017 at 8:55 pm Hello, I’d love to try this but I don’t see “print server properties”, only “printer properties” so I can’t make a new form. Am I missing something? Thank You

Craig H said

7 March 2017 at 12:19 am Hi John! I think you must be looking at the right-click menu, which is where you find “Printer properties”. Instead you should left-click “Microsoft Print to PDF” and then “Print server properties” appears as an option at the top of the control panel window, in between “See what’s printing” and “Remove device”.

Jo Smith said

8 March 2017 at 11:43 am I’m also trying this, as I publish paperbacks and need PDFs to be the trade page sizes.
Like John Fisher, I can’t see an option for “print server properties” on left-clicking “Microsoft Print to PDFs” – only the three options “Printer” “Document” and “View”.
The file I changed was called ‘merged.gpd’ – was this perhaps the wrong file?

Craig H said

Devices and Printers

11 March 2017 at 3:48 pm I’m talking about the ribbon bar menu at the top of the “Devices and Printers” window, it appears after one left click, see this picture. You must have been double left clicking and looking at the “Microsoft Print to PDF” window.

Jo Smith said

13 March 2017 at 8:13 pm OK, got that now. Set up a new paper size, but even after restarting it doesn’t show as an option in Word. Maybe I edited the wrong driver at the start 😦

Craig H said

PrinterDriverData

13 March 2017 at 9:17 pm Did you look in the registry key for the filename, as it says in the article?

Jo Smith said

17 March 2017 at 7:28 am I’m grateful to you all for the idea, and glad it works for you. I’m always nervous about messing with parts of the system I don’t understand, and as I have a critical job to do right now I shan’t be tempting providence by changing anything until it’s done. I have a work-around anyway, by firing up my old computer with Windows XP (what’s not to like?) and using Word 2000 and Cute PDF Writer as I did before. But as Arnie says, I’ll be back!

Inare said

10 April 2017 at 6:48 pm I tried doing this but I don’t really have any experience in this. I tried editing the GPD file by opening it in notepad. However there isn’t a “DefaultOption” line. There is however “Option: LETTER”. I’m very confused at this point of what I’m doing.

Craig H said

11 April 2017 at 4:56 pm All of the .gpd files on my Windows 10 system have the “*DefaultOption: LETTER” line, it’s after a line that says “*rcNameID: =PAPER_SIZE_DISPLAY”. Still, if you’re not confident doing this, I would recommend leaving well alone; if you edit the wrong .gpd file or put the new option in the wrong place, you could easily mess it up, sorry!

Ameya said

14 April 2017 at 7:14 am That was superbly done… Thanks a lot.. Needed a custom 8×10 page size! Got it..
Is it possible to change the resolution the same way to give best print output on a remote computer where I send the PDF?

Shah said

24 May 2017 at 6:08 am Hi, This doesn’t seem to be working in build 1703. Anyone confirm if it works in version 1703?

Ameya said

28 December 2017 at 1:55 pm It works.. In 1703 and also in latest 1709.
I am using regularly without any hiccups at all.

David M Hunt said

14 October 2017 at 12:38 pm As expected, Word now provides paper type “Custom” when using print to PDF. Adobe Reader does not. It’s options remain only the handful of restricted sizes. Have you encountered this?

George Ercus said

23 November 2017 at 10:08 am Thank you very much. It worked.

ProBR said

16 May 2018 at 3:45 am Thank you very much. I do not understand why Microsoft has not fixed this issue yet since so many of us have been asking for a solution. One that is very simple, I may add. Well… simple once you know what to do. I did not know until I found this page. Thank you again. For those of you using a new Windows 10 … the path for mine was at: C:\Windows\System32\spool\V4Dirs\A045D61A-BE69-49BE-B57F-C62480ACEC70 The file name to modify is called (in my computer): 69b8a4a.gpd It is working for me right now after I created a custom form with the size I wanted. Even though the size I wanted is a common ARCH D … which should be already available there … but it wasn’t. So. I created a custom size and called it ARCH D1 and now it shows in the drop down manu from Microsoft Print to PDF driver dialog box. What I do not know if for how long will this work since I am afraid that a future update of drivers from Microsoft could replace the file I just created with a new file that will not have the changes that we just implemented. Well … let’s see. Hope this help the new guys looking for a solution to this problem.

Farhan Muntaqo said

27 October 2018 at 1:17 pm Thanks Craig, it really works on my Win 10, it’s now free for me to add my custom sizes. I was just wondering why Microsoft didn’t make this feature as a default option unless users enabling it anyway. Great job Craig…

hisato said

5 December 2018 at 11:50 pm Do you change the word CUSOMSIZE next to *Option? Also what about USER_DEFINED_SIZE_DISPLAY? I’d like to add the size 4×6, which is one of the default sizes, so I did not have to “Create a new form.” Please advise.

Craig H said

7 December 2018 at 6:19 pm I’ve only tried adding CUSTOMSIZE as a new section, not changing or defining any other ones, so I don’t know if that would work. Do please let us know if you figure it out!

Fleming said

6 October 2019 at 9:24 pm Hi, The MS Windows updates downloaded automatically on Septemebr 30, 2019. Now I’m unable to use Custom Size again in MS Word to access Print via PDF with Custom Size. I had it working perfectly with see 9 X 6, 9.25 x 12.45 and 13.25 X 9.25. But when I try to view after Printing, I get an error message or the view is cut off. I tried unchecking (OFF) and checking (ON) the box for Microsoft Print to PDF in MS Windows 10 too. But that didn’t work either. I even added a NEW FORM NAME with its affiliated sizes to the MIcrosoft Print to PDF. But when I go to Microsoft Print to PDF Advanced settings, the the New Form name doesn’t appear available there. So, I’m at a loss as to what to do. This has been working for two years; and I need custom sizes for the printing of my books and their covers. Any suggestions? Would a program like pdfelement resolve this? Any and all help would be most appreciated. Thanks much.

husain Alumran said

13 May 2019 at 10:20 am Hi ,
It is super to find a good solution for the customization of a printing page , and it save me alot of time intagling here and there
Thanks alot // (grazie=italy) (aregato=japan) (tak=nordic) from all the ones i know off for that code

Erwin said

26 July 2019 at 5:55 am Does it work in Windows 10 Update 1903 64-Bit? It’s not working on mine

Craig H said

26 July 2019 at 12:20 pm It’s still working for me, but I haven’t updated to 1903 yet. A few previous Windows updates have wiped out custom page size sizes so that you have to go through the whole process again to recreate them – is that what happened for you?

orudge said

9 October 2019 at 11:56 am I tested an upgrade from 1809 to 1903 and Windows did preserve the .gpd file, but applications failed to print using a custom size. Restoring the original gpd and reapplying seemed to make no difference. I’ll try with a fresh install of 1903 and apply the change and see if that works, but it may be MS have changed something that means the patch above no longer works. 😦

Craig H said

11 October 2019 at 2:22 pm It’s still working for me in Excel 2013 on Windows 10 Home version 1903.

Josef Villanueva said

11 November 2019 at 9:31 am I’m currently on Windows 10 1809..I tried the method but it does not work for me. Is anyone else having this problem?

SuiteFiles said

29 January 2020 at 2:29 am This is also useful if you’re trying to reduce the DPI it prints at, so it makes smaller files

Pauline said

4 March 2020 at 8:50 am It works perfectly! I was looking for a PDF printer that is able to convert Word files to PDF files while keeping images in very high quality. Microsoft Print to PDF was appropriate, but I needed a customized size. Thank you for your explanations.

Joel Egelhoff said

15 June 2020 at 5:17 pm Looks great! One question, if done on a company network, would these changes need to be made on every computer that would need to produce the custom-sized PDFs or would this affect all workstations?

Craig H said

23 June 2020 at 6:17 pm Glad you like it! Unfortunately, as far as I know, you need to go through this process individually for each workstation. If all the workstations are running the same Windows version, there’s a good chance that the GPD folder and file names will be the same for each, so that might save you a bit of time. Good luck!

Bildin said

9 September 2020 at 3:15 pm Thanks for solution! To apply modification on an amount of computers I have written the bat-patcher: @echo off
setlocal enabledelayedexpansion
set mDir=C:\Windows\System32\spool\V4Dirs
for /f “tokens=3” %%a in (‘reg query “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\Microsoft Print to PDF” /v PrintQueueV4DriverDirectory’) do set mPath=%%a
for /f “tokens=3” %%a in (‘reg query “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\Microsoft Print to PDF\PrinterDriverData” /v V4_Merged_ConfigFile_Name’) do set mFile=%%a
echo.Reading %mDir%\%mPath%\%mFile%
set status=0
for /f “tokens=1,2* delims=:” %%a in (‘findstr /n /r “.*” “%mDir%\%mPath%\%mFile%”‘) do (
if !status! EQU 0 (
if “%%b” EQU “*Feature” (
if “%%c” EQU ” PaperSize” (
set status=1
)
)
)
if !status! EQU 1 (
if “%%b” EQU “*Option” (
if “%%c” EQU ” CUSTOMSIZE” (
echo Already patched!
set status=2
) else (
echo *Option: CUSTOMSIZE>>mod.tmp
echo <>>mod.tmp
echo *rcNameID: =USER_DEFINED_SIZE_DISPLAY>>mod.tmp
echo *MinSize: PAIR(180000, 180000^)>>mod.tmp
echo *MaxSize: PAIR(15138000, 21402000^)>>mod.tmp
echo *MaxPrintableWidth: 21402000>>mod.tmp
echo >>>mod.tmp
echo Patch applied!
set status=3
)
)
)
if “%%c” EQU “” (
set line=%%b
) else (
set line=%%b:%%c
)
echo.!line!>>mod.tmp
)
if !status! EQU 3 (
if not exist %mDir%\%mPath%\%mFile%.bak (
copy %mDir%\%mPath%\%mFile% %mDir%\%mPath%\%mFile%.bak
copy mod.tmp %mDir%\%mPath%\%mFile%
) else (
echo Cannot patch – %mDir%\%mPath%\%mFile%.bak already exist!
)
)
erase mod.tmp
pause
REM reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Forms /v _4A0 /t REG_BINARY /d 50AA19001049240000000000000000001049240050AA19000100000000000000
REM reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Forms /v _2A0 /t REG_BINARY /d 8824120050AA190000000000000000008824120050AA19000100000000000000
REM reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Forms /v _A0 /t REG_BINARY /d 28D50C0088241200000000000000000028D50C00882412000100000000000000
REM reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Forms /v _A1 /t REG_BINARY /d 5010090028D50C0000000000000000005010090028D50C000100000000000000
REM reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Forms /v _A2 /t REG_BINARY /d A0680600501009000000000000000000A0680600501009000100000000000000
REM reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Forms /v _A3 /t REG_BINARY /d 28880400A0680600000000000000000028880400A06806000100000000000000
REM reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Forms /v _A4 /t REG_BINARY /d 5034030028880400000000000000000050340300288804000100000000000000
REM reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Forms /v _A5 /t REG_BINARY /d 2042020050340300000000000000000020420200503403000100000000000000
REM reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Forms /v _A6 /t REG_BINARY /d 289A0100204202000000000000000000289A0100204202000100000000000000
REM reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Forms /v _A7 /t REG_BINARY /d 10210100289A0100000000000000000010210100289A01000100000000000000
REM reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Forms /v _A8 /t REG_BINARY /d 20CB000010210100000000000000000020CB0000102101000100000000000000
REM reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Forms /v _A9 /t REG_BINARY /d 8890000020CB000000000000000000008890000020CB00000100000000000000
REM reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Forms /v _A10 /t REG_BINARY /d 9065000088900000000000000000000090650000889000000100000000000000 Also I have tried to create print forms from 4A0 to A10 in registry as it makes system settings for print server, but they don’t apply. So I left them commented. Can anyone suggest a way to add print forms automatically?

Anonymous said

13 March 2021 at 9:14 pm This saved my life! Thanks so much!

bilal anwer said

15 March 2021 at 3:21 pm tested and worked perfectly. anybody who wants to add A1. use following. *Option: CUSTOMSIZE
*rcNameID: =USER_DEFINED_SIZE_DISPLAY
*MinSize: PAIR(936000, 1332000)
*MaxSize: PAIR(10698480, 15133320)
*MaxPrintableWidth: 10698480
>