Save SVG as PDF

You can save the inline SVG segment of your web page as a PDF. This uses the browser's 'Print..' feature, the window events onbeforeprint, onafterprint, plus window.matchMedia, and 'Save as PDF'.
Scenerio:
Select the browser's Print.., choose 'Save as PDF' option , then select Save.

The function beforePrint hides all elements except the DIV containing the inline SVG, plus the DIV is postioned to top/left at 0 px.

The function afterPrint returns the elements to their original visibility and locatons.

The event window.matchMedia automatically calls the above functions for Chrome.
Both IE and FF use the window events onbeforeprint and onafterprint.

Note: The PDF has the nice feature called 'Snapshot' that can be used to copy the SVG image of the PDF and save it, via any image editor, as a .png file.


SVG Source:
Javascript:

OK in:IE11/CH41/FF35