Skip to content

Commit 8154119

Browse files
committed
polished
1 parent 11ca572 commit 8154119

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

knowledge-base/convert-webp-to-png-radwordsprocessing.md

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ type: how-to
55
page_title: Converting WEBP Images to PNG in HTML Documents using Telerik WordsProcessing
66
meta_title: Converting WEBP Images to PNG in HTML Documents using Telerik WordsProcessing
77
slug: convert-webp-to-png-radwordsprocessing
8-
tags: wordsprocessing, telerik-document-processing, images, webp, html-import, docx-export
8+
tags: words,processing, telerik,document, image, webp, html,import, docx,export
99
res_type: kb
1010
ticketid: 1695863
1111
---
@@ -17,26 +17,21 @@ ticketid: 1695863
1717

1818
## Description
1919

20-
I want to render `.webp` images in DOCX files using Telerik WordsProcessing. The current implementation fails to process `.webp` format images when importing HTML content and exporting the output.
21-
22-
This knowledge base article also answers the following questions:
23-
- How to convert `.webp` images to supported formats in Telerik WordsProcessing?
24-
- How to handle unsupported image formats in DOCX export using Telerik WordsProcessing?
25-
- How to process `.webp` images when importing HTML content in Telerik WordsProcessing?
20+
The current implementation of Telerik Document Processing libraries is not intended to process `.webp` format images when importing HTML content and exporting the output using [RadWordsProcessing]({%slug radwordsprocessing-overview%}). This article shows how to convert `.webp` images to the [supported formats]({%slug radwordsprocessing-model-imageinline%}) like PNG in Telerik WordsProcessing.
2621

2722
## Solution
2823

29-
Telerik WordsProcessing does not support the `.webp` format directly. The supported image formats are listed in the [Supported Image Extensions](https://docs.telerik.com/devtools/document-processing/libraries/radwordsprocessing/model/imageinline#supported-image-extensions). To handle `.webp` images, convert them to a supported format like `.png`. Follow the steps below:
24+
To handle `.webp` images, convert them to a supported format like `.png`. Follow the steps below:
3025

3126
1. Install the `SixLabors.ImageSharp` NuGet package for image conversion.
3227

33-
2. Import the HTML content using `HtmlFormatProvider`.
28+
2. Import the HTML content using [HtmlFormatProvider]({%slug radwordsprocessing-formats-and-conversion-html-htmlformatprovider%}).
3429

3530
3. Iterate through the images in the document and convert `.webp` images to `.png` format.
3631

3732
4. Replace the `.webp` image sources with the converted `.png` sources.
3833

39-
5. Export the document to DOCX.
34+
5. Export the document to [DOCX]({%slug radwordsprocessing-formats-and-conversion-docx-docxformatprovider%}).
4035

4136
Here is the complete implementation:
4237

@@ -93,6 +88,5 @@ Process.Start(new ProcessStartInfo() { FileName = outputFilePath, UseShellExecut
9388

9489
## See Also
9590

96-
- [Supported Image Extensions](https://docs.telerik.com/devtools/document-processing/libraries/radwordsprocessing/model/imageinline#supported-image-extensions)
97-
- [WordsProcessing: Introduce support for importing webp images](https://feedback.telerik.com/document-processing/1543913-wordsprocessing-introduce-support-for-importing-webp-images)
98-
- [RadWordsProcessing Overview](https://docs.telerik.com/devtools/document-processing/libraries/radwordsprocessing/overview)
91+
- [Supported Image Formats]({%slug radwordsprocessing-model-imageinline%})
92+
- [RadWordsProcessing]({%slug radwordsprocessing-overview%})

libraries/radwordsprocessing/model/imageinline.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ position: 8
99

1010
# ImageInline
1111

12-
13-
1412
__ImageInline__ element is an inline-level flow content element intended to contain an image object.
1513

1614
## Supported Image Extensions
@@ -144,3 +142,4 @@ This section explains the behavior of the __Size__ property of The __Image__ obj
144142
* [FloatingImage]({%slug radwordsprocessing-model-floatingimage%})
145143
* [Paragraph]({%slug radwordsprocessing-model-paragraph%})
146144
* [Converting WMF Images to PNG in RTF Documents with RadWordsProcessing]({%slug convert-wmf-to-png-radwordsprocessing%})
145+
* [Converting WEBP Images to PNG in HTML Documents using Telerik WordsProcessing]({%slug convert-webp-to-png-radwordsprocessing%})

0 commit comments

Comments
 (0)