pdfng: add comment about getDestinations vs getDestination

This commit is contained in:
Brian Gough 2015-01-16 12:50:08 +00:00
parent 8d568d9663
commit d832406923

View file

@ -54,17 +54,19 @@ define [
@document.then (pdfDocument) ->
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) ->
# 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) ->
pdfDocument.getDestinations()
return @destinations.then (all) ->
all[dest]
, (error) ->
console.log 'ERROR', error
# When we upgrade we can switch to using the following direct
# code.
# @document.then (pdfDocument) ->
# pdfDocument.getDestination(dest)
# , (error) ->