Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Jun 09, 2015 9:03 am

I am defining a PDF template.

I can see how to add text:
newPdf.Template.Top.Graphics.DrawString("DOCUMENT TEMPLATE", font, brush, x, y, strFmt);

I can see how to add graphical elements e.g. lines, arcs etc....

Is it possible add a grid ?? or do I have to 'draw' a grid using the graphical elements ??

dh29
 
Posts: 9
Joined: Mon Mar 02, 2015 9:03 am

Tue Jun 09, 2015 9:52 am

Hello,

Thanks for inquiry. Here is the method to add a grid.
http://www.e-iceblue.com/Tutorials/Spir ... -in-C.html
Please let us know if you have any questions or needs.
Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Tue Jun 09, 2015 10:26 am

Hi Gary,

Thank you for your prompt reply, but I am asking if it possible to implement a 'grid' within a PDF Template ??

For a string it is:
newPdf.Template.Top.Graphics.DrawString("DOCUMENT TEMPLATE", font, brush, x, y, strFmt);

Is there an equivalent for a grid ??

Regards,
dh29

dh29
 
Posts: 9
Joined: Mon Mar 02, 2015 9:03 am

Wed Jun 10, 2015 2:58 am

Hello,

I'm afraid that there is no an equivalent method with drawing string, and you can use the following method to draw a grid to template.
Code: Select all
PdfGrid grid = new PdfGrid();
grid.Columns.Add(2);
for (int i = 0; i < 2;i++ )
        {
            grid.Rows.Add();
            grid.Rows[i].Height = 20;
        }
 grid.Draw(newPdf.Template.Top.Graphics);

Please contact us if you have any questions or needs.
Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Wed Jun 10, 2015 8:27 am

Thanks Gary. That has pointed me in the right direction. I'll give it a try and let you know how I get on.

Regards,
dh29

dh29
 
Posts: 9
Joined: Mon Mar 02, 2015 9:03 am

Wed Jun 10, 2015 9:52 am

Hi Gary,

I can now draw Grids in my PDF template.

Many thanks,
dh29

dh29
 
Posts: 9
Joined: Mon Mar 02, 2015 9:03 am

Thu Jun 11, 2015 2:41 am

Hello,

Thanks for your response.
Please feel free to contact us, if you have any questions or needs. We are here for help.

Best Regards,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Return to Spire.PDF