Hello,
Thanks for your sharing via email.
I tested the following code to convert the pdf file to images and then scanned the generated images, but found that the data matrix could be recognized successfully. If you are not using the latest
Spire.Office Platinum(Hotfix) Version:6.7.0, please update to the this version and try again.
- Code: Select all
String file = @"MR69-case1.pdf";
PdfDocument doc = new PdfDocument();
doc.LoadFromFile(file);
for (int j = 0; j < doc.Pages[2].ImagesInfo.Length; j++)
{
doc.Pages[2].DeleteImage(doc.Pages[2].ImagesInfo[j].Image);
}
String fileName = "result.png";
using (Image image = doc.SaveAsImage(2, 300, 300))
{
image.Save(fileName, System.Drawing.Imaging.ImageFormat.Png);
String[] result = Spire.Barcode.BarcodeScanner.Scan(fileName);
}
Besides, please kindly note that data matrix is not supported in the evaluation version. You will need to apply a valid license when scanning this type of barcode. Our sales team just sent you a temporary (one month free) license, please refer to this article (
How to Apply the License by license key) to apply your license.
If there are any questions, just feel free to contact us.
Sincerely,
Brian
E-iceblue support team