Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setWith is impossibly difficult -- lacks proper documentation #47

Open
aprilmintacpineda opened this issue Jan 19, 2023 · 0 comments
Open

Comments

@aprilmintacpineda
Copy link

Google Sheets use pixels for column widths.
I'm using LibreOffice which has centimeter.

I constructed this function:

function calcColumnWidthFromPx(desiredWidthPx: number) {
  const inchToPx = 96;
  const inchToCm = 2.54;
  return (desiredWidthPx / inchToPx) * inchToCm;
}

Which converts a width from pixels to centimeter, based on 96 pixels = 1 inch = 2.54 cm. However I still don't get the correct output that I want, I want to set the width of column 1 to 149px but it seems impossible because the unit of measurement being used by setWidth is not documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant