Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parakeet provides an easy to use wrapper around headless_chrome that provides an asynchronous function for PDF rendering of HTML documents. This is useful for rendering PDFs in a web server, as launching is slow, therefore should be done once. It controls many tabs at once, thus giving ability to render multiple PDFs at once.

Usage

use std::sync::Arc;
use parakeet_pdf::{
    page_props::PagePropertiesBuilder,
    rendering_engine::RenderingEngine,
};

#[tokio::main]
async fn main() {
    const TAB_COUNT: usize = 5;
    let engine = Arc::new(RenderingEngine::new(TAB_COUNT).unwrap());

    let html = format!("Hello, html!");
    let page_props = PagePropertiesBuilder::from_size(10.0, 10.0).build();   
    let _pdf = engine.render_html(&html, page_props).await.unwrap();
}

About

Rust library for converting HTML to PDF based on chrome

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages