Reputation: 1
I get the error: "System.ArgumentException: 'The specified destination is already in use by another object'".
The destination, LinkAnnotationNEW, was assigned a value just a few lines above the error, I don't see how that can be.
LinkAnnotationNEW = LinkAnnotation
Dim thePdfDest = New PdfDestination(Nothing, OLDdestination)
thePdfDest = LinkAnnotation.Link.Destination
Dim fileSpec As New PdfFileSpecification(theDocument)
fileSpec.FileName = OLDfileNameDirectory & sheetFileNameNEWannotation
LinkAnnotationNEW.Link.Action = New PdfGoToRAction(theDocument, fileSpec, thePdfDest)
Page.Annots.Remove(LinkAnnotation)
Page.Annots.Add(LinkAnnotationNEW)
Although, maybe the part of it LinkAnnotationNEW.Link.Annotation, needs to be deleted first or something else?
See images for more details and code. enter image description here enter image description here Thanks!
The code I am currently using (as above), fails with the error: 'The specified destination is already in use by another object'
I am using Patagames PDFium (not Google) a bunch already and it works great and it is super-fast.
Upvotes: 0
Views: 23