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