To export PDF with the size of the diagram instead of the page size, disable the page view by clicking on Page view in the Options menu or use the advanced export dialog by clicking on Advanced in the File, Download as menu.