But I want proper solution so that I can remove watermark with C# code without leaving the document corrupted. it removes watermark but leaves the document corrupted. Var header = (i=>maindoc.GetIdOfPart(i).Equals(headerId)) MainDocumentPart = maindoc = package.MainDocumentPart headerId is the id of the header section which contains the watermark Var watermark = head.GetPartById(watermarkId) Ĭode 2: public static void DeleteCustomWatermark(WordProcessingDocument package, string headerId) Var head = headers.First() //we are sure that this header part contains the Watermark with id=watermarkId The process of adding a watermark to a document is fairly simple and does not require much effort. That is why learning to effectively create watermark in Word for your documents is essential. Watermarks are great tools and are useful in multiple scenarios. MainDocumentPart maindoc = package.MainDocumentPart The importance of watermarks in a document cannot be denied. I have tried following code block to delete the watermark from the documentĬode 1: private static void DeleteCustomWatermark(WordprocessingDocument package, string watermarkId)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |