Introduction

Aspose.TeX FOSS for Python is a free, MIT-licensed TeX typesetting engine that runs tamamen Python’da - hiçbir LaTeX yükleme, hiçbir Perl çalışma süresi, dış TeX dağılımı yok İhtiyaç: Tek paket yöneticisi komutu ve arama ile yükleme TeXJob.run() için TeX işaretlemeyi PDF, DVI veya SVG çıkışına dönüştürün.

Kütüphane belge boruları, matematik rendering ve akademik yayın için tasarlanmıştır. TeX işaretleme programlı olarak işlenmesi gereken uygulamalar. giriş kabul eder Yürüyüş yolları (FileInputSource(Daha fazla bilgi için) veya in-memory string (StringInputSource) yapmak için hem batch çalışma akışları hem de dinamik içerik üretimi için uygundur.

Aspose.TeX FOSS is published on PyPI under the MIT license. Commercial use is permitted Sınırlama olmadan.


Ana Özellikler

PDF çıkışları pdfDevice üzerinden

O zamanlar PdfDevice çıkış cihazı tipet içeriği bir PDF byte akışı yazar. TeXJob A ile PdfDevice ve çağrı run() PDF byte almak için:

from aspose_tex import TeXJob, TeXOptions
from aspose_tex import PdfDevice
from aspose_tex import StringInputSource

source = StringInputSource("Hello world!")
job = TeXJob(source, PdfDevice(), options=TeXOptions())
pdf_bytes = job.run()

SVG Çıkış SvgDevice üzerinden

SvgDevice Her tip sayfası bir SVG grafik olarak sunar. get_all_pages() Yöntemler SVG byte çubukları listesini, sayfada birini geri getirir:

from aspose_tex import TeXJob, TeXOptions
from aspose_tex import SvgDevice
from aspose_tex import StringInputSource

device = SvgDevice()
job = TeXJob(StringInputSource("Hello world!"), device, options=TeXOptions())
job.run()
pages = device.get_all_pages()

DVI çıkışları DviDevice üzerinden

DviDevice Device Independent (DVI) çıkış byte üretir - orta format Son performans öncesi geleneksel TeX çalışma akışları tarafından kullanılan:

from aspose_tex import TeXJob, TeXOptions
from aspose_tex import DviDevice
from aspose_tex import StringInputSource

source = StringInputSource("Hello world!")
job = TeXJob(source, DviDevice(), options=TeXOptions())
dvi_bytes = job.run()

FileInputSource ile Dosya Temel Giriş

FileInputSource Diskte bir dosyadan TeX işaretleme okuyun:

from aspose_tex import TeXJob, TeXOptions
from aspose_tex import PdfDevice
from aspose_tex import FileInputSource

job = TeXJob(FileInputSource("document.tex"), PdfDevice(), options=TeXOptions())
pdf_bytes = job.run()

In-Memory ile StringInputSource

StringInputSource Piython çubuğu olarak Teks markup kabul eder:

job = TeXJob(StringInputSource(“Hello, world!”), PdfDevice(), options=TeXOptions()) pdf_bytes = job.run()


---

## Hızlı Başlangıç

Paketi kur:

```bash
pip install aspose-tex>=26.5

Bir TeX çubuğunu PDF’ye yazın:

pdf_bytes = TeXJob(StringInputSource(“Hello!”), PdfDevice(), options=TeXOptions()).run() with open(“output.pdf”, “wb”) as f: f.write(pdf_bytes)


---

## Desteklenen Formatlar

| Format | Extension | Read | Write |
| ------ | --------- | ---- | ----- |
| PDF    | .pdf için | —    | √     |
| DVI    | .2Dİ      | —    | √     |
| SVG    | .SGK      | —    | √     |

Giriş, bir dosya yolu veya hafıza içi çubuk olarak sağlanan TeX işaretidir.

---

## Açık Kaynak ve Lisans

Aspose.TeX FOSS for Python is published under the MIT license. The package is available Piyasaya göre `aspose-tex`.• Ticari kullanım ücret veya kısıtlamalar olmadan izin verilir.

---

## Başlamaya başlar

- [Kurulum Kılavuzu](https://docs.aspose.org/tex/python/getting-started/installation/)
- [Geliştirici Kılavuzu](https://docs.aspose.org/tex/python/developer-guide/)
- [KB Makaleleri](https://kb.aspose.org/tex/python/)
- [API Referansı](https://reference.aspose.org/tex/python/)

## İlgili Kaynaklar

- [Aspose.TeX FOSS for Python — Open-Source TeX Engine](https://products.aspose.org/tex/python/)
- [Aspose.TeX — Enterprise Blog](https://blog.aspose.com/)
- [Aspose.TeX for Python — Enterprise Product](https://products.aspose.com/tex/python-net/)