App Store template
PDFMathTranslate icon

PDFMathTranslate

Translate scientific PDFs with PDFMathTranslate on Sealos while preserving formulas and layout. Use a password-protected WebUI with persistent files and caches.

Launch in your Sealos workspace.

PDFMathTranslate template preview
Template previewFull screenshot
Template deployments
14 on Sealos
Deployment
Your own instance
Category
Tools

About this template

Overview

Translate scientific PDFs with PDFMathTranslate on Sealos while preserving formulas and layout. Use a password-protected WebUI with persistent files and caches.

From the documentation

The template deploys:

How to deploy PDFMathTranslate

  1. Choose Deploy now to start PDFMathTranslate in your Sealos workspace.
  2. Review webui_username, webui_password in the deployment form.
  3. Launch the template, then inspect the application status and resource cards in Canvas.

Resources to plan for

Start with the resources defined by the PDFMathTranslate template. Review CPU, memory, persistent storage, and network allocations for every service in Canvas. Capacity needs depend on your data and workload; monitor usage as they grow.

Template configuration and setup

Access after deployment

Use the application URL or connection details shown in Canvas. Follow the deployment guide for first-time account setup or client configuration, and keep generated credentials available for that step.

Hosting and billing

Sealos monthly plans include compute, memory, storage, and traffic. Size your plan for all deployed services. Software licenses and external AI or API services may have separate terms and charges. Confirm the applicable plan and optional charges in Cost Center.

Compare Sealos resource plans
Read full documentationCollapse documentation

For current cloud charges, refer to Sealos plan pricing. Upstream documentation may reference earlier billing models.

Deploy and Host PDFMathTranslate on Sealos

PDFMathTranslate translates PDF documents while preserving formulas, tables, and page layout. This template runs the upstream WebUI on Sealos with persistent configuration, model caches, and generated files.

PDFMathTranslate WebUI showing a completed English-to-Chinese translation

About Hosting PDFMathTranslate

The template deploys:

  • PDFMathTranslate 1.9.11 from an immutable multi-architecture image digest
  • One WebUI replica in a StatefulSet on port 7860
  • Runtime-generated credentials for the Gradio sign-in flow
  • A 1Gi persistent volume mounted at /data
  • Authenticated HTTPS through a Sealos-managed Service and Ingress protected by PDFMathTranslate login credentials
  • Startup, readiness, and liveness probes on the WebUI root
  • A restricted container context running as UID and GID 1000

The WebUI requires the username and password supplied during deployment. PDFMathTranslate has no registration flow, so share these credentials only with people who should access uploaded documents and saved translation-provider settings. The upstream runtime is a single service and has no database or object-storage dependency.

Common Use Cases

  • Translate research papers while retaining their visual structure
  • Produce monolingual and bilingual PDF outputs
  • Review foreign-language technical documents
  • Translate selected pages from large documents
  • Connect PDF translation to Google, Bing, DeepL, OpenAI-compatible, or self-hosted services

Dependencies for PDFMathTranslate Hosting

  • A Sealos account and workspace
  • Outbound internet access for the selected translation service
  • Outbound internet access during the first start if PDFMathTranslate needs to fetch layout models or fonts
  • Provider credentials when using a service that requires an API key

Google and Bing work from the WebUI without user-supplied API keys. Provider availability and rate limits remain subject to their public endpoints.

Implementation Details

ComponentConfiguration
Imagebyaidu/pdf2zh:1.9.11 pinned to sha256:8e083e...
WorkloadSingle-replica StatefulSet
Public port7860
Persistent mount/data
Runtime home/data/home
Upstream config path~/.config/PDFMathTranslate/config.json
Deployed config path/data/home/.config/PDFMathTranslate/config.json
Output directory/data/pdf2zh_files
Access controlGradio credential login from a runtime-only mode-0600 file
Health checksHTTP GET /

The template injects the required deployment credentials as container environment values. A small ConfigMap startup script applies umask 077, writes /tmp/pdf2zh-auth.csv, and executes pdf2zh -i --authorized /tmp/pdf2zh-auth.csv. The resulting mode-0600 authentication file stays outside the persistent volume and disappears with the container. Setting the working directory to /data keeps generated PDFs on the persistent volume, while HOME=/data/home keeps configuration, fonts, models, and translation caches across restarts.

Why Deploy PDFMathTranslate on Sealos?

  • One-click deployment: Sealos creates the workload, storage, HTTPS route, and application link from one template.
  • Persistent working data: Configuration, downloaded assets, caches, and generated PDFs survive Pod replacement.
  • Built-in observability: Inspect status, events, resource use, and logs from Sealos.
  • Simple resource tuning: Increase CPU for faster document processing without rebuilding the image.

Deployment Guide

  1. Open the PDFMathTranslate template and click Deploy Now.
  2. Enter a WebUI username and a strong, unique WebUI password, then start the deployment.
  3. Wait for the StatefulSet to become ready. The first deployment usually takes 2-3 minutes while Sealos pulls the image and PDFMathTranslate loads its layout model.
  4. Open the HTTPS application address shown by Sealos.

Both WebUI credential fields are required. Keep them in a password manager because PDFMathTranslate does not provide registration or password recovery. Upstream parses the credential file as comma-separated values, so use a username and password without commas or line breaks.

