Hi,
I am planning to buy the pdfstamp.dll library.
how do i embed the code-128 codebar in the doc.
i am using vb6
Function Insert_Code_Bar(inpdf, OutPDF)
id = veryOpen(inpdf, OutPDF)
strStampBuf = "123456789"
iRet = veryAddText(id, 1, strStampBuf, 0, 0, 20, 20, 270, 0, 0, 0, "Code 128", 11, 0, vbNullString, 0)
veryClose (id)
End Function
thanks
Customer
------------------------------------------------------
Thanks for your message, you can use PDFStampWriteTextExW() function to embed barcode text to PDF pages, please refer to following sample VB code,
Private Sub PDFStamper_Click()
VeryStampReg ("XXXXXXXXXXXXXXXXXXXXX")
id = PDFStampOpen(App.Path & "\example.pdf")
If (id > 0) Then
nPage = 1
pagecount = PDFStampGetPageCount(id)
Do While nPage <= pagecount
If (PDFStampEditPage(id, nPage) = 1) Then
nFont = PDFStampSetFontA(id, "Arial Unicode MS", 0, 12, 1, 39)
nRet = PDFStampSetFillColor(id, RGB(255, 0, 0))
strUnicode1 = StrConv("VeryPDF", vbUnicode)
dbTextLen = PDFStampGetTextWidthExW(id, ByVal StrPtr(strUnicode1),
Len(strUnicode1))
nRet = PDFStampWriteTextExW(id, 100, 100, ByVal StrPtr(strUnicode1),
Len(strUnicode1))
Dim strUnicode(0 To 5) As Byte
strUnicode(0) = &H2D
strUnicode(1) = &H4E
strUnicode(2) = &HFD
strUnicode(3) = &H56
strUnicode(4) = &H0
dbTextLen = PDFStampGetTextWidthExW(id, ByVal StrPtr(strUnicode),
UBound(strUnicode) - LBound(strUnicode) + 1)
nRet = PDFStampWriteTextExW(id, 100, 150, ByVal StrPtr(strUnicode),
UBound(strUnicode) - LBound(strUnicode) + 1)
strUnicode2 = ChrW(&H4E2D) + ChrW(&H56FD)
dbTextLen = PDFStampGetTextWidthExW(id, ByVal StrPtr(strUnicode2),
Len(strUnicode2))
nRet = PDFStampWriteTextExW(id, 100, 200, ByVal StrPtr(strUnicode2),
Len(strUnicode2))
PDFStampEndPage (id)
End If
nPage = nPage + 1
Loop
nRet = PDFStampClose(id, App.Path & "\_UnicodeStamper.pdf")
End If
End Sub
VeryPDF
------------------------------------------------------
Hi thank you. But I am talking about embedding the code bar 128 fonts in the document.
I am able to display the code bar properly on my pc but when I send it to someone the code bar does not show the code bar but only the equivalent character , because the font is NOT EMBEDDED.
my question is how do you embed fonts in the pdf.
Thank you.
Customer
------------------------------------------------------
Thanks for your message, you can set "isEmbed" parameter to 1 by PDFStampSetFontA() function to embed barcode font into PDF file, please look at the statement of these functions at below,
Private Declare Function PDFStampSetFontA Lib "PdfStamp.dll" (ByVal hPDF As Long, ByVal fontName As String, ByVal fontStyle As Long, ByVal fontSize As Double, ByVal isEmbed As Long, ByVal nCodePage As Long) As Long
Private Declare Function PDFStampWriteTextExA Lib "PdfStamp.dll" (ByVal hPDF As Long, ByVal x As Double, ByVal y As Double, ByVal lpText As String, ByVal nLen As Long) As Long
Private Declare Function PDFStampWriteTextExW Lib "PdfStamp.dll" (ByVal hPDF As Long, ByVal x As Double, ByVal y As Double, ByVal lpWText As Long, ByVal nLen As Long) As Long
You can set "isEmbed" parameter to 1 to embed font into PDF file, for example,
nFont = PDFStampSetFontA(id, "Code 128", 0, 12, 1, 39)
strText = "123456789"
nRet = PDFStampWriteTextExA(id, 100, 100, strText, Len(strText))
Please feel free to let us know if you encounter any problem with PDFStampSetFontA and PDFStampWriteTextExA functions.