PhantomJS generated the empty output PNG/PDF file

84 views
Skip to first unread message

rmaddu

unread,
Jun 21, 2019, 2:41:37 AM6/21/19
to phantomjs
Hi,

We are using 2.2.1 version PhantomJS.exe. This is downloaded file, not the compiled file. We are trying to generate the png/pdf as the output file, but the file is empty. 

  • We have HTML page. This is a template for generating map images.
  • We have JS file -
         var page = require('webpage').create(),
                         system = require('system'),
                         fs = require('fs'),
                         debug = true;

  • We have a data file -

{"projection":"EPSG:3857","extent":[-9943581.8637506254,5324921.5116860364,-9943296.2672634386,5325253.5708903763],"center":[-9943439.065507032,5325087.5412882064],"rotation":0.39389232430490972,"resolution":0.38123904057403107,"sources":[{"type":"WMS","layerOpts":{"visible":true,"zIndex":10},"sourceOpts":{"attributions":"","singleTile":true,"url":"http://XXXXXX/nwwms8/wms","params":{"LAYERS":["XXXX","XXXX","XXXXXXX","XXXXX","XXXXX","XXXXX","XXXXXX","XXXXXX"]}}}],"coordinateSystems":[{"code":"3857","bbox":[85.06,-180,-85.06,180],"proj4":"+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs","name":"WGS 84 / Pseudo-Mercator"}],"scale":"700"}

  • Below is the final process -
var startInfo = new ProcessStartInfo()
            {
                StandardOutputEncoding = Encoding.UTF8,
                WindowStyle = ProcessWindowStyle.Hidden,
                UseShellExecute = false,
                RedirectStandardOutput = true,
                FileName = PhantomJSExe,
                Arguments = string.Format(CultureInfo.InvariantCulture,
                "--web-security=false --ignore-ssl-errors=yes {0} {1} {2} {3} {4} {5} {6}",
                jsFile,
                mapTemplate,
                MapSize.Width,
                MapSize.Height,
                OutputFile,
                PixelRatio,
                dataFileName)
            };

Observations:
1. When we are passing some rotation value through the data file, we are getting requested width or height value exceeds the maximum value from service. PNG/PDF file is EMPTY since our WMS service supports only 4096 is maximum width or height.
2. When we are passing some rotation value is ZERO, png/pdf is generated properly. This case no maximum width or height issue.

Our questions -
Do we have any maximum width or height limitation related issues with PhantomJS? 
For some rotation values, png/pdf is generated properly. For some rotations not. How the width and height are calculated using rotation? How to trace the issue?


Regards,
Rajesh
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages