You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publicstaticvoidWatermark_SampleImage1(stringfolderPath,boolopenWord){Console.WriteLine("[*] Creating standard document with Watermark Image 1");varimagePaths=System.IO.Path.Combine(System.IO.Directory.GetCurrentDirectory(),"Images");stringfilePath=System.IO.Path.Combine(folderPath,"Basic Document with Watermark Image 1.docx");using(WordDocumentdocument=WordDocument.Create(filePath)){document.AddParagraph("Section 0");document.AddHeadersAndFooters();varimagePathToAdd=System.IO.Path.Combine(imagePaths,"PrzemyslawKlysAndKulkozaurr.jpg");varwatermark=document.Sections[0].Header.Default.AddWatermark(WordWatermarkStyle.Image,imagePathToAdd);// TODO: Add handling for watermark imageConsole.WriteLine(watermark.Height);Console.WriteLine(watermark.Width);document.Save(false);}using(WordDocumentdocument=WordDocument.Load(filePath)){document.Save(openWord);}}
The console lines throw an error since it only expects picture in document not headers/footers.
When using:
The console lines throw an error since it only expects picture in document not headers/footers.
OfficeIMO/OfficeIMO.Examples/Word/Watermark/Watermark.SampleImage1.cs
Lines 26 to 27 in 850f617
The text was updated successfully, but these errors were encountered: