0

I have a string variable which contains the source code of a HTML page. I have print this HTML page rendered view using source code string.

I should to print content in a single click and specify few settings like PRINTER NAME, PAGE SIZE, MARGIN and ORIENTATION in the code without showing a dialog

I am trying to print it using C# PrintDocument and WebBrowser control of Windows Form application.

First using WebBrowser WebBrowser is printing properly but I am not able set Printer Settings and PageSettings like PrinterName, Marging, Printing content height & width.

Second: PrintDocument PrintDocumet provide better way for printer settings and page settings but it is print html source code as string not render html view.

The Problem Is

How to print HTML View of give html strings with specifying few settings like PRINTER NAME, PAGE SIZE and MARGIN (Solution should be free)

6
  • i think it was answered here: stackoverflow.com/questions/32197373/… Commented May 20, 2021 at 17:00
  • How to print WebBrowser control content without showing print dialog? Commented May 20, 2021 at 17:30
  • None of the proposed answers explain how to set the Margins, Size and Orientation without using a Print Dialog. Commented May 20, 2021 at 17:31
  • Then set and configure the Default printer beforehand? Then set it back to what it was, eventually. Commented May 20, 2021 at 18:16
  • Consider a nuget package like Aspose Commented May 20, 2021 at 20:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.