PDF - Can I edit a PDF in the browser?
This was originally a StackOverflow question asked about 7 years ago. I preserve it here because the answer continues to receives upvotes, so seems of interest to some folks, and it was voted to close on SO.
A tech blog giving usable explainers, advice, tools, tricks and techniques for the Konva JavaScript canvas library, the HTML5 canvas, and related subjects.
This was originally a StackOverflow question asked about 7 years ago. I preserve it here because the answer continues to receives upvotes, so seems of interest to some folks, and it was voted to close on SO.
When we exchange position and size information with Konva, multiple coordinate systems come into play. We normally use the canvas or stage coordinates but others are available. Knowing which to use will save a lot of frustration later. Lets investigate...
I mistakenly thought that a math-based mouse pointer hit testing approach might be faster than Konva's built-in approach. In the end I had to agree that Konva has it covered and there's no optimisation to be done. Here's the explanation...
A question I see sometimes is how can we know when the layer gets redrawn. Firstly I recommend that you don't sweat about this - Konva does a perfectly good job without you interfering. But if you absolutely have to there is a way. Let's take a look...
There's more to writing code than simply, well, writing code! With anything graphical there is always the potential for runaway development that doesn't plan for the scale ahead. This article is about why you need to consider a model. Take a look...
So you need undo-redo for your project. The uniqueness of your app means there's no perfect out-of-the-box solution. But the good news is that you're here and this blog describes an overall approach that you can adapt to meet your needs.
One of the features that Konva provides is the dragBoundFunc which lets us confine a shape within a rect. But how to make that work for a group where things can get a bit more tricky? Lets take a look...
Whether you need just a small section of a shape or the entire width and height of the view, getting snapshot images is quite straightforward once you know a couple of tricks - lets take a look at them...