-
-
Notifications
You must be signed in to change notification settings - Fork 0
Exporting
Aravinda VK edited this page Jul 29, 2026
·
1 revision
Chitra supports exporting to PDF, PNG and SVG formats.
import chitra;
void main()
{
auto ctx = new Chitra(700);
with (ctx)
{
rect(100, 100, 500, 200);
saveAs("rect.pdf");
}
}import chitra;
void main()
{
auto ctx = new Chitra(700);
with (ctx)
{
rect(100, 100, 500, 200);
saveAs("rect.png");
}
}import chitra;
void main()
{
auto ctx = new Chitra(700);
with (ctx)
{
rect(100, 100, 500, 200);
saveAs("rect.svg");
}
}Default resolution is 300. Change the resolution while saving.
saveAs("rect.pdf", resolution: 72);
saveAs("rect.png", resolution: 72);
saveAs("rect.svg", resolution: 72);