Hello together,
I am experiencing a bug with the following use case:
When upgrading Telerik.Documents.Fixed from version 2024.3.806 to version 2024.4.1106 the exported PDF file is missing different parts of the originally imported PDF file or even results in a complete "messy" file. Input and output files are view with Adobe Acrobat, Google Chrome, Edge...all showing the same result.
Even omitting step 2 (i.e. I only import and directly export the PDF file) results in the same bug after.
I do not use any special import or export setting to reproduce the error. But even with applying different import/export settings I could not change the buggy outcome.
var bytes = File.ReadAllBytes(@"C:\temp\in.pdf");
var formatProvider = new PdfFormatProvider();
var document = formatProvider.Import(bytes, TimeSpan.FromSeconds(20));
var outBytes = formatProvider.Export(document, TimeSpan.FromSeconds(20));
File.WriteAllBytes(@"C:\temp\out.pdf", outBytes);
See the attached file for example, import it and export it (via code snippet above).
With version 2024.3.806 everything works fine - and as I am not seeing any relevant breaking changes or other release information regarding this issue, I am a little bit lost with what I could do to solve the issue..
Thanks for your support!
Hello,
HtmlDataProvider will throw an exception on export or when used by a RadRichTextBox, when using a html containing the length value "NaN", which doesn't seem to be a standard approved value, but nevetheless it is a special case because other invaild values are simply ignored while this one triggers two exceptions - one of which is hard to catch and crashes the whole application.
Code to reproduce: Console App / .Net Framework 4.8 / Package Telerik.Windows.Documents.FormatProviders.Html.for.Wpf 2022.3.912
using System;
using Telerik.Windows.Documents.FormatProviders.Html;
using Telerik.Windows.Documents.Model;
namespaceHtmlProviderCrash
{
internalclassProgram
{
static void Main(string[] args)
{
var htmlContent = "<img src=\"https://static.cleverpush.com/notification/icon/92fYF7FtKbthsezwS.png?element=Le7adDwC\" " +
"alt=\"\" style=\"display: inline-table;max-width: 100%;width: 300px;\" width=\"300\" height=\"NaN\" class=\"cp-element-image light-img\">";
HtmlFormatProvider htmlProvider = new HtmlFormatProvider();
RadDocument document = htmlProvider.Import(htmlContent);
try
{
var export = htmlProvider.Export(document);
}
catch (Exception ex)
{
var ka = ex.ToString();
}
while (Console.ReadKey().KeyChar != 'x') { }
}
}
}
Message "MeasureOverride returned NaN: Telerik.Windows.Documents.Layout.ImageLayoutBox" string at Telerik.Windows.Documents.Layout.LayoutElement.Measure(SizeF availableSize) at Telerik.Windows.Documents.Layout.ParagraphLayoutBox.MeasureCurrentGroupSize(ParagraphLayoutBoxMeasureContext context, SizeF measureSize, Func`1 GetCurrentXDefaultValue, LinkedList`1 currentGroupInlines) at Telerik.Windows.Documents.Layout.ParagraphLayoutBox.MeasureOverride(SizeF availableSize) at Telerik.Windows.Documents.Layout.LayoutElement.MeasureCore(SizeF availableSize) at Telerik.Windows.Documents.Layout.LayoutElement.Measure(SizeF availableSize) at Telerik.Windows.Documents.Layout.SectionLayoutBox.MeasureOverrideInternal(SizeF availableSize) at Telerik.Windows.Documents.Layout.SectionLayoutBox.MeasureOverride(SizeF availableSize) at Telerik.Windows.Documents.Layout.LayoutElement.MeasureCore(SizeF availableSize) at Telerik.Windows.Documents.Layout.LayoutElement.Measure(SizeF availableSize) at Telerik.Windows.Documents.Layout.DocumentLayoutBox.MeasureOverrideInternal(SizeF availableSize) at Telerik.Windows.Documents.Layout.DocumentLayoutBox.MeasureOverride(SizeF availableSize) at Telerik.Windows.Documents.Layout.LayoutElement.MeasureCore(SizeF availableSize) at Telerik.Windows.Documents.Layout.LayoutElement.Measure(SizeF availableSize) at Telerik.Windows.Documents.Model.RadDocument.Measure(SizeF measureSize) at Telerik.Windows.Documents.Model.RadDocument.MeasureAndArrangeInDefaultSize() at Telerik.Windows.Documents.Model.RadDocument.EnsureDocumentMeasuredAndArranged() at Telerik.Windows.Documents.FormatProviders.Html.Export.HtmlDocumentExporter.Export(RadDocument document, Stream output) at Telerik.Windows.Documents.FormatProviders.Html.HtmlFormatProvider.Export(RadDocument document, Stream output) at Telerik.Windows.Documents.FormatProviders.Html.HtmlFormatProvider.Export(RadDocument document) at HtmlProviderCrash.Program.Main(String[] args)
Message "The image data generated an overflow during processing"
at System.Windows.Media.Imaging.TransformedBitmap.FinalizeCreation() in System.Windows.Media.Imaging\TransformedBitmap.cs:line 216
at System.Windows.Media.Imaging.TransformedBitmap.EndInit() in System.Windows.Media.Imaging\TransformedBitmap.cs:line 112
at System.Windows.Media.Imaging.BitmapImage.FinalizeCreation() in System.Windows.Media.Imaging\BitmapImage.cs:line 505
at System.Windows.Media.Imaging.BitmapImage.EndInit() in System.Windows.Media.Imaging\BitmapImage.cs:line 319
at Telerik.Windows.Documents.Model.ImageDocumentElementHelper.CreateImageSourceCore(BitmapCreateOptions createOptions, Byte[] bytes, Size renderingSize, String& extension, Byte[]& resultBytes)
at Telerik.Windows.Documents.Model.ImageDocumentElementHelper.CreateImageSource(Byte[] bytes, Size imageSize, Size scaleFactor, String& extension, Byte[]& resultBytes)
at Telerik.Windows.Documents.Model.ImageDocumentElementHelper.InitializeRawImageData(IImageDocumentElement imageElement, Byte[] bytes, Size scaleFactor, String& extension)
at Telerik.Windows.Documents.Model.ImageDocumentElementHelper.InitInternal(IImageDocumentElement imageElement, Byte[] bytes, Size size, String extension, Boolean isUserInitiated)
at Telerik.Windows.Documents.Model.ImageInline.InitImageElementFromUriStream(Stream stream)
at Telerik.Windows.Documents.Model.ImageInline.<SetStreamFromUriSource>b__0(Object s, StreamReadyEventArgs a)
at Telerik.Windows.Documents.Utils.ResourceStreamLocator.OnStreamReady()
at Telerik.Windows.Documents.Utils.ResourceStreamLocator.<GetStreamAsync>b__0(Object sender, OpenReadCompletedEventArgs e)
at System.Net.WebClient.OnOpenReadCompleted(OpenReadCompletedEventArgs e)
at System.Net.WebClient.OpenReadOperationCompleted(Object arg)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
After upgrading to .net 9 I get the following error when starting the published program (running it in RIDER in debug-mode doesn't create the issue).
System.TypeInitializationException: The type initializer for 'Telerik.Windows.Input.Touch.TouchManager' threw an exception.
---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Windows.Forms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Das System kann die angegebene Datei nicht finden.
the mentioned assembly System.Windows.Forms is not used by me at all.
Suddenly with WPF release 2024 Q4 some of pdf-s are not presented correctly. Attached file was produced with Telerik Report Designer and exported as pdf. With previous WPF version was OK.
You can check in your demo application. It is shown in previous release but not with latest.
Please make solution ASAP.
Regards
Janez Ovsenik
When the focus gets in RadRichTextBox, AutomationProperties.Name is not pronounced by screen readers (for example by Windows Narrator).
Hi Telerik-Team,
on of our user found a bug when you flick with the mouse on resizing a column.
The system crashes. Here is the message and stacktrace:
Message Object reference not set to an instance of an object. StackTrace at Telerik.Windows.Controls.GridView.GridViewHeaderCell.HeaderToResize(Object gripper) at Telerik.Windows.Controls.GridView.GridViewHeaderCell.OnColumnHeaderResize(Object sender, DragDeltaEventArgs e) at System.Windows.Controls.Primitives.DragDeltaEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e) at System.Windows.Controls.Primitives.Thumb.OnMouseMove(MouseEventArgs e) at System.Windows.UIElement.OnMouseMoveThunk(Object sender, MouseEventArgs e) at System.Windows.Input.MouseEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args) at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted) at System.Windows.Input.InputManager.ProcessStagingArea() at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport) at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel) at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) at System.Windows.Window.ShowHelper(Object booleanBox) at System.Windows.Window.Show() at System.Windows.Window.ShowDialog() at Test_WPF.MainWindow.StartInstance(Type program) in C:\Users\masi\source\repos\NEMO\Test_WPF\MainWindow.xaml.cs:line 51
I have attached two examples. One in our app and a test application.
I hope you can figure out what is going on.
Best regards,
Mats
When upgrading to UI for WPF R3 2021 (NuGet), we are unable to build our projects because of a broken reference to Microsoft.VisualStudio.DesignTools.Extensibility. We also noticed that for each dll, a corresponding *.DesignTools reference was added to the project when we did the update - maybe there is a connection?
I was able to reproduce the problem by creating a new .NET Framework app (default VS template, .NET Framework 4.8) and adding the Telerik.Windows.Controls.for.Wpf nuget package (see attached screenshot). As soon as the package is added, I get the following IntelliSense warning:
Severity Code Description Project File Line Source Suppression State
Warning Unknown build error, 'Could not load file or assembly 'Microsoft.VisualStudio.DesignTools.Extensibility, Version=16.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)' WpfApp5 Build
When trying to build the project, I get the following error:
Severity Code Description Project File Line Source Suppression State
Error Unknown build error, 'Cannot resolve dependency to assembly 'Microsoft.VisualStudio.DesignTools.Extensibility, Version=16.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.' WpfApp5 Build
Manually adding the nuget package "Microsoft.VisualStudio.DesignTools.Extensibility" resolves the problem.
I would expect the telerik packages to reference the mentioned package as their dependency if it is required (allowing Visual Studio to resolve the missing reference automatically). If this is not possible for some reason, this should at least be noted in the documentation.
Regards
Simon Müller
Hofmann Fördertechnik GmbH