MCPcopy
hub / github.com/codeaashu/claude-code / isPdftoppmAvailable

Function isPdftoppmAvailable

src/utils/pdf.ts:160–169  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

158 * The result is cached for the lifetime of the process.
159 */
160export async function isPdftoppmAvailable(): Promise<boolean> {
161 if (pdftoppmAvailable !== undefined) return pdftoppmAvailable
162 const { code, stderr } = await execFileNoThrow('pdftoppm', ['-v'], {
163 timeout: 5000,
164 useCwd: false,
165 })
166 // pdftoppm prints version info to stderr and exits 0 (or sometimes 99 on older versions)
167 pdftoppmAvailable = code === 0 || stderr.length > 0
168 return pdftoppmAvailable
169}
170
171/**
172 * Extract PDF pages as JPEG images using pdftoppm.

Callers 1

extractPDFPagesFunction · 0.85

Calls 1

execFileNoThrowFunction · 0.85

Tested by

no test coverage detected