Added support for PDFs and Images

This commit is contained in:
2023-12-23 17:19:12 -05:00
parent 16a1c9a06f
commit 03e69393fc
8 changed files with 161 additions and 66 deletions

View File

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PWAPPv2.Source.DataObjects
{
public class PWPdf
{
public string path;
public PWPdf(string path)
{
this.path = path;
}
public string GetBase64String()
{
byte[] bytes = File.ReadAllBytes(path);
return Convert.ToBase64String(bytes);
}
public string ShortFileName()
{
return path.Substring(path.LastIndexOf("\\") + 1);
}
}
}