<telerik:RadListBox MinWidth="100" MaxHeight="250" x:Name="radListBox" Grid.ColumnSpan="2" Visibility="Collapsed" HorizontalAlignment="Left" VerticalAlignment="Top" CanAutocompleteSelectItems="True" IsTextSearchEnabled="True" TextSearchMode="Contains" TextPath="Name" ItemTemplate="{StaticResource AutoCompleteListBoxTemplate}" ItemsSource="{Binding autoCompleteListItems}" MouseDoubleClick="radListBox_MouseDoubleClick" MouseUp="radListBox_MouseUp"> <telerik:RadListBox.Effect> <DropShadowEffect ShadowDepth="10" Color="Gray" Opacity=".4" Direction="320" RenderingBias="Performance" /> </telerik:RadListBox.Effect></telerik:RadListBox><DataTemplate x:Key="AutoCompleteListBoxTemplate"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition /> <ColumnDefinition /> <ColumnDefinition /> </Grid.ColumnDefinitions> <Image Style="{StaticResource AutoCompleteListBoxIcon}" Width="10" Height="10" Margin="0,0,10,0" /> <TextBlock Text="{Binding Name}" Grid.Column="1" HorizontalAlignment="Stretch" /> <TextBlock Text="" Grid.Column="2" HorizontalAlignment="Right" Margin="5,0,5,0" /> </Grid></DataTemplate>private void radRichTextBox_Loaded(object sender, RoutedEventArgs e){ //Set Autocomplete ListBox itemssource radListBox.ItemsSource = autoCompleteListItems;}RadDocument headerDoc = new RadDocument();RadDocument footerDoc = new RadDocument();Section hSection = new Section();hSection.PageOrientation = PageOrientation.Landscape;headerDoc.DefaultPageLayoutSettings = new PageLayoutSettings(PaperTypes.A4);headerDoc.SectionDefaultPageOrientation = PageOrientation.Landscape;headerDoc.Sections.Add(hSection);headerDoc.SectionDefaultPageMargin = new Telerik.Windows.Documents.Layout.Padding(5, 5, 5, 5);Paragraph hparagraph = new Paragraph();hSection.Blocks.Add(hparagraph);Span hspan = new Span("Title");hspan.FontSize = 20;if (!string.IsNullOrEmpty("Title")) hparagraph.Inlines.Add(hspan);Paragraph h2paragraph = new Paragraph();h2paragraph.TextAlignment = RadTextAlignment.Right;hSection.Blocks.Add(h2paragraph);var fecha = DateTime.Now;Span h2span = new Span(fecha.ToString());h2span.FontSize = 10;h2paragraph.Inlines.Add(h2span);Section fSection = new Section();fSection.PageOrientation = PageOrientation.Landscape;footerDoc.DefaultPageLayoutSettings = new PageLayoutSettings(PaperTypes.A4);footerDoc.SectionDefaultPageOrientation = PageOrientation.Landscape;footerDoc.Sections.Add(fSection);footerDoc.SectionDefaultPageMargin = new Telerik.Windows.Documents.Layout.Padding(5, 5, 5, 5);Paragraph fparagraph = new Paragraph();fSection.Blocks.Add(fparagraph);Span fspan = new Span("Footer");fspan.FontSize = 30;if(!string.IsNullOrEmpty("Footer")) fparagraph.Inlines.Add(fspan);Header header = new Header();Footer footer = new Footer();header.Body = headerDoc;footer.Body = footerDoc;Section section = new Section();section.PageOrientation = PageOrientation.Landscape;section.Headers.Default = header;section.Footers.Default = footer;return section;Application: PdfViewer.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Runtime.InteropServices.COMException
Stack:
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32, IntPtr)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32, IntPtr)
at MS.Internal.Text.TextInterface.Native.Util.ConvertHresultToException(Int32)
at MS.Internal.Text.TextInterface.Factory.CreateFontFace(System.Uri, UInt32, MS.Internal.Text.TextInterface.FontSimulations)
at System.Windows.Media.GlyphTypeface.Initialize(System.Uri, System.Windows.Media.StyleSimulations)
at System.Windows.Media.GlyphTypeface..ctor(System.Uri, System.Windows.Media.StyleSimulations)
at System.Windows.Documents.Glyphs.ParseGlyphRunProperties()
at System.Windows.Documents.Glyphs.ComputeMeasurementGlyphRunAndOrigin()
at System.Windows.Documents.Glyphs.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Controls.Canvas.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Controls.Canvas.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Controls.Canvas.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Controls.Canvas.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.ContextLayoutManager.UpdateLayoutCallback(System.Object)
at System.Windows.Media.MediaContext+InvokeOnRenderCallback.DoWork()
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(System.Object)
at System.Windows.Media.MediaContext.RenderMessageHandler(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
at System.Threading.ExecutionContext.runTryCode(System.Object)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.InvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(System.Object)
at System.Windows.Application.RunInternal(System.Windows.Window)
at System.Windows.Application.Run(System.Windows.Window)
at PdfViewer.App.Main()
var columns = (from c in grid.Columns.OfType<GridViewBoundColumnBase>() where c.IsVisible orderby c.DisplayIndex select c).ToList();var widthTable = 0f;foreach (var col in columns ){ widthTable += (float)col.Width.DisplayValue ;}Table table = new Table();table.CellPadding = new Padding(5);if (widthTable > 0) table.PreferredWidth = new TableWidthUnit(widthTable);