Q: I'm using PDFNet to implement export functionality in one of our
products. Basically we would like to reuse our code we use to draw on
a Graphics (or HDC) object to export to PDF.
When I embeed a PNG with a transparent background to a page (using
PDFDC) the results is not of high quality, as if transparency was
simulated by overlaying an image mask.
Now, we are using PDFTron (and PDF in fact) precisely to take
advantage of the alpha blending support of PDF 1.4. Can you tell me
how to do this without the use of an image mask (as if I were creating
a PS instead of a PDF)?
---------------------------
A: The problem is due to GDI which does not support proper blending.
For better results you can use 'pdftron.PDF.PDFDCEx' instead of
'pdftron.PDF.PDFDC'.
'PDFDCEx' is using XPS graphics model wich properly supports
transparency (unlike GDI/EMF). The use of PDFDCEx is shown in the
second code snippet in PDFDC sample: