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
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

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

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

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    wai created

    Creating a printed invoice, order, order list

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    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/

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • 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?
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    I create an example:

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

    Run application and nav to /test

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    wai created

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

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    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

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    wai created

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

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

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

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    wai created

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

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    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.
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    wai created

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

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    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 : )

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    wai created

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

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • 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/

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 17, 2026, 08:41
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.