Canvas-Designer icon indicating copy to clipboard operation
Canvas-Designer copied to clipboard

Add pdf question

Open sanpangzi opened this issue 7 years ago • 9 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.

sanpangzi avatar Dec 18 '17 03:12 sanpangzi

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.

muaz-khan avatar Dec 18 '17 09:12 muaz-khan

Ok, thank you, Muaz, I will try it.

sanpangzi avatar Dec 19 '17 02:12 sanpangzi

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

jonatap2chat avatar Jul 10 '18 10:07 jonatap2chat

I use php libraries imagick convert pdf to png,and use canvas.toDataURL() put them to canvas.

sanpangzi avatar Jul 18 '18 01:07 sanpangzi

Hi, thankyou so much for the reply.

Great I have just been looking at JavaScript or node js libraries, interesting about php ones.

And then what do you use to convert them back after annotation in canvas may I ask?

Any code example would be much appreciated.

Thankyou very much!

Jon On Wed, 18 Jul 2018 at 02:10, qian_hai_zhen [email protected] wrote:

I use php libraries imagick convert pdf to png,and use canvas.toDataURL() put them to canvas.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/muaz-khan/Canvas-Designer/issues/38#issuecomment-405776641, or mute the thread https://github.com/notifications/unsubscribe-auth/AknpyVAcac2laLoPfcK13HwyceALjOt4ks5uHorwgaJpZM4RE8Rc .

--

Regards Jon

Jon Hunter

Chief Technical Officer E: [email protected] w: www.atap2chat.com

jonatap2chat avatar Jul 18 '18 01:07 jonatap2chat

First install the php library on your server, and use the follow code convert: _20180718094058 and you can see the results on server as follow: 222 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 333 third import the image by url as follow: 444 666 777

sanpangzi avatar Jul 18 '18 01:07 sanpangzi

Hi,

Thankyou so much great documentation and code really appreciate it.

One last question, any recommendation for converting back to pdf and saving after drawing on canvas?

Thankyou so much!

Jon On Wed, 18 Jul 2018 at 02:53, qian_hai_zhen [email protected] wrote:

First install the php library on your server, and use the follow code convert: [image: _20180718094058] https://user-images.githubusercontent.com/15684202/42854509-bdbbe0a4-8a6e-11e8-8ef0-8427572bd417.png and you can see the results on server as follow: [image: 222] https://user-images.githubusercontent.com/15684202/42854587-0ceabdda-8a6f-11e8-9bb8-595b73f98228.png 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 [image: 333] https://user-images.githubusercontent.com/15684202/42854706-b87a64ca-8a6f-11e8-834f-64d79dcad262.png third import the image by url as follow: [image: 444] https://user-images.githubusercontent.com/15684202/42854796-2d91fbe2-8a70-11e8-96a7-a278656918e6.png [image: 666] https://user-images.githubusercontent.com/15684202/42854799-2fd205b4-8a70-11e8-8b9a-43516f008bed.png [image: 777] https://user-images.githubusercontent.com/15684202/42854853-5ad5384e-8a70-11e8-9fd5-b47916ab77a7.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/muaz-khan/Canvas-Designer/issues/38#issuecomment-405783221, or mute the thread https://github.com/notifications/unsubscribe-auth/AknpydHWnnzueW0lcViKGzcHzJg7wFvJks5uHpUCgaJpZM4RE8Rc .

--

Regards Jon

Jon Hunter

Chief Technical Officer E: [email protected] w: www.atap2chat.com

jonatap2chat avatar Jul 18 '18 04:07 jonatap2chat

@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

ph4t0o0o0om avatar Sep 04 '18 08:09 ph4t0o0o0om

Please help me :(

ph4t0o0o0om avatar Sep 10 '18 03:09 ph4t0o0o0om