संदर्भ
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
एम्बेड किए गए दर्शक के एपीआई में एक क्लास होती है: DefaultViewer. एपीआई इस्तेमाल करने के बारे में जानने के लिए, डेवलपर की गाइड देखें.
कन्स्ट्रक्टर की खास जानकारी
google.books.DefaultViewer(div, opt_options)
- Google Book Search में किसी वॉल्यूम के लिए एम्बेड किया गया व्यूअर.
तरीके के बारे में खास जानकारी
string
getPageNumber()
- व्यूपोर्ट में फ़िलहाल दिख रहे पेज का पेज नंबर दिखाता है.
string
getPageId()
- यह फ़ंक्शन, पेज के लिए ऐसा यूनीक आइडेंटिफ़ायर दिखाता है जो अभी व्यूपोर्ट में दिख रहा है.
boolean
goToPage(pageNumber)
- अगर पेज मौजूद है और उस पर पहुंचा गया है, तो यह फ़ंक्शन 'सही' दिखाता है.
boolean
goToPageId(pageId)
- अगर पेज मौजूद है और उस पर पहुंचा गया है, तो यह फ़ंक्शन 'सही' दिखाता है.
boolean
isLoaded()
- इससे पता चलता है कि दर्शक ने दी गई किताब को पढ़ना शुरू कर दिया है या नहीं.
highlight(opt_string)
- व्यूपोर्ट में किसी शब्द को हाइलाइट करता है.
load(identifiers, opt_notFoundCallback, opt_successCallback)
- व्यूपोर्ट में किताब लोड करता है.
nextPage()
- किताब के अगले पेज पर जाता है.
previousPage()
- किताब के पिछले पेज पर ले जाता है.
resize()
- इससे व्यूअर का साइज़, उसके कंटेनर के डाइमेंशन के हिसाब से बदल जाता है.
zoomIn()
- दर्शक पर ज़ूम इन करता है.
zoomOut()
- दर्शक का ज़ूम आउट करता है.
कंस्ट्रक्टर की जानकारी
google.books.DefaultViewer
google.books.DefaultViewer(div, opt_options)
Google Book Search में किसी वॉल्यूम के लिए एम्बेड किया गया व्यूअर.
पैरामीटर:
Element div
- व्यूपोर्ट को ड्रॉ करने के लिए डिव.
Object opt_options
- दर्शक को पास करने के लिए विकल्पों का की-वैल्यू वाला मैप.
तरीके की जानकारी
getPageNumber
string getPageNumber()
यह विज़ुअल एरिया में दिख रहे पेज का पेज नंबर दिखाता है.
getPageId
string getPageId()
फ़िलहाल व्यूपोर्ट में दिख रहे पेज के लिए यूनीक आइडेंटिफ़ायर दिखाता है.
goToPage
boolean goToPage(pageNumber)
अगर पेज मौजूद है और उस पर पहुंचा गया है, तो यह फ़ंक्शन 'सही' दिखाता है.
पैरामीटर:
string, number pageNumber
- पेज का वह पेज नंबर जिस पर जाना है.
लौटाए जाने वाले प्रॉडक्ट:
goToPageId
boolean goToPageId(pageId)
अगर पेज मौजूद है और उस पर पहुंचा गया है, तो यह फ़ंक्शन 'सही' दिखाता है.
पैरामीटर:
string pageId
- पेज का यूनीक आइडेंटिफ़ायर, जिसका इस्तेमाल किया जाना है.
isLoaded
boolean isLoaded()
अगर load
का इस्तेमाल करके, व्यूअर को दी गई किताब के साथ शुरू किया गया है, तो यह 'सही' दिखाता है.
हाइलाइट
highlight(opt_string)
व्यूपोर्ट में किसी शब्द को हाइलाइट करता है.
पैरामीटर:
string opt_string
- हाइलाइट करने के लिए स्ट्रिंग. अगर
null
या undefined
हो, तो हाइलाइट करने की सुविधा बंद हो जाती है.
लोड
load(identifiers, opt_notFoundCallback, opt_successCallback)
यह व्यूपोर्ट में किताब लोड करता है.
पैरामीटर:
string, Array of strings identifiers
- झलक का यूआरएल या किताब का आइडेंटिफ़ायर, जैसे कि 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 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 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)"]]