how to highlight a table row when table display has rotation #41
tanmaymandal
started this conversation in
General
Replies: 1 comment
-
Hi All, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi All,
i am working in a project where i have to highlight table rows based on table content search , using tabula-sharp i able to get table content and its perfectly reading and finding text , issue is tabula not highlight , so i am using itext7 to do that , just placing a rectangle with 50% opacity on that rectangle .now problem is what rectangle position its actually getting from text reading , when i place yellow rectangle its completely misplace , after some research i understand there is rotation of 90 degree, so i swap vale of x,y and width , height , now my rectangles are plotting in same column , but row is different. its looks some scaling there too, i tried first 3 records by manual adjusting on modified x's value , so position them in correct place, but i can not able to figure out a formula , interestingly when i tried to put these 3 rectangle with modified value which worked , they again misplaces, in other work at a time one rectangle i can place in position and create new pdf , but if i try to place all 3 it's position again wrong .
what could be cause ? scaling ? dynamic scaling ? or use of 2 tool causing it , i thought 2 tool may looking things from different angle so i tried only in itext as this tool can draw rectangle , even there also position went wrong . out put pdf looks like this . my search was on following keys :

100113971357,
100116368091,
100131210761
here is the list of data , if i search with any one its placing in correct position. but when all 3 its placing in wrong location. i place raw extract , and manual fix , page and page table related data also in json . this is pdf source.
PF ECR ALL PAGE_DN-Input.pdf
Tabula : 100113971357
{
"X": 54.0025,
"Y": 495.0025,
"Width": 56.998476,
"Height": 32.0,
"Page": 2,
"PageWith": 842.0,
"PageHeight": 595.0,
"SearchText": "100113971357",
"tabX": 19.94,
"tabY": 545.065,
"tabWidth": 802.125,
"tabHeight": 466.12500000000006
}
FIX
{
"X": 54.0025,
"Y": 100.0025,
"Width": 56.998476,
"Height": 32.0,
"Page": 2,
"PageWith": 842.0,
"PageHeight": 595.0,
"SearchText": "100113971357",
"tabX": 19.94,
"tabY": 545.065,
"tabWidth": 802.125,
"tabHeight": 466.12500000000006
}
Tabula : 100116368091
{
"X": 54.0025,
"Y": 463.0025,
"Width": 56.998476,
"Height": 24.0,
"Page": 2,
"PageWith": 842.0,
"PageHeight": 595.0,
"SearchText": "100116368091",
"tabX": 19.94,
"tabY": 545.065,
"tabWidth": 802.125,
"tabHeight": 466.12500000000006
}
FIX
{
"X": 54.0025,
"Y": 134.0025,
"Width": 56.998476,
"Height": 24.0,
"Page": 2,
"PageWith": 842.0,
"PageHeight": 595.0,
"SearchText": "100116368091",
"tabX": 19.94,
"tabY": 545.065,
"tabWidth": 802.125,
"tabHeight": 466.12500000000006
}
Tabula : 100131210761
{
"X": 54.0025,
"Y": 439.0025,
"Width": 56.998476,
"Height": 24.0,
"Page": 2,
"PageWith": 842.0,
"PageHeight": 595.0,
"SearchText": "100131210761",
"tabX": 19.94,
"tabY": 545.065,
"tabWidth": 802.125,
"tabHeight": 466.12500000000006
}
Fix :
{
"X": 54.0025,
"Y": 157.0025,
"Width": 56.998476,
"Height": 24.0,
"Page": 2,
"PageWith": 842.0,
"PageHeight": 595.0,
"SearchText": "100131210761",
"tabX": 19.94,
"tabY": 545.065,
"tabWidth": 802.125,
"tabHeight": 466.12500000000006
}
Beta Was this translation helpful? Give feedback.
All reactions