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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Set page margins generated in PDF export

Thread ID:

Created:

Updated:

Platform:

Replies:

143243 Mar 11,2019 02:18 PM UTC Mar 13,2019 04:00 AM UTC Angular - EJ 2 3
loading
Tags: Grid
Fabiano Melo
Asked On March 11, 2019 02:18 PM UTC

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.

Pavithra Subramaniyam [Syncfusion]
Replied On 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. 


Fabiano Melo
Replied On March 12, 2019 02:53 PM UTC

Perfect. Tanks!

Thavasianand Sankaranarayanan [Syncfusion]
Replied On 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.                         


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon