xgqfrms / url-to-pdf

url to pdf
MIT License
1 stars 0 forks source link

URL to Poster #3

Open xgqfrms opened 4 years ago

xgqfrms commented 4 years ago

steps

server

  1. Node server parse URL args(api path, type)

  2. template page fetch data using URL args

  3. QRCode component generator QRCode Image, insert template page

  4. SSR render template page, then using canvas create image

  5. Node response Image, download url / base64

client

  1. request URL with args

  2. render response image

xgqfrms commented 4 years ago

refs

https://www.cnblogs.com/xgqfrms/p/11278677.html

https://www.cnblogs.com/xgqfrms/p/9802327.html

https://www.cnblogs.com/xgqfrms/p/9732276.html

xgqfrms commented 4 years ago

https://github.com/xgqfrms/url-to-pdf/commit/760978b6dc1b2b8f5023ad4b4ee6fea6be94c39d

https://www.cnblogs.com/xgqfrms/p/9726348.html

xgqfrms commented 4 years ago

screenshot

https://github.com/xyz-data/puppeteer?organization=xyz-data&organization=xyz-data#usage

# Note: When you install Puppeteer, it downloads a recent version of Chromium (~170MB Mac, ~282MB Linux, ~280MB Win) that is guaranteed to work with the API.

$ npm i puppeteer
# or 
$ yarn add puppeteer
# a version of Puppeteer that doesn't download Chromium by default.
$ npm i puppeteer-core
const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto('https://example.com');
  await page.screenshot({path: 'example.png'});

  await browser.close();
})();

https://github.com/puppeteer/puppeteer/blob/master/docs/api.md#puppeteer-vs-puppeteer-core

https://github.com/puppeteer/puppeteer/tree/master/examples

xgqfrms commented 4 years ago

API

https://github.com/puppeteer/puppeteer#usage

https://zhaoqize.github.io/puppeteer-api-zh_CN/#/

xgqfrms commented 4 years ago

https://juejin.im/post/5c6bc7ea6fb9a049f43be1f1