|
@@ -156,11 +156,11 @@ async def main():
|
|
|
})
|
|
|
await page.goto('%s', {
|
|
|
'waitUntil': 'networkidle0',
|
|
|
- 'timeout': 1000000 # 设置超时时间为 100 秒
|
|
|
+ 'timeout': 3000000 # 设置超时时间为 100 秒
|
|
|
})
|
|
|
|
|
|
# 在生成PDF之前等待2秒
|
|
|
- await asyncio.sleep(5)
|
|
|
+ await asyncio.sleep(10)
|
|
|
|
|
|
await page.pdf({
|
|
|
'path': "%s",
|
|
@@ -229,7 +229,7 @@ async def main():
|
|
|
# 导航到页面
|
|
|
await page.goto('%s', {
|
|
|
'waitUntil': 'networkidle0',
|
|
|
- 'timeout': 1000000 # 设置超时时间为 100 秒
|
|
|
+ 'timeout': 3000000 # 设置超时时间为 100 秒
|
|
|
})
|
|
|
# Customizing footer for page numbers starting from page 2
|
|
|
|
|
@@ -239,7 +239,7 @@ async def main():
|
|
|
await page.screenshot({
|
|
|
'path': "%s",
|
|
|
'fullPage': True,
|
|
|
- 'quality':100
|
|
|
+ 'quality':80
|
|
|
})
|
|
|
|
|
|
except errors.BrowserError as e:
|
|
@@ -327,7 +327,7 @@ func Report2pdfAndJpeg(reportUrl string, reportId, reportType int) {
|
|
|
reportCode := utils.MD5(strconv.Itoa(reportId))
|
|
|
|
|
|
pdfPath := `./static/` + reportCode + ".pdf"
|
|
|
- jpegPath := `./static/` + reportCode + ".jpeg"
|
|
|
+ jpegPath := `./static/` + reportCode + ".jpg"
|
|
|
|
|
|
err = ReportToPdf(reportUrl, pdfPath)
|
|
|
if err != nil {
|