PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Sep 26, 2020 6:53 pm

All times are UTC

Forum rules

Please read this before posting on this forum: Forum Rules

Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Mon Jun 16, 2008 6:56 pm 

Joined: Mon Jun 16, 2008 6:42 pm
Posts: 1
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:
// 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
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!



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)

Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 3 guests

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 post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group