|
@@ -163,9 +163,9 @@ async def main():
|
|
|
await asyncio.sleep(15)
|
|
|
|
|
|
await page.pdf({
|
|
|
+ 'width': %d,
|
|
|
'path': "%s",
|
|
|
'printBackground': True,
|
|
|
- 'format': "A2",
|
|
|
'margin': {
|
|
|
'top': '10mm',
|
|
|
'bottom': '10mm',
|
|
@@ -186,7 +186,7 @@ finally:
|
|
|
loop.close()
|
|
|
`
|
|
|
|
|
|
- pyCode = fmt.Sprintf(pyCode, utils.ChromePath, width, reportUrl, filePath)
|
|
|
+ pyCode = fmt.Sprintf(pyCode, utils.ChromePath, width, reportUrl, width, filePath)
|
|
|
utils.FileLog.Info("pdf pyCode: \n" + pyCode)
|
|
|
cmd := exec.Command("python3", "-c", pyCode)
|
|
|
output, e := cmd.CombinedOutput()
|
|
@@ -329,10 +329,10 @@ func Report2pdfAndJpeg(reportUrl string, reportId, reportType int) {
|
|
|
pdfPath := `./static/` + reportCode + ".pdf"
|
|
|
jpegPath := `./static/` + reportCode + ".jpg"
|
|
|
|
|
|
- width := 1560
|
|
|
- if reportType == 3 {
|
|
|
- width = 800
|
|
|
- }
|
|
|
+ width := 1200
|
|
|
+ //if reportType == 3 {
|
|
|
+ // width = 800
|
|
|
+ //}
|
|
|
err = ReportToPdf(width, reportUrl, pdfPath)
|
|
|
if err != nil {
|
|
|
utils.FileLog.Info("ReportToPdf failed: , error: \n" + err.Error())
|