Convert PDF to Base64
How can I convert a PDF to Base64?
The PdfDocument object doesn't contain a property to get Base64 directly, though you can get the byte [] which can be used to get Base64.
var pdf = new PdfDocument("MyPDF.pdf");
var ByteArray = pdf.BinaryData;
var Base64Result= Convert.ToBase64String(ByteArray);
var pdf = new PdfDocument("MyPDF.pdf");
var ByteArray = pdf.BinaryData;
var Base64Result= Convert.ToBase64String(ByteArray);
Dim pdf = New PdfDocument("MyPDF.pdf")
Dim ByteArray = pdf.BinaryData
Dim Base64Result= Convert.ToBase64String(ByteArray)