PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Apr 23, 2024 10:31 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Apr 24, 2014 4:32 pm 
Offline

Joined: Thu Apr 24, 2014 4:22 pm
Posts: 1
Hi,

My code crash if i like to use embedded fonts, directly at save call. -> this.pDocument.Save(sFilename);

var pFontOptions = new XPdfFontOptions(PdfFontEmbedding.Always);
pFont[0] = new XFont("Helvetica", 12, XFontStyle.Regular, pFontOptions);
pFont[1] = new XFont("Helvetica", 30, XFontStyle.Regular, pFontOptions);

if i use .None or didnt use XPdfFontOptions it works fine....... any idea????

thanks markus

Error Message
System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
bei PdfSharp.Fonts.OpenType.FontData.CreateFontSubSet(Dictionary`2 glyphs, Boolean cidFont)
bei PdfSharp.Pdf.Advanced.PdfTrueTypeFont.PrepareForSave()
bei PdfSharp.Pdf.Advanced.PdfFontTable.PrepareForSave()
bei PdfSharp.Pdf.PdfDocument.PrepareForSave()
bei PdfSharp.Pdf.PdfDocument.DoSave(PdfWriter writer)
bei PdfSharp.Pdf.PdfDocument.Save(Stream stream, Boolean closeStream)
bei PdfSharp.Pdf.PdfDocument.Save(Stream stream)
bei PdfSharp.Pdf.PdfDocument.Save(String path)


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 28, 2014 8:23 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
Hi!

I'm afraid there is not much we can do with just a few lines of code and without the font file.
Have you tried "Arial", "Verdana", "Segoe" or another font?

See also:
http://www.pdfsharp.net/wiki/PostScript_fonts.ashx

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 192 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