Img link placed before text instead of after

I use the following to extract md from a pdf file converted from ppt.

   import pymupdf.layout 
   md_text = pymupdf4llm.to_markdown(
        pdf_file,
        write_images=True,
        image_path=dest_img_dir,
        use_ocr=False,
    )

Part of the extracted md is as the following:


【考点章节】心理统计第四章第二节 完全随机实验设计的方差分析  

![](/exam/assetmd5/exam_psychology_2.6584fd2ac5f469cb.pdf-0030-03.png)  

【解析】总自由度为:  

![](/exam/assetmd5/exam_psychology_2.6584fd2ac5f469cb.pdf-0030-05.png)

In the original pdf, exam_psychology_2.6584fd2ac5f469cb.pdf-0030-03.png is to the right of the text 【解析】总自由度为:with the top edge slightly higher than the top line of the text. It is much more appropriate to extract the img and place it after the text. If the img link is placed before the text, it is not possible to make the correction by post processing it.

Hi @Charles_Ju - welcome to the forum! Are you able to supply the PDF at all? I’m interested to see the layout.