Search code examples
pdfcanvashtmlflying-saucer

Convert canvas image in webpage to pdf using flying saucer


I am using Flying Saucer to generate pdf from webpages. I came across a problem. Problem is how to print canvas images in pdf using flying saucer. Is there any other way, i can convert canvas images to pdf ?


Solution

  • The only way to print canvas images into pdf using xhtmlrenderer, would be to convert these images into some format FS could understand. There is a Javascript method that converts the canva images into some static format that FS could use, please take a look at https://github.com/hongru/canvas2image

    Hope this would help :)