1

I wanna to convert Html into pdf and save it, I was able to achieve that doing a webview with the HTML and print it, but this is a manually process, I need this to be automatic, without any action.

I used iTextSharp to do that, with a custom renderer (natively on android), and I have the following code to generate my webView and then print

Control.LoadDataWithBaseURL("file:///android_asset/", new razorModel { Model = Model.MyModel.Instance }.GenerateString(), "text/html", "UTF-8", null);
string fileName = "MyPrint_" + Guid.NewGuid().ToString() + ".pdf";
var printAdapter = Control.CreatePrintDocumentAdapter(fileName);
printManager.Print("MyPrintJob", printAdapter, null);

This is working, but I need other way to do that without doing print, anyone can help me ?

micael cunha
  • 503
  • 5
  • 24

0 Answers0