Starts in:
1 DAY
21 HRS
31 MIN
33 SEC
Starts in:
1 D
21 H
31 M
33 S
Open Closed

Preview and print in ABP #1991


User avatar
0
Shoba24 created

If you're creating a bug/problem report, please include followings:

  • ABP Framework version: v4.4.2
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

Hi,

This is our invoice form

when clicking preview button ,need to preview form and print(if required) as pdf.

Preview should be in this format

Can u pls suggest idea's to implement this?


5 Answer(s)
  • User Avatar
    0
    berkansasmaz created
    Support Team .NET Developer

    Hi 👋,

    This question doesn't seem to be about ABP, but I still want to share with you a few tips we use in our own kitchen ✌️

    For preview, you can convert the PDF file to JPG and show it to the user.

    For printing we use the PdfSharpCore package. You can check this video about using the package. Basically what is done is to place the data according to the coordinates on PDF.

    I hope this information will help you and you can do what you want more easily 😊

  • User Avatar
    0
    Shoba24 created

    Hi berkansasmaz,

    Thank you for ur valuable answer.

    I referred this ticket https://support.abp.io/QA/Questions/258/How-to-create-a-print-form-correctly, and implemented this in our code..

    Every thing works perfect,no error but still that pdf window is not opening.

  • User Avatar
    0
    berkansasmaz created
    Support Team .NET Developer

    Hi, can't you download when you request via swagger?

    Please give some more code details.

  • User Avatar
    0
    Shoba24 created

    Hi,

    1. Firstly i added this class in web project

    2. download this nuget package -Haukcode Dink to Pdf

    3. Configure this in web module context.Services.AddSingleton(typeof(IConverter), new SynchronizedConverter(new PdfTools())); 4.In createModal.cshtml.cs public IActionResult OnPostPrintAsync([FromBody] PurchaseOrderCreateDto purchaseOrder) {

           return File(_pdfService.CreatePdf(GenerateHtml(purchaseOrder)), "application/pdf");
      

      }

    In web.logs ,

  • User Avatar
    0
    alper created
    Support Team Director

    this is a 3rd party question and nothing to do with the ABP Framework. you can write a PDF just like you do in a standard ASP.NET Core application.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06