pdf.js (deprecated) - parkjunsoo91/letsread GitHub Wiki
- web/viewer.html & web/viewer.js์ ๋ฏ์ด๋ณด๊ณ ๋ถ์ํ๋ฉด์ ์ป์ด์ง๋ ๊ฒ๋ค ๊ธฐ๋ก
- ์ค๊ฐ์ ๊ฐ์ด ์ค๋ฉด ์์ ๋กญ๊ฒ ๊ณ๊ฐ์ง๋ฅผ ์นฉ์๋ค.
- api.js (https://github.com/mozilla/pdf.js/blob/master/src/display/api.js) (์ด๋ป๊ฒ ์ฝ์ด์ผํ๋์?)
- API docs (https://mozilla.github.io/pdf.js/api/draft/index.html) (๋ฏธ์์ฑ)
viewer.html ์์ ํด๋น ์ฝ๋๋ viewer.js ๋ฅผ include ํ๋ค.
<script src="viewer.js"></script>
ํด๋ฐ์ ์๋ ๋ฒํผ ์ ๋ณด:
<button id="aaa" class="bbb" title="ccc" tabindex="dd" data-l10n-id="eee"></button>
class ๋ style ์ ์ผ๊ด์ ์ผ๋ก ์ ์ฉ์ํค๊ธฐ ์ํ ๋ฌถ์์ด๋ค. title ์ ๋ง์ฐ์ค์ค๋ฒ๋ฅผ ํ์์ ๋จ๋ ํ ์คํธ๋ค. tabindex ๋ tabํ์๋ ๋์ด๊ฐ๋ ์์๋ฅผ ๋ํ๋ธ๋ค. data-l10n-id ๋ custom attribute ์ด๋ฉฐ, external/webL10n/l10n.js ์ getL10nAtrributes() ์์ ์ด๊ฑธ ๊ฐ์ ธ๋ค๊ฐ json์ผ๋ก ๋ง๋ค๊ฑฐ๋, getTranslatablChilderen() ์์ ํด๋น attribute ์ ๊ฐ์ ๊ฐ์ ธ๋ค๊ฐ ๋ฆฌ์คํธ๋ก ๊ฐ์ ธ์ค๋ ์์ผ๋ก ํ์ฉํ๋ค.
- annotation ๋ชจ๋์ด ๋๋๊ฒ๋ ์กด์ฌ(์ด๋ถ์ฑ์ค)
- AnnotationFactory() ํจ์
- Annotation ์ค๋ธ์ ํธ
- ๊ฐ ์ข annotation ์ค๋ธ์ ํธ๋ค
- AnnotationFactory
- AnnotationFactory.create(xref, ref, pdfManager, uniquePrefix, idCounters) --> Annotation ์ค๋ธ์ ํธ๋ฅผ ๋ฆฌํด
- Annotation
- properties๋ฅผ data object๋ฅผ ํตํด expose
- data.id
- data.subtype
- Link, Text, Highlight, ...
- data.annotationFlags // Unsigned 32-bit integer specifying annotation characteristics
- data.rect
- data.color
- data.borderStyle
- data.hasAppearance
- properties๋ฅผ data object๋ฅผ ํตํด expose
- HighlightAnnotation
- ๊ฐ์ข ๊ณต์ ๋ณ์ ๋ฐ ํจ์ ๋ฑ์ด ์ ์ฅ๋จ
- annotation ๊ด๋ จ
- AnnotationType
- TEXT: 1
- HIGHLIGHT: 9
- ...
- AnnotationFlag
- INVISIBLE: 0x01
- HIDDEN: 0x02
- ...
- AnnotationFieldFlag
- AnnotationBorderStyleType
- AnnotationType
- ์ผ๋ฐ util
- inherit(sub, base, prototype) ํจ์
- sub์ base์ prototype์ inherit ํจ (javascript์ ๊ฐ๋ )
- inherit(sub, base, prototype) ํจ์