Phantomjs: Page.renderBuffer is undefined

Created on 16 May 2016  路  12Comments  路  Source: ariya/phantomjs

phantomjs --version === 2.1.1

  1. Run the following file:
var server = require('webserver').create();

var listening = server.listen(8001, function(request, response) {
  var url = "http://phantomjs.org", format = 'png', quality = -1;

  var page = require('webpage').create();

  page.viewportSize = {
    width: 800,
    height: 600
  };

  page.open(url, function start(status) {
    try {

      // Buffer is an Uint8ClampedArray
      var buffer = page.renderBuffer(format, quality);

      response.statusCode = 200;
      response.headers = {
        "Cache": "no-cache",
        "Content-Type": "image/" + format
      };
      page.close();

      // Pass the Buffer to 'write' to send the Uint8ClampedArray to the client
      response.write(buffer);
      response.close();
    } catch (err) {
      console.log(err);
    }
  });

});

Taken from here: http://phantomjs.org/api/webpage/method/render-buffer.html

The result is:

TypeError: undefined is not a function (evaluating 'page.renderBuffer(format, quality)')

Ubuntu 16.04, binary version

stale

Most helpful comment

If possible may I know when the merge for renderBuffer will be,...

Thanks,

All 12 comments

typeof(page.render(QString,QVariantMap))=function
typeof(page.render(QString))=function
typeof(page.renderBase64(QByteArray))=function
typeof(page.renderBase64())=function

"page.renderBuffer" method undefined !!!!

The docs are slightly ahead. The feature is in #13345, which hasn't been merged yet.

If possible may I know when the merge for renderBuffer will be,...

Thanks,

Any updates here? This has been open ~6 months now...

Hi! What about this issue?

ROFL. A simple comment on the non-existing renderBuffer method's documentation would save everyone (maintainers included) so much time.

It seems phantomjs looks like piece of shit.

@wildlyinaccurate username checks out, docs are more than slightly ahead

We need renderBuffer method, when can this method be implemented?

+1

Due to our very limited maintenance capacity (see #14541 for more details), we need to prioritize our development focus on other tasks. Therefore, this issue will be automatically closed. In the future, if we see the need to attend to this issue again, then it will be reopened. Thank you for your contribution!

We need renderBuffer method, when can this method be implemented?

never

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Snowlav picture Snowlav  路  3Comments

maboiteaspam picture maboiteaspam  路  3Comments

mz3 picture mz3  路  5Comments

h4wlt picture h4wlt  路  5Comments

dhilipsiva picture dhilipsiva  路  4Comments