I'm trying to print a pdf using the built in that chrome uses.
I have a aspx that inherits from Page, on it's Page_Load event, I grab the pdf content as string (then convert it to bytes), and set the Response as follows:
Response.Clear()
Response.ClearContent()
Response.ClearHeaders()
Response.Buffer = bufferOutputStream
Response.BufferOutput = bufferOutputStream
Response.ContentType = "application/pdf"
Response.AddHeader("content-length", pdfBytes.Length.ToString)
Response.AddHeader("content-disposition", "inline; filename=" & fileName & ".pdf")
Response.CacheControl = "no-cache"
Response.Expires = -1
Response.BinaryWrite(pdfBytes)
Response.Flush()
When I press the print button I have the following error:

I tried to use print(); on the Top (Extension) in the console, but it wants to print a capture of the window instead of the content of the pdf.
I tried IE, Edge, Chrome Version 90, Firefox, Brave, both normal and Incognito, without any extensions and cache/nav history cleared and they work. Strangely enough, Brave uses The same Chromium version (Version 1.35.103 Chromium: 98.0.4758.102 (Official Build) (64-bit)).