Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is jsPDF outputing data loss after 8page ~? #2890

Closed
GaeTaeng opened this issue Aug 31, 2020 · 2 comments
Closed

Why is jsPDF outputing data loss after 8page ~? #2890

GaeTaeng opened this issue Aug 31, 2020 · 2 comments

Comments

@GaeTaeng
Copy link

GaeTaeng commented Aug 31, 2020

**I want make Multiple PDF page, and it can make pdf with form but it can't get html data after 8page ~

i don't know why data loss

help,,,, please

7Page have contents Data and under name Data

8Page have contents Data but loss name Data

9Page loss Contents Data and have name Data

10~ loss Contents Data and loss Name Data ..**

            await html2canvas(document.getElementById('pages'), {scale: 2}, {
                dpi: 2000,
                allowTaint: false,
                useCORS: true, 
            }).then (async function (canvas) {
                let imgData = canvas.toDataURL();  


                    // let imgData = this.canvasResolutionAdj(canvas)
                    let ctx = canvas.getContext('2d');
                    ctx.webkitImageSmoothingEnabled = false;
                    ctx.mozImageSmoothingEnabled = false;
                    ctx.imageSmoothingEnabled = false;

                    let imgHeight = canvas.height * pageWidth / canvas.width; 


                    for(j; j < len; j++) { 
                        pdf.setPage(j+1);
                        pdf.addImage(imgData, "PNG", 0, -1*(pageHeight * j), pageWidth,pageHeight*len, undefined, 'FAST', 0)
  
                    console.log(j, "END " + j)
                    if(j < len-1)pdf.addPage() 

                    } 
                }

Under 7Page Normal PDF
스크린샷 2020-08-31 오전 10 55 22

under 8Page have Contents Data / loss Name Data
스크린샷 2020-08-31 오전 10 56 03

under 9Page loss Contents Data / hava Name Data(김태훈)
스크린샷 2020-08-31 오전 10 57 16

under front Code / React enter image description here
스크린샷 2020-08-31 오전 11 02 19

Feature requests, bug reports etc. are very welcome as issues. But questions are directed to stackoverflow with the tag jspdf.

If you are facing issues with utf-8 characters, please refer to #2677.

Note that bug reports should follow these guidelines:

  1. A bug should be reported as an mcve
  2. Make sure code is properly indented and formatted (Use ``` around code blocks)
  3. Provide a runnable example.
  4. Try to make sure and show in your issue that the issue is actually related to jspdf and not your framework of choice your setup.
@HackbrettXXX
Copy link
Collaborator

Which version of jsPDF do you use? This seems like a bug that was fixed with 2.0.0 (#2793).

@GaeTaeng
Copy link
Author

GaeTaeng commented Sep 1, 2020

oh that html2canvas error
I'm sorry, my mistake.
I'm going to ask html2canvas . 👍

_image

After listening to your advice, I upgraded to version 2.1.0, but the phenomenon is still present.

Which version of jsPDF do you use? This seems like a bug that was fixed with 2.0.0 (#2793)._

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants