The problem I'm trying to solve is that users do not know that the original document may not be what they are seeing in the viewer when there are layers.
A property that indicates
that a document has layers would allow the system to refuse to open the document.
When creating many instances of RadPdfViewer:
static void Main(string[] args)
{
int i = 1;
try
{
Stopwatch stopwatch = Stopwatch.StartNew();
while (true)
{
using (RadPdfViewer pdfViewer = new RadPdfViewer())
{
}
Console.WriteLine($"iteration {i}, elapsed seconds: {stopwatch.Elapsed.TotalSeconds}");
i++;
}
}
catch (Exception e)
{
Console.WriteLine($"Exception occurred at iteration {i}");
Console.WriteLine(e);
Console.ReadLine();
}
}
the following error occurs:
System.Runtime.InteropServices.ExternalException (0x80004005): A generic error occurred in GDI+. at System.Drawing.Bitmap.GetHicon() at Telerik.WinControls.PdfViewer.MouseHandlers.PanHandler..ctor(MouseHandlersController controller, IFixedDocumentPresenter presenter) at Telerik.WinControls.PdfViewer.MouseHandlers.MouseHandlersController.BuildHandlers(IFixedDocumentPresenter presenter) at Telerik.WinControls.PdfViewer.MouseHandlers.MouseHandlersController..ctor(IFixedDocumentPresenter presenter) at Telerik.WinControls.UI.RadPdfViewerElement..ctor() at Telerik.WinControls.UI.RadPdfViewer.CreateViewerElement() at Telerik.WinControls.UI.RadPdfViewer.CreateChildItems(RadElement parent) at Telerik.WinControls.RadControl.Telerik.WinControls.IComponentTreeHandler.CreateChildItems(RadElement parent) at Telerik.WinControls.RadElementTree.InitializeRootElement() at Telerik.WinControls.RadControl.Construct() at Telerik.WinControls.RadControl..ctor() at Telerik.WinControls.UI.RadPdfViewer..ctor()
It seems that this is a regression in R1 2023 SP1 after addressing this item:
Open the Demo application >> Interactive Forms example and apply the Office2019Dark theme. You will notice that if the text field enters edit mode, it is difficult to read the input due to black fore color and black backcolor:
Run the project and load a document with bookmarks. Try to click the two buttons in order to switch between thumbnails/bookmarks.
private void radButton1_Click(object sender, EventArgs e)
{
this.radPdfViewer1.ShowThumbnails();
}
private void radButton2_Click(object sender, EventArgs e)
{
this.radPdfViewer1.ShowBookmarks();
}
Expected: clicking the two buttons should switch between bookmarks/thumbnails
Actual: the user is stuck to bookmarks
With the R1 2021 version of our controls RadPdfViewer is using the RadPdfProcessing library model. In this scenario, the PDF document contains images with sizes 87380, 87654. Internally the control is using RenderTargetBitmap to draw the image. So when we pass these values as Width and Height to the constructor of this object an exception occurs. This is a limitation of the RenderTargetBitmap class. It can be reproduced outside of the RadPdfViewer.
RenderTargetBitmap bmp = new RenderTargetBitmap(87380, 87654,96,96,PixelFormats.Pbgra32);
As a workaround, we can use the old rendering engine of the control by setting the RadPdfViewer.UsePdfProcessingModel property to false.
The highlight annotation appears above the text and covers it, instead of appearing under it.
Expected:
Actual: