Skip to content

Commit

Permalink
Minor changes - one pagination file for PDF documents
Browse files Browse the repository at this point in the history
  • Loading branch information
KrzysztofPajak committed Sep 13, 2021
1 parent fea0c05 commit 3ba9870
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 84 deletions.
10 changes: 5 additions & 5 deletions src/Business/Grand.Business.Common/Services/Pdf/WkPdfService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
namespace Grand.Business.Common.Services.Pdf
{
/// <summary>
/// Generate invoice products , shipment as pdf (from html template to pdf)
/// Generate invoice, shipment as pdf (from html template to pdf)
/// </summary>
public class WkPdfService : IPdfService
{
private const string _orderTemaplate = "~/Views/PdfTemplates/OrderPdfTemplate.cshtml";
private const string _shipmentsTemaplate = "~/Views/PdfTemplates/ShipmentPdfTemplate.cshtml";
private const string _orderFooter = "pdf/footers/order.html";
private const string _shipmentFooter = "pdf/footers/shipment.html";
private const string _paginationFooter = "assets/pdf/pagination.html";

private readonly IGeneratePdf _generatePdf;
private readonly IViewRenderService _viewRenderService;
private readonly ILanguageService _languageService;
Expand Down Expand Up @@ -50,7 +50,7 @@ public async Task PrintOrdersToPdf(Stream stream, IList<Order> orders, string la
{
PageSize = Wkhtmltopdf.NetCore.Options.Size.A4,
PageMargins = new Wkhtmltopdf.NetCore.Options.Margins() { Bottom = 10, Left = 10, Right = 10, Top = 10 },
FooterHtml = CommonPath.WebHostMapPath(_orderFooter)
FooterHtml = CommonPath.WebHostMapPath(_paginationFooter)
});

var html = await _viewRenderService.RenderToStringAsync<(IList<Order>,string)>(_orderTemaplate, new (orders, vendorId));
Expand Down Expand Up @@ -92,7 +92,7 @@ public async Task PrintPackagingSlipsToPdf(Stream stream, IList<Shipment> shipme
{
PageSize = Wkhtmltopdf.NetCore.Options.Size.A4,
PageMargins = new Wkhtmltopdf.NetCore.Options.Margins() { Bottom = 10, Left = 10, Right = 10, Top = 10 },
FooterHtml = CommonPath.WebHostMapPath(_shipmentFooter)
FooterHtml = CommonPath.WebHostMapPath(_paginationFooter)
});

var html = await _viewRenderService.RenderToStringAsync<IList<Shipment>>(_shipmentsTemaplate, shipments);
Expand Down
38 changes: 0 additions & 38 deletions src/Web/Grand.Web/wwwroot/pdf/footers/products.html

This file was deleted.

41 changes: 0 additions & 41 deletions src/Web/Grand.Web/wwwroot/pdf/footers/shipment.html

This file was deleted.

0 comments on commit 3ba9870

Please sign in to comment.