PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index PDFsharp - moved to http://forum.pdfsharp.net/
Please visit the new PDFsharp forum at http://forum.pdfsharp.net/
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Debug.Assert "Bug in Checksum Algorithm" with embe

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Bug Reports - moved to http://forum.pdfsharp.net/
View previous topic :: View next topic  
Author Message
aule



Joined: 16 Jun 2008
Posts: 1

PostPosted: Mon Jun 16, 2008 6:56 pm    Post subject: Debug.Assert "Bug in Checksum Algorithm" with embe Reply with quote

Hi,
First of all: Thanks a lot for this great library!
It works like a charm and I had up to this time just one problem which follows:

I'm trying to embed a barcode font. If I do not embed the font everything works fine and the PDF is shown correctly on systems that have the barcode font installed.
When I try to embed the font, I get the following Debug.Assert:
Bug in checksum algorithm.
at IRefFontTable.PrepareForCompilation()
at FontImage.Compile()
at FontImage.CreateFontSubSet(Dictionary`2 glyphs, Boolean cidFont)
at PdfCIDFont.PrepareForSave()
at PdfType0Font.PrepareForSave()
at PdfFontTable.PrepareForSave()
at PdfDocument.PrepareForSave()
at PdfDocument.DoSave(PdfWriter writer)
at PdfDocument.Close()
// rest of stacktrace removed

The relevant code:
#if DEBUG
// Check the checksum algorithm
if (DirectoryEntry.Tag != TableTagNames.Head)
{
byte[] bytes = new byte[DirectoryEntry.PaddedLength];
Buffer.BlockCopy(this.irefDirectoryEntry.FontTable.fontImage.Bytes, this.irefDirectoryEntry.Offset, bytes, 0, DirectoryEntry.PaddedLength);
uint checkSum1 = DirectoryEntry.CheckSum;
uint checkSum2 = CalcChecksum(bytes);
Debug.Assert(checkSum1 == checkSum2, "Bug in checksum algorithm."); <== THIS ASSERT FIRES
}
#endif
It might be worth noting that TableTagNames.Head above contains "head" and DirectoryEntry.Tag contains "hhea" when this problem occurs.

BTW, embedding a normal font like "Times New Roman" works fine.

If you need anything more, please let me know!

Regards

Uwe

EDIT: One more addition: If I ignore the assertion above the font seems to be embedded fine (I was able to open the PDF successfully on a system without the barcode fonts and the barcodes where visible)
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Bug Reports - moved to http://forum.pdfsharp.net/ All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


Start Your Own YouTube Clone

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com