Find and Replace Text in Excel Spreadsheets using C#

The Excel spreadsheets have minimized the efforts required to keep the huge data and perform complex calculations automatically. Excel automation was the next big achievement that has streamlined the way of creating Excel spreadsheets and performing a variety of operations on the data programmatically.

Finding and replacing text in Excel is one of the frequently performed operations in Excel automation. Therefore, in this article, I will show you how to find and replace a particular text in large Excel spreadsheets programmatically in C# with a few lines of code. Ultimately, you will learn how to:

  • Find and replace text in Excel Workbook in C#
  • Find and replace text in Excel Workbook using regular expression (Regex) in C#

API for Finding and Replacing Text in Excel Workbooks

Aspose.Cells for .NET is a powerful API that allows you to completely automate the process of creating, editing, parsing and converting the Excel spreadsheet programmatically. The API also provides easy ways of finding and replacing text based on the plain text as well as regular expressions (regex). You can either download the API or install it in your application via NuGet Package Manager or Package Manager Console.

NuGet Package Manager

Find and replace text with regex in Excel

Package Manager Console

PM> Install-Package Aspose.Cells

Find and Replace Text in Excel using C#

The following is the simple recipe to find and replace text in an Excel workbook using Aspose.Cells for .NET.

The following code sample shows how to find and replace text in Excel using C#.

Find and Replace Text with Regex in Excel using C#

You can also find and replace text that matches a particular pattern, such as Email IDs, SSN, etc. In order to do that, just set the ReplaceOptions.RegexKey property to true and call Workbook.Replace(String, String, ReplaceOptions) method.

The following code sample shows how to find and replace the text with regex in the Excel workbook.

Try Aspose.Cell for .NET for Free

Get a free temporary license of Aspose.Cells for .NET and enjoy its powerful features.

Posted in Aspose.Cells Product Family | Tagged , , | Leave a comment

Create, Edit, Read and Convert SVG Files using C# – Aspose.SVG for .NET

C# SVG API, Create edit convert SVG files

Its time to announce the addition of a new API to our product line – Aspose.SVG for .NET. A .NET class library that lets you create, edit, read and convert SVG files programmatically using C# in .NET or .NET Core based applications. Let’s have a quick walk through the installation methods and salient features of the API.

Aspose.SVG for .NET – Installation

Aspose.SVG for .NET DLL can be downloaded from our Downloads section. On the other hand, you can install it via NuGet Package Manager or the Package Manager Console in Visual Studio.

NuGet Package Manager

C# .NET SVG API

Package Manager Console

PM> Install-Package Aspose.SVG

Let’s now have a glance at some salient features of the API to deal with SVG files.

Create a New SVG File using C#

Aspose.SVG for .NET lets you create an empty file having an SVG structure. Furthermore, you can also create an SVG file from a user-defined string. The API provides SVGDocument class to create SVG files and you can further use this object to fill the document with SVG elements. Once done, you can save the file using SVGDocument.Save() method. The following code samples show how to create an SVG file from scratch.

Create Empty SVG File in C#

Create SVG with User Defined String in C#

Edit SVG Files in C#

Aspose.SVG for .NET also allows you to edit the SVG files to update their content. The API’s Data Object Model efficiently maps the official specifications of SVG to access and edit SVG nodes and their elements. The following code sample shows how to edit an SVG file in C#.

Read SVG Files in C#

In case you would want to read an existing SVG file, you can load it using the SVGDocument class. Simply create a new object and initialize it with SVG file’s path as shown in the following code sample.

Convert SVG Files to Other Formats

You can also convert the SVG files to various other file formats. The supported conversions include:

  • SVG to PDF
  • SVG to XPS
  • SVG to Image (JPEG, PNG, BMP, GIF, TIFF)

The following code sample shows how to convert an SVG file to PDF in C#.

For code samples of SVG to XPS and SVG to image, please visit Converting SVG Files in C#.

You can evaluate the API’s features by downloading the examples project. For more details, consult the documentation of the API. In case you would have any questions or queries, feel free to let us know via our forum.

Posted in Aspose.SVG Product Family | Tagged , , , , | Leave a comment

Convert PowerPoint PPT or PPTX to PDF using C#

PowerPoint PPT PPTX to PDF

