Class MathpixHelper
- Namespace
- SunamoMathpix
- Assembly
- SunamoMathpix.dll
Helper class for converting images with math notation using Mathpix API to plain text.
public class MathpixHelper
- Inheritance
-
MathpixHelper
- Inherited Members
- Extension Methods
Constructors
MathpixHelper(string, string, string)
Helper class for converting images with math notation using Mathpix API to plain text.
public MathpixHelper(string appId, string appKey, string curlDirectory)
Parameters
appIdstringThe Mathpix application ID for API authentication.
appKeystringThe Mathpix application key for API authentication.
curlDirectorystringThe directory path where curl executable is located.
Methods
Text(string, Func<string, string>?)
Converts a base64-encoded image containing mathematical notation to plain text using Mathpix API.
public string Text(string base64Image, Func<string, string>? convertLatexToUnicode)
Parameters
base64ImagestringThe base64-encoded image string with starting part like data:image/jpeg;base64,
convertLatexToUnicodeFunc<string, string>Optional function to convert LaTeX to Unicode. Pass null if conversion is not needed. Use SunamoLaTex package for conversion.
Returns
- string
The extracted mathematical text from the image, trimmed and optionally converted to Unicode.