Can i put a barcode on my pdf?
If is it possible which font should I use ?
===========================
The following products are all contain barcode fonts,
1. PDFStamp SDK product,
https://www.verypdf.com/pdfstamp/index.htm#dl
you can use following code to embed barcode fonts into PDF file,
void EmbedBarcodeFonts()
{
long id;
int nRet = -1;
char szOutPDF[MAX_PATH];
char szPDFFile[MAX_PATH];
GetModulePath(szPDFFile,"example.pdf");
GetModulePath(szOutPDF,"out-embedfont.pdf");
id=VeryStampOpen(szPDFFile,szOutPDF);
if(id>0)
{
VeryStampSetFunction(id, Very_Set_EmbedFont, 1, 0, 0, 0);
VeryStampAddText(id, 1, "0123456789", RGB(0, 0, 0), 0, 0, 0, 0, 0, 0, 0, "Free 3 of 9", 8, 1,"https://www.verypdf.com/",0);
VeryStampAddText(id, 2, "0123456789", RGB(0, 0, 0), 0, 0, 0, 0, 0, 0, 0, "Free 3 of 9,Bold", 8, 1,"https://www.verypdf.com/",0);
VeryStampAddText(id, 3, "0123456789", RGB(0, 0, 0), 0, 0, 0, 0, 0, 0, 0, "Free 3 of 9,Italic", 8, 1,"https://www.verypdf.com/",0);
VeryStampAddText(id, 4, "0123456789", RGB(0, 0, 0), 0, 0, 0, 0, 0, 0, 0, "Free 3 of 9,Italic,Bold", 8, 1,"https://www.verypdf.com/",0);
VeryStampClose(id);
}
}
2. VeryPDF Form Filler SDK (COM) v3.1,
https://www.verypdf.com/pdfform/index.html#dl
https://www.verypdf.com/pdfform/pdfformsdk.zip
VeryPDF Form Filler SDK (COM) v3.1 can be used to fill the various barcodes into PDF forms, please refer to the sample code at below,
void main(int argc, char *argv[])
{
char szBarcodeTemp[MAX_PATH];
GetModulePath(szBarcodeTemp, "Barcode-temp.pdf");
char szBarcodeNew[MAX_PATH];
GetModulePath(szBarcodeNew, "_Barcode-out2.pdf");
BOOL bRet = FALSE;
PDFForm_SetLicenseKey("XXXXXXXXXXXXXXXXXXXXX");
string strFormValues;
strFormValues += "BarCode1[0]=>Code128=>1234567890";
strFormValues += "\n";
strFormValues += "BarCode2[0]=>Code39=>1234567890";
strFormValues += "\n";
strFormValues += "BarCode3[0]=>Codabar=>A1234567890A";
strFormValues += "\n";
strFormValues += "BarCode4[0]=>Datamatrix=>01034009377771791712073110BXBWWW22";
strFormValues += "\n";
strFormValues += "BarCode5[0]=>EAN=>01234567890100";
strFormValues += "\n";
strFormValues += "BarCode6[0]=>Inter25=>123456789";
strFormValues += "\n";
strFormValues += "BarCode7[0]=>PDF417=>1234567890";
strFormValues += "\n";
strFormValues += "BarCode8[0]=>Postnet=>1234567890";
bRet = PDFForm_InsertBarcodeIntoPDF2(szBarcodeTemp, szBarcodeNew, strFormValues.c_str());
printf("Return value is: %d\n", bRet);
return;
}
VeryPDF
One Reply to “put a barcode into PDF file”