Are you looking for a reliable yet easy solution for converting PowerPoint PPT/PPTX to PDF? Do you want to accurately convert PowerPoint presentations to PDF with high quality? If yes then you are at the right place because, in this article, I am going to showcase a bunch of features to seamlessly convert PowerPoint PPT to PDF or PPTX to PDF programmatically in C#.

This article is composed of the following PowerPoint to PDF conversion features.

  • Convert PowerPoint (PPT or PPTX) to PDF in C#
  • Customized conversion of PPT or PPTX to PDF
  • Convert hidden slides in PPT or PPTX to PDF
  • Convert particular slides of PowerPoint presentation to PDF
  • Convert PowerPoint presentation to a password-protected PDF with desired access permissions

Prerequisite for PowerPoint to PDF Conversion in C#

Aspose.Slides for .NET is a powerful PowerPoint automation API to create, edit, parse and convert presentation documents and we’ll use this API throughout this article. You can install Aspose.Slides for .NET using one of the following ways in Visual Studio.

Installing via NuGet Package Manager

Installing via Package Manager Console

PM> Install-Package Aspose.Slides.NET

Convert PowerPoint PPT or PPTX to PDF in C#

The following are the simple steps to convert a PowerPoint presentation to PDF using Aspose.Slides for .NET.

The following code sample shows how to convert a PowerPoint PPT to PDF in C#.

Convert PPT or PPTX to PDF with Custom Options in C#

You can also customize PowerPoint to PDF conversion by defining different options such as Jpeg quality, text compression level, the behavior of metafiles and etc. You can set these options using the PdfOptions class.

The following code sample shows how to convert PowerPoint to PDF with custom options in C#.

Convert Hidden Slides of PowerPoint Presentation to PDF in C#

The PowerPoint presentations may also contain hidden slides. By default, hidden slides are not included in PPT/PPTX to PDF conversion. In case you want to convert a presentation including hidden slides, you can specify it using PdfOptions.ShowHiddenSlides property.

The following code sample shows how to convert a PowerPoint PPTX to PDF including hidden slides in C#.

Convert Selected Slides of PowerPoint PPT/PPTX to PDF in C#

Instead of converting the whole presentation, you can also convert the selected slides of the presentation to PDF. For this, you can define the integer array containing the slide numbers and then pass that array to the Save(String,Int32[], SaveFormat.Pdf) method.

The following code sample shows how to convert selected slides of PowerPoint PPT/PPTX to PDF in C#.

Convert PowerPoint PPT/PPTX to a Password-protected PDF with Access Permissions

PDF format supports setting the password and access permissions to protect the document. In case you want to apply such a protection mechanism while converting PowerPoint to PDF, you can do it using PdfOptions class.

The following code sample shows how to set a password and specify access permissions while converting PowerPoint PPTX to PDF in C#.

Try Aspose.Slides for .NET for Free

You can try and use Aspose.Slides for .NET for free by requesting a temporary license.

Posted in Aspose.Slides Product Family | Tagged , , | Leave a comment

Convert PowerPoint PPT/PPTX to JPG Images in C#

Convert PowerPoint to Image

There could be various scenarios when you need to convert PowerPoint (PPT or PPTX) slides to JPG images. For example, you may need to slide show the PPT/PPTX presentation in read-only mode within your application or you may want to generate the thumbnail for every slide of the PowerPoint presentation and etc. In order to automate PowerPoint to JPG conversion, I’ll show you how to convert PPT/PPTX slides to JPG images programmatically in C# .NET.

Converting PPT/PPTX to JPG Images in C#

In order to convert PPT/PPTX to JPG images, we’ll use Aspose.Slides for .NET which is a complete .NET package for PowerPoint automation. The API provides high-quality conversion of PowerPoint presentations to various file formats including JPG.

You can either download and reference the API’s DLL or install the package using NuGet Package Manager or Package Manager Console.

Using NuGet Package Manager

Using the Package Manager Console

PM> Install-Package Aspose.Slides

Convert PowerPoint PPT to JPG in C#

The following are the steps to convert PPT to JPG using Aspose.Slides for .NET.

The following code sample shows how to convert PPT to JPG images in C#.

PowerPoint Presentation

PowerPoint to JPG Images in C#

Converted JPG Images

PPT PPTX to JPG images in C#

Convert PowerPoint PPTX to JPG with Customized Dimensions in C#

