react-pdf-html icon indicating copy to clipboard operation
react-pdf-html copied to clipboard

suggestion: Use ref

Open mikey0000 opened this issue 4 years ago • 5 comments

Is there any issue with using ref to grab elements and css directly from the node save the step of rendering the dom to string and back again and be able to grab all styles that exist both inline and in sheet.

mikey0000 avatar Aug 12 '21 03:08 mikey0000

In my initial use case I was using HTML for some of my content server side (user editable markdown -> HTML -> PDF). It sounds like you are exploring rendering DOM elements from a browser using their computed styles. That would be great to explore but I just haven't looked into it.

danomatic avatar Aug 12 '21 22:08 danomatic

I may explore it for my use case so I'll PR the changes if it goes ahead and yes you are right I'm rendering from the browser.

mikey0000 avatar Aug 12 '21 23:08 mikey0000

https://github.com/mikey0000/react-pdf-html/tree/feature/use-ref

work in progress. By no means perfect. I'll be working on it for a few days more at least

mikey0000 avatar Aug 30 '21 05:08 mikey0000

https://github.com/mikey0000/react-pdf-html/tree/feature/use-ref

work in progress. By no means perfect. I'll be working on it for a few days more at least

@mikey0000 awesome. May I suggest a few separate PRs? I'm noticing that you are dealing with multiple things at once in that branch (support for additional tags, further image support, etc)

danomatic avatar Sep 02 '21 21:09 danomatic

Yeah I'll have to spend some time to split it out into usable PRs, just needed to work on getting it working first. There are some hurdles with images but I'll PR svg support(when it's completed which shouldn't be hard) and the additional tags that were missed (section and span)

3/09/2021 9:24:56 am Dan Blaisdell @.***>:

https://github.com/mikey0000/react-pdf-html/tree/feature/use-ref

work in progress. By no means perfect. I'll be working on it for a few days more at least

@mikey0000[https://github.com/mikey0000] awesome. May I suggest a few separate PRs? I'm noticing that you are dealing with multiple things at once in that branch (support for additional tags, further image support, etc)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub[https://github.com/danomatic/react-pdf-html/issues/5#issuecomment-912068578], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AALDOPM6L6CIKHTYYFQC5O3T77TR5ANCNFSM5CABS4LQ]. Triage notifications on the go with GitHub Mobile for iOS[https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675] or Android[https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub]. [data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAABCCAYAAADjVADoAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAAnSURBVHic7cEBDQAAAMKg909tDwcUAAAAAAAAAAAAAAAAAAAAAPBjRFIAASHKmKkAAAAASUVORK5CYII=###24x24:true###][Tracking image][https://github.com/notifications/beacon/AALDOPPUFPNKGTFRHDANMYDT77TR5A5CNFSM5CABS4L2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGZOQ7YQ.gif]

mikey0000 avatar Sep 02 '21 21:09 mikey0000