Adds a barcode image to a page in an existing PDF file
Namespace: Inlite.BarcodeGenerator
Assembly: BarcodesForDocuments.NF
Add a barcode to a page in a PDF file at
the coordinates encoded in the configuration string.
static bool AddBarcode (string file, int page, string config, string data)
Add a barcode to a page in a PDF file at specific coordinates.
static bool AddBarcode (string file, int page, double left, double top, string config, string data)
Add a barcode to a page in a file opened
by Open method at coordinates encoded
in configuration string.
bool AddBarcode (int page, string config, string data)
Add a barcode to a page in a file opened by Open method at specific coordinates.
bool AddBarcode (int page, double left, double top, string config, string data)
file
Path to existing PDF file.
page
Page to which barcode image is added
left
Distance from the left edge of a page to left edge of barcode in inches.
top
Distance from the top edge of a page to top edge of barcode in inches.
config
Configuration string form Visual Barcode Designer.
data
Data to be encoded in barcode
true if successful.
Add a barcode to page 1 at the coordinates encoded in the configuration string.
using Inlite.BarcodeGenerator;
...
string data = "123456789";
string config = "yQxuIto3hsY6M7s6P/YLpmYXrzY6F4cjDgLaTqebNp6Xwi4a28/mstpmAib2ZjdTGg7afvOefxcu9";
PdfEditor.AddBarcode ("c:\\in.pdf", 1, config, data);
Add a barcode to page 1 at specific coordinates.
using Inlite.BarcodeGenerator;
...
string data = "123456789";
string config = "yQxuIto3hsY6M7s6P/YLpmYXrzY6F4cjDgLaTqebNp6Xwi4a28/mstpmAib2ZjdTGg7afvOefxcu9";
PdfEditor.AddBarcode ("c:\\in.pdf", 1, 1.0, 3.0, config, data);
Add a barcode to all pages at the coordinates encoded in the configuration string. Include the page number in the barcode data.
using Inlite.BarcodeGenerator;
...
string data = "123456789";
string config = "yQxuIto3hsY6M7s6P/YLpmYXrzY6F4cjDgLaTqebNp6Xwi4a28/mstpmAib2ZjdTGg7afvOefxcu9";
PdfEditor pdf = new PdfEditor();
for (int page = 1; page <= pdf.PageCount(); page++)
pdf.AddBarcode(page, config, data + page.ToString());
pdf.Save("c:\\out.pdf");
Add a barcode to all pages at specific coordinates. Include the page number in the barcode data.
using Inlite.BarcodeGenerator;
...
string data = "123456789";
string config = "yQxuIto3hsY6M7s6P/YLpmYXrzY6F4cjDgLaTqebNp6Xwi4a28/mstpmAib2ZjdTGg7afvOefxcu9";
PdfEditor pdf = new PdfEditor();
for (int page = 1; page <= pdf.PageCount(); page++)
pdf.AddBarcode(page, 1.0, 3.0, config, data + page.ToString());
pdf.Save("c:\\out.pdf");