[css-page] Additional Standard Paper Keywords for (page-)size
Nobody has claimed this yet.
- Dominant language
- Bikeshed
- Stars
- 4.9k
- Forks
- 816
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 24
Description
This is a consolidated and updated revision of #328 from mid-2016.
When @fantasai closed that issue by editor discretion, she said:
I agree with [@frivoal] that unless there is specific demand for certain keywords,
we should not add them pre-emptively.
I shall show that there is specific demand for certain keywords, in the fist section below.
Moreover, although not recorded explicitly and lacking a WG decision, there appears to have been somewhat of a consensus back then that keywords should be added to CSS for
commonly used sizes with
standardized identifiers and
hard to remember dimensions.
I shall document those as well, in the second section below.
Interoperability for International Sheet and Envelope Sizes
TL;DR: Add all missing keywords for standard paper sizes in the ISO 216 A and B series, the ISO 269 C series and the JIS P 0138 B series:
A0,A1,A2andA6,A7,A8,A9,A10B0,B1,B2,B3andB6,B7,B8,B9,B10JIS-B0,JIS-B1,JIS-B2,JIS-B3andJIS-B6,JIS-B7,JIS-B8,JIS-B9,JIS-B10C0,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10
While web browser developers may seem less than keen to invest more resources in css-page than absolutely necessary, there are several applications specializing in CSS-driven PDF creation which strongly rely on this particular Module and may wish to extend its capabilities. The W3C should care about harmonizing their use of CSS to ease interchange and thereby making manuscripts more universal.
WeasyPrint and Vivliostyle support all currently standardized keywords for size (or page-size in the future) standardized by CSS in level 3: A3, A4, A5, B4, B5, JIS-B4, JIS-B5 (and American Letter, Legal, Ledger). Their open source code shows that it would be ridiculously simple to add more named sizes.
wkhtmltopdf uses plain headless Qt Webkit and relies on its capabilities.
Addendum: paged.js seems to add all of the A series (although A8 and A9 are undocumented).
Existing implementations from PDF Reactor, Prince and Antenna House support more than those specified keywords, but they use partially incompatible custom keywords for the same physical sizes. In one case, there are three different custom keywords for the same size: ANSI-C, C and Broadsheet for 17in 22in. This hinders stylesheet interchange – avoiding this is prime motivation for standardization.
However, at least two existing implementations agree on keywords and definitions of all ISO 216 formats.
Since ISO paper sizes result from an irrational aspect ratio of √2:1 and an integer base area, A(A0) = 1 m², their odd edge lengths are hard to remember exactly.
Their popularity, stability, ease of implementation and the difficulty of using their numeric values, makes them ideal candidates to add.
In the following table, the custom keywords already supported by implementations are highlighted if they are identical to the proposed keyword. In particular, the ISO- prefix supported by Antenna House in aliases shall not be adopted.
| Proposal | Size | CSS | Prince, PDF Reactor | Antenna House |
|---|---|---|---|---|
A10 |
26mm 37mm |
— | A10 |
— |
C10 |
28mm 40mm |
— | C10 |
— |
B10 |
31mm 44mm |
— | B10 |
— |
A9 |
37mm 52mm |
— | A9 |
— |
C9 |
40mm 57mm |
— | C9 |
— |
B9 |
44mm 62mm |
— | B9 |
— |
A8 |
52mm 74mm |
— | A8 |
— |
C8 |
57mm 81mm |
— | C8 |
— |
B8 |
62mm 88mm |
— | B8 |
— |
A7 |
74mm 105mm |
— | A7 |
— |
C7 |
81mm 114mm |
— | C7 |
— |
B7 |
88mm 125mm |
— | B7 |
— |
A6 |
105mm 148mm |
— | A6 |
A6 |
C6 |
114mm 162mm |
— | C6 |
ISO-C6 |
B6 |
125mm 176mm |
— | B6 |
ISO-B6, B6 |
A5 |
148mm 210mm |
A5 |
A5 |
A5 |
C5 |
162mm 229mm |
— | C5 |
ISO-C5 |
B5 |
176mm 250mm |
B5 |
B5 |
ISO-B5, B5 |
A4 |
210mm 297mm |
A4 |
A4 |
A4 |
C4 |
229mm 324mm |
— | C4 |
ISO-C4 |
B4 |
250mm 353mm |
B4 |
B4 |
ISO-B4, B4 |
A3 |
297mm 420mm |
A3 |
A3 |
A3 |
C3 |
324mm 458mm |
— | C3 |
ISO-C3 |
B3 |
353mm 500mm |
— | B3 |
— |
A2 |
420mm 594mm |
— | A2 |
— |
C2 |
458mm 648mm |
— | C2 |
— |
B2 |
500mm 707mm |
— | B2 |
— |
A1 |
594mm 841mm |
— | A1 |
— |
C1 |
648mm 917mm |
— | C1 |
— |
B1 |
707mm 1000mm |
— | B1 |
— |
A0 |
841mm 1189mm |
— | A0 |
— |
C0 |
917mm 1297mm |
— | C0 |
— |
B0 |
1000mm 1414mm |
— | B0 |
— |
Usability for common, standardized, odd-valued Page Sizes
TL;DR: Optionally, add keywords for the standard paper sizes in ISO 217 (raw oversizes) and ISO 5457 (untrimmed drawing paper sizes).
If the interoperability argument in the first section above was not convincing enough to add keywords for the missing sizes from ISO 216 and all of ISO 269, they should also qualify due to having standardized identifiers and odd length values, and even if some were not commonly used, it would be beneficial to add the complete series nevertheless, for consistency, so authors do not have to remember which sizes do not have a keyword in CSS.
The international standard paper sizes – series A and B defined in ISO 216 and series C in ISO 269, which has been withdrawn in 2009 but still exists in local norms like DIN 476-2 – have been adopted by many national standardization bodies.
Some have extended definitions for special purposes, e.g. the RA and SRA series from ISO 217, German 2A0 from DIN 476 or the now-withdrawn Swedish D–G series from SIS 014711 and, of course, the Japanese B series from JIS P 0138 that is already recognized partially by CSS.
For envelopes in particular, there are also some sizes with an 2:1 aspect ratio that combine the non-common edges of two adjacent sizes, e.g. C5/C4.
The respective Wikipedia article for paper size is quite comprehensive.
However, most of these sizes are of limited interest to most CSS authors, at least with consumer printers, but those who need any of them would certainly welcome their addition to the standard.
Since CSS introduced the JIS- prefix to distinguish Japanese B sizes from international ones defined by ISO, it is not surprising that ISO-, US- and ANSI- also appear as prefixes for short size codes in existing implementations.
Proposed side rule:
All (new) page size keywords that use an alphanumeric code instead of a proper name, shall employ a prefix for the (original) issuing standardization body, e.g.
JIS-,DIN-,SIS-,GOST-,BS-,ANSI-,ASME-, unless the code has been adopted by ISO (even if it has been deprecated since).
I do not propose any of those local sizes here, although some are apparently used frequently.
The only local sizes I am proposing are the rest of the JIS P 0138 series. Keywords for B4 and B5 are already specified and an analogous one for B6 is already supported in at least one implementation.
| Proposal | Size | CSS | Antenna House |
|---|---|---|---|
JIS-B12 |
16mm 22mm |
— | — |
JIS-B11 |
22mm 32mm |
— | — |
JIS-B10 |
32mm 45mm |
— | — |
JIS-B9 |
45mm 64mm |
— | — |
JIS-B8 |
64mm 91mm |
— | — |
JIS-B7 |
91mm 128mm |
— | — |
JIS-B6 |
128mm 182mm |
— | JIS-B6 |
JIS-B5 |
182mm 257mm |
JIS-B5 |
JIS-B5 |
JIS-B4 |
257mm 364mm |
JIS-B4 |
JIS-B4 |
JIS-B3 |
364mm 515mm |
— | — |
JIS-B2 |
515mm 728mm |
— | — |
JIS-B1 |
728mm 1030mm |
— | — |
JIS-B0 |
1030mm 1456mm |
— | — |
Furthermore, I propose to add all sizes from two international standards, which are not covered by the interoperability argument (as of early 2020).
ISO 217 specifies two A-based series for raw, uncut, untrimmed sheets, adding an R (for primary range) and SR (supplementary range) prefix, respectively. PDF Reactor does support systematic keywords for all of them.
The actual standard seems to only require the recognition of (S)RA0, (S)RA1 and (S)RA2, but othe oversizes to the sizes of the ISO 216 A series are encountered in practice. I think it makes sense to support at least as many sizes as the following standard for drawing paper.
ISO 5457 specifies drawing paper sizes, where the trimmed sizes with a T suffix are identical to the respective A series sizes, whereas the sides of untrimmed U sizes are 3 to 4 centimeters larger. The standard also specifies a fixed area for the drawing space resulting from 20mm and 30mm page margins, but does not assign monikers.
| Proposal | Size | PDF Reactor |
|---|---|---|
SRA0 |
900mm 1280mm |
SRA0 |
A0U |
880mm 1230mm |
— |
RA0 |
860mm 1220mm |
RA0 |
SRA1 |
640mm 900mm |
SRA1 |
A1U |
625mm 880mm |
— |
RA1 |
610mm 860mm |
RA1 |
SRA2 |
450mm 900mm |
SRA2 |
A2U |
450mm 625mm |
— |
RA2 |
430mm 610mm |
RA2 |
A3U |
330mm 450mm |
— |
(SRA3) |
320mm 450mm |
SRA3 |
(RA3) |
305mm 430mm |
RA3 |
A4U |
240mm 330mm |
— |
(SRA4) |
225mm 320mm |
SRA4 |
(RA4) |
215mm 305mm |
RA4 |
| — | 160mm 225mm |
SRA5 |
| — | 152mm 215mm |
RA5 |
| — | 112mm 160mm |
SRA6 |
| — | 107mm 152mm |
RA6 |
| — | 80mm 112mm |
SRA7 |
| — | 76mm 107mm |
RA7 |
| — | 56mm 80mm |
SRA8 |
| — | 53mm 76mm |
RA8 |
All American sizes, which have not already been specified in CSS, fail at least one of the three stated criteria, because their edges measure a simple number of half inches and are even often known only by those numbers (which are generally assumed to be exact).
The only popular metric sizes that are known by integer numbers are photographic prints (i.e. traditionally 9×13, 10×15, 13×18, 20×30), which, apparently, are rather approximate in fact, because they are really based on rounded inch-based specifications in ISO 1008 (see Wikipedia).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the css-page size definition and compare its currently standardized keywords with the proposed ISO, JIS, and related paper-size tables in this issue. Done would require a resolved CSS Working Group decision on the scope and naming, followed by updating the relevant specification text; no source file or test entry point is identified here.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100