Franklin Heath Ltd

Master Your Information Assets

  • Categories

  • Meta

Custom Page Sizes for Microsoft Print to PDF

Posted by Craig H on 29 August 2015

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 {084F01FA‑E634‑4D77‑83EE‑074817C03581}\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!

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

  1. Craig H said

    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.

  2. David F said

    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.

  3. 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

      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!

  4. Alex said

    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!

  5. 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!

  6. Mike Shawaluk said

    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.

  7. kbellis said

    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?

  8. Mike said

    Arch E1 maximum landscape & portrait orientation:

    *Option: CUSTOMSIZE
    {
    *rcNameID: =USER_DEFINED_SIZE_DISPLAY
    *MinSize: PAIR(936000, 1332000)
    *MaxSize: PAIR(192024000, 192024000)
    *MaxPrintableWidth: 192024000
    }

  9. Margaux said

    Screenshots please

    • Craig H said

      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!

  10. Fantastic solution. Thanks. I had to reboot before the new page settings took effect. Otherwise, this worked flawlessly.

  11. Osama said

    Thank so much it works great in latest Windows 10 Anniversary Update.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: