http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/pdf/pdfs/PDF32000_2008.pdf
Chapter 12.3.2.2 Explicit Destinations, Page 366
XYZDestination for example:
“A null value for any of the parameters left, top, or zoom specifies that the current value of that parameter shall be retained unchanged.”
The issue is evident by looking at the class definitions. For example:
https://apireference.aspose.com/net/pdf/aspose.pdf.annotations/xyzexplicitdestination
The use case is, we have PDF documents from various sources. This documents must conform to certain guidelines. In this case we tried to remove the zoom factor from the OpenAction without altering the position information. Since the document contains confidential information, we created a substitute document for testing.
Testfile and testcode:
testdoc.pdf (30.3 KB)
static void testfunc(string inputfile, string outputfile)
{
Aspose.Pdf.Document doc = new Aspose.Pdf.Document(inputfile);
Aspose.Pdf.Annotations.GoToAction action = (Aspose.Pdf.Annotations.GoToAction)doc.OpenAction;
Aspose.Pdf.Annotations.XYZExplicitDestination dest = action.Destination as Aspose.Pdf.Annotations.XYZExplicitDestination;
action.Destination = new Aspose.Pdf.Annotations.XYZExplicitDestination(dest.PageNumber, dest.Left, dest.Top, 1.5);
doc.Save(outputfile);
}
The Acrobat Reader will open the original file on the top left, the modified file on the bottom left.