It is not possible for me with the given protection functions, to protect a document (pdf, docx) in a way that it shows the visual marking defined in the azure portal.
By using the Microsoft Information Protection (MIP) SDK I'm able to read the labels and protect documents in accordance. If I Set the visual marking in the azure portal for 'footer' 'header' or 'watermark' and save it and publish it, the generated documents by applying the label with protection doesn't show the header,footer or watermark information in the protected document. Even if I print out, no header, footer or watermark is shown. How need the protection here be done, in order that the visual markings are show in the document how it was defined in the azure portal? Is there a way to read the 'visual marking' information out of the label information?
Get the labels by using Microsoft.InformationProtection.File
labels = engine.SensitivityLabels;
Protect the documents with
handler = CreateFileHandler(options,options.InputFileStream);
// Use the SetLabel method on the handler, providing label ID and LabelingOptions
// The handler already references a file, so those details aren't needed.
handler.SetLabel(options.LabelId, labelingOptions);
// The change isn't committed to the file referenced by the handler until CommitAsync() is called.
// Pass the desired output file name in to the CommitAsync() function.
var result = Task.Run(async () => await handler.CommitAsync(options.OutputFileStream)).Result;
// var result = await handler.CommitAsync(options.OutputFileStream);
options.FileName = handler.OutputFileName;
The protection works, but no visual markings are shown in the protected document as it would be expected
I would expect that the protected documents have the header, footer, watermark information as defined for the label in the azure portal.