I want to export one of my razor. page to pdf. The screenshot is shown in the attachment. Before the pdf is generated a new window with the desired content is populated by the following code:
var a = window.open('', '', 'height=700,width=480');
a.document.write('<html>');
a.document.write('<head>');
a.document.write('<link rel='nofollow' href="css/app.css" rel="stylesheet"/>');
a.document.write('<link rel='nofollow' href="Mladim.Client.styles.css" rel="stylesheet"/>');
a.document.write('<link rel='nofollow' href="_content/Syncfusion.Blazor/styles/bootstrap5.css" rel="stylesheet"/>');
a.document.write('<link rel='nofollow' href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet"/>');
a.document.write('<\/head>');
a.document.write('<body>');
a.document.write('<div style="width:600px;">');
a.document.write(document.getElementById(divName).innerHTML);
a.document.write('<\/div>');
a.document.write('<\/body>');
a.document.write('<\/html>');
I
It is worth mentioning that I purposely added div with a width of 600px which wraps the entire content. This allows the width of content to fit inside the A4 format. The problem is that the charts are not adjust to 600px but they are the same width as the screen size, Please see image in attachment. Is it possible to solve my issue somehow?
Attachment:
img_dea7a097.zip