Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Review | 916 | 2 | 2 | 2 years ago | 19 | February 10, 2018 | 6 | JavaScript | ||
Visual regression testing tool for responsive websites | ||||||||||
Theirtube | 127 | 9 months ago | 9 | JavaScript | ||||||
TheirTube scraper allows you to retrieve your own Youtube recommendation results on your local environment | ||||||||||
Lancia | 111 | 8 months ago | 13 | December 09, 2022 | 1 | mit | Java | |||
网页转PDF渲染服务。提供收据、发票、报告或任何网页内容转PDF的微服务 | ||||||||||
Casperjs_foundation | 44 | 9 years ago | 2 | mit | JavaScript | |||||
Basic foundation to write CasperJS tests within a project | ||||||||||
Cookies.txt Importer For Chrome | 12 | 7 years ago | gpl-3.0 | JavaScript | ||||||
chrome/chromium extension: Import cookies via cookies.txt files in netscape format | ||||||||||
Capture Phantomjs | 11 | 6 | 3 | 2 years ago | 15 | June 05, 2019 | 2 | JavaScript | ||
Capture screenshots using PhantomJS | ||||||||||
Grabz_it | 10 | 8 years ago | mit | Ruby | ||||||
Ruby interface to the GrabzIt (grabz.it) service | ||||||||||
Screenshot2slack | 8 | 2 years ago | apache-2.0 | JavaScript | ||||||
screenshot2slack is a tool uploading a screenshot to slack with puppeteer on docker. | ||||||||||
Lambdacd Lineup | 3 | 7 years ago | other | Clojure | ||||||
A Clojure library designed to integrate Lineup in LambdaCD pipelines | ||||||||||
Controlpanel | 3 | 3 years ago | HTML | |||||||
【基础信息模块】 【供后台职工使用,不是给用户用的】 Control panel for in-class project |
-- QQ839128 --
PDFPDF
** ** API,. ChromeJavaScript,
** :**
URLHTMLPDF(PNG/JPEG)
*PuppeteerChromePDFChrome.
app (SPA)
Easy deployment to Heroku. We love Lambda but...Deploy to Heroku button.
(scrollPage )
X-Access-Token*
@media print
CSS .Chrome @media screen
pdfChrome&emulateScreenMedia=false
Puppeteer API docs.
API
Chrome--no-sandbox--disable-setuid-sandbox
debian.
Chrome.
?
PDF,
PDFHTML+CSS,
Target | Good | Deficiency | Link | Style |
---|---|---|---|---|
jsPDF | () | N | Y | |
iText | 12pdf | 1html23() | Y | N |
wkhtmltopdf | 1()2pdf | 1wkhtmltopdf2pdf | Y | N |
APIPuppeteer Chrome node API( html)(https://github.com/aoju/lancia/blob/nodejs/src/app/shared/utils/render.utils.class.js)
::
page.setViewport(options)
viewport.*
.page.emulateMedia('screen')
emulateScreenMedia=true
.url page.goto(url,options)
' goto.* '
,html page.setContent(html, options)
' goto.* '
** page.waitFor(num)
waitFor=1000
.
** scrollPage=true
false.
pdf
page.pdf(options)
,pdf.*
.screenshot
page.screenshot(options)
screenshot.*
.POST
? pdfscale=2 '' {pdf: {scale: 2}} '
url
Parameter | Type | Default | Description |
---|---|---|---|
url | string | - | URLPDF() |
output | string | : pdf screenshot . |
|
emulateScreenMedia | boolean | true |
@media screen PDF. |
ignoreHttpsErrors | boolean | false |
https. |
scrollPage | boolean | false |
true false . |
waitFor | number | - | . |
attachmentName | string | - |
content-disposition ,. |
viewport.width | number | 1600 |
. |
viewport.height | number | 1200 |
. |
viewport.deviceScaleFactor | number | 1 |
. |
viewport.isMobile | boolean | false |
. |
viewport.hasTouch | boolean | false |
. |
viewport.isLandscape | boolean | false |
. |
cookies[0][name] | string | - | Cookie () |
cookies[0][value] | string | - | Cookie () |
cookies[0][url] | string | - | Cookie URL |
cookies[0][domain] | string | - | Cookie |
cookies[0][path] | string | - | Cookie |
cookies[0][expires] | number | - | Cookie |
cookies[0][httpOnly] | boolean | - | Cookie httpOnly |
cookies[0][secure] | boolean | - | Cookie |
cookies[0][sameSite] | string | - |
Strict or Lax
|
goto.timeout | number | 30000 |
()300. |
goto.waitUntil | string | networkidle |
:load , networkidle . |
goto.networkIdleInflight | number | 2 |
goto.waitUntil : 'networkidle'. |
goto.networkIdleTimeout | number | 2000 |
, waitUntil: 'networkidle' . |
pdf.scale | number | 1 |
. |
pdf.printBackground | boolean | false |
. |
pdf.displayHeaderFooter | boolean | false |
. |
pdf.headerTemplate | string | - | HTMLPDF. |
pdf.footerTemplate | string | - | HTMLPDF. |
pdf.landscape | boolean | false |
. |
pdf.pageRanges | string | - | 1- 5,7,11 -13. |
pdf.format | string | A4 |
,. |
pdf.width | string | - | . |
pdf.height | string | - | . |
pdf.margin.top | string | - | . |
pdf.margin.right | string | - | . |
pdf.margin.bottom | string | - | . |
pdf.margin.left | string | - | . |
screenshot.fullPage | boolean | true |
. |
screenshot.type | string | png |
,: png , jpeg
|
screenshot.quality | number | - | JPEG0-100, screenshot.type jpeg . |
screenshot.omitBackground | boolean | false |
. |
screenshot.clip.x | number | - | x. |
screenshot.clip.y | number | - | y. |
screenshot.clip.width | number | - | . |
screenshot.clip.height | number | - | . |
maven,pom.xml
<dependency>
<groupId>org.aoju</groupId>
<artifactId>lancia</artifactId>
<version>1.2.2</version>
</dependency>
TRACE
List<String> argList = new ArrayList<>();
Fetcher.on(null);
LaunchOption options = new LaunchBuilder().withArgs(argList).withHeadless(false).build();
argList.add("--no-sandbox");
argList.add("--disable-setuid-sandbox");
Puppeteer.launch(options);
Chrome
Fetcher.on(null);
List<String> argList = new ArrayList<>();
LaunchOption options = new LaunchBuilder().withArgs(argList).withHeadless(false).build();
argList.add("--no-sandbox");
argList.add("--disable-setuid-sandbox");
Browser browser = Puppeteer.launch(options);
Browser browser2 = Puppeteer.launch(options);
Page page = browser.newPage();
page.goTo("http://news.baidu.com/");
browser.close();
Page page1 = browser2.newPage();
page1.goTo("http://news.baidu.com/");
argList
Fetcher.on(null);
List<String> argList = new ArrayList<>();
LaunchOption options = new LaunchBuilder().withArgs(argList).withHeadless(false).build();
argList.add("--no-sandbox");
argList.add("--disable-setuid-sandbox");
Browser browser = Puppeteer.launch(options);
Browser browser2 = Puppeteer.launch(options);
Page page = browser.newPage();
page.goTo("http://news.baidu.com/");
PDFOption pdfOptions = new PDFOption();
pdfOptions.setPath("test.pdf");
page.pdf(pdfOptions);
page.close();
browser.close();
PDFPDFheadless
Fetcher.on(null);
List<String> argList = new ArrayList<>();
LaunchOption options = new LaunchBuilder().withArgs(argList).withHeadless(false).build();
argList.add("--no-sandbox");
argList.add("--disable-setuid-sandbox");
Browser browser = Puppeteer.launch(options);
Page page = browser.newPage();
//
page.tracing().start("/Users/xxx/Desktop/trace.json");
page.goTo("http://news.baidu.com/");
page.tracing().stop();
json Chrome json
Fetcher.on(null);
List<String> arrayList = new ArrayList<>();
LaunchOption options = new LaunchBuilder().withArgs(arrayList).withHeadless(true).build();
arrayList.add("--no-sandbox");
arrayList.add("--disable-setuid-sandbox");
Browser browser = Puppeteer.launch(options);
Page page = browser.newPage();
page.goTo("http://news.baidu.com/");
ScreenshotOption screenshotOptions = new ScreenshotOption();
//
Clip clip = new Clip(1.0, 1.56, 400, 400);
screenshotOptions.setClip(clip);
//
screenshotOptions.setPath("test.png");
page.screenshot(screenshotOptions);
yum install pango.x86_64 libXcomposite.x86_64 libXcursor.x86_64 libXdamage.x86_64 libXext.x86_64 libXi.x86_64 libXtst.x86_64 cups-libs.x86_64 libXScrnSaver.x86_64 libXrandr.x86_64 GConf2.x86_64 alsa-lib.x86_64 atk.x86_64 gtk3.x86_64 ipa-gothic-fonts xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-utils xorg-x11-fonts-cyrillic xorg-x11-fonts-Type1 xorg-x11-fonts-misc -y
yum groupinstall "fonts" -y
javanodejs
WARNING: 2GB4GB.