I am seeing intermittent issues with reading DataMatrix style barcodes within a pdf.
Attached are a couple of sample documents that have a barcode, and below is the code I am using to read these barcodes.
Any help on figuring out why I can’t recognize barcodes in these particular pdf’s would be appreciated.
//Sample Code
extractor.BindPdf(pdfStream);
extractor.StartPage = 1;
extractor.ExtractImage();<span style="color:#2b91af;">MemoryStream</span> stream = <span style="color:blue;">new</span> <span style="color:#2b91af;">MemoryStream</span>(); extractor.GetNextImage(stream); stream.Position = 0; <span style="color:#2b91af;">BarCodeReader</span> barCodeReader = <span style="color:blue;">new</span> <span style="color:#2b91af;">BarCodeReader</span>(<span style="color:blue;">new</span> <span style="color:#2b91af;">Bitmap</span>(stream), <span style="color:#2b91af;">BarCodeReadType</span>.DataMatrix); <span style="color:green;">//Only read the first barcode on the page. If they put more than 1 barcode on a page, well, too bad.</span> <span style="color:blue;">if</span> (barCodeReader.Read()) { <span style="color:blue;">string</span> barcodeText = barCodeReader.GetCodeText();<br> }<br></pre><br>Let me know if you have any questions or need additional information.<br><br><br>