I was wondering if it is possible to take a snapshot with canvas from a content panel (labels, buttons …)? Is there a way for capturing an image from a Form (content_panel)?
The Anvillic way
would be to have the content panel in its own blank form, and use it as a custom control in the main form or as a stand alone form when rendering to PDF.
The custom control should be able to build itself. That is instead of having the main form telling the canvas and the labels what to do, the form should give the custom control all the info it needs, then the __init__ or __show__ event of the custom control should do the job.
If there are input elements like buttons, then the custom control should talk back to its owner via events.
I have used this way. The PDF renderer on the server side can be slow, but it works.
The Pythonic way
would be to use javascript libraries like html2canvas.
I think this would happen on the client side, I don’t know think it would work on the server side. But you should be able to send the image back to the server if you need to.
Great Job!
I was wondering if it is possible to take a snapshot with canvas from a content panel (labels, buttons …)? Is there a way for capturing an image from a Form (content_panel)?
I am not exactly sure what you mean but if you are talking about capturing images of content panels (along with all the components in them), you might have a look at the Snapshot library