Unable to scan barcode printed on PDF.

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
anshuman82
Posts: 21
Joined: Mon Feb 12 2007
Contact:

Unable to scan barcode printed on PDF.

Post by anshuman82 »

Hi,

I am using below code to print barcode on a PDF File.
The barcode gets printed on pdf file but it doesn't get scanned. Could you please let me know what am i doing wrong because of which barcode is not getting scanned?

If I use the same font on word document then barcode gets scanned on word document.

Please let me know if you need the font file and PDF file in case some investigation is needed.

I would really appreciate an urgent response!
Thanks Anshuman



Private Sub GenerateBarCode_Click()

Dim PDF1 As ACPDFCREACTIVEX.PDFCreactiveX
Dim FileName As String
Dim sfnt As String
Dim obj As Variant


On Error GoTo abc

Set PDF1 = New ACPDFCREACTIVEX.PDFCreactiveX
NewFileName1 = "C:\PDFWriter\ABC.pdf"
With PDF1

.SetLicenseKey "abc", "pqr"
.Open NewFileName1, ""

.CurrentPage = 1
.ReportState = acReportStateDesign


'.ObjectAttribute("txtBarCode", "Text") = "*1234567890*"
'.ObjectAttribute("txtBarCode", "TextFont") = "Code39Wide-Regular, 20,0,0, 0"

.Refresh

sfnt = "Code39SmallLow-Regular,20,0,0,0"
descent = 0
ascent = 0
PDF1.GetFontAttributes sfnt, descent, ascent



' // The font size HAS to be set first for proper resizing.
.ObjectAttribute("txtBarCode", "TextFont") = sfnt

.ObjectAttribute("txtBarCode", "Text") = "*1234567890*"



.ObjectAttribute("txtBarCode", "TextAngle") = 0
.ObjectAttribute("txtBarCode", "BackColor") = "FFFFFF" ' // white


Set obj = .GetObjectByName("txtBarCode")

obj.Selected = 1 ' //select the barcode object

.DoCommandTool acCommandToolBringForward
obj.Selected = 0 '//deselect the barcode object


.Modified = True
.Save "C:\PDFWriter\ToBarcode\TestingNew.pdf", 1 ' save modified document

MsgBox "PDF Saved!"
End With
Set PDF1 = Nothing
Exit Sub

abc:
Set PDF1 = Nothing
MsgBox Err.Description & Err.Source & Err.Number & Err.LastDllError

End Sub
Anshuman
Jose
Amyuni Team
Posts: 553
Joined: Tue Oct 01 2002
Contact:

Post by Jose »

Hello,

Can you explain what you mean by “but it doesn't get scanned”? Is the barcode font being added to the document?


Thanks
anshuman82
Posts: 21
Joined: Mon Feb 12 2007
Contact:

Re:Unable to scan barcode printed on PDF

Post by anshuman82 »

Yeah Font is getting added to the PDF document.
But when I try to scan he barcode on PDF with a scanner, the scanning is unsuccesful.

Please let me know if i have any problems in the code mentioned in previous post or there could by any issue with the font file?

Regards
Anshuman
Anshuman
Post Reply