ITextSharp - get image at a particular location -


I need to do a 2D Datamatriks (bitmap) bar code extract and read it. I can do this work, but I must loop through all the images on every page. It's taking a long time when I have 1000 pages, so I was wondering if it was possible to define the location of the image (barcode) where the image was?

The bar code is always the same place I note:.

Thanks for any help I am able to use

Code Spire.Barcode from RenderFilter piece> Public class MyRegionTextRenderFilter: RenderFilter {/ ** to allow text from region / / Personal RectangleJ filterRect; Public pdfImageObject image; / ** * Creates a filter * @PRAM Filter by highlighting the rectangle to filter the text Note that this is a java.awt.Rectangle! * / Public MyRegionTextRenderFilter (RectangleJ filterRect) {this.filterRect = filterRect; } / ** * Creates a filter * @param filter, outline the rectangle to filter the text. * / Public MyRegionTextRenderFilter (iTextSharp.text.Rectangle filterRect) {this.filterRect = new RectangleJ (filterRect); } / ** * @see com.itextpdf.text.pdf.parser.RenderFilter # allowText (com.itextpdf.text.pdf.parser.TextRenderInfo) * / public override bool AllowImage (ImageRenderInfo renderInfo) {var matrix = renderInfo.GetImageCTM (); Float left = matrix [6]; Float top = matrix [7]; Float width = matrix [0]; Float height = matrix [4]; Return filter area. Content line (left, top, width, height); }}

calling code:

  RectangleJ rect = new RectangleJ (518.0f, 18.0f, 23.0f, 23.0f); PdfReaderContentParser parser2 = New PdfReaderContentParser (pdfReader); Renderfilter [] renderfilter = new renderer filter [1]; Render filter [0] = new MyRegionTextRenderFilter (rect); Fildetedtekstrenderlaistr Linrnr 2 = new filter Kiatekstrenderlaistnr (new Lokeshntekst Extraction Strategy (), Renderfiltr); Parser2.ProcessContent (3, listener2); 

Using filtering information:

  Public abstract class RenderFilter {/ ** * @param renderInfo * @return is to render the true text operation, then should be performed * / public virtual bool AllowText (TextRenderInfo renderInfo) {true return; } / ** * * @ Ultimate RenderInfo * @ Return is correct Image render operation should be done * / Public Virtual Bull Approval (ImageRenderInfo renderInfo) {Back to Truth; }}  

There is already a render filter on the basis of the field, for the filter is render.

Just copy it and add a for your work. AllowImage (ImageRenderInfo renderInfo) Allow the existing text (for example Text ReadInterInfo RenderInfo) Method.


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -