How do I convert PDF to PNG with transparency using PDFDraw.ExportAsPng?

Q: I was trying to export images from a PDF using ExportAsPng, and I
noticed that images that were partially transparent where being
exported with white as the background instead of transparent. Is there
a way to export them so that the transparency is correct?
A: If you are using ‘pdftron.PDF.PDFDraw’ to convert PDF to PNG you
can use pdfdraw.SetPageTransparent(true) to set the backdrop color of
the page to transparent. You can achieve the same effect with
PDF2Image using '--transparent_page' command-line switch.

By default, PDFDraw assumes that the page is imposed directly on an
opaque white surface. Some applications may need to impose the page on
a different backdrop. In this case any pixels that are not covered
during rendering will be transparent.