YF-GoogleCodeBackups / pdfium

Automatically exported from code.google.com/p/pdfium
0 stars 0 forks source link

this.hostContainer undefined in JavaScript API #187

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I'm hoping this is the right place. I'm developing a web application that uses 
some obscure (but official) features of PDF that work with Adobe's official 
plugin but not with the built-in viewer in Google Chrome, which I understand to 
be PDFium.. ..If I need to take my troubles elsewhere, I won't be offended. :)

What steps will reproduce the problem?
1. Author (or acquire) a PDF that uses postMessage/hostContainer to communicate 
with a host webpage. I've attached a sample that just alerts the value of 
this.hostContainer.
2. Open it with Chrome (tested with Version 43.0.2357.134 m)
3. hostContainer is undefined.

What is the expected output? What do you see instead?
I'm expecting to be able to use postMessage from a web page that contains a PDF 
to send arrays of data to a handler that the PDF attaches to the hostContainer 
property of the current document. However, when the PDF attempts to create that 
handler, it can't because the hostContainer property isn't there. It's unable 
to send messages back to the containing webpage for the same reason - the 
postMessage method that's required to send messages back also lives on the 
hostContainer property, per Adobe's Acrobat JavaScript Programming Reference: 
http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/js_api_reference.p
df#page=242

What version of the product are you using? On what operating system?
Windows 8.1, Chrome Version 43.0.2357.134 m. chrome://plugins doesn't give a 
version number for "Chrome PDF Viewer", which I understand to be PDFium.

Please provide any additional information below.
If there's another way to achieve bidirectional communication between the PDF 
and the containing web page using the APIs available in Chrome/PDFium (or even 
documentation for what's available, so I can do my own digging), I'm game to 
shim something in.

Any help would be appreciated - and if it's not supported and not going to be 
supported, knowing that would be helpful too.

Thanks!

Original issue reported on code.google.com by wsc...@gmail.com on 21 Jul 2015 at 9:40

Attachments:

GoogleCodeExporter commented 9 years ago
You're in the right place, but that feature isn't supported in PDFium at the 
present time.

Original comment by tsepez@chromium.org on 24 Jul 2015 at 6:01

GoogleCodeExporter commented 9 years ago
Okay. I think we've found another way to do what we need - thanks, though!

Original comment by wsc...@gmail.com on 24 Jul 2015 at 7:53