5 Answers, 1 is accepted
0
Hi Brian,
Can you be more specific about the error you are having. We have tried your code and everything works as expected.
We are looking forward to your reply.
Regards,
Kammen
Telerik
Can you be more specific about the error you are having. We have tried your code and everything works as expected.
We are looking forward to your reply.
Regards,
Kammen
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
0
Brian
Top achievements
Rank 1
answered on 29 Sep 2014, 09:00 AM
The error comes from the export statement:
Dim OutStream As New FileStream(Me.FileName, FileMode.Create)
PdfFormatProvider.Export(Me.PDFDocument, OutStream)
OutStream.Close()
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Telerik.Windows.Documents.Core.Fonts.Type1.Type1Format.Dictionaries.Type1Font.ReadGlyphData(String name)
at Telerik.Windows.Documents.Core.Fonts.Type1.Type1Format.Dictionaries.Type1Font.GetGlyphData(String name)
at Telerik.Windows.Documents.Core.Fonts.Type1.Type1Format.Dictionaries.Type1Font.GetAdvancedWidth(String glyphName)
at Telerik.Windows.Documents.Core.Fonts.Type1.Type1Format.Type1FontSource.GetAdvancedWidth(Int32 charCode)
at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.Fonts.SimpleFont.CopyPropertiesFromOverride(IPdfExportContext context, FontBase font)
at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.Fonts.Font.CopyPropertiesFrom(IPdfExportContext context, FontBase font)
at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Export.PdfExporter.Export(Stream output, IPdfExportContext context)
at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider.ExportOverride(RadFixedDocument document, Stream output)
at Telerik.Windows.Documents.Common.FormatProviders.FormatProviderBase`1.Export(T document, Stream output)
at ......................................
Dim OutStream As New FileStream(Me.FileName, FileMode.Create)
PdfFormatProvider.Export(Me.PDFDocument, OutStream)
OutStream.Close()
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Telerik.Windows.Documents.Core.Fonts.Type1.Type1Format.Dictionaries.Type1Font.ReadGlyphData(String name)
at Telerik.Windows.Documents.Core.Fonts.Type1.Type1Format.Dictionaries.Type1Font.GetGlyphData(String name)
at Telerik.Windows.Documents.Core.Fonts.Type1.Type1Format.Dictionaries.Type1Font.GetAdvancedWidth(String glyphName)
at Telerik.Windows.Documents.Core.Fonts.Type1.Type1Format.Type1FontSource.GetAdvancedWidth(Int32 charCode)
at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.Fonts.SimpleFont.CopyPropertiesFromOverride(IPdfExportContext context, FontBase font)
at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.Fonts.Font.CopyPropertiesFrom(IPdfExportContext context, FontBase font)
at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Export.PdfExporter.Export(Stream output, IPdfExportContext context)
at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider.ExportOverride(RadFixedDocument document, Stream output)
at Telerik.Windows.Documents.Common.FormatProviders.FormatProviderBase`1.Export(T document, Stream output)
at ......................................
0
Hello Brian,
Unfortunately we are still unable to reproduce this issue. Is it possible to open a support ticket where you can attach a working example that reproduce it in order to further investigate this.
Regards,
Kammen
Telerik
Unfortunately we are still unable to reproduce this issue. Is it possible to open a support ticket where you can attach a working example that reproduce it in order to further investigate this.
Regards,
Kammen
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
0
Brian
Top achievements
Rank 1
answered on 30 Sep 2014, 08:04 AM
Did solve the problem using:
Dim font As FontBase = Nothing
Dim FontFamily As New System.Windows.Media.FontFamily("Verdana")
Dim success As Boolean = FontsRepository.TryCreateFont(FontFamily, font)
TextProperties.Font = font
Dim font As FontBase = Nothing
Dim FontFamily As New System.Windows.Media.FontFamily("Verdana")
Dim success As Boolean = FontsRepository.TryCreateFont(FontFamily, font)
TextProperties.Font = font
/Brian
0
Hello Brian,
FixedContentEditor should do this by itself. It implements font fallback mechanism that will change the font of th TextFragments as soon as the symbols does not present in the specified font. That is why I am confused why this exception happened to you.
I think this may be a bug that should be fixed in the newer version of the library.
I am glad that you have make this work.
Regards,
Kammen
Telerik
FixedContentEditor should do this by itself. It implements font fallback mechanism that will change the font of th TextFragments as soon as the symbols does not present in the specified font. That is why I am confused why this exception happened to you.
I think this may be a bug that should be fixed in the newer version of the library.
I am glad that you have make this work.
Regards,
Kammen
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.