Skip to main content

canvas_print_pdf

Function canvas_print_pdf 

Source
pub fn canvas_print_pdf(filename: &str) -> i32
Expand description

Export the current canvas content as a PDF file.

Renders canvas draw commands (rectangles, text, lines, circles, arcs, beziers, rounded rects) to a vector PDF saved in the Downloads directory. Images, gradients, transforms, clipping, and opacity are not yet supported — use download_data with a self-rendered image for those.

The output filename is auto-generated with a timestamp.

Returns 0 on success, -1 on failure.