How do I convert PDF to PNG with transparency using PDFDraw.ExportAsPng?
106 views
Skip to first unread message
Support
unread,
Jan 4, 2011, 5:37:28 PM1/4/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to PDFTron PDFNet SDK
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.