{"action":"opened","issue":{"url":"https://api.github.com/repos/kangax/fabric.js/issues/2457","labels_url":"https://api.github.com/repos/kangax/fabric.js/issues/2457/labels{/name}","comments_url":"https://api.github.com/repos/kangax/fabric.js/issues/2457/comments","events_url":"https://api.github.com/repos/kangax/fabric.js/issues/2457/events","html_url":"https://github.com/kangax/fabric.js/issues/2457","id":104205422,"number":2457,"title":"Is it possible to trim the canvas to the size of the drawing inside it?","user":{"login":"abnersouza","id":3270632,"avatar_url":"https://avatars.githubusercontent.com/u/3270632?v=3","gravatar_id":"","url":"https://api.github.com/users/abnersouza","html_url":"https://github.com/abnersouza","followers_url":"https://api.github.com/users/abnersouza/followers","following_url":"https://api.github.com/users/abnersouza/following{/other_user}","gists_url":"https://api.github.com/users/abnersouza/gists{/gist_id}","starred_url":"https://api.github.com/users/abnersouza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abnersouza/subscriptions","organizations_url":"https://api.github.com/users/abnersouza/orgs","repos_url":"https://api.github.com/users/abnersouza/repos","events_url":"https://api.github.com/users/abnersouza/events{/privacy}","received_events_url":"https://api.github.com/users/abnersouza/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-01T07:38:15Z","updated_at":"2015-09-01T07:38:15Z","closed_at":null,"body":"Hi guys,\r\n\r\nI'm not reporting a bug, is more a question.\r\n\r\nI'm using the canvas with drawing, I created a control similar to an electronic signature. When I export the canvas to Svg, I would like to have the canvas cropped to the exactly size of the signature, because in code I have the crop method but requires too much memory.\r\n\r\nWhat I found so far:\r\n\r\n1)canvas.relatedTarget.width and canvas.relatedTarget.height, that one doesn't work for me because one get the size of the last draw path.\r\n\r\n2)canvas.getObjects(), doesn't work as well because in that case i can get each element width and height but not the total height and width.\r\n\r\nMy idea would be, to get the signature total height and width, then resize the canvas to that size, and move the paths to be centralized in canvas. Because I need to keep the same signature.\r\n\r\nSomeone know if there is any way to trim \r\n\r\nthe canvas to have only the paths? And in this case export to SVG the canvas to the exactly signature size? \r\n\r\n![signature_image](https://cloud.githubusercontent.com/assets/3270632/9598580/c227140a-5084-11e5-8565-edd94fc14129.PNG)\r\n\r\nThanks"}}