Skip to content
/ capture Public

Lambda function to capture a URL as PNG, JPG, or GIF using PhantomJS

Notifications You must be signed in to change notification settings

apex/capture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

capture

Lambda function to convert a URL to PNG, JPEG, or GIF using PhantomJS.

Installation

Add capture to your Apex project:

$ git submodule add https://github.com/apex/capture.git functions/capture

Deploy it:

$ apex deploy capture

Try it:

$ apex invoke capture < functions/capture/event.json

API

Input:

  • url (string) URL to render
  • format (string) output format, one of 'png', 'jpeg', or 'gif' (default: 'png')
  • viewport (object) viewport size with .width and .height (default: 1024x800)
  • clip (object) clip rect with .top, .left, .width, and .height (default: none)
  • zoom (number) zoom factor (default: 1)
  • wait (number) wait time in milliseconds (default: 250)
  • backgroundColor (string) body background color (default: none)

Output:

  • capture (string) base64 output

Badges


tjholowaychuk.com  ·  GitHub @tj  ·  Twitter @tjholowaychuk

About

Lambda function to capture a URL as PNG, JPG, or GIF using PhantomJS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published