Posts: 112
Threads: 38
Joined: May 2015
Reputation:
1
08-14-2016, 02:14 AM
(This post was last modified: 08-14-2016, 02:15 AM by Alan Evans.)
I often have to load .pdfs people have sent me into MSP. The problem is that these pdfs are often slanted (differing per page) which means I end up with a stiff neck and/or cross-eyed trying to read and play them.
It would be ENORMOUSLY helpful if it was possible to rotate each page seperately (in percent) in order to make the music appear visually straight on the screen.
Would this be possible to implement Mike, or is it something that you say I should give up on?
I could, of course, fix the pages in Photoshop, and I figured that if I were to start doing it in Photoshop tomorrow, I should finish somewhere around 3 months after I'm dead.
Save me, please
Posts: 16,288
Threads: 315
Joined: Apr 2012
Reputation:
310
You can rotate each page by factors of 90 degrees, but at the moment, rotating pages by an arbitrary angle is not supported. The reason for this is that a number of things become significantly more complex when rotating by a value that is not a factor of 90 (that's why many apps don't support that). For reference, to rotate each page individually, tap the "Settings" action at the top of the song editor and change the "Apply Rotation" to "Current Page Only".
I'm not sure if I'll be able to support that feature... I've wanted to implement an automatic deskew feature, but that's fairly complex as well (as it basically involves the same kinds of calculations). I think the only way it would be possible is if it's a destructive action, meaning that, unlike the normal rotation feature in MS Pro, it will rotate the actual file itself so that I don't have to do any crazy calculations in MS Pro. For a PDF, this would mean overwriting the original PDF with a new one that I would build (which can potentially increase the PDF size a lot and make it slower to load as the PDF library I'm using for that isn't great at optimization).
Posts: 112
Threads: 38
Joined: May 2015
Reputation:
1
Oh rats, Mike, I was afraid you would say that :-(
I know of the 90 degrees rotation posibility, but that won't help as the printed music/text would still be slanted (only on it's side ;-)
It's really just the arbitrary angle that would help. An auto deskew feature would require some sort of intelligent algorithm that guessed how crooked the music was on the page, I assume. Now that would be quite a feat to achieve!
But if some brilliant possibility pops up into your head about how to do the arbitray rotation, I'll be first in line to thank you profusely and call the bartender over.
Thanks for your quick response :-)
Posts: 1,385
Threads: 100
Joined: Jul 2013
Reputation:
6
Almost every Android scanning app I have looked at will automatically correct skew (they have to, it's unlikely you would do a scan without some).
I'm wondering if there is one of these apps that would take a pdf file as input and then correct it? Might be worth having a look around and see if such a thing exists.
I don't think Mike's concerns about it being a destructive actionare that much of a worry - who would want a skewed display anyway?
Posts: 144
Threads: 9
Joined: Jun 2015
Reputation:
0
08-16-2016, 09:02 AM
(This post was last modified: 08-16-2016, 09:03 AM by Steve B..)
Adobe Acrobat 8 Professional is available as a free download from Adobe.
It's an older version with far fewer features than the current version, but it does have an option to 'Optimize' an existing PDF document.
One of the options in 'Optimize' is 'de-skew'.
I've never needed to use it (and I don't have any skewed PDFs to try it on), so I don't know how well it works.
Considering that it's free, it's probably worth a try. Nothing to loose, eh?
Steve
I could be wrong, it happened once before.
Posts: 112
Threads: 38
Joined: May 2015
Reputation:
1
08-16-2016, 09:38 AM
(This post was last modified: 08-16-2016, 09:52 AM by Alan Evans.)
Thanks, Graeme and Steve.
I actually took Graeme's suggestion that an app might do the trick and google-oogled the question until I got Acrobat as a possible solution. Lo and behold, I actually own Acrobat X Pro. Stupido moi.
There is no manual deskew function in Acrobat. Deskew is one of the automated options you can choose as part of the Document Processing function.
Well, after some trial and error, I can say that it works. Sometimes. Or rather, sometimes the results are close to perfect, sometimes the end result is no better than the original at all. It's better than nothing, but as I said, the results are hit and miss. Why it works sometimes with some .pdfs and not at all on others is beyond me. I thought it might have something to do with schmutz on the page built up from bad copies, so I first cleaned it up in Photoshop, then created a "cleaner" .pdf and tried again. No luck. Strange, but having to clean a .pdf before deskewing is so time intensive that it negates the possibility of that being an option. Not that it helped.
It's now clear to me than an automated deskew function is only partially okay.
A function to deskew in percent is really what's needed.
I guess we're back to pleading with Mike ;-)
Posts: 911
Threads: 88
Joined: Dec 2013
Reputation:
10
Dell Latitude 13.5" 2-in-1 Ubuntu/Win 11
Samsung Note Pro SM-P900 12.2 Android 5.0.2
Samsung S7+, Android 12
Posts: 1,385
Threads: 100
Joined: Jul 2013
Reputation:
6
Check out the Android app Scantex - https://play.google.com/store/apps/detai...al.ocrscan - This allows you to load an existing pdf file and can deskew it.
I didn't have any bad pdf files (I corrected mine a long time ago) so I just took a deliberately skewed photograph and then got the app to process it, worked pretty well.
Posts: 9
Threads: 1
Joined: May 2024
Reputation:
0
+1 on this feature.
Coming from ForScore, I have used its manual de-skew feature fairly often to help with manual scans, so it would be a 'nice-to-have' on MS!
Posts: 1
Threads: 0
Joined: Jan 2025
Reputation:
0
+1 to this feature. I know how to do this in other tools, and I don't need a fancy auto-deskew although longer term that would be fabulous. It would just be awesome if MobileSheets had a built-in freehand rotation to supplement the existing 90-degree rotation functionality.
Thanks!
Posts: 16,288
Threads: 315
Joined: Apr 2012
Reputation:
310
The camera taking feature already has curvature correction, and you can tap the three dots next to a file, tap "Image Correction" and this will deskew images automatically as well. I'm going to add a dedicated feature for this though that lets users control the rotation with an option to try to automatically detect that angle. I will then rebuild the PDF from the rendered pages.
Mike
Posts: 43
Threads: 6
Joined: Dec 2023
Reputation:
0
08-17-2025, 05:06 PM
(This post was last modified: 08-17-2025, 05:08 PM by alternativepets.)
In 2024 I requested these features: 1) Reverse cropping (adding more blank margin) and 2) Rotation by single degrees.
Mike replied:
Quote:1) Reverse cropping - this requires the entire PDF to be rebuilt if I add margins to each page. Alternatively, I could add an optional page margin that can be set per page of each song, and the rendered page size would just be reduced by this margin (having the exact same effect as zooming out past 100%). However, if I want to allow users to annotate in these margins, for example, that would require either substantial changes to how pages are measured and rendered, or I'd have to rebuild the PDF with the margins in place. Did you say forScore supports this? I can't find any information on that, and I can't find a setting to do that in forScore itself on my iPad.
2) Rotation by single degrees - This is supported in a sense, but a little harder to find. You have to edit the song, go to the Files tab, tap the three dots next to the file, tap "Image Correction", let all of the pages be processed, and then you can draw the rectangle around each page and it will be automatically straightened. This ensures that when the PDF is rebuilt with the new images, it is fully optimized. It's quite difficult to adjust pages by single degrees, because the PDF specification does not support this (that's why Adobe Acrobat doesn't support this, for example). What really has to happen is the software either has to do the rotation itself (separate from the file, which then significantly complicates annotations, hyperlinks, etc) or the file has to be rebuilt with new images (which strips out things from the original file like bookmarks, hyperlinks, attachments, etc). I'm not sure which approach forScore takes, but I'm assuming it's probably the second option (rebuilding the file). The current cropping feature in MobileSheets is completely non-destructive, meaning it doesn't alter the original PDF in any way (and also works for image files). For that reason, I don't think I'm going to support adding margins in the same fashion as forScore - I'll probably have a separate screen for adding margins with warnings about the original PDF being modified, as the users on the forum were adamant that I should never modify their PDFs without explicit warning. I may also tackle having a dedicated screen for rotating pages that utilizes the same library used with the image correction feature to actually construct the PDF, so the same optimizations are applied. I'll once again have to make sure to warn users that the PDF will be rebuilt and hyperlinks and other embedded content will be lost.
I researched this a little more, and I think I know what forScore is doing (and it's something I can do as well). The PDF specification supports changing the page rectangle which defines the border of the page, and if you increase the size of that, it just effectively adds margins on the side of the page. I tested this out real quick by adding 50 pixels of margin on each edge of a page, and the page was correctly centered but with additional margins on each side. So this does modify the original file (and I would need to warn users about that), but it's also something you can remove easily by just changing the page rectangle back to the original size and saving out the changes. So this is all a lot easier (and cleaner) to add than I was expecting. I probably can do this all from the cropping page, but I personally don't love the way the cropping works in forScore where you zoom in/out to define the cropping region, as I prefer being able to more easily adjust the cropping on each side of the page (other users may feel differently). I may still support the concept of pinch zooming to increase/decrease the cropping rectangle though, and if the option to add margins is enabled, zooming out past the original page size will shrink it down and add margins. I think that will still feel pretty intuitive and easy to use while allowing users to specify different margins for each side of the page if desired.
Bummer...this rotation/deskewing method automatically applies a b&w filter to every page. So in order to use it for deskewing only, I would have to go through all 100 pages and click "no filter" on each page.
Mike:
Quote:That is true - it currently defaults to grayscale (which the third party library calls black & white) in order to fully optimize the PDF and reduce its size. I'm doing my best to try to manage the huge amount of work for a single person. I just haven't had time to write up documentation on the newer features yet. Ultimately, it would be best for me to add a separate rotation feature that doesn't apply a color filter and limits the functionality to only things related to fixing the skewed pages. I'll add this to the very large list of things I need to do.
I wonder if there is an update to at least be able to use the "image correction" feature for deskewing, without the b&w filter first being applied automatically to all pages.
HP Windows11, Samsung cell phone, Android13, iPad Pro 12.9" 4th gen, iPadOS18.
|