Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Oct 6, 2023

Hi All,
Completed the UG Draft work for Appent SVG image in Word document.

Task Link: https://dev.azure.com/EssentialStudio/Document%20Processing%20Libraries/_workitems/edit/847397/

Regards,
Venkatesh

@SyncfusionBuild
Copy link
Contributor

Build Status: INPROGRESS 🔃
Build Location: ES-847397-Append-svg-Image

@SyncfusionBuild
Copy link
Contributor

CI Status: SUCCESS ✅
Source Compilation: SUCCESS ✅
Build Location: ES-847397-Append-svg-Image

@SyncfusionBuild
Copy link
Contributor

Build Status: INPROGRESS 🔃
Build Location: ES-847397-Append-svg-Image

@SyncfusionBuild
Copy link
Contributor

CI Status: SUCCESS ✅
Source Compilation: SUCCESS ✅
Build Location: ES-847397-Append-svg-Image

@SyncfusionBuild
Copy link
Contributor

Build Status: INPROGRESS 🔃
Build Location: ES-847397-Append-svg-Image

@SyncfusionBuild
Copy link
Contributor

CI Status: SUCCESS ✅
Source Compilation: SUCCESS ✅
Build Location: ES-847397-Append-svg-Image

@SyncfusionBuild
Copy link
Contributor

Build Status: INPROGRESS 🔃
Build Location: ES-847397-Append-svg-Image

@SyncfusionBuild
Copy link
Contributor

CI Status: SUCCESS ✅
Source Compilation: SUCCESS ✅
Build Location: ES-847397-Append-svg-Image

{% endhighlight %}
{% endtabs %}

You can download a complete working sample from GitHub.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add link

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated


### Add SVG image

You can append SVG image specified by the byte array to the end of a paragraph using [AppendPicture](https://help.syncfusion.com/cr/file-formats/Syncfusion.DocIO.DLS.IWParagraph.html#Syncfusion_DocIO_DLS_IWParagraph_AppendPicture_System_Byte___System_Byte___) API.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To add an SVG image to a paragraph in a Word document using Syncfusion DocIO, you can use the AppendPicture() API.

Note: To preserve the SVG image in the Word document, you need to pass both the SVG image data and the equivalent bitmap image bytes to DocIO.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified

Copy link

@M-A32 M-A32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have completed the review.


N> To preserve the SVG image in the Word document, you need to pass both the SVG image data and the equivalent bitmap image bytes to DocIO.

The following code example shows how to add SVG image in Word document.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following code example shows how to add an SVG image in a Word document.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modified

///Create a new Word document.
using (WordDocument document = new WordDocument())
{
//Add new section to the document.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//Add a new section to the document.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modified

{
//Add new section to the document.
IWSection section = document.AddSection();
//Add new paragraph to the section.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//Add a new paragraph to the section.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modified

Using document As New WordDocument()
' Add new section to the document.
Dim section As IWSection = document.AddSection()
' Add new paragraph to the section.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

' Add a new paragraph to the section.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modified

{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}

Using document As New WordDocument()
' Add new section to the document.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

' Add a new section to the document.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modified

{
//Add new section to the document.
IWSection section = document.AddSection();
//Add new paragraph to the section.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//Add a new paragraph to the section.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modified


using (WordDocument document = new WordDocument())
{
//Add new section to the document.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//Add a new section to the document.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modified

IWSection section = document.AddSection();
//Add new paragraph to the section.
IWParagraph firstParagraph = section.AddParagraph();
//Get the image as byte array.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//Get the image as a byte array.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modified


To add an SVG image to a paragraph in a Word document using Syncfusion DocIO, you can use the [AppendPicture](https://help.syncfusion.com/cr/file-formats/Syncfusion.DocIO.DLS.IWParagraph.html#Syncfusion_DocIO_DLS_IWParagraph_AppendPicture_System_Byte___System_Byte___) API.

N> To preserve the SVG image in the Word document, you need to pass both the SVG image data and the equivalent bitmap image bytes to DocIO.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

N> To preserve the SVG image in the Word document, pass both the SVG image data and the equivalent bitmap image bytes to DocIO.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modified

@MohanaselvamJothi MohanaselvamJothi merged commit 250b8df into hotfix/hotfix-v23.1.36 Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants