XpsSignatureDefinition.SpotLocation - How does it work?
How does the Spot开发者_开发百科Location work? The following code will not display digital signature request(DSR) on the fixed page at the spot location. Should the DSR automatically appear at the spot location on the page, or do I have to define the signature picture, text, and the button and place it on the xps page?
...
XpsSignatureDefinition newSign = new XpsSignatureDefinition();
newSign.Intent = "I am the author of this document.";
newSign.RequestedSigner = "Jonnie ";
newSign.SigningLocale = "Richmond";
newSign.SpotLocation = new SpotLocation();
newSign.SpotLocation.PageUri
= PackUriHelper.CreatePartUri(new Uri(@"/Documents/1/Pages/1.fpage",UriKind.Relative));
newSign.SpotLocation.StartX = 30.00;
newSign.SpotLocation.StartY = 30.00;
newSign.SignBy = DateTime.Now + new TimeSpan(10, 0, 0, 0);
Guid g = System.Guid.NewGuid();
newSign.SpotId = g;
XpsDocument document = new XpsDocument(package);
IXpsFixedDocumentSequenceReader docSeqReader = document.FixedDocumentSequenceReader;
docSeqReader.FixedDocuments[0].AddSignatureDefinition(newSign);
docSeqReader.FixedDocuments[0].CommitSignatureDefinition();
....
Microsoft's XPS Viewer does not support placing a signature request in a specific location, (e.g. the location specified by the spot ID).
精彩评论