Skip to content

Commit 673b12a

Browse files
committed
update articles for webconvert options, image convert options, pdf convert options, presentation convert options, spreadsheet convert options, wordprocessing convert options
1 parent 50c788a commit 673b12a

6 files changed

Lines changed: 407 additions & 50 deletions

net/developer-guide/advanced-usage/converting/conversion-options-by-document-family/convert-to-html-with-advanced-options.md

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ keywords: Convert to HTML, Convert HTML
88
productName: GroupDocs.Conversion for .NET
99
hideChildren: False
1010
---
11-
GroupDocs.Conversion provides [WebConvertOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/webconvertoptions) to give you control over conversion result. The following options could be set:
11+
GroupDocs.Conversion provides [WebConvertOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/webconvertoptions) to give you control over conversion result. The following options could be set:
1212

13-
* [FixedLayout](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/webconvertoptions/fixedlayout) controls the HTML generation. If it's set to *true*, fixed layout will be used e.g. absolutely positioned HTML element.
14-
* [Zoom](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/webconvertoptions/zoom) specifies the zoom level in percentage. The default value is 100.
15-
* [UsePdf](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/webconvertoptions/usepdf). Sometimes, for better rendering and elements positioning the source document should be converted to PDF first. If this property is set to *true*, the input firstly is converted to PDF and after that to desired format.
13+
* [FixedLayout](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/webconvertoptions/fixedlayout) controls the HTML generation. If it's set to *true*, fixed layout will be used e.g. absolutely positioned HTML element.
14+
* [FixedLayoutShowBorders](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/webconvertoptions/fixedlayoutshowborders) controls the display of page borders during fixed layout conversion. Default is true.
15+
* [EmbedFontResources](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/webconvertoptions/embedfontresources) specifies whether to embed font resources within the main HTML. Default is false. Note: fonts automatically embed when FixedLayout is enabled.
16+
* [Zoom](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/webconvertoptions/zoom) specifies the zoom level in percentage. The default value is 100.
17+
* [UsePdf](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/webconvertoptions/usepdf). Sometimes, for better rendering and elements positioning the source document should be converted to PDF first. If this property is set to *true*, the input firstly is converted to PDF and after that to desired format.
1618

1719
The following code snippet shows how to convert to HTML with advanced options
1820

@@ -29,6 +31,25 @@ using (Converter converter = new Converter("sample.docx"))
2931
}
3032
```
3133

34+
## Embedding Font Resources
35+
36+
Control whether font resources are embedded within the HTML file:
37+
38+
```csharp
39+
using (Converter converter = new Converter("sample.docx"))
40+
{
41+
WebConvertOptions options = new WebConvertOptions
42+
{
43+
EmbedFontResources = true // Embed fonts directly in HTML
44+
};
45+
converter.Convert("embedded-fonts.html", options);
46+
}
47+
```
48+
49+
When `EmbedFontResources` is set to false (default), font files are stored separately and referenced by the HTML file. When set to true, all font data is embedded directly within the HTML file, making it self-contained but larger in size.
50+
51+
Note: When `FixedLayout` is enabled, fonts are automatically embedded regardless of the `EmbedFontResources` setting.
52+
3253
### Control page borders visibility
3354

3455
The following code snippet shows how to convert to HTML and control page borders visibility
@@ -44,3 +65,9 @@ using (var converter = new Converter(source))
4465
converter.Convert("converted.html" , options);
4566
}
4667
```
68+
69+
## More Resources
70+
71+
- [API Reference: WebConvertOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/webconvertoptions)
72+
- [Supported File Formats]({{< ref "conversion/net/getting-started/supported-document-formats.md" >}})
73+
- [Common Conversion Options]({{< ref "conversion/net/developer-guide/advanced-usage/converting/common-conversion-options/_index.md" >}})

net/developer-guide/advanced-usage/converting/conversion-options-by-document-family/convert-to-image-with-advanced-options.md

Lines changed: 95 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,31 @@ id: convert-to-image-with-advanced-options
33
url: conversion/net/convert-to-image-with-advanced-options
44
title: Convert to Image with advanced options
55
weight: 4
6-
description: "Follow this guide and learn how to convert documents to image with height, width, resolution, brightness and other customizations using GroupDocs.Conversion for .NET."
6+
description: "Follow this guide and learn how to convert documents to image with height, width, resolution, brightness and other customizations using GroupDocs.Conversion for .NET."
77
keywords: Convert to Image, Convert Image
88
productName: GroupDocs.Conversion for .NET
99
hideChildren: False
1010
---
11-
GroupDocs.Conversion provides [ImageConvertOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions) to give you control over conversion result when convert to image. Along with [common convert options]({{< ref "conversion/net/developer-guide/advanced-usage/converting/common-conversion-options/_index.md" >}}) from the base class, [ImageConvertOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions) has the following additional options:
11+
GroupDocs.Conversion provides [ImageConvertOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions) to give you control over conversion result when convert to image. Along with [common convert options]({{< ref "conversion/net/developer-guide/advanced-usage/converting/common-conversion-options/_index.md" >}}) from the base class, [ImageConvertOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions) has the following additional options:
1212

