2

I have referred official document of skia: https://learn.microsoft.com/en-us/dotnet/api/skiasharp.skcanvas?view=skiasharp-1.68.1#constructing-a-pdf-document

// create the document
var stream = SKFileWStream.OpenStream("document.pdf");
var document = SKDocument.CreatePdf(stream);

// get the canvas from the page
var canvas = document.BeginPage(256, 256);

// draw on the canvas ...

// end the page and document
document.EndPage();
document.Close();

As per the above code I'm getting canvas, but how can I draw that on my canvas view?

 <skia:SKCanvasView x:Name="canvasViews"/>

Also do I need to use scroll view to display those multiple pages on canvas?

Any help on this appreciated. Thanks.

MShah
  • 1,247
  • 9
  • 14

1 Answers1

0

I think you got the reverse issue as to what SkiaSharp supports. SkiaSharp CREATES PDF files, not renders them.

I do not know of any PDF renderers offhand that I can recommend, but I would start by searching SO or doing a bit of Googling. I see this post: How to render pdfs using C#

Matthew
  • 4,832
  • 2
  • 29
  • 55
  • 1
    Thanks for answering, sure will look into this, and I must say that, when ever we got stuck during this skia sharp learning, your comments on various portals always helped.! Much appreciated your efforts, keep up this good work.! – MShah Dec 31 '19 at 06:16