- Code: Select all
Unhandled Exception: System.FormatException: Format_InvalidString
at System.Text.ValueStringBuilder.ThrowFormatInvalidString() + 0x36
at System.Text.ValueStringBuilder.AppendFormatHelper(IFormatProvider, String, ReadOnlySpan`1) + 0x7d3
at System.String.FormatHelper(IFormatProvider, String, ReadOnlySpan`1) + 0x8a
at Spire.Pdf.PdfDocumentBase.Split(String, Int32) + 0x259
at Spire.Pdf.AOT.NLPdfDocument.PdfDocument_SplitDS(IntPtr, IntPtr, Int32) + 0x66
Then I tried a simple read and write code
- Code: Select all
def test_simple_pdf_save(filename):
input_pdf_path = Path(PDF_FILES_PATH, filename + '.pdf')
pdf = PdfDocument()
pdf.LoadFromFile(str(input_pdf_path))
pdf.SaveToFile("output.pdf")
and it doesn't crash but the output.pdf file is the same size as the original one (211 MB) but only 10 pages long instead of 353.
Any idea what could be the issue?