rrthomas / libpaper

Library and command-line tools for configuring and getting information on paper sizes
GNU Lesser General Public License v2.1
9 stars 11 forks source link

libpaper 2 breaks rst2odt #42

Closed anayrat closed 1 year ago

anayrat commented 1 year ago

Hello, rst2odt expect to get paper dimensions thanks to paperconf -s :

            dimensions = subprocess.check_output(('paperconf', '-s'),
                                                 stderr=subprocess.STDOUT)
            w, h = (float(s) for s in dimensions.split())

https://sourceforge.net/p/docutils/code/HEAD/tree/trunk/docutils/docutils/writers/odf_odt/__init__.py#l1066

I didn't find the option to get the same result ? Thanks

rrthomas commented 1 year ago

paperconf is replaced by paper in libpaper 2. You can use:

paper --unit pt

You will then need to parse the result slightly differently:

$ paper --unit pt
A4: 595.276x841.89 pt
rrthomas commented 1 year ago

Apologies for the breaking change—it's the first time in well over 20 years, and won't happen again on my watch!

anayrat commented 1 year ago

thanks!