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.

Fri Mar 01, 2013 12:19 pm

Hello,

I am fairly new in VB and try to just having Spire.PDF

I currently try a table with 2 rows and in the 2nd row to add a further table with 1 row and 2 columns. The contents of the tables are in each label's

Someone could perhaps give an example code?

Thank you very much

PS: I once appended a screenshot.

Askerion
 
Posts: 1
Joined: Fri Mar 01, 2013 10:08 am

Thu Mar 07, 2013 9:13 am

Dear Askerion,

Thanks for your inquiry.
We are sorry for the delay response.
Please refer to sample coed below.
Code: Select all
Dim document As New PdfDocument()
Dim page As PdfPageBase = document.Pages.Add(PdfPageSize.A4)

Dim grid As New PdfGrid()
grid.Columns.Add(1)
grid.Columns(0).Width = page.Canvas.ClientSize.Width
Dim row0 As PdfGridRow = grid.Rows.Add()
row0.Cells(0).Value = "Wartung und Instandhaltung"
row0.Cells(0).StringFormat = New PdfStringFormat(PdfTextAlignment.Center, PdfVerticalAlignment.Middle)
Dim row1 As PdfGridRow = grid.Rows.Add()

Dim grid1 As New PdfGrid()
grid1.Columns.Add(2)
Dim row11 As PdfGridRow = grid1.Rows.Add()
grid1.Columns(0).Width = grid.Columns(0).Width / 2
grid1.Columns(1).Width = grid.Columns(0).Width / 2
row11.Cells(0).Value = "SOP Nr.TECH-1003 /Version-Nr.xx"
row11.Cells(0).StringFormat = New PdfStringFormat(PdfTextAlignment.Left, PdfVerticalAlignment.Middle)
row11.Cells(1).Value = "Anlage 01"
row11.Cells(1).StringFormat = New PdfStringFormat(PdfTextAlignment.Right, PdfVerticalAlignment.Middle)
row1.Cells(0).Value = grid1
row1.Cells(0).StringFormat.Alignment = PdfTextAlignment.Center

Dim result As PdfLayoutResult = grid.Draw(page, New PointF(0, 10))

document.SaveToFile("sample.pdf")


If you need more assistance, please feel free to contact us.

Best regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Thu Mar 14, 2013 9:14 am

Dear Askerion,

Does our previous code solve your problem?
Please give you a feedback on this issue at your early convenience.
Thank you!
If you have other any problem, please tell us.

Best regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.PDF

cron