Just a simple question, but I don't seem to be able to work it out...
How would I add a table to my document? Say I wanted a 2x2 cell table with a,b,c,d in the cells and each cell a different colour.
Regards,
chrisM
Adding a table to my PDF document
Hello,
I will add here a sample VB code to create a 2x2 table and colore one cell in black.
Please feel free to modify this code upon your needs.
Private Sub cmdInsertTable_Click()
Dim color As ColorConstants
Dim colorA As ColorConstants
color = vbGreen
colorA = vbMagenta
With PDFcreator
' create a table object
.CreateObject acObjectTypeTable, "Table 1"
' position the table object
.ObjectAttribute("Table 1", "Left") = 100
.ObjectAttribute("Table 1", "Top") = 1000
.ObjectAttribute("Table 1", "Right") = 3600
.ObjectAttribute("Table 1", "Bottom") = 2800
.ObjectAttribute("Table 1", "Rows") = 2
.ObjectAttribute("Table 1", "Columns") = 2
.ObjectAttribute("Table 1.Cells[1,1]", "BackColor") = color
.ObjectAttribute("Table 1.Cells[1,1]", "HorzBorders") = "Top"
.ObjectAttribute("Table 1.Cells[1,1]", "VertBorders") = "Both"
End With
End Sub
Please check "Amyuni PDF Creator.pdf" Developers' manual that you received with the product to get a wider idea on how to draw tables using the PDF Creator.
Thanks.
I will add here a sample VB code to create a 2x2 table and colore one cell in black.
Please feel free to modify this code upon your needs.
Private Sub cmdInsertTable_Click()
Dim color As ColorConstants
Dim colorA As ColorConstants
color = vbGreen
colorA = vbMagenta
With PDFcreator
' create a table object
.CreateObject acObjectTypeTable, "Table 1"
' position the table object
.ObjectAttribute("Table 1", "Left") = 100
.ObjectAttribute("Table 1", "Top") = 1000
.ObjectAttribute("Table 1", "Right") = 3600
.ObjectAttribute("Table 1", "Bottom") = 2800
.ObjectAttribute("Table 1", "Rows") = 2
.ObjectAttribute("Table 1", "Columns") = 2
.ObjectAttribute("Table 1.Cells[1,1]", "BackColor") = color
.ObjectAttribute("Table 1.Cells[1,1]", "HorzBorders") = "Top"
.ObjectAttribute("Table 1.Cells[1,1]", "VertBorders") = "Both"
End With
End Sub
Please check "Amyuni PDF Creator.pdf" Developers' manual that you received with the product to get a wider idea on how to draw tables using the PDF Creator.
Thanks.
Hello,
I will add here a sample VB code to create a 2x2 table and colore one cell in black.
Please feel free to modify this code upon your needs.
Private Sub cmdInsertTable_Click()
Dim color As ColorConstants
color = vbGreen
With PDFcreator
' create a table object
.CreateObject acObjectTypeTable, "Table 1"
' position the table object
.ObjectAttribute("Table 1", "Left") = 100
.ObjectAttribute("Table 1", "Top") = 1000
.ObjectAttribute("Table 1", "Right") = 3600
.ObjectAttribute("Table 1", "Bottom") = 2800
.ObjectAttribute("Table 1", "Rows") = 2
.ObjectAttribute("Table 1", "Columns") = 2
.ObjectAttribute("Table 1.Cells[1,1]", "BackColor") = color
.ObjectAttribute("Table 1.Cells[1,1]", "HorzBorders") = "Top"
.ObjectAttribute("Table 1.Cells[1,1]", "VertBorders") = "Both"
End With
End Sub
Please check "Amyuni PDF Creator.pdf" Developers' manual that you received with the product to get a wider idea on how to draw tables using the PDF Creator.
Thanks.
I will add here a sample VB code to create a 2x2 table and colore one cell in black.
Please feel free to modify this code upon your needs.
Private Sub cmdInsertTable_Click()
Dim color As ColorConstants
color = vbGreen
With PDFcreator
' create a table object
.CreateObject acObjectTypeTable, "Table 1"
' position the table object
.ObjectAttribute("Table 1", "Left") = 100
.ObjectAttribute("Table 1", "Top") = 1000
.ObjectAttribute("Table 1", "Right") = 3600
.ObjectAttribute("Table 1", "Bottom") = 2800
.ObjectAttribute("Table 1", "Rows") = 2
.ObjectAttribute("Table 1", "Columns") = 2
.ObjectAttribute("Table 1.Cells[1,1]", "BackColor") = color
.ObjectAttribute("Table 1.Cells[1,1]", "HorzBorders") = "Top"
.ObjectAttribute("Table 1.Cells[1,1]", "VertBorders") = "Both"
End With
End Sub
Please check "Amyuni PDF Creator.pdf" Developers' manual that you received with the product to get a wider idea on how to draw tables using the PDF Creator.
Thanks.