Git Product home page Git Product logo

rabarbar's Introduction

Rabarbar

Yet another website screenshot tool

Rabarbar is a simple website screenshot utility based on Qt Web Engine (Chromium), created for Miniature.io.

sample.png

Usage

./rabarbar --url https://github.com --width 640 --height 1136 --out sample.png
./rabarbar --url https://cepa.io --width 1280 --height 1024 --out screenshot.png
./rabarbar --url https://cepa.io --width 1280 --height 1024 --out screenshot.pdf --pdf-orientation=landscape --pdf-paper-size=a4
Parameter Required Description
url yes Website URL address.
out yes Output filename.
width no Screenshot width in pixels, default 1024.
height no Screenshot height in pixels, default 1024.
delay no Number of seconds to wait before grabbing a shot once the website is fully loaded.
timeout no Max wait time for a page to be loaded in seconds.
user-agent no Custom browser user agent.
referer no Custom referer.
pdf-orientation no PDF orientation (portrait, landscape).
pdf-paper-size no PDF paper size (a3, a4, letter, tabloid).

Prerequisites

This app has been built and tested with Qt6 on Ubuntu 22.

apt-get install build-essential qt6-base-dev qt6-webengine-dev libqt6webenginecore6-bin libqt6opengl6-dev qmake6 xvfb

Building

git clone https://github.com/cepa/rabarbar
cd rabarbar
qmake6
make
./rabarbar --url https://openai.com/ --width 512 --height 512 --out sample.png

Headless

Rabarbar works in headless mode with Xvfb.

xvfb-run -a ./rabarbar --url https://google.com --width 1280 --height 1024 --out screenshot.png

Docker

You can build and run Rabarbar to render websites in Docker.

docker build -t rabarbar .

Run

docker run -v ./:/out rabarbar --url http://openai.com --out /out/openai.png

Notes

  • Referer header can be ignored by Chromium due to internal policies, consider this feature experimental.
  • Code may be built with Qt5 however there were some issues reported with QWebEngine on Ubuntu.

rabarbar's People

Contributors

cepa avatar

Stargazers

J. J. Knudsen avatar Ivan Villareal avatar  avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

ivaano

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.