Writing Barcode jpg to disk file
Hi--
We are using version 3.2 and are, so far, not able to use the 'ExportImage' method to write a jpg image to a folder on our server. The dll is creating a foo.jpg file, but it is shown as broken (red 'X') in a viewer. I opened one of the files with a hex editor and it appears to have the barcode information in it, but as ascii text, not binary data. I'm including the snippet of classic ASP that is calling the dll.
Any and all help is deeply appreciated!!
Dim objBarcode, objStream
Set objBarcode = Server.CreateObject("Morovia.BarcodeActiveX") objBarcode.RasterImageResolution = 96 objBarcode.BorderStyle = 0 objBarcode.ShowComment = false objBarcode.ShowHRText = trueobjBarcode.SymbolMarginTop = 100objBarcode.Symbology = 5 objBarcode.NarrowBarWidth = Request.QueryString("NarrowBarWidth")objBarcode.BarHeight = 500
objBarcode.Message = Request.QueryString("Message") & ".jpg"
objBarcode.ShowHRText = Request.QueryString("ShowHRText")
objBarcode.Font.Size = 9
objBarcode.Font.Name = "Arial"
objBarcode.Font.Bold = True
objBarcode.ShowComment = false
IF (objBarcode.Symbology = mbxInterleaved_2of5 ) THEN
objBarcode.Font.Bold = false 'SCC14 printed with normal font style
objBarcode.BearerBars = true 'Add bearer bars to SCC14
END IF
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = adTypeBinary
objStream.Open
objBarcode.ExportImage objStream, 1
objStream.Position = 0
objStream.SaveToFile "D:\Tradein\Motorola\TradeIn\Barcodes\" & Mailer_label & ".jpg" , 1
'Response.write "<br>Image: <img src='" & Mailer_label & ".jpg' >"
Response.BinaryWrite objStream.Read
objStream.Close
Set objStream = Nothing
Set objBarcode = Nothing
Thanks in advance--
--Jim
We are using version 3.2 and are, so far, not able to use the 'ExportImage' method to write a jpg image to a folder on our server. The dll is creating a foo.jpg file, but it is shown as broken (red 'X') in a viewer. I opened one of the files with a hex editor and it appears to have the barcode information in it, but as ascii text, not binary data. I'm including the snippet of classic ASP that is calling the dll.
Any and all help is deeply appreciated!!
Dim objBarcode, objStream
Set objBarcode = Server.CreateObject("Morovia.BarcodeActiveX") objBarcode.RasterImageResolution = 96 objBarcode.BorderStyle = 0 objBarcode.ShowComment = false objBarcode.ShowHRText = trueobjBarcode.SymbolMarginTop = 100objBarcode.Symbology = 5 objBarcode.NarrowBarWidth = Request.QueryString("NarrowBarWidth")objBarcode.BarHeight = 500
objBarcode.Message = Request.QueryString("Message") & ".jpg"
objBarcode.ShowHRText = Request.QueryString("ShowHRText")
objBarcode.Font.Size = 9
objBarcode.Font.Name = "Arial"
objBarcode.Font.Bold = True
objBarcode.ShowComment = false
IF (objBarcode.Symbology = mbxInterleaved_2of5 ) THEN
objBarcode.Font.Bold = false 'SCC14 printed with normal font style
objBarcode.BearerBars = true 'Add bearer bars to SCC14
END IF
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = adTypeBinary
objStream.Open
objBarcode.ExportImage objStream, 1
objStream.Position = 0
objStream.SaveToFile "D:\Tradein\Motorola\TradeIn\Barcodes\" & Mailer_label & ".jpg" , 1
'Response.write "<br>Image: <img src='" & Mailer_label & ".jpg' >"
Response.BinaryWrite objStream.Read
objStream.Close
Set objStream = Nothing
Set objBarcode = Nothing
Thanks in advance--
--Jim