Hello fatmedia,
Thanks for your inquiry and sorry for the late reply.
We have tested the first issue you said with the latest hotfix[Spire.Doc v4.1.22] using the following code:
- Code: Select all
//load the document
Document doc = new Document();
doc.LoadFromFile(@"..\..\test.doc", FileFormat.Doc);
//load the picture
Image image = Image.FromFile(@"..\..\untitled.bmp");
//new a pictureWatermark using the picture
PictureWatermark picMark = new PictureWatermark(image, false);
//insert the pictureWatermark into the document
doc.Sections[0].Document.Watermark = picMark;
//save the document as PDF file
doc.SaveToFile(@"..\..\result.pdf", FileFormat.PDF);
. It works fine. Would you please have a kind try with the hotfix,you can download it at http://www.e-iceblue.com/Download/download-word-for-net-now/spire-doc-hv4122.html.
For the second question,you can use the following code:
- Code: Select all
//load the document
Document doc = new Document();
doc.LoadFromFile(@"..\..\test.doc", FileFormat.Doc);
//create a header
HeaderFooter header = doc.Sections[0].HeadersFooters.Header;
//insert picture to header
Paragraph headerParagraph = header.AddParagraph();
DocPicture headerPicture
= headerParagraph.AppendPicture(Image.FromFile(@"..\..\header.jpg"));
//set the textWrapStyle
headerPicture.TextWrappingStyle = TextWrappingStyle.Behind;
//allocate the picture
headerPicture.VerticalAlignment = ShapeVerticalAlignment.Top;
headerPicture.HorizontalAlignment = ShapeHorizontalAlignment.Right;
//save the document
doc.SaveToFile(@"..\..\result.pdf", FileFormat.PDF);
As the third question, Spire.Doc doesn't support to set the text wrapping to in-front of the text at present. We are so sorry for the inconvenience.
If you still have any other questions,please feel free to contact us.
Have a great day.
BR
Suvi
e-iceblue support