Skip to content
New issue

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

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

Already on GitHub? # to your account

Unable to load a pdf file after adding a circle #107

Closed
mlecoq opened this issue May 13, 2019 · 0 comments · Fixed by #108
Closed

Unable to load a pdf file after adding a circle #107

mlecoq opened this issue May 13, 2019 · 0 comments · Fixed by #108

Comments

@mlecoq
Copy link
Contributor

mlecoq commented May 13, 2019

After drawing on one document, I cannot load it then.

In my document there are boxes :

<</BBox [-0.00000000000000224167 0.000000000000000239557 1.38095 2.7619]

-0.00000000000000224167 is seen as a number in file parseNumber.ts

The following line:

const pdfNumber = PDFNumber.fromString(num);

Transform the string to

2.24167e-15

While adding circles.

Then when I want to load the produced document (to combine it with others), the following regex (in parseNumber.ts) :

const numRegex = /^(([+-]?\d+(\.\d+)?)|([+-]?\.\d+))/;

Can not handle the full string 2.24167e-15 and only extract 2.24167.

Parsing stops on e-15

I will make a pull request

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

Successfully merging a pull request may close this issue.

1 participant