// ใช้เท็มเพลตนี้เพื่อแทรกบาร์โค้ดในเอกสาร
// <<barcode [barcode_expression] -barcode_type>>
// ระบุเส้นทางไปยังไฟล์เท็มเพลต
string template = "barcode_template.pptx";
// เรียกข้อมูลจากแหล่งที่คุณเลือก
CsvDataSource data_csv =
new CsvDataSource("Barcode Labels.csv",
new CsvDataLoadOptions(true));
// สร้างวัตถุแหล่งข้อมูลที่มีเฉพาะข้อมูลที่จำเป็นเท่านั้น
DataSourceInfo data
= new DataSourceInfo(data_csv, "label");
// เริ่มต้น DocumentAssembler
DocumentAssembler asm = new DocumentAssembler();
// ตั้งค่าคุณสมบัติเพิ่มเติมของบาร์โค้ด
asm.BarcodeSettings.Resolution = 1200;
asm.BarcodeSettings.BaseYDimension = 5f;
// บันทึกเอกสารสุดท้ายที่มีบาร์โค้ดฝังอยู่
asm.AssembleDocument(template, "result.pptx", data);