Page break shifted when adding header

Hello all,

I unfortunately have to bring this topic up again 4 years later in the Asp.Net Core environment. I am working with version 20.1.0.50 and here the same error exists. If a header is assigned to a document, the page break of the first page is shifted by the height of the header. The footer is not affected. I am happy to attach my code.


With kind regards


Attachment: TestPdfService_356a604f.rar

6 Replies 1 reply marked as answer

IJ Irfana Jaffer Sadhik Syncfusion Team April 20, 2022 11:34 AM UTC

Hi Igno,


We were able to reproduce the reported behavior with provided details on our end. Currently, we are validating on this and will update the further details on April 22nd, 2022.


Regards,

Irfana J.



IJ Irfana Jaffer Sadhik Syncfusion Team April 22, 2022 01:57 PM UTC

Hi Igno,


On our further analysis, we can overcome this issue in sample level to create the pdf page after adding header and footer. Because page client size does not update properly, if adding the document header after creating the page. So that, the reported spacing issue occurs first page alone. We have modify the sample with this solution. Please find the download link below,

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Sample-1170951227

Output PDF: https://www.syncfusion.com/downloads/support/directtrac/general/pd/test1922731895


Please let us know, if you need further assistance on this.


Regards,

Irfana J.



IN Ingo April 22, 2022 05:14 PM UTC

Hello all,


thank you for the quick reply.

Unfortunately, that does not solve the problem.


The error is simply moved up a bit.

Now the spacing is added directly under the header.


Do you have any other suggestions or could you not just patch the problem?


With kind regards



IJ Irfana Jaffer Sadhik Syncfusion Team April 25, 2022 12:28 PM UTC

Hi Igno,


On our further analysis, reported spacing behaviour occurs due to that, drawing rectangle with specific Y location. Please refer your below code snippet,

  graphics.DrawRectangle(blackPen, Rectangle(20, 27, 85, 40));

 graphics.DrawRectangle(blackPen, Rectangle(125, 32, 75, 52.5f));


We can able to over come the spacing behaviour to draw the rectangle in 0th Y position. We have modify the sample with this solution. Please find the download link below,

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Sample-144239440

Output PDF: https://www.syncfusion.com/downloads/support/directtrac/general/pd/test11983319629


Please let us know, if you need further assistance on this.


Regards,

Irfana J.


Marked as answer

IN Ingo April 28, 2022 10:08 PM UTC

Nice 1.
Thank you very much!

Feel free to distribute the template, it complies with the German DIN 5008 standard and can be used as an invoice letter.


With kind regards



GK Gowthamraj Kumar Syncfusion Team April 29, 2022 09:37 AM UTC

Hi Ingo,

Thank you for your update. We hope the sample provided was useful.


Please let us know if you need any further assistance in this.


Regards,

Gowthamraj K


Loader.
Up arrow icon