Closed sharathm89 closed 8 months ago
Can you please create a small repo/gist that helps me reproduce the issue?
@PejmanNik here is the github repo link
created node api-server and react report-app
you can refer to readme file to install and run the code.
Attaching the screenshots from above code.
React Website
API Response
@PejmanNik tried below code as well but the results are same. From existing repo you can run make pdf
from api-server folder to test it.
const puppeteer = require("puppeteer");
const { ReportBuilder } = require("@jikji/generator");
async function build() {
const browser = await puppeteer.launch({
args: ["--no-sandbox", "--disable-setuid-sandbox", "--disable-dev-shm-usage"],
headless: "new",
});
try {
await ReportBuilder.browser(browser)
.remoteHost("http://localhost:8024")
.report("/")
.pdf({
path: "./out.pdf",
})
.build();
} finally {
await browser.close();
}
}
build();
I think the issue is related to the graph transition, probably at the time of converting to PDF the bars are still hidden, try to disable this animation or use useLayoutSuspension to delay the print time.
Disabling animation works.. Thanks...
The below screenshot shows graph rendered in browser.
The below 2 sample screenshots are from the PDF generated through code.
JS Code
Sending the pdfbuffer as an attachment in the mail
If its returned to the browser directly even then it doesn't display the graph.