|
From: <ro...@zi...> - 2010-09-01 19:41:38
|
Hi, I'm afraid I'm not at all familiar with VB so I don't know how long it will be until proper integration between VB driven applications and Zint may be possible. The shell function you mention is, as far as I know, common to most languages and certainly gives you access to most of the functionality of the Zint library as long as your prepared to put in the legwork required - good lateral thinking on your part :) Unfortunately it doesn't allow things like passing pointers or sharing memory space with the library so will never be as flexible as a proper API. Also I would be interested in knowing if this method allows encoding of data beyond the 7-bit ASCII table - when I tried using Zint in the Windows Vista command shell I was frustrated by it's lack of support for Unicode. I'm quite surprised that the shell command would also be available in VBA. Admittedly I know very little about how the Windows platform works but this seems to me like a real security problem - you effectively give the application scripts access to the command line when it seems only sensible they should be sandboxed. Anyhow, thank you for the tip. Robin. On 01 September 2010 at 21:11 "Walter (Épices de cru)" <wa...@ep...> wrote: > Here is a little workaround to use ZINT in a VBA application. > > > > It’s basic and not quite complete, but it might help some of you getting > started! > > > > You should adjust following the options that are required to your specific > needs. > > > > > > > > > > Function ZintCode() > > > > Dim strZintFolder As String > > Dim strZintCall As String > > Dim strZintOutputFolder As String > > Dim strZintOutputFile As String > > Dim strZintCodeData As String > > Dim strZintFinalString As String > > Dim intZintFormat As Integer > > Dim intQRvers As Integer > > Dim intErrorCorrection As Integer > > > > > > > > strZintFolder = "C:\Program Files\Zint\" 'Folder where zint.exe can > be found > > strZintCall = "zint.exe" 'executable filename. Should > be zint.exe > > intZintFormat = 58 'Selecting which type of > barcode you wish to produce > (http://www.zint.org.uk/zintSite/Manual.aspx?page=3) > > intQRvers = 3 '--vers argument of the > executable. For QR codes. > > strZintOutputFolder = "Y:\QR_CODES\" 'Folder where you want the > files put > > strZintOutputFile = "NewOne435" 'PNG Filename > > strZintCodeData = "Here Is The Code Data !" 'Data to be encoded > > intErrorCorrection = 2 'QR error correction > > > > > > strZintFinalString = strZintFolder & strZintCall & " -b" & intZintFormat & " > -o " & strZintOutputFolder & strZintOutputFile & ".png --vers=" & intQRvers > & "--security=" & intErrorCorrection & " --box --border=2 -d '" & > strZintCodeData & "'" > > > > Call Shell(strZintFinalString, 0) > > > > End Function > > > > > > > > walter2 > > Information confidentielle: Le présent message, ainsi que tout fichier qui y > est joint, est envoyé à > > l'intention exclusive de son ou de ses destinataires; il est de nature > confidentielle et peut constituer > > une information privilégiée. Nous avertissons toute personne autre que le > destinataire prévu que tout > > examen, réacheminement, impression, copie, distribution ou autre utilisation > de ce message et de > > tout fichier qui y est joint est strictement interdit. Si vous n'êtes pas le > destinataire prévu, veuillez en > > aviser immédiatement l'expéditeur par retour de courriel et supprimer ce > message et tout document > > joint de votre système. Merci. > > Confidentiality Warning: This message and any attachments are intended only > for the use of the > > intended recipient(s), are confidential, and may be privileged. If you are > not the intended recipient, > > you are hereby notified that any review, retransmission, conversion to hard > copy, copying, > > circulation or other use of this message and any attachments is strictly > prohibited. If you are not > > the intended recipient, please notify the sender immediately by return > e-mail, and delete this > > message and any attachments from your system. > > > |