Skip to content

muedsa/snapshot-web

Repository files navigation

Snapshot Web Service Demo

Snapshot 是一个图片生成工具, 本项目是Demo提供了一个图片生成服务。

API

Host: https://snapshot.muedsa.com

POST /snapshot 生成图片
Parameters

dom like text as row request body, example:

<Snapshot background="#FFFFFFFF" type="png">
    <Column>
        <Row>
            <Container color="#FF0000" width="200" height="200" />
            <Container color="#FFFFFF" width="200" height="200">
                <Text color="#0000FF" fontSize="20">哈哈 233<![CDATA[ken_test <a></a> 233 哈哈]]>哈🤣🤣🤣
                </Text>
            </Container>
        </Row>
        <Row>
            <Image width="200" height="200" url="https://samples-files.com/samples/Images/png/480-360-sample.png"
                fit="COVER" />
            <Container color="#FFFF00" width="200" height="200" />
        </Row>
    </Column>
</Snapshot>
Responses

Image ByteArray data, reponse header Content-Type: image/png, image/jpeg, image/webp

Example:

response

GET /fonts 可用字体
Responses

Raw text, available font famliy name list

GET /fonts.png 可用字体示例图片

fonts image