Reputation: 57
I have a page with a fax button on it... when clicked it uses a dialog to capture the destination of the fax from a drop down list.
What I need to do is apply the print stylesheet and capture the webpage.
I am using RightFax webservice "OpenText" to send the fax.
How do I:
1: capture the HTML and style for the webpage 2: serialize the HTML into a byte array so I can add it as an attachment
using MVC 5 and c#
Thanks in anticipation.
Upvotes: 0
Views: 371
Reputation: 5016
I think you have to base your solution server side. You'll need a page or service that takes a URL as a parameter, it will then need to
--If you can send a BMP byte[] to OpenText--
Use a toolkit like WebKit https://github.com/webkitdotnet/webkitdotnet to render the HTML to an image.
Send the BMP byte[] to OpenText
--If you can't send a BMP byte[] to OpenText--
Use a HTML to PDF converter Convert HTML to PDF in .NET
Send the PDF to OpenText
The main point is that you'll be converting HTML to a binary object server side, and making the call to OpenText from the server too.
Upvotes: 1