mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
pdfng: add comment about getDestinations vs getDestination
This commit is contained in:
parent
8d568d9663
commit
d832406923
1 changed files with 6 additions and 4 deletions
|
@ -54,17 +54,19 @@ define [
|
||||||
@document.then (pdfDocument) ->
|
@document.then (pdfDocument) ->
|
||||||
pdfDocument.getDestinations()
|
pdfDocument.getDestinations()
|
||||||
|
|
||||||
# Not available in pdf.js-1.0.712, in later versions there is a direct
|
|
||||||
# call for this - we should use it as soon as it is available in a
|
|
||||||
# stable version
|
|
||||||
getDestination: (dest) ->
|
getDestination: (dest) ->
|
||||||
|
# There is a direct method for this in pdf.js but it is not
|
||||||
|
# available in pdf.js-1.0.712. Use the following workaround of
|
||||||
|
# getting all the destinations and returning only the one we
|
||||||
|
# want.
|
||||||
@destinations = @document.then (pdfDocument) ->
|
@destinations = @document.then (pdfDocument) ->
|
||||||
pdfDocument.getDestinations()
|
pdfDocument.getDestinations()
|
||||||
return @destinations.then (all) ->
|
return @destinations.then (all) ->
|
||||||
all[dest]
|
all[dest]
|
||||||
, (error) ->
|
, (error) ->
|
||||||
console.log 'ERROR', error
|
console.log 'ERROR', error
|
||||||
|
# When we upgrade we can switch to using the following direct
|
||||||
|
# code.
|
||||||
# @document.then (pdfDocument) ->
|
# @document.then (pdfDocument) ->
|
||||||
# pdfDocument.getDestination(dest)
|
# pdfDocument.getDestination(dest)
|
||||||
# , (error) ->
|
# , (error) ->
|
||||||
|
|
Loading…
Reference in a new issue