I just evaluated your library loading a simple XPS to convert it into PDF.
- Code: Select all
PdfDocument doc = new PdfDocument();
doc.LoadFromFile(sourceXps, FileFormat.XPS);
doc.SaveToFile(targetFile, FileFormat.PDF);
System crashes with System.ArgumentOutOfRangeException' in Spire.Pdf.dll
- Code: Select all
bei Spire.Pdf.Graphics.PdfBlendBase.Gcd(Single u, Single v)
bei Spire.Pdf.Graphics.PdfBlendBase.Gcd(Single[] values)
bei Spire.Pdf.Graphics.PdfColorBlend.ᜂ(PdfColorSpace A_0)
bei Spire.Pdf.Graphics.PdfLinearGradientBrush.ResetFunction()
bei Spire.Pdf.Graphics.PdfLinearGradientBrush.set_InterpolationColors(PdfColorBlend value)
bei sprḔ.ᜀ(LinearGradientBrush A_0)
bei sprḔ.ᜀ(Path A_0)
bei sprḔ.ᜀ(Canvas A_0)
bei sprḔ.ᜀ(Canvas A_0)
bei sprẕ.ᜀ(Canvas A_0)
bei sprẕ.ᜀ()
bei sprẕ.ᜁ()
bei sprᦆ.ᜀ(String A_0)
bei Spire.Pdf.PdfDocument.LoadFromXPS(String fileName)
bei Spire.Pdf.PdfDocument.LoadFromFile(String fileName, FileFormat fileFormat)
bei ConvertXPS2PDF.Program.ConvertToSpirePDF(String sourceXps, String targetFile)
As this StackTrace is in German I switched my system to English to make it more readable for you. Suddenly it worked. Inserting
- Code: Select all
System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB");
before loading the XPS fixes the problem but that cannot be a solution outside a test-project. Any advice? I attached the document in question.