Printing Paper Form Using asp.net RRS feed

  • Question

  • User-397120120 posted

    I have a paper form used for the purposes of leaves (period an employee is away from work during the day). This form is filled by the employee by hand, signed and submitted to the supervisor.

    I am almost finished with the design of the form as a web form in asp.net. Now I need to produce a printed output of this form so the employee can sign it and hand it to his supervisor. (We are still a bit off from automating this function)

    Is there a way to produce a printable form of a web form in a manner to guarantee compatibility across different browsers and different configurations?

    Some reporting engines produce a pdf document from a report specification. This pdf document can then be printed thereby guaranteeing compatibility.

    Is there a similar method in asp.net?

    Sunday, June 24, 2018 2:03 PM

All replies

  • User409696431 posted

    You can produce a PDF in asp.net.  There are some free ways to do it, or you could buy a library that would convert a whole page or a whole element within the page simply for you.

      You could also use a print CSS file for that page, which might be a faster solution.  A print CSS file applies only when the page is printed.  It lets you alter the appearance of the page for printing, such as excluding headers and footers and menus (display: none), and so on, and also lets you use units in terms understood by printers but not advised for screens, such as cm, in, or pt.

    You can use media queries in your main CSS (@media print), or, since the print CSS file probably will only apply to that page, add a separate CSS link for it:

    <link rel="stylesheet" type="text/css" media="print" href="yourprint.css">
    Sunday, June 24, 2018 2:57 PM