You may also customize the dimensions of the JPG images as per your requirements. The following code sample shows how to define ScaleX and ScaleY values while converting PPTX to JPG in C#.

Get a Free Temporary License for Aspose.Slides for .NET

You can get a free temporary license for Aspose.Slides for .NET to avoid the trial limitations.

See Also

Posted in Aspose.Slides Product Family | Tagged , , , , | Leave a comment

ASP.NET PDF Creator – Create PDF Files Programmatically in ASP.NET Core

Generate PDF Files Programmatically in ASP.NET Core

PDF (Portable Document Format) is a well known and widely used format to display or view digital documents without worrying about the compatible software, operating system, or hardware. Creating PDF files programmatically is quite useful for generating documents such as reports, resumes, invoices, etc. online within the web applications. So in this article, I’ll show you how to create PDF files programmatically in ASP.NET Core web application using C#.

Create PDF Files Programmatically in ASP.NET Core

In order to create PDF files programmatically, we’ll develop a PDF Creator in the ASP.NET Core web application. This PDF Creator will be based on a WYSIWYG HTML editor to create the content and Aspose.PDF for .NET to generate the PDF based on that content. So let’s begin creating our PDF Creator application in ASP.NET Core by following the below steps.

  • Create a new ASP.NET Core Web Application in Visual Studio.
asp.net core generate pdf from html
  • Select Web Application (Model-View-Controller) from the templates.
asp.net core web application

Since this PDF Creator uses the WYSIWYG HTML editor to create the content for PDF documents, for the demonstration, I have used CKEditor’s Standard Package. You can feel free to choose your favorite HTML editor that could best serve your requirements. If you are good to go with the afore-mentioned editor then follow the below step for its integration, else skip it.

  • Download the CKEditor’s package, extract it and copy/paste the folder in wwwroot directory.
asp.net pdf creator
  • Open NuGet Package Manager and install the packages of Aspose.PDF and CKEditor.
Create PDF in ASP.NET Core
  • Open Views/Home/index.cshtml and replace the script with the following.
  • Open Controllers/HomeController.cs and replace the code with the following.
  • Build the application and run it in your favorite browser.

PDF Creator in ASP.NET Core – Demo

The following is the demonstration of how to create PDF files using ASP.NET PDF Creator we have just created.

Download Source Code

You can download the complete source code of the application from GitHub.

Get a Free License for Aspose.PDF for .NET

You can request a free temporary license of Aspose.PDF for .NET to avoid evaluation limitations.

Posted in Aspose.PDF Product Family | Tagged , , , , | Leave a comment

Aspose.Words for .NET 20.2 released

Despite the public holidays, this month was finished with good productivity, 57 improvements and fixes (with 4 Enterprise and 3 Priority Support issues among them) were included to this regular monthly release. Totally 105 issues were processed.

Loading PDF documents is now supported by Aspose.Words for .NET Standard. This is the first file format codec included as plugin in Aspose.Words. To make loading PDF documents work in your .NET Core application, you should add a reference to Aspose.Words.Pdf2Word.dll, or simply add NuGet reference to Aspose.Words. Loading PDF documents is as simple as loading a regular Word document.

Model/Conversions Team delivered several new features.
The most notable are:

  • Word 2019 version set by default. From now all the documents are loaded to the model following MS Word 2019 behavior.
  • FieldMergingArgsBase.FieldValue property has been made settable so that instead of setting Text the user can set FieldValue which takes formatting into account instead of simply replacing the field.
  • Supported dynamic insertion of documents and images from Base64-encoded bytes and dynamic checkbox value setting for LINQ Reporting Engine.

Rendering team managed to fix various rendering issues for DrawingML Charts, VML shapes, DrawingML text effects. Background image rendering has also been improved so that it is closer to MS Word output. The first release of 3D Effects Rendering through OpenGL is on the finale stage, Java team came up with a proposal to refine the code for auto-porting, so it was decided to postpone the release until the next month, using this time to improve the code.

Layout Team improved hyphenation zone processing, clipping of paragraph borders inside text boxes, implemented user notification when document is assembled with floating shapes nested in a text box to make the layout process more informative and predictable.

Posted in Aspose.Words Product Family | Tagged , , , , , , , , , | Leave a comment

ASP.NET Excel Viewer – View Excel Files in ASP.NET MVC using C#

