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.

Mon May 18, 2020 7:24 pm

Hello,

i'm using the free Version of SpirePDF and try to place a Image.
I try to place a PNG Image to a new PDF File. It's working but sometimes the Colors are pale

Sample files in the attachment.

Code: Select all
public void BuildPdf()
        {
            PdfDocument Doc = new PdfDocument();
            PdfPageBase Page;
           
            PdfImage Image = PdfImage.FromFile(@"D:\Work\pdftest\input.png");

            Page = Doc.Pages.Add(new SizeF(Image.Width, Image.Height), new PdfMargins(0), PdfPageRotateAngle.RotateAngle0,
                PdfPageOrientation.Landscape);

            Page.BackgroundColor = Color.Black;
            Page.BackgroudOpacity = 1f;
           
            // Place Image
           
            var layer = Page.PageLayers.Add("Image");
            layer.Graphics.DrawImage(Image, 0, 0, Image.Width,
                Image.Height);

            layer.Graphics.Save();
           
            // Save
            Doc.SaveToFile(@"D:\Work\pdftest\output.pdf");
            Doc.Close();
        }


How do I prevent this? I want to keep the original colors.

joni1994
 
Posts: 6
Joined: Mon May 18, 2020 7:06 pm

Tue May 19, 2020 3:31 am

Hello,

Thanks for your inquiry.
I tested your case with Free Spire.PDF for .NET Version:6.2 and the latest commercial version Spire.PDF Pack(Hot Fix) Version:6.5.9, and indeed noticed the issue you mentioned. I have logged it in our bug tracking system with the ticket SPIREPDF-3272. We will inform you if there is any update.
Sorry for the inconvenience caused.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Sun Jun 21, 2020 3:59 pm

rachel.lei wrote:Hello,

Thanks for your inquiry.
I tested your case with Free Spire.PDF for .NET Version:6.2 and the latest commercial version Spire.PDF Pack(Hot Fix) Version:6.5.9, and indeed noticed the issue you mentioned. I have logged it in our bug tracking system with the ticket SPIREPDF-3272. We will inform you if there is any update.
Sorry for the inconvenience caused.

Sincerely,
Rachel
E-iceblue support team


Thanks for the Informations. Can you please tell me the current status? It's importend for us. Or maybe the link to this ticket who i can check the status by my self?

joni1994
 
Posts: 6
Joined: Mon May 18, 2020 7:06 pm

Mon Jun 22, 2020 2:33 am

Hello,

Thanks for your following up.
Sorry our bug tracking system is unavailable to customers. If there is any update regarding this ticket, we will inform you on this post.
And I checked the status of your issue but found it hasn't been fixed. Anyway, I have requested our Dev team to share any possible ETA at their earliest time. Sorry for the delay and inconvenience caused.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Wed Jul 15, 2020 12:38 pm

Any news? If you can't solve this issue i need to find another solution. Please send me a answer fast as possible.

joni1994
 
Posts: 6
Joined: Mon May 18, 2020 7:06 pm

Wed Jul 15, 2020 1:03 pm

Hey there I have the same problem. Whats the status of this problem? The problem is 2 month old...

Kind regards

Leo

LeonBro982
 
Posts: 1
Joined: Wed Jul 15, 2020 1:01 pm

Thu Jul 16, 2020 2:54 am

joni1994 wrote:Any news? If you can't solve this issue i need to find another solution. Please send me a answer fast as possible.

Hi Jonathan,

Thanks for your following up.
I learned from our Dev team that this issue is very complicated, they are still looking for a solution to fix it. Please spare us more time. Anyway, I have given your issue a high priority, once there is any update, we will inform you ASAP.
Apologize for the delay and inconvenience caused.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Thu Jul 16, 2020 3:03 am

LeonBro982 wrote:Hey there I have the same problem. Whats the status of this problem? The problem is 2 month old...

Kind regards

Leo

Hi Leo,

Thanks for your post.
Could you please provide us with your test code and your input files? If we confirm that your issue does exist, we will pass it to our Dev team for investigation and fixing. You could send them to us (support@e-iceblue.com) via email. Thanks in advance.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Sun Aug 02, 2020 6:53 pm

Can you please tell us the status?

We have been waiting several months now. If it is not important enough for your team to solve the problem, we have to use another framework, which would be a pity.

I understand that developers are reluctant to give deadlines, but after several months something should happen when it is said that it will be taken care of.

joni1994
 
Posts: 6
Joined: Mon May 18, 2020 7:06 pm

Mon Aug 03, 2020 10:48 am

Hi Jonathan,

Sorry for the delay and inconvenience caused.
We really take your issue seriously. But since this issue is really complex, our developers haven't been able to find a good solution to fix it. Anyway, we have given your problem the highest priority. Once there is any progress, we will inform you ASAP.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Wed Aug 12, 2020 4:01 am

