I have a problem with conversion from DOCX to PDF. Some files throw this exception:
System.FormatException: Input string was not in a correct format.
at System.Number.ParseSingle(String value, NumberStyles options, NumberFormatInfo numfmt)
at spr6654.1(TextureStyle A_0, Color A_1, Color A_2, RectangleF A_3)
at spr6654.0(TableCell A_0, spr8810 A_1)
at Spire.Doc.TableCell.Spire.Doc.Layout.IDocumentBase.Draw(spr6654 dc, spr8810 ltWidget)
at spr8810.0(spr6654 A_0)
at spr8810.0(spr6654 A_0)
at spr8810.0(spr6654 A_0)
at spr8810.0(spr6654 A_0)
at spr8810.0(spr6654 A_0)
at spr894.0(spr6654 A_0)
at spr4471.0(Int32 A_0, Int32 A_1, ImageType A_2, MemoryStream A_3, Boolean A_4, Boolean A_5, Boolean A_6)
at spr2475.1(spr4471 A_0)
at spr2475.0(Document A_0)
at Spire.Doc.Document.0(Stream A_0)
at Spire.Doc.Document.SaveToFile(Stream stream, FileFormat fileFormat)
at Spire.Doc.Document.SaveToStream(Stream stream, FileFormat fileFormat)
Code snippet:
- Code: Select all
var fileName = "Doc2.docx";
using (var stream = File.OpenRead(fileName))
using (var docTemplate = new Document(stream))
using (var finalDocument = new MemoryStream())
{
docTemplate.SaveToStream(finalDocument, FileFormat.PDF);
File.WriteAllBytes(Path.GetFileNameWithoutExtension(fileName) + ".pdf", finalDocument.ToArray());
}
Versions of DLLs:
Spire.Common: 1.2.346.4040
Spire.Doc: 5.6.17.4040
Spire.Licence: 1.3.5.40
Spire.Pdf: 3.6.131.4040
Is it any known issue in this version of the Spire.Doc.DLL?
Thanks