WeePecky
WeePecky

Reputation: 57

Fax Current WebPage using RightFax OpenText WebService

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

Answers (1)

Jim W
Jim W

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

  1. Use WebClient to load the website HTML from the URL

--If you can send a BMP byte[] to OpenText--

  1. Use a toolkit like WebKit https://github.com/webkitdotnet/webkitdotnet to render the HTML to an image.

  2. Send the BMP byte[] to OpenText

--If you can't send a BMP byte[] to OpenText--

  1. Use a HTML to PDF converter Convert HTML to PDF in .NET

  2. 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

Related Questions