ImageAdd Method (String, Double, Double, Double, Double) | |
Added an image to fix position (anchor)
Namespace:
SIC.OpenDocumentFormat.MSWord
Assembly:
SIC.OpenDocumentFormat (in SIC.OpenDocumentFormat.dll) Version: 19.1.23.1 (19.1.23.622)
Syntax public void Add(
string pImageFile,
double pTop,
double pLeft,
double pWidth = 0,
double pHeight = 0
)
Public Sub Add (
pImageFile As String,
pTop As Double,
pLeft As Double,
Optional pWidth As Double = 0,
Optional pHeight As Double = 0
)
Parameters
- pImageFile
- Type: SystemString
Image file - pTop
- Type: SystemDouble
Top position from page in centimetre - pLeft
- Type: SystemDouble
Left position from page in centimetre - pWidth (Optional)
- Type: SystemDouble
Image width in centimetre - pHeight (Optional)
- Type: SystemDouble
Image height in centimetre
Remarks
Can parameter
pWidth or parameter
pHeight specify so will calculate image size automatic.
The image store in document.
Examples
This example added a logo image at fix position
double lLeft = 7.2;
double lTop = 0.7;
double lWidth = 5.6;
double lHeight = 0;
SIC.OpenDocumentFormat.MSWord.Document lDOC = new SIC.OpenDocumentFormat.MSWord.Document("Brief.doc");
lDOC.Image.Add("Logo.emf", lTop, lLeft, pWidth: lWidth, pHeight: lHeight);
lDOC.Close();
See Also