Crop / Union / Difference - are supported?

Is this functionallity supported directly by the library ?

@olivers2007

Can you please share a bit more details by sharing some referencing links so that we can check and log a ticket if investigation is needed.

I need functionality that roughly corresponds to the functions of Inkscape. I thought the library could do this, but now I assume that it is not part of the library? I am referring to union, difference, etc., the Boolean functions that are to be executed between different objects in SVG. I am particularly interested in crop without prior rasterization of the SVG.
Am I correct in assuming that the library cannot do this out of the box?

@olivers2007
We have opened the following new ticket(s) in our internal issue tracking system and will investigate against your requirements. We will inform you as soon as the ticket is resolved. Please spare us some time.

Issue ID(s): SVGNET-500

@olivers2007

At the moment Aspose.SVG does not provide built-in Boolean geometry operations (union, difference, intersection/crop, XOR) like Inkscape (https://www.youtube.com/watch?v=jxhR9aT6crU). The library can visually crop artwork with a clip path or mask, but that only hides pixels—the original shapes are still intact.

Current work-around (visual crop)

// create a rectangular clipping path and apply it to the logo group
var rect = (SVGClipPathElement)doc.CreateElement("clipPath");
rect.Id = "cropArea";
rect.AppendChild(PathBuilder.Rectangle(0, 0, 200, 100));
doc.QuerySelector("#logo").SetAttribute("clip-path", "url(#cropArea)");

This renders correctly, but it is not a real Boolean intersection; opening the file in an editor will still show the unclipped shapes.

Planned solution:

A separate task SVGNET-505* has been opened to add true Boolean geometry support.

Proposed usage:

using var doc = new SVGDocument("brand.svg");

var logoGroup = (SvgGraphicsElement)doc.QuerySelector("#logo");      // subject
var cropRect  = (SvgGraphicsElement)doc.QuerySelector("#cropArea");  // clipper

var cropped = BooleanCombine.Combine(
                  logoGroup,
                  cropRect,
                  BooleanPathOp.Intersection,        // Intersection == Crop
                  new BooleanCombineOptions { PreserveSourcePaths = false });

logoGroup.ParentNode!.AppendChild(cropped);
doc.Save("logo_cropped.svg");

This future API will actually rewrite the geometry and return a single representing the cropped result-matching what Inkscape’s Path → Intersection command produces.