VintaSoft Barcode .NET SDK Discussions

Questions, comments and suggestions concerning VintaSoft Barcode .NET SDK.

Board index < VintaSoft Barcode < VintaSoft Barcode .NET SDK Discussions

We are migrating to new forums engine, no new registration or posting currently available. TIA for your patience.

2D-Code from Outlook contact



2D-Code from Outlook contact

Post by volkerkunze »

Hello,

is it possible to create an 2D-Barcode by assigning an outlook contact file (*.vcf) to the barcode writer?

Greetings from Germany
Volker


Re: 2D-Code from Outlook contact

Post by Alex »

Hello Volker,

Yes, this is possible. You need get content of an outlook contact file as binary data and create 2D barcode from the binary data.

Best regards, Alexander


Re: 2D-Code from Outlook contact

Post by volkerkunze »

Hello Alex,

thanks for your reply. I tried the following code:
Friend Shared Function GetStringFromVCard() As String

        Dim inFile As System.IO.FileStream
        Dim binaryData As Byte()

        inFile = New System.IO.FileStream(<filename>.vcf,
             System.IO.FileMode.Open,
             System.IO.FileAccess.Read)

        ReDim binaryData(CInt(inFile.Length))

        Dim bytesread As Integer = inFile.Read(binaryData, 0, CInt(inFile.Length))

        inFile.Close()

        Dim base64string As String = System.Convert.ToBase64String(binaryData, 0, binaryData.Length)

        Return base64string

    End Function
If I copy the returned string into the BarcodeWriter's <value> property, I get an error "Data region is too large". The string has got more than 7.000 characters. Is this too long for any Barcode or is anything wrong in my code? I tried QR, Aztec, DataMatrix, MaxiCode

Best regards,
Volker


Re: 2D-Code from Outlook contact

Post by Alex »

Hello Volker,

2D barcode can contain maximum 2.5K characters.

You can go 2 ways if you have more than 2.5K characters:
  • Compress your data. I think the contact information can be well compressed. This is the best way.
  • Use the structure append feature and combine up to 16 2D barcodes in one 2D barcode. This is not the best way, because the structure append feature must be used in very special cases.
The example that shows how to write and read the structure append character you can find in the documentation in the overview of the Vintasoft.Barcode.BarcodeInfo.StructureAppendCharacter class:
https://www.vintasoft.com/docs/vsbarcode ... acter.html

Best regards, Alexander


Page 1 from 1: 1