Version 1.49.4 (Beta)
Pre-release
Pre-release
Changes
NEW
Apple tvOS supportNEW
Support for PDF creation (1)
NuGet: https://www.nuget.org/packages/SkiaSharp/1.49.4-beta
Notes
Note 1
A PDF file can be created using a SKDocument
and then by drawing using the normal drawing methods:
using (var stream = new SKFileWStream ("document.pdf"))
using (var document = SKDocument.CreatePdf (stream)) {
// the first page
using (var canvas = document.BeginPage (width, height))
using (var paint = new SKPaint ()) {
canvas.DrawText ("...PDF...", 10f, 100f, paint);
document.EndPage ();
}
// the second page
using (var canvas = document.BeginPage (width, height))
using (var paint = new SKPaint ()) {
canvas.DrawText ("...PDF...", 10f, 100f, paint);
document.EndPage ();
}
// all done
document.Close ();
}