Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document.save_as_markdown(page_no=page_number) creates an artefacts folder with all the images, instead the images of the page #179

Open
mariaapostigo opened this issue Mar 2, 2025 · 0 comments

Comments

@mariaapostigo
Copy link

I am iterating over the pages of a document as follows:
`
for page_num, _ in enumerate(pages, start=1):
# Save each page as a separate Markdown file
page_md_filename = output_dir / f"{doc_filename}page{page_num}.md"
conv_res.document.save_as_markdown(page_md_filename, image_mode=ImageRefMode.REFERENCED, page_no=page_num)

    # Read the Markdown content
    with page_md_filename.open("r", encoding="utf-8") as md_file:
        md_content = md_file.read()

    artifacts_dir = f"{doc_filename}_page_{page_num}_artifacts"
    image_files = list((output_dir / artifacts_dir).glob("*.png"))
    table_counter = 0

`
from line: conv_res.document.save_as_markdown(page_md_filename, image_mode=ImageRefMode.REFERENCED, page_no=page_num) I would expect to generate a directory with the images in page_num, but I create a directory pero page with all the images from the document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant