Call pdfium (built-in chrome pdf viewer) from javascript

I know that pdfium provides a javascript API ( see this question ). But I can not find what to call these functions. On the page with the rendered PDF, I can see the embed tag, but I do not know what to do with it.

var p =  document.getElementsByTagName('embed')[0]

Gives me this:

function anonymous()
 __proto__: Object
 <function scope>

And in the source code of the Chrome extension there is this function in pdf.js:

  /**
* Handle a scripting message from outside the extension (typically sent by
* PDFScriptingAPI in a page containing the extension) to interact with the
* plugin.
* @param {MessageObject} message the message to handle.
*/
 handleScriptingMessage: function(message) {...}

But it only allows the message "selectAll".

I would really appreciate if someone would tell me where I can learn more about this or how to interact with pdfium using javascript

+4
source share
1

javascript- PDFium pdf.js: github PDFium.js

0

Source: https://habr.com/ru/post/1619996/


All Articles