ASP.NET Spreadsheet Viewer

Do you want to display Microsoft Excel worksheets within your web application? Are you looking for an ASP.NET MVC Excel Viewer? If yes, you have landed in an absolutely correct place. In this blog, you will learn how to create an Excel Viewer and display Excel worksheets in ASP.NET MVC applications using C#. After spending a few minutes and following some simple steps you will have your own Excel (XLS or XLSX) Viewer up and running. So let’s begin.

Features of ASP.NET MVC Excel Viewer

Our ASP.NET Excel Viewer will have the following features and you can enhance them as per your requirements.

  1. Browse and view Excel files.
  2. Load default Excel file on page load.
  3. Tabs to navigate between Excel worksheets.

Steps to Create Excel Viewer in ASP.NET MVC

The following are some easy steps to view Excel files in ASP.NET MVC.

1. Create a new ASP.NET MVC web application in Visual Studio.

ASP.NET MVC Web Application

2. Open NuGet Package Manager and install Aspose.Cells for .NET package.

View Excel files in ASP.NET MVC in browser

3. Create a new folder “Documents” to keep the Excel files and a subfolder “Rendered” to save rendered images.

4. Create a new folder with the name “Helpers” in the root folder.

5. Create a new class with the name “Sheet” in the “Helpers” folder to store the Excel worksheets’ information.

6. Open the “HomeController” class and replace it’s code with the following. Make sure to replace the default Excel file’s name in Index action.

7. Open Views/Home/index.cshtml and replace its content with the following script.

8. Build the application and run it in your favorite browser.

View Excel Files in ASP.NET MVC Viewer – Demo

The default Excel file will be displayed when you’ll start the application for the first time.

Excel Viewer in ASP.NET

Open an Excel File

In order to open an Excel file, click the browse button and select the file from the list.

Browse Excel Files
Open Excel file in ASP.NET C#

Navigate Between Excel Worksheets using Tabs

All the worksheets in the Excel workbook will be displayed in the form of tabs. You can click the tabs to navigate between worksheets.

Display Excel Files in ASP.NET

Download Source Code

This application is open source and its source code is available on GitHub.

Get a Temporary License for Aspose.Cells for .NET

You can get the temporary license of Aspose.Cells for .NET API to avoid evaluation/trial limitations.

Posted in Aspose.Cells Product Family | Tagged , , , , , | Leave a comment

Convert HTML Files to PDF Programmatically using Java

PDF is the most widely used document format for exchanging digital information. The cross-platform compatibility, stable layout and security features of PDF format have made it quite famous. The conversion from other documents to PDF is highly in practice these days and HTML to PDF is one of the popular conversion scenarios for converting the content of the web pages to PDF documents.

The online HTML to PDF converters allow you to convert the single or multiple HTML pages to PDF documents. However, in case you want to perform this conversion programmatically or you need to do a batch conversion of HTML files to PDF, you’ll definitely look for some SDK or API. In this article, you’ll learn how easy it is to convert a single or batch of HTML documents to PDF programmatically in Java. The following scenarios will be addressed in the rest of the article.

  • Convert HTML document to PDF in Java
  • Convert HTML to password-protected PDF in Java
  • Convert HTML to PDF using URL in Java
  • Convert HTML content to single-page PDF in Java

Aspose.PDF for Java API for HTML to PDF Converter

Aspose.PDF for Java is a powerful Java class library to work with PDF documents. In addition to the other PDF manipulation features, Aspose.PDF for Java also provides high-quality HTML to PDF conversion features. You can download the API’s JAR file or install it using the following configurations in your Maven-based Java project.

Repository

<repository>
    <id>AsposeJavaAPI</id>
    <name>Aspose Java API</name>
    <url>https://repository.aspose.com/repo/</url>
</repository>

Dependency

<dependency>
    <groupId>com.aspose</groupId>
    <artifactId>aspose-pdf</artifactId>
    <version>19.12</version>
    <classifier>jdk17</classifier>
</dependency>

Convert HTML to PDF in Java

The following is the simple recipe to convert an HTML file to PDF using Aspose.PDF for Java.

  • Create an instance of the HtmlLoadOptions class.
  • Create an instance of Document class and initialize it with the HTML file’s path and HtmlLoadOptions object.
  • Call Document.save(String) method with the output PDF file’s name.

