PDF Test

This post only records the recommended way to insert PDFs on posts.

Two ways to insert PDF have been found.

Most importantly, just make sure:

  1. Documents chosen should be put in the post folder whose name must be the same as the post;
  2. The path of post folder must be the same as the path of post;
  3. The post folder and the post must be put in the same folder _post.

Issues remained unresolved:

  1. If documents are local, explorers will directly download them instead of previewing them;
  2. URL can be previewed but NOT local paths;
  3. HTML languages like iframe is better than PDF.js because they can show the column in the preview window.

2 Examples displayed as below.

No.1

Example_Display_html
1
{% pdf https://downloadcenter.samsung.com/content/UM/202111/20211116144456470/SM-G99X_UM_EU_SS_Eng_Rev.1.0_211103.pdf %}

No.2

Example_Display_html
1
<iframe src="./samsung-s21-ultra-user-manual.pdf" width="100%" height="800px"></iframe>

Unfortunately, it is found that only the second one (iframe) can be displayed successfully on Android and iOS.