Get Rectangle Coordinates

Discussions about document viewing.
Post Reply
DERRYT
Posts: 14
Joined: Fri Jul 03, 2015 3:05 pm

Get Rectangle Coordinates

Post by DERRYT » Thu Dec 17, 2015 3:37 pm

Hi There

A rather complex problem.

Could you please explain why I get different results to my zonal OCR attempts depending on how I load the pdf image.

I use the following code to get the rectangles coordinates
GdViewer1.GetRectCoordinatesOnDocument(ref left, ref top, ref width, ref height);

If I use the following code to load the image my (left, top, width, height) returned are wrong

if (m_NativePDF.LoadFromFile(Passed_Document, true) == GdPictureStatus.OK)
{
GdPictureStatus status = GdViewer1.DisplayFromGdPicturePDF(m_NativePDF);
if (status != GdPictureStatus.OK)
{
MessageBox.Show(status.ToString());
}
openOK = true;
}
else
{
MessageBox.Show("Cannot load image: " + m_NativePDF.GetStat().ToString());
}

If I use the following code to load the image my (left, top, width, height) returned are right (Unfortunately with this method my GdViewer1.PdfGetPageTextArea(GdViewer1.CurrentPage, left, top, width, height) returns nothing.

if (m_NativePDF.LoadFromFile(Passed_Document, false) == GdPictureStatus.OK)
{
int m_ImageID = m_NativePDF.RenderPageToGdPictureImageEx(200, true);
if (m_ImageID == 0)
{
MessageBox.Show("File could not be loaded. Error: " + m_NativePDF.GetStat().ToString());
m_NativePDF.CloseDocument();
}
else
{
if (GdViewer1.DisplayFromGdPictureImage(m_ImageID) != GdPictureStatus.OK)
{
MessageBox.Show("Image could not be Displayed");
}
}
}

Regards
Derry Taylor

DERRYT
Posts: 14
Joined: Fri Jul 03, 2015 3:05 pm

Re: Get Rectangle Coordinates

Post by DERRYT » Tue Jan 05, 2016 8:28 am

Any news on this?

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests