0

I am using phantomjs to rasterize an html page that I'm creating dynamically with javascript/php. It looks fine when testing on my localhost, but when testing on an apache server, it appears to blow the image up, causing it to be formatted wrong (extends to two pages instead of one, etc).

Does anyone know how I can stop this from happening?

(Sorry, just created this account and it won't let me post screenshots yet)

jdelong
  • 71
  • 1
  • 6
  • PhantomJS is a client right? What does the server software have to do with it? Can you upload the screenshot somewhere and post it as a link? – Halcyon Jun 08 '15 at 20:41
  • I've uploaded the screenshots to google drive. Here is the link to the localhost -> https://drive.google.com/file/d/0B-qYGnGDG0QEaXN6NWJnY2NmU0U/view?usp=sharing And here is the link to the zoomed in screenshot from the apache server -> https://drive.google.com/file/d/0B-qYGnGDG0QESkZyVHRIOGRTS0U/view?usp=sharing – jdelong Jun 08 '15 at 20:50

2 Answers2

1

Found out that the phantomjs binary we were using has issues running on a Linux machine (which is what our server runs on). We were trying to use the MacOS binary on a Linux machine.

jdelong
  • 71
  • 1
  • 6
0

Without further information it is difficult to diagnose. In my Impression you are mixing up things quite a bit. Phantomjs is a headless Browser while Apache is a Server. So my best guess is to check if you zoomed in on the browser you are opening the page on.

Brasilikum
  • 111
  • 6
  • Yes, phantoms includes a Javascript api for headless testing but also for things such as screen capture, network monitoring, etc. The browser is not zoomed it and I am not mixing anything up, as I noted that there was a difference in the result between my localhost test server, and apache server. – jdelong Jun 08 '15 at 20:49
  • What are you using as your localhost server? – Brasilikum Jun 08 '15 at 21:03
  • I'm using mamp, which I had thought also ran an apache server. – jdelong Jun 08 '15 at 21:05
  • Indeed, mamp uses apache as well. Why don't you take a Screenshot with from your Browser on both mamp and apache server. And two with phantomjs, also from mamp and apache? – Brasilikum Jun 08 '15 at 21:11
  • Figured it out, and answered above. Thanks for the input! – jdelong Jun 08 '15 at 21:46
  • I guess this answer isn't useful since it's more of a comment and can be deleted. – Artjom B. Jun 08 '15 at 22:14