PDF to Markdown Conversion

Revision as of 16:39, 15 September 2026 by Planetoid (talk | contribs) (Created page with "= PDF to Markdown Conversion = == Introduction == This prompt is designed to convert a PDF document into structured Markdown while preserving not only its textual content, but also information contained in images, charts, screenshots, scanned pages, diagrams, and other visual elements. The goal is to produce a Markdown representation that preserves the original document as faithfully as possible, including its content, structure, reading order, tables, formatting, vis...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

PDF to Markdown Conversion

Introduction

This prompt is designed to convert a PDF document into structured Markdown while preserving not only its textual content, but also information contained in images, charts, screenshots, scanned pages, diagrams, and other visual elements.

The goal is to produce a Markdown representation that preserves the original document as faithfully as possible, including its content, structure, reading order, tables, formatting, visually embedded text, and source references.

Model Requirements

This prompt should be used with an AI model that supports vision, image understanding, or multimodal input.

The model must be capable of analyzing visual content inside a PDF, rather than relying solely on text extracted from the PDF's text layer.

Examples of suitable multimodal or vision-capable models include:

  • OpenAI: GPT-4.5[1], GPT-4.1, GPT-5 series
  • Google: Gemini models with multimodal/image understanding capabilities, such as Gemini 2.5 Flash[2] or Gemini 2.5 Pro
  • Anthropic: Claude models with vision/image-input support

Equivalent or newer multimodal models or models with vision capabilities may also be used, provided that they can inspect images and graphical content contained within the PDF.

A text-only model, or a PDF processing pipeline that extracts only the PDF text layer, is not sufficient for this task because text embedded in screenshots, scanned pages, charts, diagrams, or other images may otherwise be omitted.

Task

Prompt


I will provide a PDF file. Convert its contents into Markdown-formatted text.

Please follow these requirements:

# If the PDF contains images, charts, screenshots, scanned pages, diagrams, or other graphical content, inspect the visual content and extract '''all readable text contained within it'''.

   Transcribe that text into the Markdown output. Do not omit text simply because it is embedded in an image rather than stored in the PDF text layer.

# If a graphical element contains no text, such as a photograph, icon, illustration, or purely visual diagram, do not skip it.

   Represent it using the following format:

   <code>[Image: Brief description of its content or purpose]</code>

# Preserve the original document's structure and hierarchy as closely as possible, including:

* Headings (<code>#</code>, <code>##</code>, <code>###</code>, etc.)
* Paragraphs
* Ordered and unordered lists
* Tables
* '''Bold text'''
   '' ''Italic text*
* Blockquotes
* Code blocks
* Other meaningful structural formatting

# Convert tables into standard Markdown table syntax whenever possible.

   If a table is too complex to reproduce accurately in Markdown, explain the limitation and preserve the relationships between rows, columns, headers, and values as faithfully as possible.

# If a page contains both textual and graphical content, preserve the original '''reading order'''.

   Insert transcribed image content or image descriptions at the position where the corresponding visual element appears in the document.

# Do not add, rewrite, correct, infer, summarize, or guess information that does not appear in the original PDF.

   The output should be a transcription and structural conversion, not an interpretation of the document.

# If any text is blurry, obscured, incomplete, or otherwise impossible to identify reliably, use:

   <code>[Unrecognizable]</code>

   Do not guess the missing text.

# When both the PDF text layer and the visual rendering contain the same text, avoid unnecessary duplication.

   Prefer the version that most accurately represents the document while preserving visually significant information that may not exist in the text layer.

# Pay particular attention to visual elements that commonly contain important text, including:

* Screenshots
* Scanned documents
* Infographics
* Flowcharts
* Charts and graphs
* Forms
* Presentation slides embedded in the PDF
* Captions and annotations
* Labels inside diagrams
* Text rendered as part of an image

References