Skip to content

Instantly share code, notes, and snippets.

@szydan
Created August 19, 2024 12:30
Show Gist options
  • Save szydan/627f969b5bab3d3ccae61ef35a2c5117 to your computer and use it in GitHub Desktop.
Save szydan/627f969b5bab3d3ccae61ef35a2c5117 to your computer and use it in GitHub Desktop.
paper sheets sizes
// inches
const sheetSizes = {
A0: { width: 46.81, height: 33.11 },
A1: { width: 33.11, height: 23.4 },
A2: { width: 23.4, height: 16.5 },
A3: { width: 16.5, height: 11.7 },
A4: { width: 11.7, height: 8.3 },
A5: { width: 8.3, height: 5.8 },
A6: { width: 5.8, height: 4.1 },
A7: { width: 4.1, height: 2.9 },
A8: { width: 2.9, height: 2.0 },
A9: { width: 2.0, height: 1.5 },
A10: { width: 1.5, height: 1 }
};
const sheetSizes = { // in pixels at 300DPI{
A0: { width: 14043, height: 9933 },
A1: { width: 9933, height: 7020 },
A2: { width: 7020, height: 4950 },
A3: { width: 4950, height: 3510 },
A4: { width: 3510, height: 2490 },
A5: { width: 2490, height: 1740 },
A6: { width: 1740, height: 1230 },
A7: { width: 1230, height: 870 },
A8: { width: 870, height: 600 },
A9: { width: 600, height: 450 },
A10: { width: 450, height: 300 }
};
const sheetSizesInPixelsAt300DPI = {};
for (const [key, value] of Object.entries(sheetSizes)) {
sheetSizesInPixelsAt300DPI[key] = {
width: Math.floor(value.width * DPI),
height: Math.floor(value.height * DPI),
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment