ต่อไปนี้คือข้อมูลโค้ดสำหรับแสดงองค์ประกอบผ้าใบ HTML5
<a href = "javascript:print_voucher()">PRINT CANVAS</a>
function print_canvas()
{
$("#canvas_voucher").printElement();
} ที่นี่ canvas_voucher คือ ID ขององค์ประกอบ canvas เพื่อให้การเริ่มต้นทำงาน เราจำเป็นต้องแปลงแคนวาสเป็น URL รูปภาพ .png และเปิดในหน้าต่างเบราว์เซอร์ใหม่ กล่องโต้ตอบการพิมพ์ถูกเรียกใช้เพื่อให้ผู้ใช้พิมพ์หน้าได้
function print_canvasr(){
var win1 = window.open();
win1.document.write("<br><img src = '"+canvas.toDataURL()+"'/>");
win1.print();
win1.location.reload();
}