The following code sample shows how to convert an HTML document to PDF in Java.

Input HTML File

Converted PDF Document

Convert HTML to Password-Protected PDF in Java

Aspose.PDF for Java also lets you convert HTML file to encrypted PDF document. You can protect the resultant PDF document by specifying the user’s password, owner’s password, access permissions, and cryptographic algorithm in the Document.encrypt() method.

The following code sample shows how to convert HTML to an encrypted PDF in Java.

Output

Convert HTML to PDF using URL in Java

You can also convert the web page from the live URL to the PDF document. Below are the steps to achieve this:

  • Create and initialize the URL object.
  • Get the web page into the InputStream object.
  • Create the Document object and initialize it with InputStream and HtmlLoadOptions objects.
  • Save HTML stream as PDF using Document.save() method.

The following code sample shows how to convert HTML content from URL to PDF in Java.

Convert HTML to a Single Page PDF in Java

In case you want to convert the whole HTML content into a single page PDF document, you can set HtmlLoadOptions.setRenderToSinglePage(true) as shown in the following Java code sample.

Related Articles

Posted in Aspose.PDF Product Family | Tagged , , , , | Leave a comment

Aspose.BarCode for PHP via Java – PHP Barcode Generator and Reader API

PHP Barcode Generator Library

Barcodes are used to visually represent the data about an object in the machine-readable form. It is more popular to keep the data about products which can be read using the barcode scanners. In order to make it possible to generate and read a variety of barcodes in the PHP based web applications, we have released Aspose.BarCode for PHP via Java – an easy to use PHP barcode generator and reader API which is designed to work via Java Bridge.

In this article, I will present the recipes and code samples of how to generate and read the barcodes using PHP in your applications. After reading this article, you’ll be able to:

  • generate a barcode using PHP,
  • generate 2D barcodes such as QR using PHP,
  • generate barcodes with a customized appearance in PHP,
  • generate barcodes with a caption using PHP,
  • scan and read a barcode using PHP,
  • scan and read a barcode with a particular symbology using PHP.

Aspose.BarCode for PHP via Java – Installation and Usage

The installation of Aspose.BarCode for PHP via Java consists of a few simple steps. The following are the pre-requisites of the API:

You can download the complete package containing the API’s JAR file, Java Bridge.jar, Java.inc, and ready to run source code examples to read, generate and recognize barcodes using PHP. In order to run the examples, following the below steps:

  • Run JavaBridge server using run-bridge.bat (available in the package).
  • Open doc/examples/php_side/how_to_generate_barcode_examples.php in the browser or run it using the command line.

Generate Barcodes using Barcode Generator in PHP

Once you have set up the environment, you can begin working with barcodes in your PHP based application. Aspose.BarCode for PHP via Java supports a variety of barcode symbologies including:

  • Code128
  • Code11
  • Code39
  • QR
  • Datamatrix
  • EAN13
  • EAN8
  • ITF14
  • PDF417
  • and many more.

The following is the simple recipe to generate a barcode of any supported symbology using PHP:

  • Create an object of BarcodeGenerator class and initialized it with the desired encoding type and code text.
  • Generate barcode using BarcodeGenerator->save() method.

The following code sample shows how to generate a barcode using PHP.

Output

PHP Barcode Generator

Generate 2D Barcodes in PHP

Two-dimensional barcodes are represented as squares or the rectangles containing multiple dots. Aspose.BarCode for PHP via Java also supports various 2D barcode types such as QR, PDF417, etc. The following code sample shows how to generate a QR barcode using PHP:

Output

QR Code Generator in PHP

Generate Barcodes with a Customized Appearance in PHP

Aspose.BarCode for PHP via Java also lets you customize the appearance of the barcodes. For example, you can set the background, foreground or border color of the barcode. The following code sample shows how to generate a barcode with a customized appearance in PHP.

Output

Generate Barcode in PHP

Generate Barcode with Caption in PHP

You can also set as well as customize the appearance of the barcode’s caption. The following code sample shows how to set the barcode’s caption and customize its font.

Output

PHP Barcode Library

Read a Barcode using Barcode Reader in PHP

