Converts the interactive HTML report into a static PDF file using headless Chrome. This ensures that the layout matches the HTML view exactly.
Details
This function requires the pagedown package and a strictly local installation
of Chrome or Chromium. It generates a temporary HTML report first, then prints it to PDF.
Examples
example_file <- system.file("extdata", "bcl11a_rs1427407_example.csv",
package = "AlphaVaR")
obj <- av_import_csv(example_file)
#> Reading bcl11a_rs1427407_example.csv ...
print(obj)
#> === AlphaVarSet Object ===
#> Entries: 2,676
#> Variants: 2
#> Modalities: 11
#> Columns: 25 (incl. 19 extra)
#> Score Mode: quantile_score
#> Source: bcl11a_rs1427407_example.csv
# PDF export prints the HTML report through a headless Chrome binary, which
# is absent on check machines, so the call runs interactively only.
if (interactive() && requireNamespace("pagedown", quietly = TRUE)) {
pdf_path <- file.path(tempdir(), "bcl11a_report.pdf")
av_export_pdf(obj, output_file = pdf_path, open = FALSE)
file.exists(pdf_path)
}