Use LRMogrify2 plug-in https://www.photographers-toolbox.com/products/lrmogrify2.php . This allows you to flex the canvas size to the aspect ratio always maximising one dimension - no padding.
Once configured it exporting files in a batch works automatically maximising the use of a standard canvas - even sorting portrait and landscape issues appropriately. It's a bit more involved to install for PC users but operates the same as Mac. I can't work without Mogrify - it's very powerful for other aspects like titles and watermarks where LR alone struggles.
It hasn't been updated in four years. Does it work in current version of Lightroom CC?
No reason why it won't work with Cc although I use lr5.7.1. On a PC the latest version of image magic has been known to cause problems so if relevant download an earlier/legacy version which is they maintained on the site.
Ok, thanks, I'll try it out!
LR/Mogrify can't do what I need, but an ImageMagick script does. It gets complicated, though.
Maybe I misunderstood your requirement. Can you clarify where the approach below is off kilter?
If you have an export (post-processing) preset for each of the printed aspect ratios e.g.2:3, 5:4 &c. does it not achieve your requirement? It is certainly possible to set up LR2 Mogrify to automatically have the most appropriate dimension at the maximum with borders in whatever colour you prefer (white black or RGB). Such presets can prepare each aspect ratio batch for your printing service.
In combination with the outer border feature inserted and turned on (as white in this case) but not with any defined dimensions these settings show how I batch process for Instagram. A square crop uses the full image and portrait or landscape end up with equal borders on the 'short' dimension. A lot easier than command lines!
The problem is that the pixel dimensions of my photos vary, from cropped 16 megapixel photos to stitched 200+MP photos. Therefore the final pixel dimensions have to be relative to the original pixel dimensions. Neither the border or the final size can be expressed in absolute terms at input time.
Even if I set up separate presets for each of the ARs - not a big deal -, I don't see it being done without command line - which is also not such a big deal.
In the end, the printer or my site hosting service changed their aspect ratio requirements to be looser, as now all my photos can be printed. So I don't have a need for this solution anymore, which is great!
Thanks for the help, though, as it did direct me down the right path, and LR/Mogrify is a great tool.
On the printer's side, the correct thing to do is to offer the buyer the ability to crop the image to the desired printing shape or print the image with any resulting margins required by the mismatch in paper shape vs image shape. If your printing service does not allow for both these options, you might look for a better print service.
On your side of things, knowing the limitations of the printing service is useful in picking your crop for the image.
For my images posted for public printing at Smugmug.com, 95% are cropped to a 5x7 shape. The printing service lets the user crop the image to fit the size they are printing. Converting a 5x7 to a 4x6 is much easier than converting a 4x6 to a 5x7. I recommend people get a 8x12 instead of an 8x10 (same price) due to the 8x12 being a 4x6, thus easy cropping. I also get to review the orders before they are printed; if I don't like the results of a forced 8x10 crop, I can replace the photo with a new photo with a better 8x10 crop for that order.