Along with the barcode generator, the API also provides you a powerful barcode reader to scan the barcodes and extract the data. The following is the recipe for how to read a barcode.

  • Create an instance of BarcodeReader and initialize it with the file’s path.
  • Read barcode using BarcodeReader->read() method.
  • Get barcode type and text using BarcodeReader->getCodeTypeName() and BarcodeReader->getCodeText() methods.

The following code sample shows how to read a barcode using PHP.

Recognize Barcode with a Particular Symbology in PHP

Barcode Recognition is the process of identifying the type of barcode we want to scan or read. In the previous example, we simply read a barcode without knowing its symbology type. However, in some cases, we know about the symbology of the barcode in advance. In such a scenario, we can speed up the scanning process by providing the barcode symbology explicitly to the barcode reader.

The following code sample shows how to read a barcode of a specific symbology using PHP.

Advanced Barcode Manipulation Features

Aspose.BarCode for PHP via Java provides a wide range of features for manipulating barcodes using PHP. You may have a look at the following documentation articles and simply port the Java code to PHP.

In case you would find anything confusing or difficult for you, feel free to contact us via our forum.

Posted in Aspose.BarCode Product Family | Tagged , , , , , , | Leave a comment

Find and Replace Text in Word Documents using C# .NET

This article covers various approaches to find and replace text in Word documents using C# in .NET or .NET Core applications.

Find and Replace is quite a useful feature of MS Word to quickly locate and replace the desired text in the documents. It becomes more handy and time-saving when you are working with longer documents. In cases when you need to find and replace text in hundreds of Word documents or you need to automate this process, you’ll definitely opt to do it programmatically. So in this article, I’ll show you how to find and replace text in Word documents programmatically in different scenarios using C#. Once you have read this article, you will be able to:

  • find and replace text in Word documents,
  • find and replace similar words in Word documents,
  • find and replace text using Regex,
  • find and replace text in the header/footer of Word document,
  • find and replace text with meta-characters in Word document.

First of all, create a new C# project (Console, ASP.NET, etc.) in Visual Studio and install Aspose.Words for .NET via NuGet Package Manager or Package Manager Console.

Installing via NuGet Package Manager

Finding and replacing text in Word DOC

Installing via Package Manager Console

PM> Install-Package Aspose.Words

After we have installed Aspose.Words for .NET, let’s now begin finding and replacing text in the following Word document.

c# find and replace text in word document

Find and Replace Text in Word Documents in C#

The following are the steps to find and replace a particular text in Word document using Aspose.Words for .NET.

The FindReplaceOptions class provides various options to customize the find/replace operations. The following code sample shows how to find and replace a particular word or string in a Word document using C#.

Output

find text in word document using c#

Find and Replace Similar Words in Word Documents using C#

You can also customize the API to find similar words and replace them with a particular word. For example, you can find the words “sad” and “mad” and replace them with a single word. The following code sample shows how to find and replace similar words in Word document using C#.

Output

c# replace text in docx file

Find and Replace Text using Regex in C#

There might be the case when you want to find and replace text that appears in a particular pattern. For example, you need to hide/replace all the email IDs in a Word document. In such cases, you can create a regular expression for email IDs and pass it to Document.Range.Replace(Regex, string, FindReplaceOptions) method.

The following code sample shows how to find and replace text based on a pattern in Word document.

Output

how to replace text in word document

Find and Replace Text in Header/Footer of Word Document using C#

You can also find and replace text in the header or footer sections of a Word document using the HeaderFooter class. The HeaderFooter.Range.Replace(string, string, FindReplaceOptions) method is used for this purpose. The following code sample shows how to replace text in the header/footer of Word document in C#.

Output

Word Document Finding and Replacing Text in C#.NET

Find and Replace Text with Meta-Characters in Word Documents using C#

There could be a scenario where a particular text or phrase is composed of multiple paragraphs, sections, or pages. In such cases, the simple find and replace method wouldn’t work effectively and we’ll have to handle the paragraphs breaks, section breaks or page breaks. For this, Aspose.Words allows you to use the following meta-characters in the search string or the replacement string:

  • &p: paragraph break
  • &b: section break
  • &m: page break 
  • &l: line break

The following code sample shows how to find and replace the text with a paragraph break in a Word document.

Output

find and replace text using regular expression C#

Explore more about the features offered by Aspose.Words for .NET here.

Related Article(s)

Posted in Aspose.Words Product Family | Tagged , , , , , | Leave a comment