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);
}
}