I have a pdf files of size 13.1MB. When print with Acrobat Reader DC, the size of the spool file is 105MB. However, when I try to programatically print with PdfiumViewer, the spool file size become over 500MB and eventually crash the program due to insufficient printer memory.
The code is as follow
var pdfStream = new FileStream("file.pdf", FileMode.Open);
var pdfDocument = PdfDocument.Load(pdfStream);
var printDocument = pdfDocument.CreatePrintDocument();
printDocument.Print();
I'm aware that the pdf file need to be converted to some data format understood by the printer, and the size of the data vary from application to application. My question is, how does Acrobat reduce the spool file size? Does it preprocess the pdf file (compress?) before converting the file to data format understood by the printer?
I'm trying to get some clues and hopefully can reduce spool file size just like Acrobat did.