Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Sun Aug 04, 2019 3:41 am

I'm using Freespire.Office and get a font parsing exception error on the SaveToFile line, but only if I'm also using the code below to check if there are images. If I comment that block out, or close the document and reopen it after the for loop, I don't get the error.

doc.LoadFromFile(FileWithPath);
foreach (PdfPageBase p in doc.Pages)
{
Image[] images = p.ExtractImages();
if (images != null && images.Length > 0)
HasPicture = true;
}

doc.SaveToFile(DOCX, Spire.Pdf.FileFormat.DOCX);

spr㍎
HResult=0x80131600
Message=Font parsing exception
Source=Spire.Pdf
StackTrace:
at spr㌚.ᜀ(spr㌃ A_0)
at spr㊼.ᜀ(spr㌃ A_0)
at spr㊼.ᜀ(spr㊳ A_0, spr㌇ A_1)
at sprⴥ.ᜐ()
at sprⱩ.ᜀ(spr㜃 A_0)
at Spire.Pdf.PdfDocumentBase.ᜂ(Int32 A_0, Boolean A_1)
at spr㰂.ᜀ(PdfDocumentBase A_0, Int32 A_1)
at spr㰂.ᜀ(PdfDocumentBase A_0, Stream A_1, Int32 A_2, Int32 A_3)
at spr㰂.ᜂ(PdfDocumentBase A_0, Stream A_1, Int32 A_2, Int32 A_3)
at spr㰂.ᜀ(PdfDocumentBase A_0, Stream A_1)
at Spire.Pdf.PdfDocumentBase.ᜀ(String A_0, Boolean A_1)
at Spire.Pdf.PdfDocumentBase.Save(String fileName, FileFormat fileformat)
at Spire.Pdf.PdfDocument.SaveToFile(String filename, FileFormat fileFormat)
at MessageConverter.worker.InterrogatePDF(String FileWithPath) in C:\development\MessageConverter\MessageConverter\worker.cs:line 32
at MessageConverter.Program.Main(String[] args) in C:\development\MessageConverter\MessageConverter\Program.cs:line 17

Inner Exception 1:
ArgumentNullException: Buffer cannot be null.

I have it working, but it means I have to close it and re-open it to save it as another format.

DanRoche
 
Posts: 3
Joined: Mon Jul 29, 2019 4:14 pm

Mon Aug 05, 2019 8:00 am

Hi,

Thanks for your inquiry.
To help us accurately investigate your issue, please provide your input PDF.

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.PDF