Skip to main content

Crate ravenrs_report_pdf

Crate ravenrs_report_pdf 

Source
Expand description

PDF export for RavenRS Reporting: draws a [Document] as vector pages, with subsets of the fonts it was measured with embedded, so the file looks the same everywhere and its text can be selected and searched.

use ravenrs_report::{Band, Control, Report, ReportEngine};
use serde_json::json;

let report = Report::new("Sales").detail(Band::new(18.0).control(Control::field("[Customer]").at(0.0, 0.0, 300.0, 18.0)));
let document = ReportEngine::new().render(&report, &json!([{ "Customer": "Ana" }]));
let pdf = ravenrs_report_pdf::to_pdf(&document)?;
assert!(pdf.starts_with(b"%PDF-"));

Enums§

PdfError
Why a document could not be written as PDF.

Functions§

to_pdf
Writes document as a PDF 1.7 file.