Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
d8fd7f9956 | |||
1711aadb6b | |||
06b9385e97 | |||
94386b0e02 | |||
36fea0b0f2 | |||
437d56e54d | |||
1537705cde |
1
.gitignore
vendored
1
.gitignore
vendored
@ -20,3 +20,4 @@ dist_serve/
|
||||
dist_ts_web/
|
||||
|
||||
# custom
|
||||
assets/pdfdir
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartpdf",
|
||||
"version": "1.0.7",
|
||||
"version": "1.0.9",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartpdf",
|
||||
"version": "1.0.7",
|
||||
"version": "1.0.9",
|
||||
"private": false,
|
||||
"description": "create pdfs on the fly",
|
||||
"main": "dist/index.js",
|
||||
|
@ -75,6 +75,7 @@ export class SmartPdf {
|
||||
|
||||
async getPdfForWebsite(websiteUrl: string) {
|
||||
const page = await this.headlessBrowser.newPage();
|
||||
page.emulateMedia('screen');
|
||||
const response = await page.goto(websiteUrl, { waitUntil: 'networkidle2' });
|
||||
const pdfId = plugins.smartunique.shortId();
|
||||
await page.pdf({
|
||||
@ -89,6 +90,7 @@ export class SmartPdf {
|
||||
|
||||
async getFullWebsiteAsSinglePdf(websiteUrl: string) {
|
||||
const page = await this.headlessBrowser.newPage();
|
||||
page.emulateMedia('screen');
|
||||
const response = await page.goto(websiteUrl, { waitUntil: 'networkidle2' });
|
||||
const pdfId = plugins.smartunique.shortId();
|
||||
const {documentHeight, documentWidth} = await page.evaluate(() => {
|
||||
|
Reference in New Issue
Block a user