We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

PDF Black & White Conversion - Black Transparent Background

hi,

Converting a PNG image to black and white, seems to transform the transparent background to black rather than leaving it as transparent - please see the original word document that the pdf is generated from.

https://canusicom-my.sharepoint.com/:w:/g/personal/benjamin_hargrave_canusi_com/EWgHPOMQGlpIkVih4zDFAhQBhnu7EPU-zOVaCOKZFhJgIw?e=7RSC3f

The result can be seen here backandwhite-nda-merge (3).pdf (226.4 KB)

This is generated with the following code segment


        com.aspose.pdf.RgbToDeviceGrayConversionStrategy strategy = new com.aspose.pdf.RgbToDeviceGrayConversionStrategy();
        for (int idxPage = 1; idxPage <= document.getPages().size(); idxPage++) {
            Page page = document.getPages().get_Item(idxPage);
            strategy.convert(page);
        }

Thanks for the speedy response in advance
Benjamin

@Twister99

We were able to reproduce the issue in our environment while using Aspose.PDF for Java 20.12 and logged it as PDFJAVA-40054 in our issue tracking system. We will further look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.

Hi Asad,

Have the developers made any progress on this - if there is a system environment that produces a different output to this issue, we could also look into using that, if its an option?

Thanks and best
Ben

@Twister99

The issue is sadly not yet resolved and pending for a review. Furthermore, it does not seem related to some specific environment initially. We will be able to share further feedback about reasons behind it after completing the investigation against it. Please be patient and give us some time.

We apologize for the inconvenience.

@asad.ali

I’ve begun an investigation into this as we are actually live with the product now on our side. As such we need to tackle this.

The Java.awt seems to be replacing images with a black background in the same manner, it would be great if i can confirm this is the framework that is used in the backend, by aspose.

As the ticket is already >40 days old, I can offer to help debug this on our end, provided the development team can support us. I realize you already have a full pipeline of tickets, so I want to be realistic but proactive, in getting this resolved.

After doing a dive into the aspose code, I found this the java.awt framework in usage, with the black and white conversion strategy within com.aspose.pdf.internal.l53h.l1v

This bug has similar symptoms to another defined online whilst using java awt - see the link below

Would your development team be open to allowing us to support with tickets like this going forward, and cooperate with us getting these investigated?

Thanks and best wishes,
Benjamin

My email is benjamin.hargrave@canusi.com

Best wishes,
Ben

@Twister99

Thanks for sharing the results of the investigation you made. We really appreciate it and have logged it along with the ticket as well. We would also like to share with you that we are in the process to investigate the ticket as well and it is expected to be resolved in 21.6 version of the API. We appreciate providing support via our dedicated support forums where you can freely share your feedback and information you consider can be helpful in resolving the issue. We will further inform you as soon as we have additional updates in this regard.

We apologize for the inconvenience caused.

The issues you have found earlier (filed as PDFJAVA-40054) have been fixed in Aspose.PDF for Java 21.6.