how can i get all the block coordinates of my image file(pdf)?

asked 25 Nov '13, 11:03

vbknight's gravatar image

vbknight
3115

edited 04 Dec '13, 21:12

please specify the product

(26 Nov '13, 14:54) Anastasia Ga... ♦♦

Using FineReader 11 SDK.


I was able to get the blocks type and coordinateS by using below procedure. Passing loaded document layout.


    private void GetCoordinates(FREngine.ILayout layout)
    {
        foreach (FREngine.IBlock block in layout.Blocks)
        {
            if (block.Type == FREngine.BlockTypeEnum.BT_VectorPicture)
            {
                FREngine.FRRectangle coor = block.Region.BoundingRectangle;
                //left, top, right, bottom
                coordinate = "<block x1='" + coor.Left + "' y1='" + coor.Top + "' x2='" + coor.Right + "' x2='" + coor.Bottom + "'";

            }
            if (block.Type == FREngine.BlockTypeEnum.BT_RasterPicture)
            {
                FREngine.FRRectangle coor = block.Region.BoundingRectangle;
                //left, top, right, bottom
                coordinate = "<segment pageid='' x1='" + coor.Left + "' y1='" + coor.Top + "' x2='" + coor.Right + "' x2='" + coor.Bottom + "'>";

            }
            if (block.Type == FREngine.BlockTypeEnum.BT_Text) {

                FREngine.ITextBlock textBlock = block.GetAsTextBlock();
                //int iPar = textBlock.Text.Paragraphs.Count;
                foreach (FREngine.IParagraph para in textBlock.Text.Paragraphs) {
                    content = para.Text.ToString();    
                }
            }
        }
    }

codedby #J3553#

link

answered 26 Nov '13, 08:50

vbknight's gravatar image

vbknight
3115

edited 04 Dec '13, 21:10

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×41
×16
×15

Asked: 25 Nov '13, 11:03

Seen: 1,713 times

Last updated: 04 Dec '13, 21:12

© 2016 ABBYY. All rights Reserved. www.ABBYY.com | Privacy Policy | Legal