Spaces:
Paused
Paused
Download python_files/import fitz.py from Rachel7/hvac_fable: direct link, hf CLI and curl.
- Browser
- Download file 564 Bytes
-
https://huggingface.co/spaces/Rachel7/hvac_fable/resolve/main/python_files/import%20fitz.py
- Command line
-
hf download 'hf://spaces/Rachel7/hvac_fable/python_files/import fitz.py'
-
curl -L -o 'import fitz.py' https://huggingface.co/spaces/Rachel7/hvac_fable/resolve/main/python_files/import%20fitz.py
564 Bytes
| import fitz | |
| #convert pdf to image | |
| # Open the PDF file | |
| doc = fitz.open("C:/Users/ruchy/OneDrive/Documents/hvac_project/raw_pdfs/355 E 86th St Mechanical 100% CD Set_flattened.pdf") | |
| # Iterate over each page in the PDF | |
| for page in doc: | |
| # Convert the page to an image | |
| pix = page.get_pixmap() | |
| #increment the image name for each page | |
| #pix.writePNG("C:/Users/ruchy/OneDrive/Documents/hvac_project/images/image{}.png".format(page.number)) | |
| pix.save("C:/Users/ruchy/OneDrive/Documents/hvac_project/images/image{}.jpg".format(page.number)) |