> On 18 Mar 2024, at 07:20, list_email--- via Skim-app-users > <[email protected]> wrote: > > I am making PDF plots using Plotly which sometimes leaves more white space at > the margins than seems necessary, especially when considering cramming them > into a column in a paper. Skim does a nice job of cropping, but I’m wondering > if there is a way to do this programmatically, e.g,. from Python, Julia, or > Ada. I know that Skim is scriptable but I can’t find anything in Skim’s > Applescript dictionary about cropping. > > I know that if there is an Applescript for doing this on a specified file or > all the PDFs in a folder that I can issue the command from any of the other > mentioned languages. I would gladly consider a non-Skim way also but I need a > method that detects the white-space margins rather than having me manually > determine the coordinates of a crop box since they will be different for > different images. > > Jerry
There are various bounds properties for pages in the Skim AppleScript dictionary. there is a “bounds”, “media bounds” and “content bounds”. In particular, the latter one especially detects the white margins of the page. The other two are properties of the PDF that can also be changed (in particular the “bounds” for the crop box). Note that by default the page bounds are not saved by Skim, as they are part of the PDF data which we leave alone. So you need to export with embedded note to have it saved. That can also be done from AppleScript. Christiaan
_______________________________________________ Skim-app-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/skim-app-users
