Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.
Mon Sep 11, 2017 2:05 pm
I'm using this method to add a watermark to an existing document. Also using FreeSpire.Doc
- Code: Select all
Dim Doc As New Document
Doc.LoadFromFile("\\****\c$\Users\****\Documents\Custom Office Templates\Job Letter1.dotx", FileFormat.Docx2013)
Dim picture As PictureWatermark = New PictureWatermark
picture.Picture = System.Drawing.Image.FromFile(Server.MapPath("~\images\Watermark.jpg"))
picture.Scaling = 1000
picture.IsWashout = True
Doc.Sections(0).Document.Watermark = picture
It adds the watermark except it is placed in the top left corner of the page. I need it placed in the center of the page. Any ideas or help is appreciated. I also need to keep using the "LoadFromFile" method since I am replacing text in the document as well.
-
chiefind
-
- Posts: 1
- Joined: Mon Sep 11, 2017 1:54 pm
Tue Sep 12, 2017 2:42 am
Dear chiefind,
Thanks for your inquiry.
After an initial test, sorry that I didn't reproduce your issue. Could you please provide the input document and the image for testing?
In addition, you just need to use "Doc.Watermark = picture" to set the watermark for the document.
Thanks,
Betsy
E-iceblue support team
-
Betsy.jiang
-
- Posts: 3099
- Joined: Tue Sep 06, 2016 8:30 am
Fri Sep 15, 2017 8:43 am
Dear chiefind,
How is your issue now ?
Could you please give us some feedback at your convenience ?
Thanks,
Betsy
E-iceblue support team
-
Betsy.jiang
-
- Posts: 3099
- Joined: Tue Sep 06, 2016 8:30 am