๐๐ paper (by WebPDF.pro)
๐ size.css
(๐๐ป demo interactions legend ๐๐ป)
on <pdf-page>
๐ฐ๐น๐ถ๐ฐ๐ธ/๐๐ฎ๐ฝ (๐ฑ๏ธ/๐๐ป): next page
๐ฟ๐ถ๐ด๐ต๐-๐ฐ๐น๐ถ๐ฐ๐ธ/๐น๐ผ๐ป๐ด-๐๐ฎ๐ฝ (๐ฑ๏ธ/๐๐ป): previous page
on a paper size
๐ต๐ผ๐๐ฒ๐ฟ (๐ฑ๏ธ): highlight size
๐ฐ๐น๐ถ๐ฐ๐ธ/๐๐ฎ๐ฝ (๐ฑ๏ธ/๐๐ป): overlay size on <pdf-page> and focus
anywhere
๐๐ฎ๐ฏ (โจ๏ธ): switch focus between sizes
๐ฒ๐๐ฐ (โจ๏ธ): cancel size overlay
aspect-ratio
will now be notified and offered a direct link to the below simpler codepen!
<link href=//open.pdf.ist/paper/size.css rel=stylesheet>
<style>
[size] {
/* A4 letter
--u: paper size unit 1mm 1in
--w: paper width 210 8.5
--h: paper height 297 11
--wu: paper width ร unit == calc(var(--w) * var(--u)) 210mm 8.5in
--hu: paper height ร unit == calc(var(--h) * var(--u)) 297mm 11in
*/
aspect-ratio: var(--w) / var(--h);
width: var(--wu);
}
@supports not (aspect-ratio: 1 / 1) { [size] { height: var(--hu); } }
.paper { background-color: #fbfbf8; outline: 1px solid #ccc; }
.paper[size=letter] { position: absolute; transform: translateY(-100%); }
.paper:hover { opacity: .5; }
.paper::before { content: attr(size); position: absolute; font-family: system-ui; }
</style>
<div size=A4 class=paper></div>
<div size=letter class=paper></div>
- https://open.PDF.ist/paper/size.css
๐ฆ auto-minified
โ via Cloudflare
ISO 4A0 2A0 A0โ10 A2โ5-extra A3โ4-super super-A3โ4 A4-long โ๏ธ
B0โ10 B5-extra โ๏ธ
C0โ10 C7/6 DL โ๏ธ
JPN JIS-B0โ12 โ๏ธ
CHN D0โ6 โ๏ธ
RD0โ6 โ๏ธ
USA letter legal ... ๐ง
- https://caniuse.com/mdn-css_properties_aspect-ratio
not needed but it just makes sizing things a true breezeโข
This project is proudly sponsored by
<pdf-file> <pdf-page> |
---|
WebPDF.pro |
Professional PDF web components
in the form of HTML custom elements
Now featuring WASM-powered
high-fidelity โ PDFium
rendering.
Mention codrops
when you contact us at https://WebPDF.pro/#๐ฌ ยน to get your free ๐ World-wide
license!
ยน also available via email at [email protected]