The annotation toolbar icons don't appear when I run my Win 8.1 project

32 views
Skip to first unread message

Ryan

unread,
May 25, 2016, 9:15:24 PM5/25/16
to PDFTron PDFNet SDK
Question:

When I run my Windows 8.1 App, the annotation toolbar icons are missing. I tried Windows 10, and it was fine, and also the PDFNet SDK samples work fine on Win 8.1

Answer:

It appears the problem is a glitch in Windows 8.1, where because the tools are used in an intermediate project, the resources (custom.ttf) seem to not be accessible at runtime. This same setup works fine on Windows 10, just not on Windows 8.1. This works in our samples, and I suppose most of our customers, because the tools are used directly.

Note, the icons are in the PDFViewCtrlTools project, in Controls -> Resources -> custom.ttf 

Fortunately the tools project is open code for you. The easiest solution would be to create a folder inside the Example.WinRT project called Tools and simply drag all the source code into that project. You will have to manually change the resource paths. The other option is to only move the AnnotationToolbar over, along with the font file.

Tomas Hofmann

unread,
May 27, 2016, 7:15:59 PM5/27/16
to PDFTron PDFNet SDK
Update:

It appears that you can work around this on Windows 8.1 by explicitly giving the font family to the button (rather than as an implicit style).

Either in Xaml directly (AnnotationToolbar.xaml):

 <resources:TabButton x:Name="AnnotSquareButton" Tag="square" Content="&#xE095;" FontFamily="ms-appx:///pdftron.PDF.Tools/Controls/Resources/custom.ttf#PDFTron Glyphicons"
                                             Command="{Binding ToolButtonClickedCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}}"
                                             Style="{Binding CurrentTool, Converter={StaticResource EnumToStyleConverterWithProperties}, ConverterParameter=e_rect_create}"/>

Or in the codebehind (AnnotationToolbar.xaml.cs):

AnnotCircleButton.FontFamily = new FontFamily("ms-appx:///pdftron.PDF.Tools/Controls/Resources/custom.ttf#PDFTron Glyphicons");


This should make the glyphs show up, without any other modifications.
Reply all
Reply to author
Forward
0 new messages