I am using a valid 30 days license.
One difference might be that I am creating the Visio document and then creating a stream to download ? I’m not saving the file then opening and converting.
using (var stream = new MemoryStream())
{
if(saveFormat == SaveFileFormat.VSDX)
{
Aspose.Diagram.Saving.DiagramSaveOptions saveOptions = new Aspose.Diagram.Saving.DiagramSaveOptions()
{
SaveFormat = SaveFileFormat.VSDX,
AutoFitPageToDrawingContent = true
};
diagram.Save(stream, saveOptions);
}
if(saveFormat == SaveFileFormat.PDF)
{
Aspose.Diagram.Saving.PdfSaveOptions saveOptions = new Aspose.Diagram.Saving.PdfSaveOptions()
{
SaveFormat = SaveFileFormat.PDF,
JpegQuality = 100,
PageSize = new Aspose.Diagram.Saving.PageSize(Aspose.Diagram.Saving.PaperSizeFormat.A4),
DefaultFont = "Arial",
EnlargePage = true,
SplitMultiPages = true,
Shapes = diagram.Pages[0].Shapes
};
diagram.Save(stream, saveFormat);
}
var content = stream.ToArray();
return File(content, contentType, String.Format("{0}.{1}", trace.Name, saveFormat.ToString()));
}
Content type for PDF would be
“application/pdf”