Print Page | Close Window

Barcode in table

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1332
Printed Date: 01 Feb 26 at 9:39PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Barcode in table
Posted By: doug_b
Subject: Barcode in table
Date Posted: 01 Feb 10 at 9:08PM

Can a barcode be put into a table cell?




Replies:
Posted By: Ingo
Date Posted: 02 Feb 10 at 6:30AM
Hi Doug!

In the online-documentation you can read that the barcode will be drawn on the page.
So why not drawn in a cell of a page? Try it.
If you're speaking from an Excel-cell ... After drawn on the pdf-page you can convert it to an image and then insert it into a cell.

Cheers, Ingo



Posted By: doug_b
Date Posted: 02 Feb 10 at 3:12PM
Thanks for suggestions.

I'm trying to layout some shipping labels with bar-codes. I just thought that maybe there was a way to place a bar-code using the table structure. If not, I will just calculate the correct location on the page and use DrawBarcode function. 

Below is a sample of my code. 

           ' Set the page size of the new document
            qp.SetPageSize(PageSize)

            ' Set the Measurement Units to Inchs
            qp.SetMeasurementUnits(2)

            ' Create the table and specify the number of rows and columns
            Dim tableID As Integer
            tableID = qp.CreateTable(10, 3)

            ' Specify color and width of borders   
            qp.SetTableBorderColor(tableID, 0, 1, 1, 1)
            qp.SetTableBorderWidth(tableID, 0, 0.01)

            ' Specify table row height
            For row = 1 To 9 Step 2
                qp.SetTableRowHeight(tableID, row, row, 0.5)
                qp.SetTableRowHeight(tableID, row + 1, row + 1, 1.5)
            Next

            ' Specify table column width
            qp.SetTableColumnWidth(tableID, 1, 3, 3.9)
            qp.SetTableColumnWidth(tableID, 2, 2, 0.2)

            ' Specify Cell Padding
            qp.SetTableCellPadding(tableID, 1, 1, 5, 3, 0, 0.05)

            ' Insert the content for cells
            For col = 1 To 3 Step 2
                For row = 1 To 9 Step 2

'---> I would like to add a barcode 
                    qp.SetTableCellContent(tableID, row, col, "1234567890123")
'---
                    qp.SetTableCellContent(tableID, row + 1, col, _
                    "<p align=""center"">1234567890123</p>")

                Next
            Next

            ' Draw the table onto the document
            Dim s As Double
            s = qp.DrawTableRows(tableID, 0.25, 10.5, 10.5, 1, 0)

            ' Save the document to disk
            qp.SaveToFile(output)

            ' Check to see if the table could be created
            If s = False Then
                MsgBox("Could not create table!")
            End If

            Process.Start(output)



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk