참조
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Embedded Viewer API에는 DefaultViewer라는 클래스가 하나 포함되어 있습니다. API 사용에 관한 소개는 개발자 가이드를 참고하세요.
생성자 요약
google.books.DefaultViewer(div, opt_options)
- Google 도서검색에 특정 권호를 삽입하는 뷰어입니다.
메서드 요약
string
getPageNumber()
- 현재 표시 영역에 표시되는 페이지의 페이지 번호를 반환합니다.
string
getPageId()
- 현재 표시 영역에 표시된 페이지의 고유 식별자를 반환합니다.
boolean
goToPage(pageNumber)
- 페이지가 존재하고 돌아간 경우 true를 반환합니다.
boolean
goToPageId(pageId)
- 페이지가 있고 전환된 경우 true를 반환합니다.
boolean
isLoaded()
- 시청자가 지정된 도서로 성공적으로 초기화되었는지 여부를 나타냅니다.
highlight(opt_string)
- 뷰포트에서 용어를 강조 표시합니다.
load(identifiers, opt_notFoundCallback, opt_successCallback)
- 표시 영역에 책을 로드합니다.
nextPage()
- 책의 다음 페이지로 이동합니다.
previousPage()
- 책의 이전 페이지로 이동합니다.
resize()
- 뷰어의 크기를 컨테이너 div의 크기에 맞게 조정합니다.
zoomIn()
- 뷰어를 확대합니다.
zoomOut()
- 뷰어를 축소합니다.
생성자 세부정보
google.books.DefaultViewer
google.books.DefaultViewer(div, opt_options)
Google 도서 검색의 볼륨을 위한 삽입된 뷰어입니다.
매개변수:
Element div
- 뷰포트를 그리는 Div입니다.
Object opt_options
- 시청자에게 전달할 옵션의 키-값 맵입니다.
메서드 세부정보
getPageNumber
string getPageNumber()
현재 표시 영역에 표시되는 페이지의 페이지 번호를 반환합니다.
getPageId
string getPageId()
현재 표시 영역에 표시된 페이지의 고유 식별자를 반환합니다.
goToPage
boolean goToPage(pageNumber)
페이지가 있고 전환된 경우 true를 반환합니다.
매개변수:
string, number pageNumber
- 이동할 페이지의 페이지 번호입니다.
goToPageId
boolean goToPageId(pageId)
페이지가 있고 전환된 경우 true를 반환합니다.
매개변수:
string pageId
- 이동할 페이지의 고유 식별자입니다.
isLoaded
boolean isLoaded()
load
를 사용하여 지정된 도서로 뷰어가 성공적으로 초기화된 경우 true를 반환합니다.
하이라이트
highlight(opt_string)
매개변수:
string opt_string
- 강조 표시할 문자열입니다. null
또는 undefined
인 경우 강조 표시를 사용 중지합니다.
load
load(identifiers, opt_notFoundCallback, opt_successCallback)
매개변수:
string, Array of strings identifiers
- 미리보기 URL 또는 ISBN, OCLC와 같은 도서 식별자입니다. 동적 링크 요청 형식을 참고하세요. 도서에 대한 여러 대체 식별자 (예: 양장본 및 소프트커버 ISBN)를 지정하려면 이러한 식별자 문자열의 Array
를 전달합니다. 시청자는 배열에서 삽입 가능한 첫 번째 도서를 로드하게 됩니다.
Function opt_notFoundCallback
- identifier
가 도서 식별자인 경우 도서를 찾을 수 없는 경우 이 콜백이 호출됩니다. null
가 전달되거나 이 매개변수가 생략되면 실패 시 함수가 호출되지 않습니다.
Function opt_successCallback
- 이 콜백은 뷰어가 특정 도서로 성공적으로 인스턴스화되고 nextPage
와 같은 함수 호출을 수신할 준비가 되었을 때 실행됩니다.
nextPage
nextPage()
previousPage
previousPage()
resize
resize()
뷰어의 크기를 컨테이너 div의 크기에 맞게 조정합니다.
zoomIn
zoomIn()
zoomOut
zoomOut()
맨 위로
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-11-08(UTC)
[null,null,["최종 업데이트: 2024-11-08(UTC)"],[[["\u003cp\u003eThe Embedded Viewer API allows you to embed a Google Book into your webpage using the \u003ccode\u003egoogle.books.DefaultViewer\u003c/code\u003e class.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods for navigation such as \u003ccode\u003enextPage\u003c/code\u003e, \u003ccode\u003epreviousPage\u003c/code\u003e, \u003ccode\u003egoToPage\u003c/code\u003e, and \u003ccode\u003egoToPageId\u003c/code\u003e, as well as zooming and highlighting functionalities.\u003c/p\u003e\n"],["\u003cp\u003eYou can load a book using identifiers like ISBN or OCLC with the \u003ccode\u003eload\u003c/code\u003e method and handle loading success or failure with callbacks.\u003c/p\u003e\n"],["\u003cp\u003eThe viewer can be resized dynamically with \u003ccode\u003eresize\u003c/code\u003e and provides methods to retrieve current page information like \u003ccode\u003egetPageNumber\u003c/code\u003e and \u003ccode\u003egetPageId\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Reference\n\nThe Embedded Viewer API contains one class: DefaultViewer. For an introduction to using the API, see the [Developer's Guide](/books/docs/viewer/developers_guide).\n\nConstructor summary\n-------------------\n\n`\n`**[google.books.DefaultViewer](#google.books.DefaultViewer)**`(div, opt_options)\n`\n: An embedded viewer for a volume in Google Book Search.\n\nMethod summary\n--------------\n\n`string\n`**[getPageNumber](#google.books.DefaultViewer.getPageNumber)**`() `\n: Returns the page number of the page that's currently visible in\n the viewport.\n\n`string\n`**[getPageId](#google.books.DefaultViewer.getPageId)**`() `\n: Returns a unique identifier for the page that's currently visible in the\n viewport.\n\n`boolean\n`**[goToPage](#google.books.DefaultViewer.goToPage)**`(pageNumber) `\n: Returns true if the page exists and was turned to.\n\n`boolean\n`**[goToPageId](#google.books.DefaultViewer.goToPageId)**`(pageId) `\n: Returns true if the page exists and was turned to.\n\n`boolean\n`**[isLoaded](#google.books.DefaultViewer.isLoaded)()**\n: Indicates whether the viewer has been successfully initialized with the given book.\n\n`\n`**[highlight](#google.books.DefaultViewer.highlight)**`(opt_string) `\n: Highlights a term in the viewport.\n\n`\n`**[load](#google.books.DefaultViewer.load)**`(identifiers, opt_notFoundCallback, opt_successCallback) `\n: Loads a book in the viewport.\n\n`\n`**[nextPage](#google.books.DefaultViewer.nextPage)**`() `\n: Goes to the next page in the book.\n\n`\n`**[previousPage](#google.books.DefaultViewer.previousPage)**`() `\n: Goes to the previous page in the book.\n\n`\n`**[resize](#google.books.DefaultViewer.resize)**`() `\n: Resizes the viewer to conform to size of its container div.\n\n`\n`**[zoomIn](#google.books.DefaultViewer.zoomIn)**`() `\n: Zooms into the viewer.\n\n`\n`**[zoomOut](#google.books.DefaultViewer.zoomOut)**`() `\n: Zooms out of the viewer.\n\nConstructor detail\n------------------\n\n### google.books.DefaultViewer\n\n```\ngoogle.books.DefaultViewer(div, opt_options)\n```\n\nAn embedded viewer for a volume in Google Book Search.\n\n\u003c!-- --\u003e\n\n**Parameters:** *Element*` div` - Div to draw the viewport in.\n\u003c!-- --\u003e\n\n*Object*` opt_options` - Key-value map of options to pass along to the viewer.\n\nMethod detail\n-------------\n\n### getPageNumber\n\n```\nstring getPageNumber()\n```\n\nReturns the page number of the page that's currently visible in the viewport.\n\n\u003c!-- --\u003e\n\n**Returns:** *string*` `\n\n### getPageId\n\n```\nstring getPageId()\n```\n\nReturns a unique identifier for the page that's currently visible in the viewport.\n\n\u003c!-- --\u003e\n\n**Returns:** *string*` `\n\n### goToPage\n\n```\nboolean goToPage(pageNumber)\n```\n\nReturns true if the page exists and was turned to.\n\n\u003c!-- --\u003e\n\n**Parameters:** *string, number*` pageNumber ` - The page number of the page to turn to.\n\n\u003c!-- --\u003e\n\n**Returns:** *boolean*` `\n\n### goToPageId\n\n```\nboolean goToPageId(pageId)\n```\n\nReturns true if the page exists and was turned to.\n\n\u003c!-- --\u003e\n\n**Parameters:** *string*` pageId ` - The unique identifier of the page to turn to.\n\n\u003c!-- --\u003e\n\n**Returns:** *boolean*` `\n\n### isLoaded\n\n```\nboolean isLoaded()\n```\n\nReturns true if the viewer has been successfully initialized with the given book using `load`.\n\n\u003c!-- --\u003e\n\n**Returns:** *boolean*` `\n\n### highlight\n\n```\nhighlight(opt_string)\n```\n\nHighlights a term in the viewport.\n\n\u003c!-- --\u003e\n\n**Parameters:** *string*` opt_string ` - A string to highlight. Turns off highlighting if `null` or `undefined`.\n\n### load\n\n```\nload(identifiers, opt_notFoundCallback, opt_successCallback)\n```\n\nLoads a book in the viewport.\n\n\u003c!-- --\u003e\n\n**Parameters:** *string* `, `*Array of strings*` identifiers ` - A preview URL or book identifier such as an ISBN, OCLC, etc. See [Dynamic Links request format](/books/docs/dynamic-links#requestFormat). To specify several alternative identifiers for the book (e.g., the hardcover and softcover ISBNs), pass an `Array` of these identifier strings; the viewer will the viewer will load the first embeddable book in the array.\n\u003c!-- --\u003e\n\n*Function*` opt_notFoundCallback ` - If `identifier` is a book identifier, this callback will be called if the book was not found. If `null` passed or this parameter is omitted, no function will be called on failure.\n\u003c!-- --\u003e\n\n*Function*` opt_successCallback ` - This callback will be executed if and when the viewer is successfully instantiated with a particular book, and ready to receive function calls such as `nextPage`.\n\n### nextPage\n\n```\nnextPage()\n```\n\nGoes to the next page in the book.\n\n### previousPage\n\n```\npreviousPage()\n```\n\nGoes to the previous page in the book.\n\n### resize\n\n```\nresize()\n```\n\nResizes the viewer to conform to size of its container div.\n\n### zoomIn\n\n```\nzoomIn()\n```\n\nZooms into the viewer.\n\n### zoomOut\n\n```\nzoomOut()\n```\n\nZooms out of the viewer.\n\n[Back to top](#top)"]]