Spool - Microsoft Print to PDF, Microsoft XPS Document Writer - Error in converting SPL file to Image C#

Elanchezhiyan P 100 Reputation points
2023-02-09T11:31:12.2266667+00:00

How to convert the SPL (spool) files to list of images?

 var filePath = @"C:\Windows\System32\spool\Printers\0001.SPL";
     using (var xpsConverter = new Xps2Image(filePath))
     {
        List<Bitmap> PageImages = xpsConverter.ToBitmap(
            new Parameters
            {
               ImageType = ImageType.Png,
               Dpi = 96
            }
        ).ToList();

I'm trying to convert the SPL file to list of PNG image.

Note: These SPL files are spool files which are generated using Microsoft Print to PDF, Microsoft XPS Document Writer.

Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
5,822 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,341 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.