We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Insert Picture - Size & Hyperlink

Hi,

I have successfully created word to pdf , and inserted picture using

Dim shp As Aspose.Words.Drawing.Shape = builder.InsertImage(myimage)

However, the size of the inserted picture does not appear to be 100% of the original jpg picture, it seems to have streched it. How do i set the inserted picture to be 100% height and size ?

Also, i would like to assign a hyperlink to the inserted image. How would i go about this please ?

Many Thanks

Mark

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. The image is inserted inline and at 100% scale. Please see the following link:

http://www.aspose.com/documentation/file-format-components/aspose.words-for-.net-and-java/aspose.words.documentbuilder.insertimage_overload_2.html

Also you can set negative values of width and height. See the following link.

http://www.aspose.com/documentation/file-format-components/aspose.words-for-.net-and-java/aspose.words.documentbuilder.insertimage_overload_6.html

Here is code that shows how to insert image with hyperlink.

'Create new document

Dim doc As Document = New Document()

'Create DocumentBuilder

Dim builder As DocumentBuilder = New DocumentBuilder(doc)

'Insert Image into the document

Dim img As Shape = builder.InsertImage("test.jpg", -1, -1)

'Set hyperlink

img.HRef = "http://www.aspose.com"

'Save document

doc.Save("out.doc")

Hope this helps.

Best regards.

Hi,

Thats great thanks !

Mark