Preview Mistral OCR Page as HTML with Embedded Images
mistral_preview_html.RdThis function creates a complete HTML preview of a Mistral OCR page with embedded images. Unlike mistral_preview_page(), this function embeds images directly in the HTML using base64 data URIs, eliminating the need for the magick package.
Details
This function combines markdown rendering with image embedding to create a complete, self-contained HTML preview. Images are embedded as base64 data URIs, so no external files or image processing libraries are required.
See also
mistral_embed_images for the underlying image embedding function
Examples
if (FALSE) { # \dontrun{
# Preview the first page of an OCR result
result <- mistral_ocr("document.pdf")
mistral_preview_html(result, page_num = 1)
# Use in Shiny
output$ocr_preview <- renderUI({
mistral_preview_html(ocr_result())
})
} # }