Rank: Newbie Groups: Member
Joined: 8/21/2015 Posts: 1
|
Can someone please post some code about how to either extract a barcode from the pdf or how to save a portion of a page to a memory stream? I am using a 3rd party package to read the barcode and process it but the package is not overly performant. So I am currently using a competitor to EO.PDF and I loop through each page and save a portion of that page to a memory stream as an image. I then feed that image into the barcode parser and check for a barcode. I can understand if EO.PDF does not parse for a barcode, but I would need to know how to save some portion of each page into a memory stream. I have given an example of the code I currently use below:
doc.PageNumber = i; System.IO.MemoryStream ms = new System.IO.MemoryStream(); doc.Rendering.Save("barcode.tif", ms); System.Drawing.Rectangle area = new System.Drawing.Rectangle(0, 0, 1700, 800); r = BarCodeReader(new System.Drawing.Bitmap(ms), area, BarCodeReadType.DataMatrix); if(r.read()) //Do something with barcode
I hope this makes sense as to what I am doing here. Thanks in advance
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
You will not be able to use EO.Pdf to do that. Of the two features you are looking for: A. Render a PDF page into an image, B. Extract barcode from an image, neither exists in our product. Sorry about it!
Thanks!
|