Printing PDF: transparancy in images is printed as white

When printing a PDF document (using PdfViewer.PrintDocumentWithSettings), images with transparent parts are printed with a white background. I would expect the underlying elements to be visible in those parts instead.

Hi Pieter,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I tried to replicate your issue with a test PDF file with the latest version of Aspose.Pdf for .NET v7.3 but I was unable to reproduce the issue. Please share your template file which is causing the problem at your end. This will help is reproduce the issue at our end.

Sorry for the inconvenience,

Hello, I’ve attached one of the PDFs I’ve been using to test. It does show up correctly in Adobe Reader, but when printing, the Polaroid logo image has a white background.

Hi Pieter,


Thanks for using our products.

I
have tested the scenario and I am able to reproduce the same problem. For the
sake of correction, I have logged it in our issue tracking system as
PDFNEWNET-34260. We
will investigate this issue in details and will keep you updated on the status
of a correction.

We
apologize for your inconvenience.

The issues you have found earlier (filed as PDFNEWNET-34260) have been fixed in Aspose.Pdf for .NET 7.5.0.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

I just updated to Aspose Pdf 8.1.0 and found that images with transparency are not being printed at all. Just to be sure, I tested with the same pdf that I attached in a previous post and again, the transparent logos in that document did not show up on the print. Printing the same pdf file with Adobe Reader X does produce a correct print so it’s unlikely to be a printer issue.

So now, instead of producing white images, the PdfViewer is not printing transparent image at all.

I tried using the ‘PrintAsImage’ setting, and that does produce correct prints - transparent images do show up. However, the overall print quality is lower due to
the lower image resolution and what looks to be a nearest-neighbor interpolation mode.

Due to the above (and other, card-printer specific reasons) it’s not a viable workaround.

Hi Pieter,


Thanks for your inquiry. I’m afraid images are printing fine, while testing with Aspose.Pdf for .NET 8.2. Please find attached image. Can you please share your sample code snippet and output here? So we test the scenario further and suggest you accordingly.

Sorry for the inconvenience faced.

Best Regards,

I’m using the following code (tested with 8.1, not yet with 8.2):

var pdfViewer = new PdfViewer();
pdfViewer.OpenPdfFile(pdfFileName);
try
{
var printerSettings = new PrinterSettings { Copies = 1, PrinterName = PrinterName };
var pageSettings = new PageSettings { Margins = new Margins(0, 0, 0, 0) };
//pdfViewer.PrintAsImage = true; //
pdfViewer.AutoResize = false;
pdfViewer.AutoRotate = false;
pdfViewer.PrintPageDialog = false;
pdfViewer.RenderingOptions.SystemFontsNativeRendering = true;
pdfViewer.PrintDocumentWithSettings(pageSettings, printerSettings);
}
finally
{
pdfViewer.ClosePdfFile();
}

Hi there,


Thanks for the additional information. Please download and try latest version of Aspose.Pdf for .NET 8.2. Your code is working fine, please find attached output file. Moreover, OpenPdfFile() and ClosePdfFIle() methods are obsolete now so please use BindPdf() and Close() methods instead.

Please feel free to contact us for any further assistance.

Best Regards,