We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

SVG Filter not working when saving as PDF

Examples.zip (31.1 KB)

I’m inserting an SVG-Image containing a SVG-Filter to have some shadows on a rectangle into Aspose.Words.

When I save the document in .docx everything looks good (see Aspose-Words.docx)
When I save the document in .pdf the shadow is gone. (see Aspose-Words.pdf)

When I open the .docx in Microsoft Word and select “Save as .pdf”, everything looks good.
(See Microsoft-Word.pdf)
So I suppose this should also work when done via Aspose.

Reproduce with the following Java-Code:

package com.orgavision;
import com.aspose.words.Document;
import com.aspose.words.DocumentBuilder;
import com.aspose.words.OoxmlSaveOptions;
import com.aspose.words.PdfSaveOptions;
import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.InputStream;
import java.util.UUID;

public class Aspose {

    public static void main(String[] args) throws Exception {
        Document doc = new Document();
        DocumentBuilder docBuilder = new DocumentBuilder(doc);

        final InputStream svgFile = FileUtils.openInputStream(new File("C:\\organigram-card-shadow.svg"));
        docBuilder.insertImage(svgFile);

        String filename = System.getProperty("java.io.tmpdir") + UUID.randomUUID();
        System.out.println(filename);

        OoxmlSaveOptions docxSaveOptions = new OoxmlSaveOptions();
        docxSaveOptions.setTempFolder(System.getProperty("java.io.tmpdir"));
        doc.save(filename + ".docx", docxSaveOptions);

        PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
        pdfSaveOptions.setTempFolder(System.getProperty("java.io.tmpdir"));
        doc.save(filename + ".pdf", pdfSaveOptions);
    } 
}

@orgavision Thank you for reporting this problem to us, I have managed to reproduce it on my side. For a sake of correction the issue has been logged as WORDSNET-23449 in our defect tracking system. We will keep you informed and let you know once it is resolved.

@orgavision We have analyzed the issue, the problem occurs because our SVG renderer currently does not support filter element. The issue has been postponed till later date. Unfortunately, this means that currently we cannot provide you any estimates when this feature will be implemented. Please accept our apologizes for your inconvenience.