JFLib

40. PDF, tables, drawings and other files#

These crates come with jflib like the rest, need no window and no GPU to read and write, and bound what a crafted file can cost. Each README has examples and lists what is supported.

CrateWhat it doesREADME
jflib::pdfVector PDFs page by page (Document, Canvas), reading, showing, filling in forms, changing and encrypting existing filespdf
jflib::sheet_ioExcel workbooks and CSV files, in and out as typed tables; formulas are not evaluatedsheet_io
jflib::dxfDXF drawings in ASCII, R12 to 2018; render2d::dxf puts one into a scenedxf
jflib::diagram_core, diagram_io, diagram_viewDiagrams of the Visio kind: the model with its formulas, the VSDX family in and out, the drawingdiagram_core, diagram_io, diagram_view
jflib::formatsJSON, typed JSON records, a bounded part of XML, the text encodings of the web and of old filesformats
use jflib::{pdf, plat};

let mut doc = pdf::Document::new();
let page = doc.add_page(pdf::A4.0, pdf::A4.1); // points, 1/72 inch
let font = doc.add_font(font_bytes, 0)?;       // a .ttf, .otf or a collection's face
doc.canvas(page, pdf::Origin::TopLeft).text(font, 12.0, 50.0, 60.0, "Hello");
let bytes = doc.write()?;
plat::write_file("documents://hello.pdf", &bytes);

Source: docs/GUIDE.md in the JFLib repository.