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

Free Support Forum - aspose.com

How to reduce svg file size (DIP/Resolution) when converting pdf to svg in aspose.pdf for .NET

I need to reduce exported svg file size.

public List<byte[]> Convert(ContentsDto content, IDictionary<string, string> options, Func<DependentContent, Task<ContentsDto>> GetDependency = null)
        License htmlLicense = new License();
        var pdfBytearray = new List<byte[]>();

        // Load PDF document
        using (var stream1 = new MemoryStream(content.Data))
            Aspose.Pdf.Document doc = new Document(stream1);
            foreach (Aspose.Pdf.Page page in doc.Pages)
                Document doc1 = new Document();
                using (var svgStream = new MemoryStream())
                    SvgSaveOptions saveOptions = new SvgSaveOptions()
                    { ScaleToPixels = false };
                    saveOptions.CompressOutputToZipArchive = false;
                    doc1.Save(svgStream, saveOptions);
        return pdfBytearray;

this is my method to convert pdf document to SVG format using aspose.pdf. Could you please give me a solution to reduce svg file size??


Could you please ZIP and attach your input PDF and expected output SVG here for our reference? We will then provide you more information on it.