Skip to content

Stage 3b: SVG Conversion

obsidian_export.pipeline.stage3_svg

Stage 3b: Convert SVG image references for LaTeX (PDF) and DOCX compatibility.

convert_svg_images

convert_svg_images(body: str, tmpdir: Path, resource_path: Path | None) -> str

Find SVG image references and convert to PDF for LaTeX/PDF output.

Source code in obsidian_export/pipeline/stage3_svg.py
def convert_svg_images(body: str, tmpdir: Path, resource_path: Path | None) -> str:
    """Find SVG image references and convert to PDF for LaTeX/PDF output."""
    return _convert_svg_images(body, tmpdir, resource_path, "pdf", ".pdf")

convert_svg_images_to_png

convert_svg_images_to_png(body: str, tmpdir: Path, resource_path: Path | None) -> str

Find SVG image references and convert to PNG for DOCX output.

Source code in obsidian_export/pipeline/stage3_svg.py
def convert_svg_images_to_png(body: str, tmpdir: Path, resource_path: Path | None) -> str:
    """Find SVG image references and convert to PNG for DOCX output."""
    return _convert_svg_images(body, tmpdir, resource_path, "png", ".png")