Embed a PDF in Help Center articles



Posted Dec 30, 2015

Having the ability to embed a PDF file into an article would be really beneficial to our clients and myself (the keeper of the knowledge base).


10

35

35 comments

Official

image avatar

Ryan McGrew

Zendesk Product Manager

Hey All,

We are working through improve asset management in our product overall. You've probably recently seen the improvements related to article attachments in the media gallery as well as making them compliant with our data locality requirements. We expect to continue to make improvements in the next 6 to 9 months to enable you to at the very least insert icons in the text of the article where users can open the PDF in a new tab or window. We are then working to move from there to embedding directly into the document. There are currently some security concerns related to remote script execution that can be embedded into a PDF document that we are working through with our security team and causing things to take a little bit longer. 

With all that being said, if you need to embed documents today, I recommend the following code snippet which relies on the Google PDF Viewer. You can insert this code in the source code editor

<iframe style="width: 100%; height: 1000px;" src="https://docs.google.com/gview?url={{article_attachment_url}}&amp;embedded=true" frameborder="0"></iframe>

In this snippet, replace {{article_attachment_url}} with the URL of the PDF you've uploaded to the article as an attachment. You can get this URL by opening the article settings, scrolling to the Attachments section. From there you can right click the attachment link and click "Copy link address" or open the attachment in a new tab and copy the URL from the navigation bar of your browser.

Thanks!

1


I have been waiting for the ability to embed PDFs at two separate companies and their help centers since 2018. I think waiting 6+ years is enough time for this feature to be heavily considered. 

0


Has there been any update since the above comment and subsequent 1263082319149 update in March 2024? We have PDF's to attach that are not on Google Docs so those solutions will not address the PDF issue. Thank you!

0


Official

Hey All,

We are working through improve asset management in our product overall. You've probably recently seen the improvements related to article attachments in the media gallery as well as making them compliant with our data locality requirements. We expect to continue to make improvements in the next 6 to 9 months to enable you to at the very least insert icons in the text of the article where users can open the PDF in a new tab or window. We are then working to move from there to embedding directly into the document. There are currently some security concerns related to remote script execution that can be embedded into a PDF document that we are working through with our security team and causing things to take a little bit longer. 

With all that being said, if you need to embed documents today, I recommend the following code snippet which relies on the Google PDF Viewer. You can insert this code in the source code editor

<iframe style="width: 100%; height: 1000px;" src="https://docs.google.com/gview?url={{article_attachment_url}}&amp;embedded=true" frameborder="0"></iframe>

In this snippet, replace {{article_attachment_url}} with the URL of the PDF you've uploaded to the article as an attachment. You can get this URL by opening the article settings, scrolling to the Attachments section. From there you can right click the attachment link and click "Copy link address" or open the attachment in a new tab and copy the URL from the navigation bar of your browser.

Thanks!

1


What is the latest update on embedding PDFs to Help Center article content? Have there been any improvements since this feedback was submitted in 2015 (or earlier)? Please let me the latest on the following: 

1. Is there an easy to use code to upload a PDF / embed a PDF in an article? 

2. The option to add an attachment with a preview of the content 

Thanks!

1


Hi everyone, for better visibility to our product team, I've moved this post over to our Feedback - Help Center (Guide) topic.

0


I agree with this request. Zendesk needs functionality to embed PDFs inside accordions, inline text, etc. Attaching a PDF to the bottom of an article isn't eye catching for users and copy/pasting PDFs already created is not an optimal use of time. 

0


365174939048 I tried your code but it only works if I install the Chrome extension mentioned in the comment (https://chrome.google.com/webstore/detail/pdf-viewer/oemmndcbldboiebfnladdacbdfmadadm?hl=en).

Without it, the browser just downloads the PDF - it doesn't display it on the page.

Do you have any suggestions?

0


Hi Chaz - 

Thanks for the feedback. We've removed the answered tag from the post. 

0


In my opinion, this article should not be marked Answered.

  1. The original request was a way to embed a pdf - without having to code - like we could when the pdf was an asset. Various solutions provided here are workarounds.
  2. 972664333 - your code is beautiful but how did you get your pdf on the Zendesk CDN? It doesn't work with pdfs shared from Google drive or OneDrive.
  3. 365174939048 - That Google article is about exporting a Google Doc to PDF without creating/sharing a PDF. But we have actual PDFs shared so the code doesn't seem like it would work. Before I can test it though, where are you defining your javascript variables you use for the handlebar entries?

Why is this still so hard after all these years?

0


Hey 365174939048, I tried your codeblock but I think im missing something here. Does your codeblock automatically use the uploaded attachment and display it or am I supposed to dictate a URL somewhere?

0


Sign in to leave a comment.

Didn't find what you're looking for?

New post