Support for fill attribute of SVG G element

Any plans to support fill attribute of SVG G element for Java PDF library?


This Topic is created by codewarior using the Email to Topic plugin.

@arthur_ramsey,

Thanks for contacting support.

Can you please share some details regarding your requirement. Please confirm if you need to fill color inside SVG image or your requirement is to honor the filled color when manipulating the SVG image using Aspose.Pdf for Java.

Kindly share the details, so we may reply accordingly.

The requirement is to honor the filled color when converting an SVG image to a PDF using Aspose.Pdf for Java.

@arthurr,
Kindly send us your source SVG file and code. We will investigate and share our findings with you. Your response is awaited.

import com.aspose.pdf.Document;
import com.aspose.pdf.LoadOptions;
import com.aspose.pdf.SvgLoadOptions;

public class ConvertSvg {
    public static void main(String[] args) {
		// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Java
		// Instantiate LoadOption object using SVG load option
		LoadOptions options = new SvgLoadOptions();
		// Create Document object
		Document document = new Document(args[0], options);
		// Save the resultant PDF document
		document.save(args[1]);
	}
}
1.zip (3.6 KB)

The documentation seems to imply with “fill=none” that fill for g elements isn’t yet supported: https://docs.aspose.com/display/pdfjava/Convert+a+File+to+PDF+Format#ConvertaFiletoPDFFormat-ConvertSVGfiletoPDFformat.

@arthurr,
We managed to replicate the said problem in our environment. It has been logged under the ticket ID PDFJAVA-37104 in our bug tracking system. We have linked your post to this ticket and will keep you informed regarding any available updates.

Any update available?

@arthurr,

The linked ticket ID PDFJAVA-37104 is pending for the analysis and not resolved yet. Our product team will investigate as per their development schedules. We will let you know once it is fixed.

The issues you have found earlier (filed as PDFJAVA-37104) have been fixed in Aspose.PDF for Java 20.9.