Discuss anything related to web development but no technical support questions


Post by RedTeam »

Team Bryntum.

I want to know if there is any way to generate the PDF export with margins.
Now it is generated:
margin.png
margin.png (133.91 KiB) Viewed 3610 times
I need the PDF to have margins as shown in the image.
margin1.png
margin1.png (157.72 KiB) Viewed 3610 times

Post by Terence »

You can put this in your css:
@page {
    margin: 1cm;
}

Post by RedTeam »

I put the code in a css and it does not generate the PDF with margins. You could tell me which page I could put it on.

Post by Terence »

Just to be sure, which backend are you using? The new one based on node shipped with 6.0?

In the export demo of (6.0) I have put it in resources/app.css

Post by RedTeam »

We are with the version 5.1.12

Post by Terence »

The old export doesn't apply the print media setting before export. But you could use the .sch-export rule which is appended on export
.sch-export {
   margin : margin: 1cm;
}

Post by RedTeam »

I put the code in my css when export don't put margin in right side.
margin 1.png
margin 1.png (106.44 KiB) Viewed 3582 times
and when I print some tasks are not shown.
margin 2.png
margin 2.png (156.04 KiB) Viewed 3582 times

Post by Terence »

We can not change any native browser print settings with javascript, you have to adjust the margins and set the corresponding paper size in the browsers print dialog manually. Paper size 'Letter' should correspond with the paper format set in the schedulers print dialog.

Also you can change the DPI, when the page is not fitting correctly. You can set the DPI to a lower or higher level, this will make the paper fit. But please check first if the 'Letter' format is what you've entered in the print dialog on export.

Post Reply