設置 PDF 條碼讀取器選項
IronBarcode在PdfBarcodeReaderOptions
類中提供了多種選項,專門支持針對PDF的自定義和優化讀取。 此功能將處理PDF密碼,選擇掃描哪些頁面,解析PDF所使用的DPI,以及任何額外的縮放,以提高讀取品質。
using IronBarCode; PdfBarcodeReaderOptions myPdfOptionsExample = new PdfBarcodeReaderOptions() { // The password string to open the PDF if there is one Password = "password123", // Pages of the PDF you want to scan PageNumbers = new[] { 1, 3 }, // By default, all barcode formats are scanned for // Specifying a subset of barcode types to search for would improve performance ExpectBarcodeTypes = BarcodeEncoding.AllOneDimensional, // The DPI (dots per inch) to render each barcode image for reading DPI = 72, // The scaling factor to scale the width and height when converting the PDF to image // Default is 3.5 for both dimensions Scale = 4 }; // Read the pdf with the options applied var results = BarcodeReader.ReadPdf("barcode.pdf", myPdfOptionsExample);
Imports IronBarCode Private myPdfOptionsExample As New PdfBarcodeReaderOptions() With { .Password = "password123", .PageNumbers = { 1, 3 }, .ExpectBarcodeTypes = BarcodeEncoding.AllOneDimensional, .DPI = 72, .Scale = 4 } ' Read the pdf with the options applied Private results = BarcodeReader.ReadPdf("barcode.pdf", myPdfOptionsExample)
Install-Package BarCode
IronBarcode在PdfBarcodeReaderOptions
類中提供了多種選項,專門支持針對PDF的自定義和優化讀取。 此功能將處理PDF密碼,選擇掃描哪些頁面,解析PDF所使用的DPI,以及任何額外的縮放,以提高讀取品質。