รูปแบบการออกผลิต

รูปแบบการออกผลิต

รูปแบบการออกผลิต

Aspose.TeX FOSS for Python supports three output formats through interchangeable output device classes. Pass the appropriate device to TeXJob and call run() to obtain the typeset output. PdfDevice returns PDF bytes directly from run(). DviDevice returns DVI bytes from run(). SvgDevice does not return bytes from run() — instead, retrieve per-page SVG byte strings using SvgDevice.get_all_pages() after run() completes.


PDF ผ่าน PdfDevice

from aspose_tex import TeXJob, TeXOptions, PdfDevice, StringInputSource

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

DVI ผ่านเครื่องมือ Dvi

from aspose_tex import TeXJob, TeXOptions, DviDevice, StringInputSource

dvi_bytes = TeXJob(StringInputSource("Hello!"), DviDevice(), options=TeXOptions()).run()
with open("output.dvi", "wb") as f:
    f.write(dvi_bytes)

SVG ผ่าน SvgDevice

from aspose_tex import TeXJob, TeXOptions, SvgDevice, StringInputSource

device = SvgDevice()
TeXJob(StringInputSource("Hello!"), device, options=TeXOptions()).run()
for i, svg in enumerate(device.get_all_pages()):
    with open(f"page_{i}.svg", "wb") as f:
        f.write(svg)

การเลือกรูปแบบการออกเสียง

การใช้งานDeviceNotes
พิมพ์หรือแบ่งปันPdfDeviceขนส่งได้; เป็นที่เหมาะสมที่สุด
เว็บ / ภาพกราฟิกเวกเตอร์SvgDeviceSVG ต่อหน้าผ่าน get_all_pages()
ท่อ TeX แบบดั้งเดิมDviDeviceรูปแบบ DVI สําหรับเครื่องมือด้านล่าง

คําอธิบายการพบบ่อย API

ClassDescription
PdfDeviceการผลิต PDF output bytes
DviDeviceการผลิตไบต์การออก DVI
SvgDeviceผลิตการออก SVG ต่อหน้า
SvgDevice.get_all_pages()รายการกลับของ SVG byte string

See Also

 ภาษาไทย