Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Sun Jun 06, 2021 2:15 am

Hi,

I am converting images to PDF files using the following example code, and on linux using the .net 5 version of Spire.Doc I am getting a 'Divide by zero' on certain images when the conversion from word -> PDF happens. This issue does not seem to happen on windows.

Here is the example code that causes this issue. Unfortunately I cannot attach the image because it is 4mb in size, is there somewhere I should send it?

Code: Select all
void Main()
{
   var image = "C:\\Users\\felix\\Desktop\\20210601_135513.jpg";
   using var doc = new Document();

   var section = doc.AddSection();
   section.PageSetup.PageSize = PageSize.Letter;

   var p = section.AddParagraph();
   p.AppendPicture(image);

   var options = new ToPdfParameterList
   {
      CreateWordBookmarks = false,
      IsEmbeddedAllFonts = true
   };

   var ms = new MemoryStream();
   doc.SaveToStream(ms, options);
}


Cheers,
Felix

felix@kalixhealth.com
 
Posts: 20
Joined: Sat Nov 07, 2015 4:10 am

Mon Jun 07, 2021 6:59 am

Hello Felix,

Thanks for your inquiry.
I simulated an image about 4 mb size and tested your code, and I did not reproduce your issue.
To help us investigate further, please provide your input image. You could send it to us (support@e-iceblue.com) via email. Thanks in advance.

Sincerely,
Brian
E-iceblue support team
User avatar

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

Tue Jun 08, 2021 1:35 am

Hello Felix,

Thanks for your sharing via email.
I tested your case and did reproduce your issue, I have logged it in our bug tracking system with the ticket SPIREDOC-6128. If there is any update, we will let you know. Apologize for the inconvenience caused.

Sincerely,
Brian
E-iceblue support team
User avatar

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

Return to Spire.Doc