SVG SCALE IN IFRAME?

aspdotnet_mvc_groupdocs.png (13.4 KB)

Hello everyone, I’m developing a web application using ASP.NET MVC. I’m using GroupDocs to render my .dwg and .dxf files as HTML, and I’m displaying them within an iframe on my page. So far, everything is working fine. However, I’m having trouble resizing the SVG page displayed inside the iframe. Can you please help me with this?

//asp.net mvc c# controller
string rootDirectory = AppDomain.CurrentDomain.BaseDirectory; // “C:\Users\nesto\source\repos\NestoRaporWeb\NestoRaporWeb\”
string nestedOutputDirectory = Path.Combine(rootDirectory, “output”, “RenderAllLayouts”); //“C:\Users\nesto\source\repos\NestoRaporWeb\NestoRaporWeb\output\RenderAllLayouts”
string lazim = Path.Combine(“output”, “RenderAllLayouts”, “svg{0}.html”);//output\RenderAllLayouts"
string pageFilePathFormat = Path.Combine(nestedOutputDirectory, “svg{0}.html”); //“C:\Users\nesto\source\repos\NestoRaporWeb\NestoRaporWeb\output\RenderAllLayouts\calisma{0}.html”
int index = 1;
var fileList = new List();
var iframeList = new List();
var tableData = new List<Dictionary<string, object>>();
foreach (var file in files)
{
var fileExtension = Path.GetExtension(file.FileName).ToLower();
if (fileExtension == “.dwg” || fileExtension == “.dxf”)
{
var (adet, mm) = ExtractAdetAndMM(file.FileName);
string fileExtensions = Path.GetExtension(file.FileName).ToLower();
string filePath = Path.Combine(nestedOutputDirectory, $“{index}.{fileExtensions}”);
file.SaveAs(filePath);
using (Viewer viewer = new Viewer(filePath))
{
HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(string.Format(pageFilePathFormat, index));
options.CadOptions.RenderLayouts = true;
//options.CadOptions.ScaleFactor = 1;
viewer.View(options);
}
string htmlFilePath = string.Format(lazim, index);
fileList.Add(htmlFilePath);
string iframeContent = $“<iframe src="{htmlFilePath}" style="border: 1px solid;">”;
iframeList.Add(iframeContent);
var row = new Dictionary<string, object>
{
{ “Dosya Adı”, file.FileName },
{ “Uzantı”, fileExtension },
{ “Adet”, adet },
{ “Kalınlık”, mm },
{ “Görsel”, iframeContent },
{ “Yazdır”, $“<button class="btn btn-primary" onclick="printFile({index - 1})">Yazdır” },
{ “Kaldır”, $“<button class="btn btn-danger" onclick="removeFile({index - 1})">Kaldır” },
{ “Sil”, $“<button class="btn btn-warning" onclick="inspectFile({index - 1})">İncele” }
};
tableData.Add(row);
index++;
}
}
var tableDataObject = new
{
Table = new
{
Data = tableData,
Columns = new string[]
{
“Dosya Adı”, “Uzantı”, “Adet”, “Kalınlık”, “Görsel”, “Yazdır”, “Kaldır”, “Sil”
}
}
};
var result = new
{
FileList = fileList,
IframeList = iframeList,
TableData = tableDataObject
};
return Json(result);

@nestougur

Could you please share the problematic/source and output/HTML files as well? Secondly, it seems you are evaluating the API in trial mode. You could request/avail a temporary license. Please follow these steps to get the temporary license.