Skip to content

Instantly share code, notes, and snippets.

Avatar

Aspose.com Gists aspose-com-gists

View GitHub Profile
@aspose-com-gists
aspose-com-gists / delete-column.java
Last active Dec 8, 2022
Insert and Delete Rows and Columns in Excel using Java
View delete-column.java
// Load Excel file
Workbook workbook = new Workbook("Book1.xls");
// Access the first worksheet in the Excel file
Worksheet worksheet = workbook.getWorksheets().get(0);
// Delete a column from the worksheet at 2nd position
worksheet.getCells().deleteColumns(1, 1, true);
// Save the modified Excel file in default format
@aspose-com-gists
aspose-com-gists / search-text-in-dwg.java
Created Dec 7, 2022
Search Text in DWG File using Java
View search-text-in-dwg.java
// Load the input DWG file with CadImage class
CadImage dgnImage = (CadImage) Image.load("search.dwg");
// Search for text in the file
for (CadBaseEntity entity : dgnImage.getEntities())
{
// We iterate through CadText entities here, but some other entities
// may contain text also, e.g. CadMText and others
if (entity.getClass() == com.aspose.cad.fileformats.cad.cadobjects.CadText.class)
{
@aspose-com-gists
aspose-com-gists / search-text-in-dwg.cs
Created Dec 6, 2022
Search Text in DWG File using C# .NET
View search-text-in-dwg.cs
// Load an existing DWG file as CadImage.
using (CadImage cadImage = (CadImage)Aspose.CAD.Image.Load(sourceFilePath))
{
// Search for text in the file
foreach (CadBaseEntity entity in cadImage.Entities)
{
// We iterate through CadText entities, but some other entities may contain text also, e.g. CadMText and others
IterateCADNodes(entity);
}
@aspose-com-gists
aspose-com-gists / draw-arc.cs
Last active Dec 6, 2022
Draw Shapes in C#: Lines, Arcs, Ellipses, and Rectangles
View draw-arc.cs
// Create BmpOptions
BmpOptions bmpCreateOptions = new BmpOptions();
bmpCreateOptions.BitsPerPixel = 32;
// Define the source property for the instance of BmpOptions
bmpCreateOptions.Source = new StreamSource();
// Creates an instance of Image and call create method by passing the
// bmpCreateOptions object
Image image = Image.Create(bmpCreateOptions, 500, 500);
@aspose-com-gists
aspose-com-gists / readme.md
Last active Dec 5, 2022
C# Watermark CAD Documents | Aspose.CAD for .NET
View readme.md

Add a Watermark to CAD Files using .NET CAD API

C# codes listed below demonstrating how to added a watermark to file. Developers can easily use and modify these as of their OMR application requirement.

More details of viewer code using .NET CAD Library at https://products.aspose.com/cad/net/watermark/

For code integration there few prerequisite listed in installation section below.

Installation

View convert-html-files-to-excel-in-python.py
import aspose.cells
from aspose.cells import Workbook, LoadOptions, LoadFormat
loadOptions = LoadOptions(LoadFormat.HTML)
workbook = Workbook(dataDir + "wordtoHtml.html", loadOptions)
workbook.save(dataDir +"wordtoexcel.xlsx")
@aspose-com-gists
aspose-com-gists / Convert-GeoJSON-to-SVG.cs
Created Dec 2, 2022
Convert GeoJSON to SVG Programmatically in C# .NET
View Convert-GeoJSON-to-SVG.cs
// Create a map
using (var map = new Aspose.Gis.Rendering.Map(800, 400))
{
// Use the specified SRS
map.SpatialReferenceSystem = Aspose.Gis.SpatialReferencing.SpatialReferenceSystem.Wgs84;
// Use the specified style to draw lines
var symbolizer = new Aspose.Gis.Rendering.Symbolizers.SimpleLine() { Width = Aspose.Gis.Rendering.Measurement.Pixels(2) };
// Open a layer and add to the map
@aspose-com-gists
aspose-com-gists / QuerySelectorAll.cs
Created Dec 2, 2022
How to Use CSS Selector in C# - QuerySelector & QuerySelectorAll in HTML .NET
View QuerySelectorAll.cs
// Prepare output path for HTML document saving
string savePath = "css-selector-color.html";
// Prepare path to source HTML file
string documentPath = "spring.html";
// Create an instance of an HTML document
var document = new Aspose.Html.HTMLDocument(documentPath);
// Here we create a CSS Selector that extracts all elements whose 'class' attribute equals 'square2'