Hi Everybody,
The scaling and empty image/pdf issues are due to an update of the Inkscape software.
You can find below the steps on how to resolve the problem with the latest versions of Telerik UI for ASP.NET AJAX (R2 2020/ 2020.2.512) and Inkscape 1.0.
1) Download the latest version of Inkscape 1.0 from https://inkscape.org/release/1.0/windows/. Note that the 32-bit installation will install the tool in C:\Program Files (x86)\Inkscape\bin\inkscape.exe, while the 64-bit one in the C:\Program Files\Inkscape\bin\inkscape.exe folder.
Depending on the installation folder, you have to update the path to the inkscape.exe in the InkscapePath path constant inside the \App_Code\HtmlChartExportSettings.cs file:
public const string InkscapePath = @"C:\Program Files\Inkscape\bin\inkscape.exe";
2) Inkscape 1.0 has a new API that you can find out on https://inkscape.org/doc/inkscape-man.html.
Having this in mind, in order to fix the scaling issue you must update the following line inside the ExportHtmlChart in the \App_Code\HtmlChartExporter.cs file, from
String.Format("--file \"{0}\" --export-{1} \"{2}\" --export-width {3} --export-height {4}",
settings.SvgFilePath, settings.Extension, settings.OutputFilePath, settings.Width, settings.Height);
to
String.Format("--export-type={1} {0} --export-filename={2} --export-area-drawing",
settings.SvgFilePath,settings.Extension, settings.OutputFilePath, settings.Width, settings.Height);
Note that the width and height options from the original code are replaced with --export-area-drawing, which solves the cropping and calling problem.
The --export-filename is also added to set the name of the output file.
There is also a --export-type property specifying the file type to export.
-D, --export-area-drawing
In SVG, PNG, PDF, PS, and EPS export, exported area is the drawing (not page), i.e. the bounding box of all objects of the document (or of the exported object if --export-id is used). With this option, the exported image will display all the visible objects of the document without margins or cropping. This is the default export area for EPS. For PNG, it can be used in combination with --export-use-hints.
-o, --export-filename=FILENAME
Sets the name of the output file. The default is to re-use the name of the input file. If --export-type is also used, the file extension will be adjusted (or added) as appropriate. Otherwise, the file type to export will be inferred from the extension of the specified filename.
Usage of the special filename "-" makes Inkscape write the image data to standard output (stdout).
--export-type=TYPE[,TYPE]*
Specify the file type to export. Possible values: svg, png, ps, eps, pdf, emf, wmf, xaml. It is possible to export more than one file type at a time.
For your convenience, I recorded a short video that you can review and use it as a guide on how to proceed. Here you go: https://youtu.be/TcGlA9wcBeM.
Best Regards,
Rumen
Progress Telerik
Progress is here for your business, like always.
Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.