How can I show Html/pdf on page(Using Canvas) and add images and text by dragging and dropping them and save Canvas as html ? I have tried jQuery UI for drag and drop images and text but it's not up to mark. Can I load html into canvas and perform the drag and drop on canvas?
1条回答 默认 最新
dongmi0760 2013-10-26 16:38关注No, you can't load actual html into canvas itself (largely for security reasons).
This canvas library does a fairly good job of "faking it":
http://html2canvas.hertzen.com/
But with a little learning, you may find that canvas itself has all the formatting/drawing capabilities you need.
- Drawing basic elements: lines, rectangles, arcs, images
- Drawing text including fonts and font sizes
- Drawing custom paths
- Drawing effects: opacity, shadowing, compositing (blending), clipping
- Strokes, fills (including gradients), patterns
- Transforms: move, rotate, scale, skew
And you can tie into window events (mouse, touch, requestAnimationFrame, etc) to get more:
- Drag/Drop
- Animations
- Transitions
- Spriting
- Capture & Alter video streams
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报