{"action":"created","issue":{"url":"https://api.github.com/repos/MrRio/jsPDF/issues/476","labels_url":"https://api.github.com/repos/MrRio/jsPDF/issues/476/labels{/name}","comments_url":"https://api.github.com/repos/MrRio/jsPDF/issues/476/comments","events_url":"https://api.github.com/repos/MrRio/jsPDF/issues/476/events","html_url":"https://github.com/MrRio/jsPDF/issues/476","id":67788349,"number":476,"title":"Image in PDF cut off: How to make a canvas fit entirely in a PDF page?","user":{"login":"gumatias","id":681278,"avatar_url":"https://avatars.githubusercontent.com/u/681278?v=3","gravatar_id":"","url":"https://api.github.com/users/gumatias","html_url":"https://github.com/gumatias","followers_url":"https://api.github.com/users/gumatias/followers","following_url":"https://api.github.com/users/gumatias/following{/other_user}","gists_url":"https://api.github.com/users/gumatias/gists{/gist_id}","starred_url":"https://api.github.com/users/gumatias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gumatias/subscriptions","organizations_url":"https://api.github.com/users/gumatias/orgs","repos_url":"https://api.github.com/users/gumatias/repos","events_url":"https://api.github.com/users/gumatias/events{/privacy}","received_events_url":"https://api.github.com/users/gumatias/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-04-11T14:00:04Z","updated_at":"2015-04-16T20:07:51Z","closed_at":null,"body":"When placing the canvas in the PDF using the jspdf library makes the image cut off.\r\n\r\n    html2canvas(myContainer, {background: 'red'}).then (canvas) ->\r\n      imgData = canvas.toDataURL('image/jpeg', 1.0)\r\n      window.open(imgData) # this is just a test that opens the image in a new tab and it displays nicely, the entire image\r\n      pdf = new jsPDF(\"l\", \"pt\", \"b1\") # tried a variety of formats but no luck\r\n      pdf.addImage(imgData, 'JPEG', 0, 0)\r\n      pdf.save('file.pdf') # the generated pdf that contains the image gets trimmed\r\n\r\nDoes anyone have any ideas how to make the canvas fit?"},"comment":{"url":"https://api.github.com/repos/MrRio/jsPDF/issues/comments/93828290","html_url":"https://github.com/MrRio/jsPDF/issues/476#issuecomment-93828290","issue_url":"https://api.github.com/repos/MrRio/jsPDF/issues/476","id":93828290,"user":{"login":"gumatias","id":681278,"avatar_url":"https://avatars.githubusercontent.com/u/681278?v=3","gravatar_id":"","url":"https://api.github.com/users/gumatias","html_url":"https://github.com/gumatias","followers_url":"https://api.github.com/users/gumatias/followers","following_url":"https://api.github.com/users/gumatias/following{/other_user}","gists_url":"https://api.github.com/users/gumatias/gists{/gist_id}","starred_url":"https://api.github.com/users/gumatias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gumatias/subscriptions","organizations_url":"https://api.github.com/users/gumatias/orgs","repos_url":"https://api.github.com/users/gumatias/repos","events_url":"https://api.github.com/users/gumatias/events{/privacy}","received_events_url":"https://api.github.com/users/gumatias/received_events","type":"User","site_admin":false},"created_at":"2015-04-16T20:07:51Z","updated_at":"2015-04-16T20:07:51Z","body":"Actually, just tried with a larger image/element and even in portrait made the image cut off instead of resizing it to fit in the page. Any ideas? \r\n\r\nIs the best solution resize the image myself to the size of a page before passing it to jsPDF?"}}