Approved
Last Updated: 28 Dec 2018 09:27 by ADMIN
Andre
Created on: 30 Nov 2018 17:33
Category: PDFViewer
Type: Bug Report
1
PdfViewer: Destinations with null properties doesn't scroll to page
By specification, when some of the destination parameters have null value, the current value of that parameter is to be retained unchanged (This rule applies for most of the properties). For example, if Location (XYZ) destination is imported and any of the left, top, or zoom parameters is null, the current value of the visual viewport for the specified property should be retained. 

Workaround: Edit the document destinations and set default values. For example if the document contains Location destinations the Left, Top and Zoom properties can be set:
foreach (var annotation in document.Annotations)
{
    Link link = annotation as Link;
    if (annotation != null)
    {
        if (link.Destination is Location location)
        {
            location.Left = location.Left != null ? location.Left : 0;
            location.Top = location.Top != null ? location.Top : 0;
            location.Zoom = location.Zoom != null ? location.Zoom : 1;
        }
    }
}
0 comments