Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
5de0032
Add example: convert-an-entire-workbook-to-a-multipage-tiff-using-def…
agent-aspose-cells-examples May 21, 2026
9c4c11f
Add example: render-a-workbook-as-tiff-using-300-dpi-resolution-to-im…
agent-aspose-cells-examples May 21, 2026
f4d6531
Add example: render-a-workbook-to-tiff-with-horizontal-and-vertical-r…
agent-aspose-cells-examples May 21, 2026
4ce85e5
Add example: convert-a-workbook-to-tiff-using-eightbit-color-depth-fo…
agent-aspose-cells-examples May 21, 2026
0cd5ee4
Add example: convert-a-workbook-to-tiff-using-twentyfourbit-color-dep…
agent-aspose-cells-examples May 21, 2026
12e50d5
Add example: generate-a-multipage-tiff-from-the-first-three-worksheet…
agent-aspose-cells-examples May 21, 2026
127bded
Add example: track-workbooktotiff-conversion-progress-by-handling-the…
agent-aspose-cells-examples May 21, 2026
996fbf1
Add example: render-a-workbook-to-tiff-and-write-the-result-into-a-me…
agent-aspose-cells-examples May 21, 2026
b4177f6
Add example: save-a-generated-tiff-file-directly-to-a-network-share-p…
agent-aspose-cells-examples May 21, 2026
65e5020
Add example: embed-the-resulting-tiff-image-into-an-html-page-using-a…
agent-aspose-cells-examples May 21, 2026
1f8f66a
Add example: measure-conversion-duration-using-stopwatch-and-log-elap…
agent-aspose-cells-examples May 21, 2026
7dec93c
Add example: set-custom-page-margins-in-imageorprintoptions-before-co…
agent-aspose-cells-examples May 21, 2026
f7aa35c
Add example: specify-a-white-background-color-in-imageorprintoptions-…
agent-aspose-cells-examples May 21, 2026
9f5d59a
Add example: convert-the-first-worksheet-of-a-workbook-to-png-using-d…
agent-aspose-cells-examples May 21, 2026
2b867f9
Add example: export-the-worksheet-named-chart-to-bmp-at-96-dpi-resolu…
agent-aspose-cells-examples May 21, 2026
0997d9c
Add example: render-a-worksheet-to-jpeg-with-gridlines-hidden-by-sett…
agent-aspose-cells-examples May 21, 2026
81165d7
Add example: generate-a-jpeg-image-from-a-worksheet-with-custom-image…
agent-aspose-cells-examples May 21, 2026
8b76a8c
Add example: convert-a-worksheet-to-png-and-embed-the-resulting-image…
agent-aspose-cells-examples May 21, 2026
235349e
Add example: render-a-worksheet-to-jpeg-and-upload-the-image-file-to-…
agent-aspose-cells-examples May 21, 2026
c108093
Add example: store-the-png-worksheet-image-in-azure-blob-storage-with…
agent-aspose-cells-examples May 21, 2026
dd61bd4
Add example: send-the-png-worksheet-image-via-http-post-to-a-rest-end…
agent-aspose-cells-examples May 21, 2026
4f6fd6d
Add example: perform-pixelbypixel-comparison-between-the-generated-pn…
agent-aspose-cells-examples May 21, 2026
e2178a7
Add example: convert-a-worksheet-to-svg-with-the-viewbox-attribute-en…
agent-aspose-cells-examples May 21, 2026
387ed99
Add example: export-a-worksheet-to-svg-without-the-viewbox-attribute-…
agent-aspose-cells-examples May 21, 2026
8d3dbe9
Add example: embed-the-generated-svg-worksheet-file-into-an-html-docu…
agent-aspose-cells-examples May 21, 2026
db8f3fe
Add example: save-the-svg-worksheet-image-to-a-svg-file-with-utf8-enc…
agent-aspose-cells-examples May 21, 2026
b547507
Add example: compress-the-svg-worksheet-file-using-gzip-before-transm…
agent-aspose-cells-examples May 21, 2026
1cef959
Add example: validate-the-svg-worksheet-file-against-the-svg-schema-t…
agent-aspose-cells-examples May 21, 2026
75c7e5b
Add example: render-the-svg-worksheet-image-in-a-wpf-image-control-fo…
agent-aspose-cells-examples May 21, 2026
c4f3f04
Add example: use-the-svg-worksheet-graphic-as-a-vector-element-when-g…
agent-aspose-cells-examples May 21, 2026
a2cd655
Add example: render-a-chart-object-from-the-workbook-to-a-png-image-u…
agent-aspose-cells-examples May 21, 2026
2de9e0a
Add example: export-a-chart-to-svg-with-viewbox-attribute-for-respons…
agent-aspose-cells-examples May 21, 2026
a506c90
Add example: attach-the-jpeg-chart-image-to-an-email-body-using-inlin…
agent-aspose-cells-examples May 21, 2026
561bc4d
Add example: include-the-svg-chart-file-in-a-web-page-to-allow-intera…
agent-aspose-cells-examples May 21, 2026
b231199
Add example: preserve-data-labels-visibility-when-converting-a-chart-…
agent-aspose-cells-examples May 21, 2026
6cb2223
Add example: set-chart-image-resolution-to-300-dpi-during-png-convers…
agent-aspose-cells-examples May 21, 2026
552d0d3
Add example: batch-convert-all-excel-files-in-a-directory-to-individu…
agent-aspose-cells-examples May 21, 2026
af4965f
Add example: iterate-through-each-worksheet-in-a-workbook-and-save-ea…
agent-aspose-cells-examples May 21, 2026
5935571
Add example: extract-every-chart-from-a-workbook-and-export-them-as-s…
agent-aspose-cells-examples May 21, 2026
6f11064
Add example: split-a-multipage-tiff-workbook-output-into-individual-s…
agent-aspose-cells-examples May 21, 2026
ab39849
Add example: convert-the-workbook-tiff-to-pdf-by-invoking-a-thirdpart…
agent-aspose-cells-examples May 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
200 changes: 200 additions & 0 deletions index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2339,11 +2339,211 @@
"file": "verify-that-the-merged-workbook-contains-the-expected-number-of-worksheets-after-combination.cs",
"title": "Verify that the merged workbook contains the expected number of worksheets after combination."
},
{
"category": "working-with-images",
"file": "attach-the-jpeg-chart-image-to-an-email-body-using-inline-html-to-display-within-the-message.cs",
"title": "Attach the JPEG chart image to an email body using inline HTML to display within the message."
},
{
"category": "working-with-images",
"file": "batch-convert-all-excel-files-in-a-directory-to-individual-tiff-images-using-default-rendering-settings.cs",
"title": "Batch convert all Excel files in a directory to individual TIFF images using default rendering settings."
},
{
"category": "working-with-images",
"file": "compress-the-svg-worksheet-file-using-gzip-before-transmitting-it-over-the-network-for-efficiency.cs",
"title": "Compress the SVG worksheet file using GZip before transmitting it over the network for efficiency."
},
{
"category": "working-with-images",
"file": "convert-a-workbook-to-tiff-using-eightbit-color-depth-for-smaller-output-files.cs",
"title": "Convert a workbook to TIFF using eight\u2011bit color depth for smaller output files."
},
{
"category": "working-with-images",
"file": "convert-a-workbook-to-tiff-using-twentyfourbit-color-depth-for-highquality-images.cs",
"title": "Convert a workbook to TIFF using twenty\u2011four\u2011bit color depth for high\u2011quality images."
},
{
"category": "working-with-images",
"file": "convert-a-worksheet-to-png-and-embed-the-resulting-image-as-a-base64-string-in-json.cs",
"title": "Convert a worksheet to PNG and embed the resulting image as a base64 string in JSON."
},
{
"category": "working-with-images",
"file": "convert-a-worksheet-to-svg-with-the-viewbox-attribute-enabled-for-scalable-rendering.cs",
"title": "Convert a worksheet to SVG with the viewBox attribute enabled for scalable rendering."
},
{
"category": "working-with-images",
"file": "convert-an-entire-workbook-to-a-multipage-tiff-using-default-rendering-options.cs",
"title": "Convert an entire workbook to a multi\u2011page TIFF using default rendering options."
},
{
"category": "working-with-images",
"file": "convert-the-first-worksheet-of-a-workbook-to-png-using-default-resolution-for-quick-preview.cs",
"title": "Convert the first worksheet of a workbook to PNG using default resolution for quick preview."
},
{
"category": "working-with-images",
"file": "convert-the-workbook-tiff-to-pdf-by-invoking-a-thirdparty-converter-after-image-generation.cs",
"title": "Convert the workbook TIFF to PDF by invoking a third\u2011party converter after image generation."
},
{
"category": "working-with-images",
"file": "embed-the-generated-svg-worksheet-file-into-an-html-document-using-the-object-tag-for-display.cs",
"title": "Embed the generated SVG worksheet file into an HTML document using the object tag for display."
},
{
"category": "working-with-images",
"file": "embed-the-resulting-tiff-image-into-an-html-page-using-an-img-tag-with-appropriate-source-attribute.cs",
"title": "Embed the resulting TIFF image into an HTML page using an img tag with appropriate source attribute."
},
{
"category": "working-with-images",
"file": "export-a-chart-to-svg-with-viewbox-attribute-for-responsive-scaling-in-modern-browsers.cs",
"title": "Export a chart to SVG with viewBox attribute for responsive scaling in modern browsers."
},
{
"category": "working-with-images",
"file": "export-a-worksheet-to-svg-without-the-viewbox-attribute-to-produce-fixedsize-vector-output.cs",
"title": "Export a worksheet to SVG without the viewBox attribute to produce fixed\u2011size vector output."
},
{
"category": "working-with-images",
"file": "export-the-worksheet-named-chart-to-bmp-at-96-dpi-resolution-for-legacy-image-compatibility.cs",
"title": "Export the worksheet named Chart to BMP at 96 DPI resolution for legacy image compatibility."
},
{
"category": "working-with-images",
"file": "extract-every-chart-from-a-workbook-and-export-them-as-svg-files-into-a-designated-subfolder.cs",
"title": "Extract every chart from a workbook and export them as SVG files into a designated subfolder."
},
{
"category": "working-with-images",
"file": "generate-a-jpeg-image-from-a-worksheet-with-custom-image-quality-set-to-80-percent.cs",
"title": "Generate a JPEG image from a worksheet with custom image quality set to 80 percent."
},
{
"category": "working-with-images",
"file": "generate-a-multipage-tiff-from-the-first-three-worksheets-of-a-loaded-workbook.cs",
"title": "Generate a multi\u2011page TIFF from the first three worksheets of a loaded workbook."
},
{
"category": "working-with-images",
"file": "include-the-svg-chart-file-in-a-web-page-to-allow-interactive-zoom-and-pan-features.cs",
"title": "Include the SVG chart file in a web page to allow interactive zoom and pan features."
},
{
"category": "working-with-images",
"file": "iterate-through-each-worksheet-in-a-workbook-and-save-each-as-a-separate-png-file.cs",
"title": "Iterate through each worksheet in a workbook and save each as a separate PNG file."
},
{
"category": "working-with-images",
"file": "measure-conversion-duration-using-stopwatch-and-log-elapsed-time-for-performance-analysis.cs",
"title": "Measure conversion duration using Stopwatch and log elapsed time for performance analysis."
},
{
"category": "working-with-images",
"file": "perform-pixelbypixel-comparison-between-the-generated-png-worksheet-image-and-a-baseline-reference.cs",
"title": "Perform pixel\u2011by\u2011pixel comparison between the generated PNG worksheet image and a baseline reference."
},
{
"category": "working-with-images",
"file": "preserve-data-labels-visibility-when-converting-a-chart-to-png-to-retain-informational-context.cs",
"title": "Preserve data labels visibility when converting a chart to PNG to retain informational context."
},
{
"category": "working-with-images",
"file": "render-a-chart-object-from-the-workbook-to-a-png-image-using-the-chartrender-api.cs",
"title": "Render a chart object from the workbook to a PNG image using the ChartRender API."
},
{
"category": "working-with-images",
"file": "render-a-workbook-as-tiff-using-300-dpi-resolution-to-improve-image-clarity.cs",
"title": "Render a workbook as TIFF using 300 DPI resolution to improve image clarity."
},
{
"category": "working-with-images",
"file": "render-a-workbook-to-tiff-and-write-the-result-into-a-memory-stream-for-further-processing.cs",
"title": "Render a workbook to TIFF and write the result into a memory stream for further processing."
},
{
"category": "working-with-images",
"file": "render-a-workbook-to-tiff-with-horizontal-and-vertical-resolutions-set-to-150-dpi.cs",
"title": "Render a workbook to TIFF with horizontal and vertical resolutions set to 150 DPI."
},
{
"category": "working-with-images",
"file": "render-a-worksheet-to-jpeg-and-upload-the-image-file-to-a-cloud-storage-bucket.cs",
"title": "Render a worksheet to JPEG and upload the image file to a cloud storage bucket."
},
{
"category": "working-with-images",
"file": "render-a-worksheet-to-jpeg-with-gridlines-hidden-by-setting-isgridlinesvisible-to-false.cs",
"title": "Render a worksheet to JPEG with gridlines hidden by setting IsGridLinesVisible to false."
},
{
"category": "working-with-images",
"file": "render-the-svg-worksheet-image-in-a-wpf-image-control-for-display-within-a-desktop-application.cs",
"title": "Render the SVG worksheet image in a WPF Image control for display within a desktop application."
},
{
"category": "working-with-images",
"file": "save-a-generated-tiff-file-directly-to-a-network-share-path-after-converting-the-workbook.cs",
"title": "Save a generated TIFF file directly to a network share path after converting the workbook."
},
{
"category": "working-with-images",
"file": "save-the-svg-worksheet-image-to-a-svg-file-with-utf8-encoding-to-preserve-character-data.cs",
"title": "Save the SVG worksheet image to a .svg file with UTF\u20118 encoding to preserve character data."
},
{
"category": "working-with-images",
"file": "send-the-png-worksheet-image-via-http-post-to-a-rest-endpoint-for-downstream-processing.cs",
"title": "Send the PNG worksheet image via HTTP POST to a REST endpoint for downstream processing."
},
{
"category": "working-with-images",
"file": "set-chart-image-resolution-to-300-dpi-during-png-conversion-to-achieve-highdefinition-output.cs",
"title": "Set chart image resolution to 300 DPI during PNG conversion to achieve high\u2011definition output."
},
{
"category": "working-with-images",
"file": "set-custom-page-margins-in-imageorprintoptions-before-converting-workbook-to-tiff-for-layout-control.cs",
"title": "Set custom page margins in ImageOrPrintOptions before converting workbook to TIFF for layout control."
},
{
"category": "working-with-images",
"file": "specify-a-white-background-color-in-imageorprintoptions-when-rendering-workbook-to-tiff-to-ensure-consistency.cs",
"title": "Specify a white background color in ImageOrPrintOptions when rendering workbook to TIFF to ensure consistency."
},
{
"category": "working-with-images",
"file": "split-a-multipage-tiff-workbook-output-into-individual-singlepage-tiff-files-for-separate-handling.cs",
"title": "Split a multi\u2011page TIFF workbook output into individual single\u2011page TIFF files for separate handling."
},
{
"category": "working-with-images",
"file": "store-the-png-worksheet-image-in-azure-blob-storage-with-custom-metadata-for-categorization.cs",
"title": "Store the PNG worksheet image in Azure Blob Storage with custom metadata for categorization."
},
{
"category": "working-with-images",
"file": "track-workbooktotiff-conversion-progress-by-handling-the-conversion-progress-event-and-logging-percentages.cs",
"title": "Track workbook\u2011to\u2011TIFF conversion progress by handling the conversion progress event and logging percentages."
},
{
"category": "working-with-images",
"file": "use-the-svg-worksheet-graphic-as-a-vector-element-when-generating-a-pdf-document-with-itextsharp.cs",
"title": "Use the SVG worksheet graphic as a vector element when generating a PDF document with iTextSharp."
},
{
"category": "working-with-images",
"file": "validate-the-svg-worksheet-file-against-the-svg-schema-to-ensure-structural-correctness.cs",
"title": "Validate the SVG worksheet file against the SVG schema to ensure structural correctness."
},
{
"category": "working-with-json",
"file": "apply-a-custom-culture-setting-to-format-dates-in-json-according-to-iso-8601-standard.cs",
Expand Down
97 changes: 97 additions & 0 deletions working-with-images/agents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Working With Images Examples

This folder contains **Aspose.Cells for .NET** code examples related to:

Working With Images


## Purpose

These examples demonstrate common **Aspose.Cells APIs** used when working with:

- Workbooks
- Worksheets
- Cells
- Formulas
- Charts
- Data operations


## Example Files

Each `.cs` file demonstrates a specific task related to **Working With Images**.

Example:

create-a-workbook.cs


## Required Namespaces

Most examples will require:

using Aspose.Cells;


## Common Pattern

Typical Aspose.Cells workflow:

Workbook workbook = new Workbook();

Worksheet sheet = workbook.Worksheets[0];

Cells cells = sheet.Cells;


## Output

Examples may generate:

- XLSX files
- PDF files
- CSV files
- Images

Output files are written to the working directory.
- convert-an-entire-workbook-to-a-multipage-tiff-using-default-rendering-options.cs
- render-a-workbook-as-tiff-using-300-dpi-resolution-to-improve-image-clarity.cs
- render-a-workbook-to-tiff-with-horizontal-and-vertical-resolutions-set-to-150-dpi.cs
- convert-a-workbook-to-tiff-using-eightbit-color-depth-for-smaller-output-files.cs
- convert-a-workbook-to-tiff-using-twentyfourbit-color-depth-for-highquality-images.cs
- generate-a-multipage-tiff-from-the-first-three-worksheets-of-a-loaded-workbook.cs
- track-workbooktotiff-conversion-progress-by-handling-the-conversion-progress-event-and-logging-percentages.cs
- render-a-workbook-to-tiff-and-write-the-result-into-a-memory-stream-for-further-processing.cs
- save-a-generated-tiff-file-directly-to-a-network-share-path-after-converting-the-workbook.cs
- embed-the-resulting-tiff-image-into-an-html-page-using-an-img-tag-with-appropriate-source-attribute.cs
- measure-conversion-duration-using-stopwatch-and-log-elapsed-time-for-performance-analysis.cs
- set-custom-page-margins-in-imageorprintoptions-before-converting-workbook-to-tiff-for-layout-control.cs
- specify-a-white-background-color-in-imageorprintoptions-when-rendering-workbook-to-tiff-to-ensure-consistency.cs
- convert-the-first-worksheet-of-a-workbook-to-png-using-default-resolution-for-quick-preview.cs
- export-the-worksheet-named-chart-to-bmp-at-96-dpi-resolution-for-legacy-image-compatibility.cs
- render-a-worksheet-to-jpeg-with-gridlines-hidden-by-setting-isgridlinesvisible-to-false.cs
- generate-a-jpeg-image-from-a-worksheet-with-custom-image-quality-set-to-80-percent.cs
- convert-a-worksheet-to-png-and-embed-the-resulting-image-as-a-base64-string-in-json.cs
- render-a-worksheet-to-jpeg-and-upload-the-image-file-to-a-cloud-storage-bucket.cs
- store-the-png-worksheet-image-in-azure-blob-storage-with-custom-metadata-for-categorization.cs
- send-the-png-worksheet-image-via-http-post-to-a-rest-endpoint-for-downstream-processing.cs
- perform-pixelbypixel-comparison-between-the-generated-png-worksheet-image-and-a-baseline-reference.cs
- convert-a-worksheet-to-svg-with-the-viewbox-attribute-enabled-for-scalable-rendering.cs
- export-a-worksheet-to-svg-without-the-viewbox-attribute-to-produce-fixedsize-vector-output.cs
- embed-the-generated-svg-worksheet-file-into-an-html-document-using-the-object-tag-for-display.cs
- save-the-svg-worksheet-image-to-a-svg-file-with-utf8-encoding-to-preserve-character-data.cs
- compress-the-svg-worksheet-file-using-gzip-before-transmitting-it-over-the-network-for-efficiency.cs
- validate-the-svg-worksheet-file-against-the-svg-schema-to-ensure-structural-correctness.cs
- render-the-svg-worksheet-image-in-a-wpf-image-control-for-display-within-a-desktop-application.cs
- use-the-svg-worksheet-graphic-as-a-vector-element-when-generating-a-pdf-document-with-itextsharp.cs
- render-a-chart-object-from-the-workbook-to-a-png-image-using-the-chartrender-api.cs
- export-a-chart-to-svg-with-viewbox-attribute-for-responsive-scaling-in-modern-browsers.cs
- attach-the-jpeg-chart-image-to-an-email-body-using-inline-html-to-display-within-the-message.cs
- include-the-svg-chart-file-in-a-web-page-to-allow-interactive-zoom-and-pan-features.cs
- preserve-data-labels-visibility-when-converting-a-chart-to-png-to-retain-informational-context.cs
- set-chart-image-resolution-to-300-dpi-during-png-conversion-to-achieve-highdefinition-output.cs
- batch-convert-all-excel-files-in-a-directory-to-individual-tiff-images-using-default-rendering-settings.cs
- iterate-through-each-worksheet-in-a-workbook-and-save-each-as-a-separate-png-file.cs
- extract-every-chart-from-a-workbook-and-export-them-as-svg-files-into-a-designated-subfolder.cs
- split-a-multipage-tiff-workbook-output-into-individual-singlepage-tiff-files-for-separate-handling.cs
- convert-the-workbook-tiff-to-pdf-by-invoking-a-thirdparty-converter-after-image-generation.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
using System;
using System.IO;
using System.Net;
using System.Net.Mail;
using Aspose.Cells;
using Aspose.Cells.Charts;
using Aspose.Cells.Drawing;

class ChartEmailExample
{
static void Main()
{
// 1. Create a workbook and add sample data
Workbook workbook = new Workbook();
Worksheet sheet = workbook.Worksheets[0];

sheet.Cells["A1"].PutValue("Category");
sheet.Cells["A2"].PutValue("Apple");
sheet.Cells["A3"].PutValue("Orange");
sheet.Cells["A4"].PutValue("Banana");

sheet.Cells["B1"].PutValue("Value");
sheet.Cells["B2"].PutValue(120);
sheet.Cells["B3"].PutValue(80);
sheet.Cells["B4"].PutValue(150);

// 2. Add a column chart
int chartIndex = sheet.Charts.Add(ChartType.Column, 5, 0, 20, 8);
Chart chart = sheet.Charts[chartIndex];
chart.NSeries.Add("B2:B4", true);
chart.NSeries.CategoryData = "A2:A4";

// 3. Render the chart to a JPEG image in memory
using (MemoryStream imgStream = new MemoryStream())
{
chart.ToImage(imgStream, ImageType.Jpeg); // Use Aspose.Cells Chart.ToImage(Stream, ImageType)

// 4. Convert the image bytes to a Base64 string
string base64Image = Convert.ToBase64String(imgStream.ToArray());

// 5. Build the HTML body with an inline image
string htmlBody = $@"
<html>
<body>
<h3>Sales Chart</h3>
<img src='data:image/jpeg;base64,{base64Image}' alt='Chart' />
</body>
</html>";

// 6. Prepare the email message
MailMessage message = new MailMessage();
message.From = new MailAddress("sender@example.com"); // TODO: replace with actual sender
message.To.Add("recipient@example.com"); // TODO: replace with actual recipient
message.Subject = "Chart Embedded in Email";
message.Body = htmlBody;
message.IsBodyHtml = true;

// 7. Configure SMTP client (replace placeholders with real values)
SmtpClient smtp = new SmtpClient("smtp.example.com", 587) // TODO: SMTP server
{
Credentials = new NetworkCredential("username", "password"), // TODO: credentials
EnableSsl = true
};

// 8. Send the email
try
{
smtp.Send(message);
Console.WriteLine("Email sent successfully.");
}
catch (Exception ex)
{
Console.WriteLine("Error sending email: " + ex.Message);
}
}
}
}
Loading