Copy link to clipboard
Copied
Hello Everyone,
I have a custom pdf embeded into a webpage I would like to send JSON data to, in order to prefill it.
The data would look like this:
{
"fname": "Maverick",
"sig":"Base64"
}
The data is available to the webpage in which the document is embeded.
Also I have a save button I have created with the intent of saving a copy of the pdf to a static directory, However I am having trouble with that as well. The code for the save button is:
this.saveAs('/c/test/temp.pdf');
I have already figured out how to add buttons to my embeded pdf to validate inputs.
I am hoping for some guidance regarding if sharing data between the webpage and the embeded document is possible as well as any tips on where I might find documentation of hints to get the custom save button working for the embeded PDF.
Copy link to clipboard
Copied
What are you using to embed the PDF in your page?
Copy link to clipboard
Copied
Just HTML, like the following:
<embed id="plugin" type="application/x-google-chrome-pdf" src="http://localhost:3000/static/media/test.pdf" stream-url="chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/4b026347-6ad9-47c3-9ac5-89eeee68c3ef" headers="Accept-Ranges: bytes
Content-Length: 77489
Content-Type: application/pdf; charset=UTF-8
Date: Sat, 06 Feb 2021 18:22:46 GMT
ETag: W/"12eb1-lQmFGHiCFPNvKUGLKJ841dHbz64"
X-Powered-By: Express
" background-color="0xFF525659" top-toolbar-height="56" javascript="allow" top-level-url="undefined">
Copy link to clipboard
Copied
Ok - When you use the <embed> tag, you are allowing the browser to present the PDF. Most browsers don't execute PDF JavaScript in PDF so you won't be able to accomplish your goal simply by embedding the PDF.