פורמט היציאה

פורמט היציאה

פורמט היציאה

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)

2D דרך DviDevice

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)

בחירת פורמט היציאה

שימוש במקרהמכשירהערות
הדפסה או שיתוףPdfDeviceתגית: הכי מתאים
Web / ויקטור גרפיקהSvgDeviceעמודים ב- SVG via get_all_pages()
טייקס מסורתיDviDeviceפורמט DVI עבור כלים מתחת לזרם

סיכום התייחסות API

שיעורתיאור
PdfDeviceיצירת PDF ביטים
DviDeviceיצירת DVI ביטים ייצוא
SvgDeviceיצירת כל דף SVG
SvgDevice.get_all_pages()רשימת החזרים של SVG ביט קווים

ראה גם

 עברית