Coder Social home page Coder Social logo

crop-page's Introduction

网页截图服务

示例

JD HOME

示例代码

http://49.233.2.233:3002/crop?src=https%3A%2F%2Fjd.com&renderWidth=1000&width=1000

完整参数说明

  • src<String>: 必选,截图的页面地址(encodeURIComponent),例:http%3A%2F%2Fseejs.me
  • fullscreen<Boolean>: 是否整页截图。当启用该参数时,x, y, width, height四个参数无效
  • renderWidth<Number>: 截图时的窗口宽度,因为不同宽度窗口宽度,前端页面的布局样式会不一样,因此该参数应尽量设置为预览页面时的窗口宽度,默认值:1366。
  • x<Number>: 截图区域的起始点横坐标,相对于窗口左上角,默认值:0。
  • y<Number>: 截图区域的起始点纵坐标,相对于窗口左上角,默认值:0。
  • width<Number>: 截取的图片宽度,默认值:640。
  • height<Number>: 截取的图片高度,默认值:640。
  • holdTime<Number>: 页面加载完成直到截图的间隔时间,单位秒。因为前端页面内容有可能由JS渲染,并伴随一些CSS3淡入淡出动效,例如:百码山庄首页的渐变。使用该参数可保证内容显示完成后再截图,确保截到有效内容。对比示例如下: 百码山庄 SEEJS.ME

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.