Adding a table to my PDF document

The PDF Creator enables you to create secure PDF documents and to view, print and process existing PDF documents.
If you have any questions about the installation and usage of the PDF Creator please post them here.
Post Reply
chrisM
Posts: 13
Joined: Wed Oct 01 2003

Adding a table to my PDF document

Post by chrisM »

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
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

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.
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

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.
chrisM
Posts: 13
Joined: Wed Oct 01 2003

Post by chrisM »

Thanks for that,

The version of the documentation I have (PDF Creator Version 1.5 )didn't seem to mention the 'Rows' and 'Columns' attributes of the Table object, hence my confusion. But armed with that information, I shall go and give it a try. Watch this space, back soon....

Cheers,
:D
chrisM
Post Reply