Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cenfun/page-save-as
Page save as JPG/PNG/PDF
https://github.com/cenfun/page-save-as
jpg page pdf png puppeteer save
Last synced: 29 days ago
JSON representation
Page save as JPG/PNG/PDF
- Host: GitHub
- URL: https://github.com/cenfun/page-save-as
- Owner: cenfun
- License: mit
- Created: 2020-12-30T07:45:14.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-08-07T15:49:00.000Z (over 2 years ago)
- Last Synced: 2024-10-07T15:22:45.651Z (about 1 month ago)
- Topics: jpg, page, pdf, png, puppeteer, save
- Language: JavaScript
- Homepage:
- Size: 32.2 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Page Save As
> Page save as JPG/PNG/PDFIt uses Puppeteer([
puppeteer-chromium-resolver](https://github.com/cenfun/puppeteer-chromium-resolver)) API to save a page.## Install
```
npm i page-save-as
```## Node.js API
```
const PSA = require("page-save-as");
const option = await PSA({
url: "xxx",
name: "xxx",
type: "jpg/png/pdf"
});
```
see [test.js](./test/test.js)## API Default Options
see [option.js](./lib/option.js)## CLI
```sh
#global install:
npm i page-save-as -g
#execute command
psa --name filename --type jpg
#uses "npx psa ..." for local install
```## CLI Options
* -n, --name `` save filename
* -t, --type `` file type: jpg(default)/png/pdf
* -w, --width `` page width
* -s, --scroll scroll to bottom
* -e, --edit edit mode")
* -o, --output `` output path
* -ds, --delay `` delay in seconds
* -ts, --timeout `` timeout in seconds## CHANGELOG
* 1.0.5
* support local file
* updated PCR* 1.0.4
* support edit for pdf format* 1.0.3
* fixed filename* 1.0.2
* fixed output
* added delay
* updated scroll logic
* updated edit complete logic
* updated puppeteer-chromium-resolver to latest* 1.0.1
* fixed filename