Blog on software engineering
Convert PDF to hex string in .NET 4.7.2 for T-SQL insert statement

Convert PDF to hex string in .NET 4.7.2 for T-SQL insert statement

 

private string ConvertToHexString(string filePath)
{
    byte[] contentAsBytes = File.ReadAllBytes(filePath);
    string contentAsHexString = BitConverter.ToString(contentAsBytes).Replace("-", "");
    return contentAsHexString;
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.