How to convert a string attribute of a Model containing an XML (Danfe) to PDF (ASP.NET Core)?

Asked

Viewed 10 times

0

I’m sorry if the question wasn’t specific enough, but I’m a beginner in ASP.NET Core. Long story short, I need to have an endpoint that returns a PDF file to the front end of the application, PDF that matches a Danfe. In the respective Controller that handles this Model (cited below), I can already pass the attribute "Xmldanfe" to XML, but the question is how I can get a PDF. What’s the best way to do that?

public class DanfesXml
{
    [JsonPropertyName("XmlDanfe")]
    public string XmlDanfe { get; set; } // já está sendo alimentado através de um WebService
}
  • Felipe, you can use some pdf generation library, search for pdf nuget package this should help you create a pdf, for display you can make a return file type etc, recommend you search for 'Return file . net core on controller'.

  • Please clarify your problem or provide additional details in order to highlight exactly what you need. The way it’s written these days it’s hard to tell exactly what you’re asking.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.