设置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 one or more, performance will increase. ExpectBarcodeTypes = BarcodeEncoding.AllOneDimensional, // The DPI (Dots per inch) to render each Barcode image. DPI = 72, // The scaling factor to scale the Width and Height when converting the PDF to Image. // Default is 3.5 Scale = 4 }; // And, apply: 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 } ' And, apply: Private results = BarcodeReader.ReadPdf("barcode.pdf", myPdfOptionsExample)
Install-Package BarCode
IronBarcode在 "PdfBarcodeReaderOptions "类中提供了多种选项,以支持专门针对PDF的定制和优化读取。这将处理 PDF 密码、选择扫描的页面、解析 PDF 的 DPI 以及为提高读取质量所需的任何额外缩放。