I'm working on a blazor project where I need to convert a PDF document, which is stored as a byte[], into a list of PNG images, also stored as byte[], with each image representing a page from the PDF. The solution needs to be cross-platform (Windows, Linux, macOS) and cannot rely on any paid or non-commercially usable tools.
Here’s what I’m trying to achieve:
Input: A PDF document as a byte[].Output: A List<byte[]> where each byte[] is a PNG image corresponding to a page in the PDF.
Constraints:The solution must be cross-platform.
I cannot use any paid libraries or tools (e.g., Adobe SDK).
The tools/libraries used must be commercially usable (e.g., open-source with permissive licenses like MIT, Apache, etc.).
Code Example (Pseudocode):
byte[] pdfBytes = // PDF document as byte arrayList<byte[]> pngImages = ConvertPdfToPng(pdfBytes);