-
Notifications
You must be signed in to change notification settings - Fork 35
Parse Error in windows #14
Comments
I also got this error. I took the JSON string you pasted above tried it over at http://codebeautify.org/jsonviewer. I had to convert it to the below to get it to validate:
Not sure yet if I can transfer this to the H2P library EDIT: Had to update the backslashes to \\ to work with JSON.parse(). |
Hey @RaXaR , can you test setting the temp folder to a different one? |
Hi Yeah, i tried using a folder inside the webroot but the same error appears:
To my eye it looks like an issue with escapeshellarg() being used in PhatomJS::transform() and then the parsing inside the converter.js at JSON.parse(). However, I can't figure out how to debug inside coverter.js so that I can see what strings it receives. |
You can try using Daniel Pereira 2015-11-13 10:30 GMT-02:00 RaXaR [email protected]:
|
Nope, I don't know how to get the output of console.log to PHP? |
Ok I resolved the parse error on windows with:
I tested with:
When I use new Tempfile() for input then I get:
Tested with:
|
Note: Updated previous comment with a few fixes. |
I had aa similar problem today on windows. I had to use your updates transform() function and to had this fix: PhantomJS is not able to access fils on filesystem if url is not prefixed by |
I've just merged a PR that fixes that issues on Windows. Can you guys test using master branch? (or dev-master for those using composer) |
The PR fixed the issue with file://. But not the original issue about the parse Error in windows. |
I thought that the parsing error was directly related to the file:// issue - my bad. |
No, on windows, the parsing error is related to the escapeshellarg function:
So the command line is generated with an invalid json. |
Library is creatin following command on window
"C:\www\myproject\vendor\kriansa\h2p\bin/win32/phantomjs.exe" "C:\www\myproject\vendor\kriansa\h2p\bin/converter.js" "{ destination : C:\Windows\TEMP\14b6e6edc209b6e731bdbc79976a9430438409ae.tmp , request :{ uri : C:\Windows\TEMP\127ef8f78c335d9af694a9cef0423541dd17a256.html , method : GET }, orientation : Portrait , format : A3 , zoomFactor :1, allowParseCustomFooter :false, allowParseCustomHeader :false, border : 1cm , header :null, footer :null}"
When I run this command it is giving me parse error . Seems json is not getting created properly
The text was updated successfully, but these errors were encountered: