Click or drag to resize

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
)

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
//* declaration position and size *
double lLeft = 7.2;     // cm
double lTop = 0.7;      // cm
double lWidth = 5.6;    // cm
double lHeight = 0;     // cm

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