13-
* [Format](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/convertoptions-1/format/) specifies desired result document type. Available options are: *Tiff, Tif, Jpg, Jpeg, Png, Gig, Bmp, Ico, Psd, Wmf, Emf, Dcm, Webp, Dng, Svg, Jp2, Odg, J2c, J2k, Jpx, Jpf, Jpm, Eps, Cgm, Cdr, Cmx, Dib, Jpc, Jls, DjVu*.
13+
* [Format](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/convertoptions-1/format/) specifies desired result document type. Available options are: *Tiff, Tif, Jpg, Jpeg, Png, Gig, Bmp, Ico, Psd, Wmf, Emf, Dcm, Webp, Dng, Svg, Jp2, Odg, J2c, J2k, Jpx, Jpf, Jpm, Eps, Cgm, Cdr, Cmx, Dib, Jpc, Jls, DjVu*.
1414
* [Width](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions/width) specifies desired image width after conversion.
1515
* [Height](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions/height) specifies desired image height after conversion.
1616
* [HorizontalResolution](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions/horizontalresolution) specifies desired image horizontal resolution after conversion.
1717
* [VerticalResolution](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions/verticalresolution) specifies desired image vertical resolution after conversion.
1818
* [Grayscale](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions/grayscale) specifies if true converted image will be grayscaled.
1919
* [RotateAngle](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions/rotateangle) specifies image rotation angle.
20-
* [FlipMode](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions/flipmode) specifies image flip mode. Available options are: *None, FlipX, FlipY, FlipXY*.
20+
* [FlipMode](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions/flipmode) specifies image flip mode. Available options are: *None, FlipX, FlipY, FlipXY*.
2121
* [Brightness](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions/brightness) adjusts image brightness.
2222
* [Contrast](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions/contrast) adjusts image contrast.
23-
* [Gamma](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions/gamma) adjusts image gamma.
23+
* [Gamma](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions/gamma) adjusts image gamma.
24+
* [BackgroundColor](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions/backgroundcolor) sets the background color where supported by the source format.
25+
* [CropArea](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions/croparea) crops a rectangular area from the raster image after conversion. Specify as Rectangle(x, y, width, height).
2426
* [JpegOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions/jpegoptions) contains JPEG specific convert options.
2527
* [TiffOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions/tiffoptions) contains TIFF specific convert options.
2628
* [PsdOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions/psdoptions) contains PSD specific convert options.
27-
* [WebpOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions/webpoptions) contains WebP specific convert options.
28-
* [UsePdf](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions/usepdf). Sometimes, for better rendering and elements positioning the source document should be converted to PDF first. If this property is set to *true*, the input firstly is converted to PDF and after that to desired format.
29+
* [WebpOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions/webpoptions) contains WebP specific convert options.
30+
* [UsePdf](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions/usepdf). Sometimes, for better rendering and elements positioning the source document should be converted to PDF first. If this property is set to *true*, the input firstly is converted to PDF and after that to desired format.
2931

3032
The following code snippet shows how to convert to image with advanced options:
3133

