Skip to content
Loading
  • 0
    you can go with itextsharp dll to generate pdf from your view,
    You can get it from nuget. 
     
    http://www.c-sharpcorner.com/code/3112/generate-pdf-using-itextsharp-in-asp-net-mvc.aspx
     
     
    0
  • 0
    There are many libraries can do this. You can get Free Spire.PDF library from Manage NuGet Packages and then use it to generate or operate PDF file. Here is the guidance for your reference:
    https://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/Spire.PDF-Program-Guide-Content.html 
    0
  • 0
    If you're already saving the receipt to a file in any format, such as plain text, and you want to convert it to PDF, you can try using the Document Converter in the LEADTOOLS toolkit (https://www.leadtools.com/sdk/document/document-converter)
     
    In web API, this can be implemented in JavaScript as follows:
     
    1. var url = "link to your receipt file";  
    2. lt.Documents.DocumentFactory.loadFromUri(url, null)  
    3.    .done(function (document) {  
    4.       var jobData = new lt.Documents.DocumentConverterJobData();  
    5.       jobData.documentFormat = lt.Documents.Writers.DocumentFormat.user;  
    6.       jobData.rasterImageFormat = lt.Documents.RasterImageFormat.rasPdfJpeg;  
    7.       document.convert(jobData)  
    8.          .done(function (result) {  
    9.             var resultDocument = result.document != null ? result.document.url : result.archive.url;  
    10.             window.open(resultDocument);  
    11.          })  
    12.          .fail(function (jqXHR, statusText, errorThrown) {  
    13.             alert("Error converting document " + errorThrown);  
    14.          });  
    15.    })  
    16.    .fail(function (jqXHR, statusText, errorThrown) {  
    17.       alert("Error loading document " + errorThrown);  
    18.    });  
     
    0