Sign In

  1. Open the HTTPS application address shown by Sealos.
  2. Enter the WebUI username and password supplied during deployment.
  3. Continue to the translation interface.

Every user shares the same deployment-level credentials. Changing either value requires updating the StatefulSet environment through a new deployment or template update.

Translate Your First PDF

  1. Sign in to the deployed WebUI.
  2. Keep File selected and upload a PDF, or select Link and enter a direct PDF URL.
  3. Choose a translation service, source language, target language, and page range.
  4. Click Translate.
  5. Download Translation (Mono) for the translated document or Translation (Dual) for a bilingual document.

The Experimental Options panel controls thread count, translation-cache bypass, font subsetting, custom formula-font matching, and BabelDOC mode.

Translation Services and API Keys

The service selector reveals the fields required by the chosen provider. Common examples include:

ServiceTypical fields
Google or BingNo user-supplied key
DeepLDEEPL_AUTH_KEY
OpenAIOPENAI_BASE_URL, OPENAI_API_KEY, OPENAI_MODEL
GeminiGEMINI_API_KEY, GEMINI_MODEL
DeepSeekDEEPSEEK_API_KEY, DEEPSEEK_MODEL
OpenAI-likedCompatible base URL, API key, and model
OllamaReachable OLLAMA_HOST and model name

PDFMathTranslate stores provider settings in /data/home/.config/PDFMathTranslate/config.json. The WebUI credentials protect this persistent configuration, uploaded documents, and the ability to spend paid-provider quota. Use a strong, unique password, limit credential sharing to trusted users, and use provider keys with the narrowest practical scope.

Persistence

PathPurpose
/data/home/.config/PDFMathTranslateLanguage defaults and translation-service settings
/data/home/.cacheLayout models, fonts, and translation caches
/data/pdf2zh_filesUploaded source PDFs and generated Mono/Dual PDFs

All three locations share the template's 1Gi ReadWriteOnce persistent volume. Monitor storage use when processing many or large documents.

Resource Defaults

CPU limitMemory limitCPU requestMemory request
100m2048Mi10m204Mi

Live cold-start and uncached translation tests established these defaults. A 512Mi container was OOM-killed while loading the ONNX model, and 1024Mi reached 92.93% of its cgroup limit. The 2048Mi tier provides operating headroom. The lowest CPU tier completed the official one-page uncached sample in 77.69 seconds.

Increase CPU to 200m or 500m for faster translations, concurrent users, larger PDFs, or BabelDOC workloads.

Scaling

The template uses one replica because configuration, caches, and generated files share a ReadWriteOnce volume. Vertical CPU scaling is the direct path for improving throughput. Multi-replica operation requires a shared storage design and upstream-aware job coordination.

Troubleshooting

The application is still starting

Check the Pod logs in Sealos. A first start can download the DocLayout ONNX model and fonts before Gradio begins listening on port 7860.

Translation fails with a provider error

Try Google or Bing to verify the PDF pipeline without a user-supplied key. For another provider, reopen its service fields and confirm the endpoint, key, and model.

The WebUI rejects the credentials

Use the exact username and password entered during deployment. PDFMathTranslate has no registration or password-recovery flow; update the StatefulSet environment through a new deployment or template update when credentials need to change.

Translation is slow

Increase the CPU limit in Sealos. PDF layout analysis is CPU-bound, and the default 100m tier favors a small resource footprint.

A large upload is rejected

The public Ingress accepts request bodies up to 32m. Reduce the PDF size or raise nginx.ingress.kubernetes.io/proxy-body-size in the Ingress for larger documents.

Generated files consume the volume

Remove old files from /data/pdf2zh_files and monitor the 1Gi persistent volume. Models and fonts under /data/home/.cache also use this volume.

Additional Resources

License

PDFMathTranslate is distributed under the GNU Affero General Public License v3.0. This repository provides the Sealos deployment template and does not change the upstream license.

From launch to everyday operations

Why deploy
on Sealos

A shorter path from an app you want to an app you can run. Sealos brings deployment and ongoing operations into one place.

  1. One-click deployment

    Start with a ready-made template. Review its configuration and launch from the Sealos console.

  2. Managed Kubernetes

    Run on managed infrastructure with built-in workload scheduling and recovery.

  3. Automatic HTTPS

    Give your application a public HTTPS endpoint with certificates managed for you.

  4. Persistent storage

    Keep application data on persistent volumes across container restarts.

  5. Room to grow

    Adjust CPU, memory, and replicas from the console as your workload changes.

One template. Connected resources.

You Get the Whole Stack

Sealos provisions the resources defined by your template and brings them together in your workspace.

  • App Service

    Container workloads with configurable CPU, memory, and replicas.

  • Public HTTPS URL

    An address for your app, with managed TLS certificates.

  • Database

    A database provisioned alongside your app when the template calls for one.

  • Persistent Volume

    Storage for the files and data your application needs to keep.

  • Environment Variables

    Application settings and secrets configured in one place.

  • Logs & Metrics

    Inspect container logs and resource usage from the console.

Resources and their configuration vary by template. Review the deployment form for this app’s exact setup.

Explore more production-ready templates.

More