-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Open
Labels
questionFurther information is requestedFurther information is requested
Description
Question
...I have a PDF file containing numerous images, and I am trying to convert it into a PDF document. I do not want an tag to be generated for every image in the PDF. Is it possible to set restrictions on the image size, including length and width?
Below code is used to convert to a normal markdown file
source = "input/A_" # Local Path
converter = DocumentConverter()
result = converter.convert(source)
# Create output folder if it doesn't exist
output_folder = "output"
os.makedirs(output_folder, exist_ok=True)
source_filename = os.path.basename(source)
output_filename = os.path.splitext(source_filename)[0] + ".md" # Change extension to .md
output_path = os.path.join(output_folder, output_filename)
# Write markdown to file
with open(output_path, "w", encoding="utf-8") as file:
file.write(result.document.export_to_markdown())
print(f"Markdown written to {output_path}")
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested