Welcome to this Obsidian PDF to Markdown Converter! This plugin brings the power of advanced PDF conversion directly into your Obsidian vault. By leveraging the capabilities of Marker through a self-hosted API, the hosted solution on datalab.to, or the powerful MistralAI OCR capabilities, this plugin offers a seamless way to transform your PDFs into rich, formatted Markdown files, with support for tables, formulas and more!
Important
This plugin requires a Marker API endpoint, a paid account for datalab, the python api of marker, or a free MistralAI API key to work. Without an endpoint, the application can't convert anything.
You can find the related repositories and services here:
- Marker Project (AI model for PDF conversion + Simple Python API)
- datalab.to (Hosted API for the Marker AI model, provided by the developer himself)
- Marker API Docker Container (Container for self-hosting, needs Nvidia GPU)
- Marker API (API for self-hosting the conversion service)
- MistralAI (Free OCR API with excellent results)
- OCR Capabilities: Convert scanned PDFs to rich markdown
- Formula Detection: Accurately captures and converts mathematical formulas
- Table Extraction: Preserves table structures in your Markdown output
- Image Handling: Extracts and saves images from your PDFs and includes them in the markdown
- Batch Processing: Convert multiple PDFs at once by selecting files with Alt + Click (Note: Processing multiple files may take considerable time depending on their size and complexity)
- Mobile Compatibility: Works on both desktop and mobile Obsidian apps
- Flexible Output: Choose between full content extraction or specific elements (text/images)
- Smart Folder Integration: If a folder with the PDF's name already exists, the plugin will ask if you want to integrate the new files into the existing folder
- Superior Extraction: Utilizes the Marker project's advanced AI model or MistralAI's powerful OCR for high-quality conversions
- Mobile Accessibility: Unlike many converters, this works seamlessly on mobile devices (when the API is accessible)
- Customizable: Tailor the conversion process to your specific needs
- Obsidian Integration: Converts PDFs directly within your Obsidian environment
If you enjoy this plugin, feel free to star the repository and share it with others! When you want to support the development, consider buying me a coffee:
To use this plugin, you'll need:
- A working Obsidian installation
- Access to a Marker API endpoint (self-hosted or paid service or python api) OR a free MistralAI API key
- Install the plugin in your Obsidian vault
- Choose your conversion method:
- MistralAI: Get a free API key from console.mistral.ai/api-keys
- Datalab.to: Sign up for a paid account
- Self-hosted Marker API: Set up Docker on a machine with a solid GPU/CPU
- Python API: Run the Python server when needed
- Configure your chosen endpoint/API key in the plugin settings
Solution | Pros | Cons |
---|---|---|
MistralAI (recommended) | Completely free, excellent results in testing, easy setup with just an API key | Uploads your files to Mistral's servers (stored for at least 24h) |
Hosted on datalab.to | No setup required, fast and reliable, supports the developer and is easily accessible from anywhere | Costs a few dollars |
Self-Hosted via Docker | Full control over the conversion process, no costs for the API | Requires a powerful machine, Setup can be complex for beginners |
Self-Hosted via Python | Easy to set up, no Docker required | Not all features available |
Note
MistralAI Privacy Consideration: When using the MistralAI endpoint, your PDFs will be uploaded to Mistral's servers for processing. These files are stored for at least 24 hours. If you have sensitive documents, consider using a self-hosted solution instead.
You can convert PDFs to Markdown in multiple ways:
- Single PDF file: Right-click on a PDF file in the file explorer and select "Convert to MD" from the context menu
- Multiple PDF files: Select multiple PDF files with Alt + Click and right-click to convert them all at once
- PDF file in editor: After opening a PDF file in the editor, click on the three dots in the top right corner and select "Convert to MD"
- Use the command palette: Open the command palette and search for "Convert PDF to MD" (only works if a PDF file is open)
Folder Integration: If a folder with the same name as your PDF already exists, the plugin will ask if you want to integrate the new files into this existing folder. This allows you to update or add to already converted documents.
Setting | Default | Description |
---|---|---|
API Endpoint | 'selfhosted' | Select the API endpoint to use: 'Datalab', 'Selfhosted', 'Python API', or 'MistralAI' |
Marker API Endpoint | 'localhost:8000' | The endpoint to use for the Marker API. Only shown when 'Selfhosted' is selected as the API endpoint. |
Python API Endpoint | 'localhost:8001' | The endpoint to use for the Python API. Only shown when 'Python API' is selected as the API endpoint. |
Datalab API Key | - | Enter your Datalab API key. Only shown when 'Datalab' is selected as the API endpoint. |
MistralAI API Key | - | Enter your MistralAI API key. Only shown when 'MistralAI' is selected as the API endpoint. |
Languages | 'en' | The languages to use if OCR is needed, separated by commas. Only shown when 'Datalab' is selected as the API endpoint. |
Force OCR | false |
Force OCR (Activate this when auto-detect often fails, make sure to set the correct languages). Only shown when 'Datalab' is selected as the API endpoint. |
Paginate | false |
Add horizontal rules between each page. Available for both Datalab and MistralAI endpoints. |
Image Limit | 0 |
Maximum number of images to extract (0 for no limit). Only shown when 'MistralAI' is selected. |
Image Minimum Size | 0 |
Minimum height and width of images to extract (0 for no minimum). Only shown when 'MistralAI' is selected. |
Move PDF to Folder | false |
Move the PDF to the folder after conversion. |
Create Asset Subfolder | true |
Create an asset subfolder for images. |
Extract Content | 'all' | Select the content to extract from the PDF. Options: 'Extract everything', 'Text Only', 'Images Only'. |
Write Metadata | false |
Write metadata as frontmatter in the Markdown file. |
Delete Original PDF | false |
Delete the original PDF after conversion. |
This plugin wouldn't be possible without the incredible work of:
- Marker Project: The AI model powering the conversions
- Marker API: The API that enables self-hosting of the conversion service
- MistralAI: For providing the free OCR capabilities
A huge thank you to these projects for their contributions to the community!
If you encounter issues related to the plugin itself, please open an issue in this repository. For problems with the conversion process or API, please refer to the Marker and Marker API repositories.
Note
When converting multiple files at once, be patient as the process can take a significant amount of time depending on the size and complexity of your PDFs. For very large batches, consider processing them in smaller groups.
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
Happy converting! 📚➡️📝