Hi Nicola,
Thank you for using Syncfusion Products.
In the code snippet, which you have posted in the last update has the code to add new page to the created PDF document before assigning the converted Excel to PDF file as shown below:
This the reason for the addition of the extra page in the beginning of the document.
This can be avoided by adding the new page and setting the width of the header manually, in order to set the default width of the page as header width, please refer the below code snippet:
//Setting the header bounds
RectangleF rect = new RectangleF(0, 0, 515, 50);
//Create page template
PdfPageTemplateElement header = new PdfPageTemplateElement(rect);
|
Please find the width details of a A4 page:
Default width: 595.
Default margin value for left and right: 40
Width of the page after applying left and right margins: 595-40-40= 515.
We have attached a sample with the made changes, please find it from the below link:
Let us know if you need any further assistance regarding this.
Regards,
Surya Kumar