-
Notifications
You must be signed in to change notification settings - Fork 33
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
add workaround changing zoom on linux #16
base: master
Are you sure you want to change the base?
Conversation
i think the same too
for teams with multiple OS this will be a huge pain (like my team) :(, not cool but i guess this is the best that we can do for now with phantom 1.9.8 the problem/inconsistency seems to be only in windows, so we should normalize windows not linux/osx .. there are other solutions as described in this thread, will try to dive into it more and try more solutions. |
Hmm. Maybe better do this at once with upgrade to 2.0. Otherwise we could be fixing this twice. |
@pofider seems reasonable.. leave the issue open in case someone explore the problem a little more or find others workarounds :) |
The fix works, but only sort of. The (0.75^2 = 0.5625) page.open(address, function (status) {
if (status !== 'success') {
console.log('Unable to load the address!');
phantom.exit(1);
} else {
page.evaluate(function() {
document.body.style["transform-origin"] = "0 0";
document.body.style["-webkit-transform-origin"] = "0 0";
document.body.style["transform"] = "scale(0.555)";
document.body.style["-webkit-transform"] = "scale(0.555)";
});
window.setTimeout(function () {
page.render(output, { format: format });
phantom.exit(0);
}, 200);
}
}); |
i can confirm that the correct value on unix OS is the workaround is only for unix (linux, osx), windows is a reference for the others OS. what works on windows with zoom = 1.0, works on unix with zoom = 0.5625. like i said before i think this patch should be applied in user-land, better for us to wait for phantom 2.0 (it still have issues for pdf rendering) |
I've tested this both on windows and mac and can confirm the values above for zoom do fix highchart image sizes but has no effect on the text. On windows the text is still a lot smaller. I set the zoom when I call rasterize.js. Is there a workaround to getting both the images and text to be consistent on both platforms? |
The pdf generated on linux and windows looks differently. The issue is described here. I have tried the proposed workaround and it is partially working. The output pdf files are still a little bit different, but it is not that significant.
This result is the most far I got:
linux.pdf
windows.pdf
I guess this should be an optional behavior user can opt in. However we should for sure recommend the users to design pdf files on the same platform where the production will run.