[Python] Extracting Images from a pdf file of Engineering Drawings in python

Discussão em 'Python' iniciado por Stack, Junho 26, 2025.

  1. Stack

    Stack Membro Participativo

    this is the first time I am trying this,

    I have a PDF file which is basically a 2D Engineering drawing eg: as given here[​IMG]

    All drawings are very similar in nature,

    I need to find out the centre circular drawings area covered by black ink. I want to find out in the central circular image, what portion of the area is having black ink, and what portion has white dots.

    My problem starts with loading the pdf file in python for which I used this code:

    import os
    os.chdir("E:\WorkStation Laptop\Projects\Shirwal\Printing\PDF Images")

    from pdf2image import convert_from_path

    images = convert_from_path('06561 ALKEM LABORATORIES LIMITED mm.pdf')

    for img in images:
    img.save('output.jpg', 'JPEG')


    But this isn't working and giving me this error

    PDFInfoNotInstalledError: Unable to get page count. Is poppler installed and in PATH?


    My 2nd step is to extract that area having a circular image and then calculating the black dots area and white dots area

    How should I do it?

    Continue reading...

Compartilhe esta Página