Closed tranek closed 11 years ago
Yeah we haven't ported that code to Node yet. It's relying on browser functionality right now. Thanks for pointing that out! I think there should be a DOM abstraction library that we can pull in to help. It might not be that trivial though. Will investigate soon.
Thank you for responding! Let me know if I can help from the testing side -- the paperjs code is a bit over my head so I don't think that I can help there :)
No it's fine... I know what's there to do, but it might take some time to get it sorted. Hope that's not a show stopper for you guys.
At the moment, it's not a show stopper at all. That's planned for future functionality so no rush from us :)
This was easier than I thought, thanks to the amazing https://github.com/tmpvar/jsdom module. And I was able to squash a few bugs in the node paper module along the way.
SVGImport still needs fixing though! But SVGExport is ready for test spin.
But SVGExport is ready for test spin.
Is that change pushed to the version in npm? Still getting the document error on a quick test.
Done!
And now SVGImport works too! Closing this for now, but these features need extensive testing.
No errors from my quick and dirty testing :)
Thanks!
When calling project.exportSVG() in a NodeJS instance of paper, it errors with:
svg/SVGExport.js:40 document.createElementNS('http://www.w3.org/2000/svg', t ag), attrs); ^ ReferenceError: document is not defined at createElement (svg/SVGExport.js:40:4) at Project.inject.exportSVG (svg/SVGExport.js:515:15) at end_external_path (C:\Users\dan\Documents\GitHub\draw\server.js:201:11) at Socket. (C:\Users\dan\Documents\GitHub\draw\server.js:84:5)
at Socket.EventEmitter.emit as $emit
at SocketNamespace.handlePacket (C:\Users\dan\node_modules\socket.io\lib\nam
espace.js:335:22)
at Manager.onClientMessage (C:\Users\dan\node_modules\socket.io\lib\manager.
js:488:38)
at WebSocket.Transport.onMessage (C:\Users\dan\node_modules\socket.io\lib\tr
ansport.js:387:20)
at Parser. (C:\Users\dan\node_modules\socket.io\lib\transports\we
bsocket\hybi-16.js:39:10)
at Parser.EventEmitter.emit (events.js:95:17)