I have this asp.net mvc C# project that returns a downloadable pdf file with A5 page size, and everything seems fine, but when I open the downloaded file and proceed to the print dialog box, I don't get the A5 sheet size by default, but Letter.
What am I missing? Is there a way to achieve this?
Here's the code, thanks in advance:
MemoryStream ms = new MemoryStream();
PdfWriter pw = new PdfWriter(ms);
PdfDocument pdfDocument = new PdfDocument(pw);
Document doc = new Document(pdfDocument, PageSize.A5.Rotate());
doc.SetMargins(5, 5, 5, 5);
//Here I add the content...
doc.Close();
byte[] bytesStream = ms.ToArray();
ms = new MemoryStream();
ms.Write(bytesStream, 0, bytesStream.Length);
ms.Position = 0;
return File(ms, "application/pdf", ID + ".pdf");