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 Nov 22, 2018 3:09 pm

Hi Support

We are using both spire.pdf and spire.pdf.wpf latest version we are facing a strange issue when we add an image in documents some documents don't display the added images.

The process we follow is
Split the pdf into single pages
Add an image into each page of pdf and save it as pdf and also as image
Then merge all the pdf pages into one single pdf
the code we use to add image to pdf is

Code: Select all
PdfPageBase page0 = pdfDocument.Pages[0];
page0.Canvas.DrawImage(pdfImage, rect);


I have send the documents via email in which we are facing problems.

Looking forward for your response and do let us know if you need anything else form our side.

Regards

jperkinsSC
 
Posts: 93
Joined: Thu Oct 30, 2014 10:01 pm

Fri Nov 23, 2018 9:29 am

Hi,

Thanks for your inquiry.
I have reproduced your issue and posted it to our DEV team for fixing. We will let you know as soon as there is any update. So sorry for the inconvenience caused.

Best wishes,
Anna
E-iceblue support team
User avatar

Anna.Zhang
 
Posts: 73
Joined: Thu Sep 27, 2018 3:20 am

Wed Dec 19, 2018 3:03 pm

Good Morning Anna - Please provide a status update on this when you are able.

jperkinsSC
 
Posts: 93
Joined: Thu Oct 30, 2014 10:01 pm

Thu Dec 20, 2018 2:15 am

Hi,

Sorry your issue is not resolved yet. Our Dev team is still working on it, please spare us more time. Once there is any good news, we will let you know. Thanks for your understanding.

Best wishes,
Anna
E-iceblue support team
User avatar

Anna.Zhang
 
Posts: 73
Joined: Thu Sep 27, 2018 3:20 am

Fri Dec 28, 2018 10:07 am

Hi,

Thanks for your patient waiting.
About the adding image issue, we found there was a solution, below code for your reference.
Code: Select all
PdfDocument doc = new PdfDocument();
doc.LoadFromFile(@"1.pdf");
PdfPageBase page = doc.Pages[0];
PdfImage image = PdfImage.FromFile(@"sample.png");
float width = image.Width * 0.75f;
float height = image.Height * 0.75f;
float x = (page.Canvas.ClientSize.Width - width) / 2;
page.Canvas.DrawImage(image, page.MediaBox.X, -page.MediaBox.Y + 60, width, height);
doc.SaveToFile(@"result.pdf", FileFormat.PDF);
doc.Close();

Any question, welcome to write back.

Best wishes,
Anna
E-iceblue support team
User avatar

Anna.Zhang
 
Posts: 73
Joined: Thu Sep 27, 2018 3:20 am

Mon Dec 31, 2018 8:14 pm

thank you for your response. we'll implement this code in our solution and see whether it works for us or not.

jperkinsSC
 
Posts: 93
Joined: Thu Oct 30, 2014 10:01 pm

Wed Jan 02, 2019 7:03 am

Hi,

Thanks for your feedback.
Just feel free to contact us if you need further assistance.
Have a nice day!

Best wishes,
Anna
E-iceblue support team
User avatar

Anna.Zhang
 
Posts: 73
Joined: Thu Sep 27, 2018 3:20 am

Return to Spire.PDF