Recent

Author Topic: SAVE StringGrid to PDF  (Read 4551 times)

dseligo

  • Hero Member
  • *****
  • Posts: 1443
Re: SAVE StringGrid to PDF
« Reply #30 on: December 14, 2024, 06:50:20 pm »
I was just correcting your compiling error.

In procedure DrawLineUnderHeading you draw on your screen canvas, not on the PDF.

Add this above For loop in SaveToPDF procedure:
Code: Pascal  [Select][+][-]
  1. Page.DrawLine(15, YPos, 15 + StringGrid1.ColCount * 20, YPos, 1);

seghele0

  • Sr. Member
  • ****
  • Posts: 253
Re: SAVE StringGrid to PDF
« Reply #31 on: December 15, 2024, 01:14:48 pm »
Thanks for the code.
You can view the result in attachment.
After opening the PDF, a diagonal line is applied to the top left of the Form.
 ::)

dseligo

  • Hero Member
  • *****
  • Posts: 1443
Re: SAVE StringGrid to PDF
« Reply #32 on: December 15, 2024, 01:35:54 pm »
Thanks for the code.

You're welcome

Quote
After opening the PDF, a diagonal line is applied to the top left of the Form.

You draw that line in procedure DrawLineUnderHeading. Don't call this procedure if you don't want that line.

seghele0

  • Sr. Member
  • ****
  • Posts: 253
Re: SAVE StringGrid to PDF
« Reply #33 on: December 15, 2024, 01:47:35 pm »
Attached I leave you the test application, with custom code.
Finally got hold of the code.
Thank you all and hopefully this is an instructive contribution for non-professional progrtammeurs.
 ;)
Code: Pascal  [Select][+][-]
  1.    // Draw line below header
  2.     YPos := YPos + HeaderHeight;
  3.     Page.DrawLine(15, YPos, 30 + (StringGrid1.ColCount - 1) * 20, YPos, LineThickness);    


 

TinyPortal © 2005-2018