This is developing an application in .Net that requires access to office files (Word, Excel, PDF, etc.) hosted in OneDrive folders, the access must be stream level and not logical, since you want to add an electronic signature to said documents, after the signature is added that same document is stored in another folder in the same OneDrive account.
Part of the code used for signing in PDF is as follows:
Stream archivoPdf = new FileStream(pdfCon, FileMode.Create);
PdfReader firmapdf = new PdfReader(pdfSin);
PdfStamper fir = PdfStamper.CreateSignature(firmapdf, archivoPdf, '"size": 17358,
"webUrl": "https://1drv.ms/x/s!AEuukj7rjH7VjH8",
"file": {
"hashes": {
"crc32Hash": "E248ECFD",
"sha1Hash": "673102CFAAF6B3C13DAC3E850FE51B0DA8834104"
},
"mimeType": "text/plain; charset=UTF-8"
},
"fileSystemInfo": {
"createdDateTime": "2015-03-12T13:45:04.52Z",
"lastModifiedDateTime": "2015-03-12T13:21:08Z"
},
"[email protected]": "https://graph.microsoft.com/v1.0/$metadata#users('xxxxxxxxx%40hotmail.com')/drive/root/children",
"children": [],
');
I have only been able to get the logical route, using an example of the OneDrive API with JavaScript.
Stream archivoPdf = new FileStream(pdfCon, FileMode.Create);
PdfReader firmapdf = new PdfReader(pdfSin);
PdfStamper fir = PdfStamper.CreateSignature(firmapdf, archivoPdf, '"size": 17358,
"webUrl": "https://1drv.ms/x/s!AEuukj7rjH7VjH8",
"file": {
"hashes": {
"crc32Hash": "E248ECFD",
"sha1Hash": "673102CFAAF6B3C13DAC3E850FE51B0DA8834104"
},
"mimeType": "text/plain; charset=UTF-8"
},
"fileSystemInfo": {
"createdDateTime": "2015-03-12T13:45:04.52Z",
"lastModifiedDateTime": "2015-03-12T13:21:08Z"
},
"[email protected]": "https://graph.microsoft.com/v1.0/$metadata#users('xxxxxxxxx%40hotmail.com')/drive/root/children",
"children": [],
');