javascript - Html5 canvas size to print size -
have 1 small issue though have searched blogs, articles, , stackoverflow questions there still small confusion thought put question.
need adjust canvas printing, how can ? maximum limit printing 6.50' x 15.75' (inches), size can vary in range. if not wrong dpi irrespective of screens (they more useful printing devices) on working how can dominate size on canvas? e.g.
6.50 * 72 = 468 px 15.75 * 72 = 1134 px
or 6.50 * 96 = 624 px 15.75 *96 = 1512 px
or 6.50 * 300 = 1950 px 15.75 * 300 = 4725 px
my work area canvas cannot exceeded more 703px x 391px; need adjust canvas size exact required printing? or missing something? scale factor considered drawing in confined region , printing on various sizes. suggestions or links grateful.
thanks
ps: using fabricjs canvas stuff.
fabric js helps in providing zoom factor.
you can define canvas big need, limit respecting aspect ratio of print size.
let's want print 6 x 15 inch sheet.
you define canvas in aspect ration of 6/15 2/5.
700px x 280px fit aspect ratio , canvas size limit.
you work on canvas , when time export graphic file can:
define final size
6 x 15 inch @ 300dpi = 1800 x 4500 pixels.
find ratio between canvas , final canvas:
4500 / 700 = 6.428
you can do
canvas.todataurl({ multiplier: 6.428 })
, should obtain file of right size.
Comments
Post a Comment