79470883

Date: 2025-02-26 19:53:21
Score: 0.5
Natty:
Report link

This is a relatively old question, but this answer could be useful anyway.

I believe what you are looking for is a library I've been working on recently https://github.com/BobLd/PdfPig.Rendering.Skia

It uses SkiaSharp to render pdf documents. At the time of writing the library is still early stage.

Using the following you can get the SKPicture of the page, that you can then draw on a canvas

using UglyToad.PdfPig.Graphics.Colors;
using UglyToad.PdfPig;
using UglyToad.PdfPig.Rendering.Skia;
using SkiaSharp;

[...]

using (var document = PdfDocument.Open(_path))
{
    document.AddSkiaPageFactory(); // Same as document.AddPageFactory<SKPicture, SkiaPageFactory>()

    for (int p = 1; p <= document.NumberOfPages; p++)
    {
        var picture = document.GetPage<SKPicture>(p);
        // Use the SKPicture
    }
}
Reasons:
  • Contains signature (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: bld