pdf_page_to_image: Convert a single PDF page to an image

View source: R/pdf.R

pdf_page_to_imageR Documentation

Convert a single PDF page to an image

Description

Renders one page of a PDF to a PNG file. Uses a temporary directory internally to avoid pdftools filename template issues.

Usage

pdf_page_to_image(pdf_path, page_index, image_dir, dpi = 300, overwrite = TRUE)

Arguments

pdf_path

Path to the PDF file.

page_index

Page number to render (1-indexed).

image_dir

Directory to save the PNG image.

dpi

Resolution in dots per inch (default: 300).

overwrite

Logical; overwrite an existing rendered page. Set to FALSE to reuse it (default: TRUE).

Value

Path to the saved PNG image.

Examples

## Not run: 
img <- pdf_page_to_image("document.pdf", page_index = 1, image_dir = "pages")

## End(Not run)

PaddleOCR documentation built on Aug. 30, 2026, 5:07 p.m.