Hi Jonathan,

Hope you are doing well.
Regarding the image color issue, we found that the display effect of the generated PDF in different PDF readers is different. When opened in Adobe Reader, the colors of the picture are pale, which is the same as opening with Adobe Photoshop. But when opened in Chrome and Foxit Editor, the colors of the picture are not pale, as shown in the attached screenshot.
Meanwhile, I tried to use our Spire.PDF to extract the image of the generated PDF, but I found that the color of the extracted image did not become pale. Below is the code I used, you can try it with the latest Spire.PDF Pack(Hot Fix) Version:6.8.1. We suspect that this issue may be related to Adobe's internal display mechanism. We are very sorry that we are currently unable to find a solution to solve it.
Code: Select all
            PdfDocument Doc = new PdfDocument();
            PdfPageBase Page;

            PdfImage Image = PdfImage.FromFile(@"input.png");
            Page = Doc.Pages.Add(new SizeF(Image.Width, Image.Height), new PdfMargins(0), PdfPageRotateAngle.RotateAngle0,
                PdfPageOrientation.Landscape);

            //New method to add layer
            var layer = Doc.Layers.AddLayer("Image");
            Doc.Pages[0].Canvas.DrawRectangle(PdfBrushes.Black, new RectangleF(0, 0, Page.Size.Width, Page.Size.Height));
            PdfCanvas pcC = layer.CreateGraphics(Doc.Pages[0].Canvas);
            pcC.DrawImage(Image, 0, 0, Image.Width, Image.Height);

            //Save
            Doc.SaveToFile(@"output.pdf");
            Doc.Close();

            //Extract image
            PdfDocument doc = new PdfDocument();
            doc.LoadFromFile(@"output.pdf");

            IList<Image> images = new List<Image>();

            foreach (Image image in doc.Pages[0].ExtractImages())
            {
                images.Add(image);
            }

            int index = 0;
            foreach (Image image in images)
            {
                String imageFileName
                    = String.Format(@"Image-{0}.png", index++);
                image.Save(imageFileName, ImageFormat.Png);
            }


Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Thu Oct 08, 2020 12:30 pm

Thanks for your reply.
Why you can't check what other PDF generators do diffrent here? With some online Converters it's working great.
The problem is we send this PDF to external service provider who list products for us and generate a PNG of the Cover and it looks there pale as well. So that effects our sales.

Will be nice if you can take a look again. Maybe it's a small issue like other color profile or something like that.

Thanks

joni1994
 
Posts: 6
Joined: Mon May 18, 2020 7:06 pm

Fri Oct 09, 2020 7:04 am

Hello,

Thanks for your response.
In fact, our Dev team did a lot of investigations and attempts, but failed to find the cause of this issue.
Of course, we will continue to investigate this issue, but given the complexity and difficulty of the issue, it may take more time. Hope you can understand.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Thu Oct 27, 2022 12:17 am

rachel.lei wrote:Hello,

Thanks for your response.
In fact, our Dev team did a lot of investigations and attempts, but failed to find the cause of this issue.
Of course, we will continue to investigate this issue, but given the complexity and difficulty of the issue, it may take more time. Hope you can understand.

Sincerely,
Rachel
E-iceblue support team


Hello,
is there any update on this issue?
Will be nice if you can manage it and got a solution after two years now.

joni1994
 
Posts: 6
Joined: Mon May 18, 2020 7:06 pm

Thu Oct 27, 2022 2:27 am

Hello,

Thanks for your following-up.
This is Abel from E-iceblue support team. Now, the latest version Spire.Pdf isV8.10.5. I suggest you use it to test your scenario with the following code due to due to the latest version has a lot of optimization in every aspect.
If you have any issue, just feel free to contact us.

Code: Select all
PdfDocument Doc = new PdfDocument();
            PdfPageBase Page;

            PdfImage Image = PdfImage.FromFile(@"../../data/input.png");
            Page = Doc.Pages.Add(new SizeF(Image.Width, Image.Height), new PdfMargins(0), PdfPageRotateAngle.RotateAngle0,
                PdfPageOrientation.Landscape);

            Page.BackgroundColor = Color.Black;
            Page.BackgroudOpacity = 1f;

           //Drawing the image
            var layer = Doc.Layers.AddLayer("Image");
            PdfCanvas pcC = layer.CreateGraphics(Doc.Pages[0].Canvas);
            pcC.DrawImage(Image, 0, 0, Image.Width,
                Image.Height);

            // Save
            Doc.SaveToFile(@"../../output/output.pdf");
            Doc.Close();



Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 951
Joined: Tue Mar 08, 2022 2:02 am

Return to Spire.PDF

cron