Einhugur Word Plugin for Xojo |

# EinhugurWord.Drawing Class

Class representing drawings in the Word document.
Currently we only support reading drawings that are Images and or SVG.
Not Word art drawings.

Object
Drawing

class EinhugurWord.Drawing

#### Constructors

Drawing (private) | Private constructor.

#### Properties

AltTextDescription | Sets or gets description for Alt Text.
HasSVGRepresentation | Returns true if the drawing has SVG representation.
IsPicture | Returns true if the Drawing is Picture.
PictureData | Returns the raw data for the picture as String.
PictureFileName | Gets name of the picture file.
PictureType | Returns type of the picture.
SVGRepresentationData | Returns the raw data for the SVG as String.
SVGRepresentationFileName | Gets name of the SVG file.

#### Examples

Embedding image from Xojo.
Note this example also needs Einhugur GraphicsFormats plugin and Einhugur TypeLib plugin.
using EinhugurWord
var ft as FileType = new FileType
ft.Extensions = "docx"
ft.Name = "Word Document"
var f as FolderItem = FolderItem.ShowSaveFileDialog(ft, "New document.docx")
if f <> nil then
try
var doc as Document = Document.Create(f)
doc.Creator = "Einhugur test user"
doc.LastModifiedBy = "Einhugur test user"
doc.Subject = "My first"
// Empty document has one paragraph so we just populate the first one instead of adding
call doc.Paragraph(0).AppendRun("Hello world ! This is my first paragraph. Bellow we will add Xojo Picture")
// Create some Xojo Picture object
var pic as Picture = new Picture(450,450)
var g as Graphics = pic.Graphics
g.DrawingColor = &C80 00 00
g.FillRectangle(1,1, 200, 200)
g.DrawingColor = &C00 00 FF
g.FillRectangle(150,150, 200, 200)
var exporter as RawPngExporter = new RawPngExporter()
var imageData as String = exporter.SaveToString(RawBitmapConverter.FromPicture(pic))
call doc.AppendParagraph(imageData, EinhugurWord.PictureTypes.png, "My image from Xojo", pic.Width, pic.Height)
doc.Save()
catch e as WordException
MessageBox e.Message
end try
end if

#### Supported Platforms:

- macOS Intel 64 bit
- macOS Apple Silicon
- Windows 32 bit
- Windows 64 bit
- Windows ARM 64 bit
- Linux 32 bit
- Linux 64 bit
- Linux ARM 32 bit
- Linux ARM 64 bit
- iOS