@@ -75,41 +77,113 @@ using (Converter converter = new Converter("sample.pdf"))
7577
}
7678
```
7779

80+
## Setting Background Color
81+
82+
Set a background color for the converted image where supported by the source format:
83+
84+
```csharp
85+
using System.Drawing;
86+
using (Converter converter = new Converter("sample.pdf"))
87+
{
88+
ImageConvertOptions options = new ImageConvertOptions
89+
{
90+
Format = ImageFileType.Png,
91+
BackgroundColor = Color.White // Use System.Drawing.Color
92+
};
93+
converter.Convert("white-background.png", options);
94+
}
95+
```
96+
97+
You can use any color from System.Drawing.Color or create custom colors:
98+
99+
```csharp
100+
using System.Drawing;
101+
using (Converter converter = new Converter("sample.pdf"))
102+
{
103+
ImageConvertOptions options = new ImageConvertOptions
104+
{
105+
Format = ImageFileType.Png,
106+
BackgroundColor = Color.FromArgb(173, 216, 230) // Light blue (RGB)
107+
};
108+
converter.Convert("custom-background.png", options);
109+
}
110+
```
111+
112+
## Cropping Image Area
113+
114+
Crop a specific rectangular area from the converted image. The CropArea property takes a Rectangle with X, Y coordinates for the top-left corner, and Width, Height for the dimensions:
115+
116+
```csharp
117+
using GroupDocs.Conversion.Contracts;
118+
using (Converter converter = new Converter("sample.pdf"))
119+
{
120+
ImageConvertOptions options = new ImageConvertOptions
121+
{
122+
Format = ImageFileType.Png,
123+
CropArea = new Rectangle(100, 100, 400, 300) // X, Y, Width, Height
124+
};
125+
converter.Convert("cropped-image.png", options);
126+
}
127+
```
128+
129+
You can combine BackgroundColor and CropArea:
130+
131+
```csharp
132+
using System.Drawing;
133+
using GroupDocs.Conversion.Contracts;
134+
using (Converter converter = new Converter("sample.pdf"))
135+
{
136+
ImageConvertOptions options = new ImageConvertOptions
137+
{
138+
Format = ImageFileType.Png,
139+
BackgroundColor = Color.LightGray,
140+
CropArea = new Rectangle(50, 50, 512, 512)
141+
};
142+
converter.Convert("background-and-crop.png", options);
143+
}
144+
```
145+
78146
### JpegOptions
79147

80-
[JpegOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/jpegoptions) is subset of [ImageConvertOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions) which allow enhanced control over conversions to JPEG format. 
148+
[JpegOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/jpegoptions) is subset of [ImageConvertOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions) which allow enhanced control over conversions to JPEG format.
81149

82150
The following options are available:
83151

84-
* [Quality](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/jpegoptions/quality) specifies desired image quality.
85-
* [ColorMode](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/jpegoptions/colormode) sets JPEG color mode. Available options are: *Rgb, YCbCr, Cmyk, Ycck, Grayscale*.
86-
* [Compression](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/jpegoptions/compression) sets JPEG compression methods. Available options are: *Baseline, Progressive, Lossless, JpegLs*.
152+
* [Quality](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/jpegoptions/quality) specifies desired image quality.
153+
* [ColorMode](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/jpegoptions/colormode) sets JPEG color mode. Available options are: *Rgb, YCbCr, Cmyk, Ycck, Grayscale*.
154+
* [Compression](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/jpegoptions/compression) sets JPEG compression methods. Available options are: *Baseline, Progressive, Lossless, JpegLs*.
87155

88156
### TiffOptions
89157

90-
[TiffOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/tiffoptions) is subset of  [ImageConvertOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions) which allow enhanced control over conversions to TIFF format. 
158+
[TiffOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/tiffoptions) is subset of [ImageConvertOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions) which allow enhanced control over conversions to TIFF format.
91159

92160
The following options are available:
93161

94-
* [Compression](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/tiffoptions/compression) sets TIFF compression method. Available options are: None, Lzw, Ccitt3, Ccitt4, Rle.
162+
* [Compression](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/tiffoptions/compression) sets TIFF compression method. Available options are: None, Lzw, Ccitt3, Ccitt4, Rle.
95163

96164
### PsdOptions
97165

98-
[PsdOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/psdoptions) is subset of  [ImageConvertOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions) which allow enhanced control over conversions to PSD format. 
166+
[PsdOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/psdoptions) is subset of [ImageConvertOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions) which allow enhanced control over conversions to PSD format.
99167

100168
The following options are available:
101169

102-
* [ChannelBitsCount](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/psdoptions/channelbitscount) sets bits count per channel.
103-
* [ChannelsCount](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/psdoptions/channelscount) sets color channels count.
104-
* [ColorMode](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/psdoptions/colormode) sets PSD color mode. Available options are: *Bitmap, Grayscale, Indexed, Rgb, Cmyk, Multichannel, Duotone, Lab*.
105-
* [Compression](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/psdoptions/compression) sets PSD compression method. Available options are: *Raw, Rle, ZipWithoutPrediction, ZipWithPrediction*.
106-
* [Version](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/psdoptions/version) sets desired PSD version.
170+
* [ChannelBitsCount](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/psdoptions/channelbitscount) sets bits count per channel.
171+
* [ChannelsCount](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/psdoptions/channelscount) sets color channels count.
172+
* [ColorMode](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/psdoptions/colormode) sets PSD color mode. Available options are: *Bitmap, Grayscale, Indexed, Rgb, Cmyk, Multichannel, Duotone, Lab*.
173+
* [Compression](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/psdoptions/compression) sets PSD compression method. Available options are: *Raw, Rle, ZipWithoutPrediction, ZipWithPrediction*.
174+
* [Version](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/psdoptions/version) sets desired PSD version.
107175

108176
### WebpOptions
109177

110-
[WebpOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/webpoptions) is subset of  [ImageConvertOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions) which allow enhanced control over conversions to WebP format. 
178+
[WebpOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/webpoptions) is subset of [ImageConvertOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions) which allow enhanced control over conversions to WebP format.
111179

112180
The following options are available:
113181

114182
* [Lossless](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/webpoptions/lossless) sets the compression of the converted image will be lossless.
115-
* [Quality](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/webpoptions/quality) sets set the quality of converted image.
183+
* [Quality](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/webpoptions/quality) sets set the quality of converted image.
184+
185+
## More Resources
186+
187+
- [API Reference: ImageConvertOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/imageconvertoptions)
188+
- [Supported File Formats]({{< ref "conversion/net/getting-started/supported-document-formats.md" >}})
189+
- [Common Conversion Options]({{< ref "conversion/net/developer-guide/advanced-usage/converting/common-conversion-options/_index.md" >}})

0 commit comments

Comments
 (0)