Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Thu Apr 22, 2021 8:34 am

We're trying to use Spire.PDF to create a thumbnail for .AI files and it looks like transparency isn't being preserved. The only image format that appears to be supported is BMP, which appears to flatten alpha to white. What is the best way of saving out the PDF document into eg PNG format and maintain transparency?

Collaboro
 
Posts: 3
Joined: Tue Apr 20, 2021 11:24 pm

Thu Apr 22, 2021 10:59 am

Hello,

Thanks for your inquiry.
I’m sorry that our Spire.PDF does not support converting white background to transparent background when converting PDF to image. But you can refer to the following code to convert the white background of the image to transparent.
Code: Select all
            Image image2 = System.Drawing.Image.FromFile("ToImage.png");
            Bitmap pbitmap = new Bitmap(image2);
            pbitmap.MakeTransparent(Color.White);
            pbitmap.Save("result.png",ImageFormat.Png);

If there are any other issues related to our products, please feel free to contact us.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Fri Apr 23, 2021 12:59 am

Thanks for the reply. Will there ever be support for this? We can't rely on white as it's a common colour in AI documents.

Collaboro
 
Posts: 3
Joined: Tue Apr 20, 2021 11:24 pm

Fri Apr 23, 2021 9:50 am

Hello,

Thanks for your response.
I will forward your needs to our Dev team and they will further investigate whether this feature can be implemented. If there is any update, we will notify you immediately.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Fri May 07, 2021 3:33 am

Hello,

Thanks for your patience.
Glad to inform you that we have implemented the new feature that supports converting PDF to transparent background images. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Sun May 09, 2021 11:00 pm

This is fantastic. Thank you!

Collaboro
 
Posts: 3
Joined: Tue Apr 20, 2021 11:24 pm

Tue Jun 15, 2021 10:38 am

Hello,

Glad to inform you that we just released Spire.Office Platinum Version:6.6, it implements the new feature that supports converting PDF to transparent background images. Please download it from the following links to test on your side. Looking forward to your test result.
Website link: https://www.e-iceblue.com/Download/down ... t-now.html
Nuget link: https://www.nuget.org/packages/Spire.Office/6.6.0

Code:
Code: Select all
doc.ConvertOptions.SetPdfToImageOptions(0);


Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Mon Jun 21, 2021 10:42 am

Hello,

Greetings from E-iceblue!
Has your issue been resolved? Does this hotfix meet your needs? Any feedback will be greatly appreciated.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Return to Spire.PDF