Table of Contents

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

appId string

The Mathpix application ID for API authentication.

appKey string

The Mathpix application key for API authentication.

curlDirectory string

The 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

base64Image string

The base64-encoded image string with starting part like data:image/jpeg;base64,

convertLatexToUnicode Func<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.