MvcPdfWriter 0.1.0
See the version list below for details.
dotnet add package MvcPdfWriter --version 0.1.0
NuGet\Install-Package MvcPdfWriter -Version 0.1.0
<PackageReference Include="MvcPdfWriter" Version="0.1.0" />
paket add MvcPdfWriter --version 0.1.0
#r "nuget: MvcPdfWriter, 0.1.0"
// Install MvcPdfWriter as a Cake Addin #addin nuget:?package=MvcPdfWriter&version=0.1.0 // Install MvcPdfWriter as a Cake Tool #tool nuget:?package=MvcPdfWriter&version=0.1.0
Render/ Create Pdf using mvc Razor view, Html markup string or metadata elements with x,y & page number co-ordinations. MvcPdfWriter provide pdf writer a base controller "PdfController", you must inherit from PdfController to render view as a pdf document.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net40 is compatible. net403 was computed. net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
- iTextSharp (>= 5.5.0)
- itextsharp.xmlworker (>= 5.5.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
MvcPdfWriter has a "PdfController" base controller, you must inherit from PdfController.
e.g.
[AllowAnonymous]
public class Test1Controller : PdfController
{
[HttpGet]
public ActionResult TestInvoice(int id)
{
var testModel = new
{
To = "Abc",
FAO = " test fao",
RefDate = DateTime.Now.ToShortDateString(),
Name = "Abc",
TradingName = "Xyz",
FunderAddress = "abc road, abc, AB12CD",
TotalCost = 1000,
VAT = 200,
CreditExpiryDate = DateTime.Now.AddMonths(1).ToShortDateString()
};
return ViewPdf(testModel);
}
[HttpGet]
public ActionResult TestInvoice2(int id)
{
var testModel = new
{
To = "Abc",
FAO = " test fao",
RefDate = DateTime.Now.ToShortDateString(),
Name = "Abc",
TradingName = "Xyz",
FunderAddress = "abc road, abc, AB12CD",
TotalCost = 1000,
VAT = 200,
CreditExpiryDate = DateTime.Now.AddMonths(1).ToShortDateString()
};
var metadatas = new List<ElementMetadata>{/*your meta data*/};
return ViewPdf("c:/Temp/InvoiceTemplate.pdf", metadatas, testModel, "c:/Temp/Output/Invoice-1.pdf");
}
}