How to download React JSX to PDF

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ต.ค. 2024

ความคิดเห็น • 41

  • @Copt774
    @Copt774 4 วันที่ผ่านมา

    Awesome. Just what i was looking for!

  • @mounis
    @mounis ปีที่แล้ว

    Really appreciate sharing GitHub link, most people forget to do that!

  • @bryanodinadev
    @bryanodinadev 9 หลายเดือนก่อน

    This is really great! Thank you so much man! Keep creating videos!

  • @zafarishaq9445
    @zafarishaq9445 ปีที่แล้ว +1

    Thankyou for saving my time, really appreciate it

  • @grx4.067
    @grx4.067 ปีที่แล้ว

    thanks so much bro your video saved me

  • @fredtchiadeu1089
    @fredtchiadeu1089 8 หลายเดือนก่อน

    Thanks. I'm having an issue. On small screen my receipt don't look good. Should we make a responsive design for that ? That will give another problem, we want only one pdf design for all devices

    • @JSSolutions
      @JSSolutions  8 หลายเดือนก่อน

      Receipt design should be consistent for every device, try to create your design in a popup or something like that

  • @JeswinJ-ey8kh
    @JeswinJ-ey8kh 6 หลายเดือนก่อน

    By using this can we also create dynamic pdf's?

    • @JSSolutions
      @JSSolutions  6 หลายเดือนก่อน

      You certainly download dynamic JSX, you can also draw the pdf using html2canvas but it is going to be a lot of work

  • @jayantpapola
    @jayantpapola ปีที่แล้ว

    Thank you so much for this video brother

  • @ahadhossain2597
    @ahadhossain2597 ปีที่แล้ว

    Nice bro

  • @pramodrawat9113
    @pramodrawat9113 ปีที่แล้ว +4

    This is not the right approach.....it's an image ..
    1. can't copy text from pdf file.
    2. If there is scrolling you won't be able to capture full content

    • @MentalMusings-1
      @MentalMusings-1 ปีที่แล้ว +1

      do you know how can we do that?

    • @rodrigocastro3934
      @rodrigocastro3934 ปีที่แล้ว

      have you found a solution? to get real pdf with several pages?

    • @vivekjaiswal2422
      @vivekjaiswal2422 10 หลายเดือนก่อน +1

      I am also facing the same issue in my project and it's a blocker. 😢😢

    • @gustavosilva3107
      @gustavosilva3107 8 หลายเดือนก่อน

      Have you found a solution?

  • @Viosa-ajay
    @Viosa-ajay 10 หลายเดือนก่อน

    Really appreciate this but can you find other way without using canvas like without using image based approach is there any other way? Well there has to be but i tried like all the libs but facing issue in margin or formatting or in designing. Can you help?

    • @JSSolutions
      @JSSolutions  10 หลายเดือนก่อน +1

      I will try

    • @Viosa-ajay
      @Viosa-ajay 10 หลายเดือนก่อน

      @@JSSolutions Yes Pls, Do try. I have tried using jspdf but it has multi page issue in margin. I also tried using kendopdf but its too much expensive.

  • @Awesomesauce699
    @Awesomesauce699 9 หลายเดือนก่อน

    I’m having a problem with my pdf not looking right. I’m missing certain inputs and etc. I tried changing it to landscape and I got everything now but the content is so squished. Wonder if there is a way to fix it.

    • @JSSolutions
      @JSSolutions  9 หลายเดือนก่อน

      What are you developing?

    • @Awesomesauce699
      @Awesomesauce699 9 หลายเดือนก่อน

      @@JSSolutionsit’s a webpage that basically people want when approved a pdf is created and emailed to people. I’ve messed with different settings but can’t get the pdf to look correct. I’ve gotten it kind of close but it still cuts off the bottom of the page so I’m about to just give up at this point and call it good enough.

  • @vivekjaiswal2422
    @vivekjaiswal2422 7 หลายเดือนก่อน

    what if page will be lengthy and we dont know how many pages will come in HTML?

    • @JSSolutions
      @JSSolutions  7 หลายเดือนก่อน

      You mean something dynamic? Explain your usecase, I will try to replicate the issue and try to comeup with a solution

  • @gokuu_427
    @gokuu_427 5 หลายเดือนก่อน

    this is working but the logo is not rendered when i generate to pdf.any idea why is it happening??

    • @JSSolutions
      @JSSolutions  5 หลายเดือนก่อน

      Check in console if your getting an CORS error

  • @adnanhassan2070
    @adnanhassan2070 ปีที่แล้ว

    Thank you

  • @shaikhmohdnoman5340
    @shaikhmohdnoman5340 ปีที่แล้ว

    easiest tutorial ever

  • @tejasjani2544
    @tejasjani2544 3 หลายเดือนก่อน

    nice but, but this will not work in real-world problems , pdf should be selectable. but in your solution pdf download as image pdf.

    • @JSSolutions
      @JSSolutions  3 หลายเดือนก่อน

      You mean selecting a portion of jsx or what?

  • @sahilkhan-dt2ln
    @sahilkhan-dt2ln ปีที่แล้ว

    thanks.

  • @g3zeck485
    @g3zeck485 7 หลายเดือนก่อน

    Helo i have this error "incomplete or corrupt png file" Does anyone know the solution?

    • @JSSolutions
      @JSSolutions  7 หลายเดือนก่อน

      It means the image is not there during process. Make sure to wait for the image to be ready before converting it to pdf

  • @aleksandrmatyka3118
    @aleksandrmatyka3118 ปีที่แล้ว

    But why not ref?

  • @Shipon_Dev
    @Shipon_Dev 7 หลายเดือนก่อน

    It is not working my project

    • @JSSolutions
      @JSSolutions  7 หลายเดือนก่อน

      What is happening?

  • @ABHISEKSUBHAMqw
    @ABHISEKSUBHAMqw ปีที่แล้ว

    I need dynamic PDF is there any solution for this ?

    • @JSSolutions
      @JSSolutions  ปีที่แล้ว

      I think you can create dynamic pdf with this approach if that is what you meant. I have done it in my projects.

  • @thecodelife9855
    @thecodelife9855 ปีที่แล้ว

    It was giving me errors in capture so i had to write it like this :
    const downloadPDF = () => {
    const capture = document.querySelector('.actual-certificate');
    if (capture) {
    setLoader(true);
    html2canvas(capture as HTMLElement).then((canvas) => {
    const imgData = canvas.toDataURL('img/png');
    const doc = new jsPDF();
    const componentWidth = doc.internal.pageSize.getWidth();
    const componentHeight = doc.internal.pageSize.getHeight();
    doc.addImage(imgData, 'PNG', 0, 0, componentWidth, componentHeight);
    setLoader(false);
    doc.save('certificate.pdf');
    });
    }
    };
    P.S , the images didn't download. only the text in my case.

  • @BenGamingBD
    @BenGamingBD ปีที่แล้ว

    this give me screenshort