I'm trying to create a document with printer settings black and white by default, so when the user opens the document and press print button this may be printed in black and white.
- Code: Select all
var documentPath = "C:\document.docx";
Spire.Doc.Document doc = new Spire.Doc.Document(documentPath);
doc.PrintDocument.PrinterSettings.DefaultPageSettings.Color = false;
MemoryStream stream = new MemoryStream();
doc.SaveToStream(stream, Spire.Doc.FileFormat.Docx);
// return stream.ToArray()
This code is inside a function, and returns a byte[] because i'm using this in server side on a apsx page, and this file is going to be sent to the client.
The problem is when the user opens the document and tries to print, the document is being printed with color.
Regards,
JP.