This is a migrated thread and some comments may be shown as answers.

Inserting Text æøåÆØÅ

5 Answers 156 Views
PdfProcessing
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 29 Sep 2014, 07:06 AM
Hi,

Setting:

TextProperties.Font = FontsRepository.Helvetica

Editor.DrawText("æøåÆØÅ")

Gives an error

Any setting for nordic letters I am missing?

Regards,
Brian

5 Answers, 1 is accepted

Sort by
0
Kammen
Telerik team
answered on 29 Sep 2014, 08:50 AM
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
 
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 ......................................
0
Kammen
Telerik team
answered on 29 Sep 2014, 10:52 AM
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
 
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


/Brian



0
Kammen
Telerik team
answered on 30 Sep 2014, 02:38 PM
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
 
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.
 
Tags
PdfProcessing
Asked by
Brian
Top achievements
Rank 1
Answers by
Kammen
Telerik team
Brian
Top achievements
Rank 1
Share this question
or