问题
I am starting this web app project (asp.net mvc)
It's a document-based system, such that nearly each web page is a model of an official printed form (and users sometimes should be able to produce prints).
I am wondering how much cost and time saving it will be if the form could be a wyswyg page that will serve both electronic and paper audiences.
I know that Adobe Acrobat forms has something like that. Would've have been perfect for my purposes but it's not pluggable -- meaning I don't have a choice as to backend system.
Does anyone know anything out there that renders pdf/like pdf to the printer but has html form submit capabilities?
回答1:
Why not css print media? For example,
<link rel="stylesheet" href="css/printstylesheet.css" media="print" />
You can define both the things in the same page. Something like this,
<link rel="stylesheet" href="css/mainstylesheet.css" media="screen" />
<link rel="stylesheet" href="css/printstylesheet.css" media="print" />
I hope this is you are looking for, not sure though.
An excerpt from the book Pro CSS Technique.
Edited:
CSS print media browser conformance.
回答2:
Check out wkhtmltopdf... FOSS and uses webkit rendering engine (safari, google chrome) to convert from html to pdf... I tried compiling it on windows and I got it to work. Much better than anything else I can find. Supports all the css I can throw at it.
来源:https://stackoverflow.com/questions/580424/wyswyg-html-form-printing