Open Closed

How to create a print form correctly? #258


User avatar
0
wai created

Could you please give an example and a rule for creating a document form for printing in ABP?


  • ABP Framework version: v2.9.0
  • UI type: MVC
  • Tiered (MVC) or Identity Server Seperated (Angular): no

15 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Can you explain in detail? Do you mean export ppt?

  • User Avatar
    0
    wai created

    Creating a printed invoice, order, order list

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    ABP has no restrictions on this, you can use any way you favorite.

    LIke : https://blog.elmah.io/generate-a-pdf-from-asp-net-core-for-free/

  • User Avatar
    0
    wai created
    1. I installed the NuGet package:
    Install-Package Wkhtmltopdf.NetCore
    
    1. Called the AddWkhtmltopdf method in the ConfigureServices method in Startup.cs
    2. I downloaded the latest version of wkhtmltopdf for Windows from https://wkhtmltopdf.org and placed it in the wkhtmltopdf \ Windows directory in the project folder Where in which controller do I need to call the constructor?
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    I create an example:

    https://github.com/liangshiw/AbpVext.PdfDemo

    Run application and nav to /test

  • User Avatar
    0
    wai created

    Your example does not work; the test controller does not see

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    It doesn't show up in the Swagger and you can navigate directly to /test in the browser

    source code : https://github.com/liangshiw/AbpVext.PdfDemo/blob/master/Pdf.Demo/aspnet-core/src/Pdf.Demo.HttpApi/Controllers/TestController.cs

  • User Avatar
    0
    wai created

    The fact of the matter is that I do not have the skill in swagger

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    It's strange, I updated the code, now you can call the API in swagger

  • User Avatar
    0
    wai created

    Please update your solution on github, it seems to me that you push an incomplete solution

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi, I updated the code

    Steps:

    * Download the project
    * Run the `.DbMigrator` project
    * Run the `.Web` project
    * Navigate  to `/swagger` and find test API.
    
  • User Avatar
    0
    wai created

    I did everything step by step but unfortunately there is no test in swagger :(

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi, I updated the project again and added the invoice template:

    If there is still a problem, I can help you remotely.

    Have a nice day : )

  • User Avatar
    0
    wai created

    Thanks now it works :) We will understand. Have a nice day

  • User Avatar
    0
    alper created
    Support Team Director

    I'm closing this question.

    You can also use PdfSharpCore library if you want to generate PDF in cross-platform. https://www.nuget.org/packages/PdfSharpCore/

Made with ❤️ on ABP v9.1.0-preview. Updated on November 01, 2024, 05:35