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

Error when parsing json options in Windows #35

Open
henrygiocondo opened this issue Feb 26, 2015 · 0 comments
Open

Error when parsing json options in Windows #35

henrygiocondo opened this issue Feb 26, 2015 · 0 comments

Comments

@henrygiocondo
Copy link

It seems that there is a problem when parsing options at Windows 8;

I'm having this problem at line 18 in render.js, the string with the options come without quotes, so JSON cant parse.

Thats what its trying to execute:

phantomjs  C:\\Publix\\Dev\\node_modules\\nodepdf/render.js http://yahoo.com yahoo.pdf "{'viewportSize':{'width':2880,'height':1440},'paperSize':{'format':'A4','orientation':'portrait','margin':{'top':'1cm','right':'1cm','bottom':'1cm','left':'1cm'}},'zoomFactor':1,'args':'','captureDelay':400}"

But then the argument goes to render.js there is no quotes:

{viewportSize:{width:2880,height:1440},paperSize:{format:A4,orientation:portrait,margin:{top:1cm,right:1cm,bottom:1cm,left:1cm}},zoomFactor:1,args:,captureDelay:400}

I made some tests, the correct json string should be escaped with "":

phantomjs  C:\\Publix\\Dev\\node_modules\\nodepdf/render.js http://yahoo.com yahoo.pdf "{\"viewportSize\":{\"width\":2880,\"height\":1440},\"paperSize\":{\"format\":\"A4\",\"orientation\":\"portrait\",\"margin\":{\"top\":\"1cm\",\"right\":\"1cm\",\"bottom\":\"1cm\",\"left\":\"1cm\"}},\"zoomFactor\":1,\"args\":\"\",\"captureDelay\":400}"
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

1 participant