• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Pass Variables to Embeded Web Pdf and save to server directory on button press.

New Here ,
Feb 05, 2021 Feb 05, 2021

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. 

TOPICS
General troubleshooting , How to , JavaScript , PDF forms

Views

385

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 05, 2021 Feb 05, 2021

Copy link to clipboard

Copied

What are you using to embed the PDF in your page?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 06, 2021 Feb 06, 2021

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/&quot;12eb1-lQmFGHiCFPNvKUGLKJ841dHbz64&quot;
X-Powered-By: Express
" background-color="0xFF525659" top-toolbar-height="56" javascript="allow" top-level-url="undefined">

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 08, 2021 Feb 08, 2021

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines