Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QuickSign] The drawings are not positioned correctly on pdf #91

Open
bnchi opened this issue Dec 19, 2022 · 7 comments
Open

[QuickSign] The drawings are not positioned correctly on pdf #91

bnchi opened this issue Dec 19, 2022 · 7 comments
Assignees

Comments

@bnchi
Copy link
Collaborator

bnchi commented Dec 19, 2022

Original drawing :

Screen Shot 2022-12-19 at 12 55 07 PM

Signed pdf results :

Screen Shot 2022-12-19 at 12 55 20 PM

@mkhatib
Copy link
Collaborator

mkhatib commented Dec 19, 2022

Damn it. I had to rewrite the positioning logic for paths because we weren't repositioning them correctly after moving them post initial creation. But Fabric doesn't update the actual paths instead it changes a left/top property of them and leave paths as is. I'll continue looking into this now.

@mkhatib mkhatib self-assigned this Dec 19, 2022
@mkhatib
Copy link
Collaborator

mkhatib commented Dec 19, 2022

This is tricky, my brain is fried thinking of this and trying to get it to work. Fabricjs adds top/left on initial creation but doesn't seem to be useful for positioning initially, but on moving they don't update the path instead they update left and right leaving the path as is. I tried normalizing it by just depending on the left/top to position and always starting the path at 0,0 but that doesn't seem to work since left/top refer to the bounding box and not the first point the path was created at.

I am tempted to look at other solutions other than Fabric.

@bnchi do you wanna give it a try at fixing this?

@mkhatib
Copy link
Collaborator

mkhatib commented Dec 19, 2022

The alternative is to drop my latest changes and revert back to getting the initial positioning working and disabling moving paths after creation. This would work but would not allow us to do the saved signatures feature. It'll probably be better than what we have now.

@bnchi
Copy link
Collaborator Author

bnchi commented Dec 19, 2022

This is tricky, my brain is fried thinking of this and trying to get it to work. Fabricjs adds top/left on initial creation but doesn't seem to be useful for positioning initially, but on moving they don't update the path instead they update left and right leaving the path as is. I tried normalizing it by just depending on the left/top to position and always starting the path at 0,0 but that doesn't seem to work since left/top refer to the bounding box and not the first point the path was created at.

I am tempted to look at other solutions other than Fabric.

@bnchi do you wanna give it a try at fixing this?

No I don't think i'm gonna spend time fixing it tbh, let's try this https://github.com/steveruizok/perfect-freehand
what do you think ? @mkhatib

@bnchi
Copy link
Collaborator Author

bnchi commented Dec 20, 2022

I also did some research, maybe http://dmitrybaranovskiy.github.io/raphael/reference.html#Paper.text sounds like a pretty good option and good API docs. It uses svgs

@mkhatib
Copy link
Collaborator

mkhatib commented Dec 20, 2022

If that's something you'd like to try let me know. Otherwise, I'll take a look soon.

Kinda playing around with building my own annotator - mostly to learn and see if I can build something usable. If you're interested in that let me know I can push the code I have to a private repo (code is still a mess and at the beginning).

@bnchi
Copy link
Collaborator Author

bnchi commented Dec 20, 2022

If that's something you'd like to try let me know. Otherwise, I'll take a look soon.

Kinda playing around with building my own annotator - mostly to learn and see if I can build something usable. If you're interested in that let me know I can push the code I have to a private repo (code is still a mess and at the beginning).

I'll try to make the sign tool work with the options I gave. I think building an annotator from scratch would be a-lot of fun I'll check it out when you decide to open source it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants