MobileSheets Forums

Full Version: Cropping
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Maybe the hot, record breaking temperatures are slowing down my brain cells but I seem to remember that it was possible to import/export page croppings in the csv.

Am I mistaking?
I only know of the checkbox "Automatically crop pages" in the import dialog.
Yes, but that doesn't help when you have pages with more than one song, and you want to crop out each of the songs individually.

I've done this with a couple of song collection PDFs and it would be nice to share this information.

Mike, would it be feasible to add cropping info to the csv import and export? E.g. in the form widthxheight+left+top (one of the forms often used in image tools) to avoid having to specify multiple items?
Sure, I can add support for that. I'll have to do some basic validation on the cropping coordinates to ensure out-of-range values were not specified (which means loading the document and checking the page sizes), but hopefully this shouldn't slow down the import very much. The automatic cropping actually has to render the page to figure out the cropping coordinates, so it will be much faster than that.


For cropping validation you do not need to render the page, you can just use the page MediaBox or CropBox.
You realize that crops go with pages? So the page range for a song that starts about halfway page 15 (pagesize 599x830) and extends to halfway page 17 would become something similar to "15@599x420+0+410,16,17@599x410+0+420".

A abbreviated form could be "15@+410,16,17@-420" (only vertical crop).

Just some ideas...
Exactly - that's what I was saying. I do not need to render the page for this new capability, so just loading the page to read the mediabox or cropbox should be plenty fast. I was comparing that to automatic cropping where I do need to render the page to analyze the pixels to figure out how much of the page can be cropped without eliminating content.

So you want to include the cropping as part of the page order? I had assumed it would be a different column, but I guess I can see that is makes sense to include it with the page order. I'll just have to write some new parsing code to replace the existing page order parsing.