Free Support Forum - aspose.com

Aspose pdf to svg conversion

Hi,

We are using Aspose.pdf library to convert pdf tp svg.I am able to see that size of the SVG canvas seems to be calculated with 96 DPI.Is it possible to calculate at 72 DPI by using some property as this is a requirement in my project?

Thanks

@arunasrathore

Would you kindly share a bit more about your requirements by sharing your sample PDF document and code snippet. We will test the scenario in our environment and address it accordingly.

Hi,

I am using this code.
Document doc = new Document(filePath);

                        doc.OptimizeSize = true;
                        doc.FitWindow = true;
                        doc.OptimizeResources();
	                    
                        //replace text that might cause issues with the import
                        PdfContentEditor pdfContentEditor = new PdfContentEditor();
                        pdfContentEditor.BindPdf(doc);

                       Aspose.Pdf.SvgSaveOptions saveOptions = new Aspose.Pdf.SvgSaveOptions();
                        // Do not compress SVG image to Zip archive
                        saveOptions.CompressOutputToZipArchive = false;
                        // doc.IsLinearized = true;
                        doc.Save(Path.Combine(_SourceDirectory, fileName + PfdFileTypes.Svg),saveOptions);

Attaching the sample pdf .
the pdf file page size is 8.5*11.Its calculating svg canvas using 96 dpi while i require it to be using 72 dpi .
Sample.pdf (31.8 KB)

Thanks

@arunasrathore

We have logged an investigation ticket as PDFNET-46957 in our issue tracking system for your requirements. We will further look into details of the scenario and keep you posted with the status of ticket resolution. Please be patient and spare us little time.

We are sorry for the inconvenience.

Thank you.Eagerly waiting for the solution.

Hi,

Any update on this will be helpful.

Thanks

@arunasrathore

The ticket has recently been logged in our issue tracking system and still pending for review. We will surely look into this on first come first serve basis. As soon as any update is available regarding its resolution, we will let you know. Please spare us some time.

We are sorry for the inconvenience.

Hi,

I can see that this bug is fixed in Aspose.pdf version 19.10.From where i can download these dlls because I can find only dlls for version 19.9.

Thanks

@arunasrathore

The latest release i.e. Aspose.PDF for .NET 19.10 is on its way to get published. As soon as it is published and available for download, we will let you know. Please spare us some time.

@arunasrathore

Adding more to our previous response, SVG markup has nothing to do with resolution or DPIs. PDF units are typographic points and browser units are pixels. So, to keep sizes and positioning in browser adequate to those in PDF reader, the 1.3333 factor scaling applies along PDF-to-SVG conversion. This scaling now can be disabled by a conversion option:

SvgSaveOptions saveOptions = new SvgSaveOptions() { ScaleToPixels = false };

The update will be available with Aspose.PDF for .NET 19.10 and we will let you know as soon as it is available for download.

Thank you.I am waiting to download 19.10.

The issues you have found earlier (filed as PDFNET-46957) have been fixed in Aspose.PDF for .NET 19.10.

Thank You for your support.