Help us understand the problem. What is going on with this article?

ブラウザでbase64エンコードしたPDFファイルを表示する

概要

ブラウザでbase64のPDFファイルを表示する。

実装

HTML5の標準機能で実装可能。
↓の !!!!ここにbase64エンコードしたPDFファイルの文字列を入れる!!! 部分にbase64エンコードしたPDFファイルの文字列を入れる。

<!DOCTYPE html>
<html lang="ja">

<head>
  <meta charset="UTF-8" />
  <title>Document</title>
</head>

<body style="height: 100%; width: 100%; overflow: hidden; margin:0px; background-color: rgb(82, 86, 89);">

  <embed style="position:absolute; left: 0; top: 0;" width="100%" height="100%" type="application/pdf"
    src="data:application/pdf;base64,!!!!ここにbase64エンコードしたPDFファイルの文字列を入れる!!!" />

</body>

</html>

おまけ

base64エンコード用のコマンド。

base64 -w0 Untitled-1.pdf > tmp.txt
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした