Generate PDF in dot net core web API | Create Invoice PDF in .NET CORE 6.0 Web API

Поділитися
Вставка
  • Опубліковано 20 вер 2024

КОМЕНТАРІ • 107

  • @AbhijeetDorge-z5j
    @AbhijeetDorge-z5j 9 місяців тому +1

    getting error as => One or more errors occurred. (The type initializer for 'PdfSharpCore.Utils.FontResolver' threw an exception.)

    • @NihiraTechiees
      @NihiraTechiees  9 місяців тому

      Have you followed all steps?

    • @digantadas9630
      @digantadas9630 7 місяців тому

      I also faced this error in spite of following all the steps. Any resolution to this exception?
      I am working with azure functions in windows platform.

  • @enjoytheday513
    @enjoytheday513 11 місяців тому

    Super Bro, thanks for the video.. congralations for more videos

  • @MTSightseeing
    @MTSightseeing 2 місяці тому

    Can I use your method to generate offer letter etc in dotnet core api and angular which is fully customisable dynamic content

  • @vinisyx
    @vinisyx Рік тому

    very good video! so important to my studies! congratulations!

  • @DhruviLad-p6d
    @DhruviLad-p6d Рік тому +1

    I have used your code in my project. but its give me error. like "The type initializer for 'PdfSharpCore.Utils.FontResolver' threw an exception". can you please give me solution for that.

    • @NihiraTechiees
      @NihiraTechiees  Рік тому

      Follow the steps in the video, source code is just for reference

    • @DhruviLad-p6d
      @DhruviLad-p6d Рік тому

      @@NihiraTechiees I have followed your steps but when code is execute this line "PdfGenerator.AddPdfPages(document, htmlcontent, PageSize.A4);" that time error is occurred.

  • @NakibAkash
    @NakibAkash Рік тому

    Can you show us an example where it will make pdf from a controller action view. Cause I try this it is not working perfectly. Somewhere some pages may missing. Any suggestion?

  • @BinaryBeta
    @BinaryBeta Рік тому +1

    nice explained ! can you guide us how to create dynamic editable pdf from sql server database in dot net core? means binding data from sql server db and display it on pdf and that pdf should be editable as well? Thanks

  • @marciliojrr
    @marciliojrr 9 місяців тому

    Hi!
    First, great video! Thanks for sharing this content with us.
    I have a question.
    I always think about security in my projects, so I am somewhat hesitant to use packages from another author instead Microsoft or others that we already know. The question is: Is it safe to use these packages for professional projects?

    • @NihiraTechiees
      @NihiraTechiees  9 місяців тому +1

      It's open souce only also around 10M people were using anyway just go through the license area.... My point of view we can use

    • @marciliojrr
      @marciliojrr 9 місяців тому

      @@NihiraTechiees True... I hadn't thought about it that way. Thank you very much!

  • @PrabhuShaju
    @PrabhuShaju Рік тому

    Well done bro keep going on...

  • @VijayKumar-fq4ie
    @VijayKumar-fq4ie Рік тому

    Wow good one. 🙏🏻

  • @nazmulhyder8695
    @nazmulhyder8695 Рік тому

    Internal server error after deploying iis… how can i solve it??

    • @NihiraTechiees
      @NihiraTechiees  Рік тому

      Can you confirm ,it's working in local?

    • @cansugoren2232
      @cansugoren2232 Рік тому

      I have got internal server error too after deploying kubernates server how can i fix this?

  • @dineshkumar-d2j8y
    @dineshkumar-d2j8y Рік тому

    how to create in visual studio code ,
    tamil la oru video podunga sir ,modles &dbcontext&controllers example videos pls

    • @NihiraTechiees
      @NihiraTechiees  Рік тому

      ua-cam.com/play/PLfyWdpsiUiPDcTp8SucoyN4nX1JW_Hgcm.html
      Follow this series. It's in English only, I don't have much time to make tamil version

  • @MichaelCapiliEla
    @MichaelCapiliEla Рік тому

    hi Nihira, can we save the MVC view as pdf instead of creating HTML?

    • @NihiraTechiees
      @NihiraTechiees  Рік тому

      I believe yes, bcoz it's expecting html content as input.
      Please try if you found any error let me know

    • @MichaelCapiliEla
      @MichaelCapiliEla Рік тому

      Thinking how can I assign the view to HTML variable or should I copy line by line. I am losing the bootstrap formatting when I do. Can you add bootstrap as styling?

  • @GauravKumar-bk7hh
    @GauravKumar-bk7hh 7 місяців тому

    can we use post request? because i want to get pdf if i pass some string and it will print that_string.pdf

  • @Afoxrer
    @Afoxrer 10 місяців тому

    Can we send any chinese text via html to pdf.....please sugg.

    • @NihiraTechiees
      @NihiraTechiees  10 місяців тому

      Yes. Please follow same step if you find any problem let me know

  • @kentrusselpayumo2572
    @kentrusselpayumo2572 Рік тому

    can you make from GraphQL to PDF instead of from HTML?

  • @gabrielnzete8913
    @gabrielnzete8913 Рік тому

    if i have millions of users will saving to memory stream be ideal? My second question is, how can we add background image to the generated pdf file

    • @NihiraTechiees
      @NihiraTechiees  Рік тому

      1, I hope it will support n number of users
      2, follow this video ua-cam.com/video/OmkrwACAYh8/v-deo.html
      Here I just added image in pdf the same way you can set as background image

  • @vinisyx
    @vinisyx Рік тому

    can I change the font family throught the html content? I have been trying this but I cant.

    • @NihiraTechiees
      @NihiraTechiees  Рік тому

      Yes. I believe the library will support limited items

  • @flowrlds
    @flowrlds 11 місяців тому

    Bro is the better way to create pdf docs from html? I search for lts solution...

    • @NihiraTechiees
      @NihiraTechiees  11 місяців тому

      Yes. It's one of the best solution 👍

  • @amitkumarpant9520
    @amitkumarpant9520 Рік тому

    Pdf is not completely generating, its half, is there any configuration, there are only 2 page rendering whereas there are 5-6 pages

    • @NihiraTechiees
      @NihiraTechiees  Рік тому +1

      Can you share the html content that you used through mail, I will check & let you know

    • @amitkumarpant9520
      @amitkumarpant9520 Рік тому

      @@NihiraTechiees Here I have sent an email to you with attached html, this html is not completely rendering in pdf, It can have more sections

    • @amitkumarpant9520
      @amitkumarpant9520 Рік тому

      @@NihiraTechiees The above issue has been resolved, this is because of the wrong tags in html, now the only issue I am facing is that, the content is breaking between 2 pages.

    • @umeshshelke725
      @umeshshelke725 Рік тому

      @@NihiraTechiees can I get your email address ? want to connect with you

  • @MichaelCapiliEla
    @MichaelCapiliEla Рік тому

    Cool. Can you save it to a server side folder?

    • @NihiraTechiees
      @NihiraTechiees  Рік тому +1

      Yes, since we have memory stream we can write file in the server path

    • @MichaelCapiliEla
      @MichaelCapiliEla Рік тому

      Wow cool. I guess I need to learn memory stream then. Thanks!

  • @nkolanu
    @nkolanu 8 місяців тому

    Hi Nihira, First of all thanks for sharing the content it helped me to create pdf in blazor. I need some open source library which should create pdf from Mobile(Android,IOS) using MAUI. I have trie using your code in MAUI it got worked in windows but when I run in andriod I got exception called "System.InvalidOperationException: Cannot save a PDF document with no pages.
    at PdfSharpCore.Pdf.PdfDocument.DoSave(PdfWriter writer)
    at PdfSharpCore.Pdf.PdfDocument.Save(Stream stream, Boolean closeStream)" can you help me out on this? the exception got occure while save the doc.Save(stream)

    • @NihiraTechiees
      @NihiraTechiees  8 місяців тому

      For Android and ios you can use some other library

  • @kelvincabezas
    @kelvincabezas 4 місяці тому

    Where is located the Database ?

    • @NihiraTechiees
      @NihiraTechiees  4 місяці тому

      if you have existing database you can use

  • @tlearner
    @tlearner Рік тому

    when i try to aading bootstrap 5 its not working can u please help me

    • @NihiraTechiees
      @NihiraTechiees  Рік тому

      Please use inline style. It's never work with external css files

  • @ronyolazabal6589
    @ronyolazabal6589 Рік тому

    In Production error: The type initializer for 'PdfSharpCore.Utils.FontResolver' threw an exception.||Could not find a part of the path '/usr/share/fonts/truetype'

    • @NihiraTechiees
      @NihiraTechiees  Рік тому

      Provide the exact file path then it will work. Currently it's choosing some path but it's not available that's why this error

    • @ronyolazabal6589
      @ronyolazabal6589 Рік тому

      public async Task GeneraPDFExclusion(List parametrosInvalidos, string invoice)
      {
      var salida = new MensajeSalida();
      var document = new PdfDocument();
      string HtmlContent = "hello world";
      PdfGenerator.AddPdfPages(document, HtmlContent, PageSize.A4);
      byte[]? response = null;
      using (MemoryStream ms = new MemoryStream())
      {
      document.Save(ms);
      response = ms.ToArray();
      }
      var resultado = Convert.ToBase64String(response);
      salida.Respuesta = resultado;
      return salida;
      }

    • @ronyolazabal6589
      @ronyolazabal6589 Рік тому

      this is my code it works locally but in azure cloud it doesn't work

    • @ronyolazabal6589
      @ronyolazabal6589 Рік тому

      server linux

    • @digantadas9630
      @digantadas9630 7 місяців тому

      @@NihiraTechiees I also faced this error in spite of following all the steps. Any resolution to this exception?
      I am working with azure functions in windows platform.

  • @tlearner
    @tlearner Рік тому

    can we use this pdfsharp in mvc project

  • @malithiroshan9394
    @malithiroshan9394 Рік тому

    does it also work with .NET CORE 7.0 Web API ?

  • @chamithhcompute
    @chamithhcompute Рік тому

    Why would ever you pay for a new MS Office package if still 2007 version gets your job done?

    • @NihiraTechiees
      @NihiraTechiees  Рік тому

      Notes for my reference, even I can use notepad also. Do you have any issue seeing MS Office 2007

  • @ابومحمد-ن7غ4ز
    @ابومحمد-ن7غ4ز Рік тому

    how to change size from A4 to POS invoice

    • @NihiraTechiees
      @NihiraTechiees  Рік тому

      I don't think we don't have direct option, let me check

  • @vinisyx
    @vinisyx Рік тому

    good good

  • @ashimbera23
    @ashimbera23 11 місяців тому

    How do we add custom font??

    • @NihiraTechiees
      @NihiraTechiees  11 місяців тому

      You can include in the part of dynamic html generation

  • @PrabhuShaju
    @PrabhuShaju Рік тому

    Make angular video with datatable grid

  • @JJ-np9sg
    @JJ-np9sg Рік тому

    Cheer Up!!

  • @cissemy
    @cissemy Рік тому

    Great
    Is it possible to add the logo ?

    • @NihiraTechiees
      @NihiraTechiees  Рік тому

      Yes . I created separate video for adding images (logo)

    • @cissemy
      @cissemy Рік тому

      @@NihiraTechiees
      Where is the link for that video ?
      Thanks

    • @NihiraTechiees
      @NihiraTechiees  Рік тому

      ua-cam.com/video/OmkrwACAYh8/v-deo.html

  • @minimal-tools
    @minimal-tools Рік тому

    10/10

  • @usermommooo
    @usermommooo Рік тому

    does that support arabic language ?

  • @venkatprem7942
    @venkatprem7942 Рік тому

    Will this work in Linux

  • @rodrigomartins2
    @rodrigomartins2 Рік тому

    How can I insert an image with html in the pdf?

    • @NihiraTechiees
      @NihiraTechiees  Рік тому +1

      We can handle by adding img tag, In my next video will cover this one also

    • @rodrigomartins2
      @rodrigomartins2 Рік тому

      @@NihiraTechiees Thanks!

    • @NihiraTechiees
      @NihiraTechiees  Рік тому

      Video will be available Today 7.30 IST

  • @ابومحمد-ن7غ4ز
    @ابومحمد-ن7غ4ز Рік тому

    how to change dir from right to left

  • @jobins8752
    @jobins8752 Рік тому

    super bro

  • @rahul139
    @rahul139 Рік тому

    File error in last

    • @NihiraTechiees
      @NihiraTechiees  Рік тому

      Are you getting error? Please cross check the GitHub source code

  • @aleatoryfella1201
    @aleatoryfella1201 Рік тому

    hello gays?