There are two ways to create a PDF for a diagram.
- Diagram | Save Diagram As | PDF, PNG, etc.
- File | Print
Using the second you usually have to select a standard page size, non of which may be large enough to hold your diagram on a single page. These cause FH to page the diagram, so the output contains more than one page. In particular Microsoft Print to PDF, which comes with Windows, only has relatively small paper sizes available.
For saving images you have the first choice, using, say PNG. There are two problems here. It uses the screen resolution unless you do something (see below). This is typically 96 dpi, whereas conventional wisdom for printing is to use 300 dpi. More importantly, it will not do large images, giving you a dialog that says "Unable to save diagram in this file format. The image may be too large..." and goes on to give advice on how to deal with this, including using EMF.
For large diagrams, at least, none of these suggestions gives what I want, the full diagram at 300 dpi. For the EMF option, I had a hard time finding an application that would view it, and the three I found (InfranView, Paintshop Pro, and Inkscape) all did it poorly. I found no way to create a usable PNG from the EMF. There may be a problem with how FH writes EMF, but I don't know that.
Before getting to my solution, note the following:
You can save your diagram in any resolution by setting the Zoom level accordingly. To get 300 dpi on a 96 dpi screen, use 313% =100*300/96. This works as long as FH will allow you to use it.
Use File | Print Setup to set the printer you want to use. This will cause FH to reset the page boundaries, so you can see what will happen. This was not immediately obvious to me but has been very useful.
My solution involves using PDF Creator, which is free. I have used it for years and been happy with it. What works with PDF Creator is to choose Postscript Custom Page Size as the paper size. This lets you choose the output size. I needed to get the size from Diagram Statistics and use the height in the width box and width in the height box. The default resolution says 600 dpi. I didn't change that. The PDF's created are sharp when I zoom in.
To get an image I used GhostScript with the PDF file. The command line for me is:
C:\Program Files\gs\gs9.20\bin\gswin64c -dNOPAUSE -dBATCH -r<resolution> -sDEVICE=png16m -sOutputFile="<your-output-file-name> <your-pdf-file-name>"
I use 300 for the resolution. This is a version of GhostScript I installed a long time ago, and I do not remember the details, so I won't give them here. Specifying a higher resolution than is in the PDF will not be useful, but the default 600 dpi seems to be ok. I get a usable PNG of my 16' All Relatives diagram, with not too much work (after it is set up, of course ).
In my case I wrapped the GhostScript command in a C# console app. The reason is that you can use the Open With menu in File Explorer on a PDF and it will then appear in the Open With menu next time, making it easy to use. I use C# as it makes a .exe and appears more attractive in the Open With menu. You could just as well use a BAT file, PowerShell script, or Java JAR. My C# application can be found at https://github.com/KennethEvans/VS-ConvertPdfToImage. The GhostScript location and output directory is hard-coded and would need to be changed.
I have used this program for many years for other uses and it seems to work. The heavy lifting is done by GhostScript, of course, not my application, which is very simple.
There are likely other ways to get an image from a PDF. There seem to be a number of online converters, but they seem to come marked as an ad. Since I already have a solution, I didn't look very hard. You may want to if you don't want to use GhostScript.
Finally I will note that as far as I know, neither PDF nor any of the image formats is limited in image size. These are limitations in the implementation in FH or Family History PDF.