It is specifically the SaveToFile function that throws the exception.
I have the PDF file but it contains sensive data so I need a secure upload space to send it to you.
Using FreeSpire.PDF version 10.2.0 for .Net Standard 2.0
Running on Windows 11.
Visual Studio 2022
.Net 7
- Code: Select all
using (var pdfStream = new MemoryStream(Convert.FromBase64String(pdfBase64)))
{
PdfDocument document = new PdfDocument();
document.LoadFromStream(pdfStream);
var path = Path.GetTempPath() + @"PDF2SVGconvertions\";
Directory.CreateDirectory(path);
var workingFolder = Directory.CreateDirectory(Path.Combine(path, Guid.NewGuid().ToString()));
var workingFolderPath = workingFolder.FullName;
var fileName = Path.Combine(workingFolderPath, Guid.NewGuid().ToString() + ".svg");
document.SaveToFile(fileName, FileFormat.SVG);
}