• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Internals: Crop values
#1
When a song page from a (possibly larger) PDF is cropped, this is registered in the database table Crop.
I was wondering what the exact interpretation of the values for Left/Top/Right/Bottom is.
I'd like to use these values for an external tool to apply the same crop to the pages.
Johan
johanvromans.nl — hetgeluidvanseptember.nl — mojore.nl -- howsagoin.nl
Samsung Galaxy Note S7FE (T733) 12.4", Android 13.0, AirTurn Duo & Digit (Gigs).
Samsung Galaxy Note S4 (T830) 10.5", Android 10.0 (maintenance and backup).
Samsung A3 (A320FL), Android 8.0.0 (emergency).
Reply
#2
That's interesting. Maybe these coordinates can be exported and used for another import by csv? Kind of saving the crop data without a full backup?
Reply
#3
They are the coordinates relative to the file page dimensions. So to use them, you will need to open the file and read the size of the page.
Reply
#4
This is what I thought, but the numbers just do not match.
For example, in one of my PDFs all pages have the same dimensions (mediabox 597.0 x 828.0). In the Crop table I see typical values of 596 and occasionally 598 (right) and 824 and 827 (bottom).

For page dimensions, do you use MediaBox, CropBox, BleedBox, TrimBox or ArtBox?
Johan
johanvromans.nl — hetgeluidvanseptember.nl — mojore.nl -- howsagoin.nl
Samsung Galaxy Note S7FE (T733) 12.4", Android 13.0, AirTurn Duo & Digit (Gigs).
Samsung Galaxy Note S4 (T830) 10.5", Android 10.0 (maintenance and backup).
Samsung A3 (A320FL), Android 8.0.0 (emergency).
Reply
#5
(07-05-2017, 05:27 AM)BRX Wrote: That's interesting. Maybe these coordinates can be exported and used for another import by csv? Kind of saving the crop data without a full backup?

Exactly  Smile
Johan
johanvromans.nl — hetgeluidvanseptember.nl — mojore.nl -- howsagoin.nl
Samsung Galaxy Note S7FE (T733) 12.4", Android 13.0, AirTurn Duo & Digit (Gigs).
Samsung Galaxy Note S4 (T830) 10.5", Android 10.0 (maintenance and backup).
Samsung A3 (A320FL), Android 8.0.0 (emergency).
Reply
#6
I use the MediaBox for the page dimensions. i believe I am setting the right value of the crop rectangle to pageWidth - 1 and the bottom value to pageHeight - 1 if you drag the cropping boxes all the way to the edges of the page. If you clear the cropping, I set it to 0,0,0,0, so that's how you can identify when no crop has been applied. During some of my processing, if I calculate that cropping was applied, I set pageWidth = width of the cropping box + 1, and pageHeight = height of the cropping box + 1, and verify that I haven't exceeded the raw page dimensions (otherwise I clamp).
Reply




Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2024 MyBB Group.