Last Updated:
27 Jun 2023 08:46
by ADMIN
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;
}
}
}