Admin Area PDF Generation Error

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 Jahre weitere
Whenever I try to generate a PDF in the admin area (Packing Slip, Invoice or Product Catalogue), I am getting a server error, specifically:

Attempted to read past the end of the stream.

The top lines of the stack trace are:  

[EndOfStreamException: Attempted to read past the end of the stream.]
   iTextSharp.text.pdf.RandomAccessFileOrArray.ReadUnsignedShort() +129
   iTextSharp.text.pdf.TrueTypeFont.get_BaseFont() +314
   iTextSharp.text.pdf.TrueTypeFont.Process(Byte[] ttfAfm, Boolean preload) +1392
   iTextSharp.text.pdf.TrueTypeFontUnicode..ctor(String ttFile, String enc, Boolean emb, Byte[] ttfAfm, Boolean forceRead) +757
   iTextSharp.text.pdf.BaseFont.CreateFont(String name, String encoding, Boolean embedded, Boolean cached, Byte[] ttfAfm, Byte[] pfb, Boolean noThrow, Boolean forceRead) +1509
   iTextSharp.text.pdf.BaseFont.CreateFont(String name, String encoding, Boolean embedded, Boolean cached, Byte[] ttfAfm, Byte[] pfb, Boolean noThrow) +66
   iTextSharp.text.pdf.BaseFont.CreateFont(String name, String encoding, Boolean embedded) +56


The site is running nopCommerce 2.40. I have a few other sites running 2.40 and have not encountered this issue before and a search of the forums and web have drawn a blank.

I have tried a number of things (reupload the 'bin' folder and check permissions) but none have solved the issue.

Any help would be appreciated.

Thanks,

Marty
11 Jahre weitere
It looks like there may be a problem with the font file used for PDFs: App_Data\Pdf\FreeSerif.ttf -file may have been corrupted or it may be empty.

See if reuploading this file fixes the problem. If it doesn't, can you post more of the stack trace and the source error from the error page?

.
11 Jahre weitere
mb thankyou very much. The font file was indeed to blame - it must have been corrupted during upload. I've re-uploaded the font and everything's working.

Thanks again for the help.
11 Jahre weitere
+1 on this one. It helped me too. same issue, corrupted /App_data/PDF/FreeSerif.ttf on version 2.8. Downloading a working file fixes the issue after web application restart

also, you can test file in windows by just double clicking on it. Corrupted file did not open
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.