Embed API: Is the URL passed visible anywhere in the browser

Explorer ,
Sep 01, 2020 Sep 01, 2020

Copy link to clipboard

Copied

After passing the url to the Preview method I found that in the resulting iframe I could not see the URL? I wish to confirm whether this is true. It suits my use-case where even though the PDF is a public resource I would not like it to be available on display. Hence. Thanks

TOPICS
PDF Embed API

Views

127

Likes

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

correct answers 1 Correct Answer

Adobe Community Professional , Sep 02, 2020 Sep 02, 2020
If you pass the PDF as a URL, it will be visible in the page source even though it won't be apparent in the iframe. If you need to obfuscate the location of the PDF. Pass the content as a Promise and leverage some middleware to get the PDF and return just the bytes to your page.

Likes

Translate

Translate
Adobe Community Professional ,
Sep 02, 2020 Sep 02, 2020

Copy link to clipboard

Copied

If you pass the PDF as a URL, it will be visible in the page source even though it won't be apparent in the iframe. If you need to obfuscate the location of the PDF. Pass the content as a Promise and leverage some middleware to get the PDF and return just the bytes to your page.

Likes

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
Explorer ,
Sep 02, 2020 Sep 02, 2020

Copy link to clipboard

Copied

Thanks Joel. will do that

~R

Likes

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
Explorer ,
Sep 02, 2020 Sep 02, 2020

Copy link to clipboard

Copied

Your suggestion worked Joel. I did the following.

 

1. "Fetched" the PDF. fetch(url-to-pdf)

2. On successful response converted into blob: response.blob() 

3. Created localhost URL :  URL.createObjectURL(blob)

4. Passed above URL to preview method.

Likes

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
Adobe Community Professional ,
Sep 03, 2020 Sep 03, 2020

Copy link to clipboard

Copied

Good to hear that you got it working. Be sure to disable both downloading and printing if you want to prevent people from getting to the PDF. Download is obvious but printing back to PDF is another way to get the PDF. 

Likes

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
Explorer ,
Sep 03, 2020 Sep 03, 2020

Copy link to clipboard

Copied

LATEST
Yup. Have done that. Thanks for nudging that too.

Likes

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