Skip to content

Base64 image not appearing in pdf_document #2604

@averissimo

Description

@averissimo

Embededed base64 images are not properly rendered in pdf outputs.

note: the image is properly shown on other formats: html, rtf, word, odt

Image

Rmd minimal example file:

---
title: Base64 test
---

There should be an image below.

![](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAFUlEQVR42mP8z8BQz0AEYBxVSF+FABJADveWkH6oAAAAAElFTkSuQmCC)

There should be an image above.

When rendering via rmarkdown::pdf_document() it fails to produce the image.

rmarkdown::render("remove_me.Rmd", output_format = rmarkdown::pdf_document(), clean = FALSE, quiet = FALSE)
session info (click here to expand)
xfun::session_info('rmarkdown')
#> R version 4.5.2 (2025-10-31)
#> Platform: x86_64-pc-linux-gnu
#> Running under: Ubuntu 25.04
#> 
#> Locale:
#>   LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
#>   LC_TIME=en_IE.UTF-8        LC_COLLATE=en_US.UTF-8    
#>   LC_MONETARY=en_IE.UTF-8    LC_MESSAGES=en_US.UTF-8   
#>   LC_PAPER=en_IE.UTF-8       LC_NAME=C                 
#>   LC_ADDRESS=C               LC_TELEPHONE=C            
#>   LC_MEASUREMENT=en_IE.UTF-8 LC_IDENTIFICATION=C       
#> 
#> Package version:
#>   base64enc_0.1.3   bslib_0.9.0       cachem_1.1.0      cli_3.6.5        
#>   digest_0.6.37     evaluate_1.0.3    fastmap_1.2.0     fontawesome_0.5.3
#>   fs_1.6.6          glue_1.8.0        graphics_4.5.2    grDevices_4.5.2  
#>   highr_0.11        htmltools_0.5.8.1 jquerylib_0.1.4   jsonlite_2.0.0   
#>   knitr_1.50        lifecycle_1.0.4   memoise_2.0.1     methods_4.5.2    
#>   mime_0.13         R6_2.6.1          rappdirs_0.3.3    rlang_1.1.6      
#>   rmarkdown_2.30    sass_0.4.10       stats_4.5.2       tinytex_0.57     
#>   tools_4.5.2       utils_4.5.2       xfun_0.52         yaml_2.3.10      
#> 
#> Pandoc version: 3.1.11.1

Checklist

When filing a bug report, please check the boxes below to confirm that you have provided us with the information we need. Have you:

  • formatted your issue so it is easier for us to read?

  • included a minimal, self-contained, and reproducible example?

  • pasted the output from xfun::session_info('rmarkdown') in your issue?

  • upgraded all your packages to their latest versions (including your versions of R, the RStudio IDE, and relevant R packages)?

  • installed and tested your bug with the development version of the rmarkdown package using remotes::install_github("rstudio/rmarkdown") ? (yup, same problem)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions