Skip to main content
POST
/
v1
/
mathcad
/
convert
Convert Legacy Files
curl --request POST \
  --url https://api.stru.ai/v1/mathcad/convert \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '{
  "source_file": "<string>",
  "options": {},
  "preserve_formatting": true,
  "output_format": "<string>"
}'
{
  "422": {},
  "500": {}
}

Overview

Convert legacy Mathcad 15 (.xmcd) files to the modern Mathcad Prime (.mcdx) format. This one-way conversion allows you to modernize your calculation library and use older files with the document generation API.
One-way conversion: .xmcd → .mcdx only. Binary .mcd files (Mathcad 14 and earlier) are not supported.
Asynchronous Operation: Returns immediately with a job ID. Poll for the converted file download URL.

Authentication

Authorization
string
required
Bearer token (API key from app.stru.ai)

Request Body

source_file
string
required
Base64-encoded .xmcd file content
"source_file": "UEsDBBQAAAAIAOiG..."
options
object
Conversion options (optional)
"options": {
  "preserve_formatting": true,
  "output_format": "mcdx"
}

Conversion Options

preserve_formatting
boolean
default:"true"
Attempt to preserve original layout and formattingNote: Some complex formatting may be simplified
output_format
string
default:"mcdx"
Output format: "mcdx" or "pdf"Generate either a .mcdx file or directly convert to PDF

Example Request

# Encode the legacy file
FILE_B64=$(base64 -i legacy-calc.xmcd)

curl -X POST https://api.stru.ai/v1/mathcad/convert \
  -H "Authorization: Bearer sk_live_abc123..." \
  -H "Content-Type: application/json" \
  -d "{
    \"source_file\": \"$FILE_B64\",
    \"options\": {
      \"preserve_formatting\": true,
      \"output_format\": \"mcdx\"
    }
  }"

Example Response

{
  "job_id": "job_conv_abc123",
  "status": "completed",
  "created_at": "2025-10-17T10:30:00Z",
  "completed_at": "2025-10-17T10:30:18.456Z",
  "results": {
    "file_url": "https://storage.stru.ai/temp/converted.mcdx?signature=...",
    "file_type": "mcdx",
    "expires_at": "2025-10-18T10:30:18.456Z",
    "conversion_notes": [
      "Some complex formatting simplified",
      "Custom font replaced with default",
      "One embedded image could not be converted"
    ]
  }
}

Conversion Notes

Fully supported:
  • Variables and constants
  • Standard mathematical expressions
  • Text regions and annotations
  • Common functions (sin, cos, sqrt, etc.)
  • Plots and simple charts
  • Most formatting (bold, italic, colors)
⚠️ May be simplified:
  • Complex custom formatting
  • Non-standard fonts (converted to default)
  • Custom region positioning
  • Some advanced plot configurations
  • Certain custom units
Not supported:
  • OLE embedded objects
  • Some third-party extensions
  • Binary .mcd files (Mathcad 14 and earlier)
  • Scripted components
  • Some legacy add-ins

Conversion Workflow

1

Prepare Legacy Files

Ensure files are .xmcd format (Mathcad 15). If you have .mcd files, open in Mathcad 15 and save as .xmcd first.
2

Submit Conversion Job

Encode and submit the .xmcd file with desired options.
3

Review Conversion Notes

Check the conversion_notes array for any warnings or issues encountered during conversion.
4

Download and Verify

Download the converted .mcdx file and open in Mathcad Prime to verify the conversion quality.
5

Manual Adjustments (if needed)

Make any necessary manual adjustments in Mathcad Prime for elements that didn’t convert perfectly.

Use Cases

Convert your entire library of Mathcad 15 calculations to modern .mcdx format for use with current software and the API.
# Batch convert all legacy calculations
for xmcd_file in legacy_library:
    convert_to_mcdx(xmcd_file)
Convert legacy calculations to .mcdx so they can be used with the Mathcad API for automated workflows.
# Convert, then use with API
mcdx_file = convert_xmcd(legacy_file)
structure = read_document(mcdx_file)
# Now use in automated pipeline
Convert old calculations to PDF for archival or distribution to clients who don’t have Mathcad.
convert_xmcd(legacy_file, output_format="pdf")

Best Practices

Test with a sample first - Before batch converting, test with one representative file to see conversion quality
Review conversion notes - Always check the conversion_notes array for warnings
Verify critical calculations - Manually verify that key formulas and results are preserved correctly
Keep originals - Always keep the original .xmcd files as backups
For Mathcad 14 (.mcd) files: Open in Mathcad 15, save as .xmcd, then use this conversion endpoint to get to .mcdx.
Complex documents: Documents with extensive custom formatting, embedded objects, or third-party extensions may require manual post-conversion adjustments.

Error Responses

422
Unprocessable Entity
File format not supported or corrupt
{
  "error": {
    "code": "UNSUPPORTED_FORMAT",
    "message": "File is not a valid .xmcd format"
  }
}
500
Conversion Failed
Conversion encountered an error
{
  "error": {
    "code": "CONVERSION_FAILED",
    "message": "Unable to parse legacy file structure",
    "details": {
      "reason": "Corrupt file or unsupported Mathcad version"
    }
  }
}

Next Steps

After conversion:
  1. Download the converted .mcdx file
  2. Open in Mathcad Prime to verify
  3. Make manual adjustments if needed
  4. Use with the Mathcad API for automation