Custom tool for OpenCode that converts PDF files into images (one image per page) for multi-modal models. Updated to work with new Orca2 file structure.
Add to your project's opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-tool-pdf2img"]
}Add to ~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-tool-pdf2img"]
}OpenCode automatically installs dependencies and sets up the tool.
The tool can be called during your conversation:
Use the pdf2img tool to convert a PDF file into PNG images.
pdfPath(string, required): Path to the PDF file (absolute or relative to current directory)scale(number, optional): Rendering scale factor (default: 4.0, approximately 288 DPI)
- Creates
page-1.png,page-2.png, etc. in thepdf2imgsub-directory below the source PDF
# Install dependencies
bun install
# Build
npm run buildMIT
- @whpthomas - Concept, logic and troubleshooting
- Qwen3.5 122B A10B int4 AutoRound ~ DGX Spark - Research and coding