Add pdf question
sanpangzi opened this issue · comments
Hi Muaz,
Now Canvas-Designer only can add image, I want to add other, such as PDF. Do you any advice? I am looking forward to your reply.
You can use javascript libraries (search-on-google) to convert PDF into images, and then import single or multiple images (DataURIs or Blobs) into the tool using image-tool methods (reuse button-click event to pass DataURI instead of selecting from system).
(pdf-based) JS libraries may generate Canvas object. You can use canvas.toDataURL()
to get images.
Ok, thank you, Muaz, I will try it.
Hi guys, Did you manage to allow for import and export to pdf? I am just looking at it myself and be interested to hear if you made any progress. By the way Muaz-khan loving all your webrtc projects, awesome :) Jon
I use php libraries imagick convert pdf to png,and use canvas.toDataURL() put them to canvas.
First install the php library on your server, and use the follow code convert:
and you can see the results on server as follow:
second on canvas, you can get these image according to path, as follow:
https://uploadt.dz101.com/uploadfiles/weiXinO2OpdfCourseware/2018/07/18/pdf749891531878335/1.png
third import the image by url as follow:
@sanpangzi hi i saw you comment . Now is your canvas support upload pdf function and sync in to other users and can draw on presentation? Please help me
Please help me :(