[Python] Spire.PDF for Python: PdfDocument.Close() gives attribute error

Discussão em 'Python' iniciado por Stack, Maio 18, 2025.

  1. Stack

    Stack Membro Participativo

    Code (adapted from recipe book here: https://www.e-iceblue.com/Tutorials...e/Conversion/Python-Convert-PDF-to-SVG.html#1 )

    from spire.pdf.common import *
    from spire.pdf import *
    myfile = 'c:/atelier/myimage.pdf'
    doc = PdfDocument()
    doc.LoadFromFile(myfile)
    doc.SaveToFile('c:/atelier/ToSVG.svg', FileFormat.SVG)
    doc.Close()


    gives this error:


    It is the doc.Close() line that gives this error. The ToSVG.svg file is created just fine.

    I have Python 3.12, spire.pdf==9.8.0, plum-dispatch==1.7.4, and I downloaded/installed the spire.pdf_11.3 binaries.

    Continue reading...

Compartilhe esta Página