We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Set page margins generated in PDF export

Good afternoon.

I could not find in the documentation any parameters that allow me to configure the margin of the page generated in the PDF export. I found the margin of the header and the footer, and the sides very large and I would like to reduce.

3 Replies

PS Pavithra Subramaniyam Syncfusion Team March 12, 2019 10:01 AM UTC

Hi Fabiano, 
 
Greetings from Syncfusion. 
 
Query : I found the margin of the header and the footer, and the sides very large and I would like to reduce 
 
We have analyzed your query and we suggest to use the beforePdfExport event to achieve your requirement. In the below sample, we have set the margin of the exported pdf document by overriding the default processSectionExportProperties method. Please refer to the below sample and documentation for your reference, 
 
import {PdfPageSettings, PdfPageOrientation} from '@syncfusion/ej2-pdf-export' 
... 
beforeExport(args){ 
      args.gridObject.pdfExportModule.processSectionExportProperties = function (section, pdfExportProperties){ 
            let pdfPageSettings: PdfPageSettings = new PdfPageSettings(); 
            ... 
            pdfPageSettings.margins.setMargins(10); 
            section.setPageSettings(pdfPageSettings); 
         
        return section; 
 
      } 
    }... 
 
 
 
Please get back to us for further assistance. 
 
Regards, 
Pavithra S. 



FM Fabiano Melo March 12, 2019 02:53 PM UTC

Perfect. Tanks!


TS Thavasianand Sankaranarayanan Syncfusion Team March 13, 2019 04:00 AM UTC

Hi Fabiano, 
 
We are happy that the problem has been solved. 
 
Please get back to us if you need any further assistance.  
                          
Regards, 
Thavasianand S.                         


Loader.
Live Chat Icon For mobile
Up arrow icon