Thursday, 18 December 2025

Embed Documents, Audio to blogger post


Summary way to remember embedding Audio and PDF Files

So, Embedding audio and pdf is similar right?

Syntax

<iframe src="URL/preview" width="100%" height="____">    
</iframe>    

Where
URL minus from view? onwards
URL:
https://drive.google.com/file/d/1X_ZBs31vhazvf8lKVEG_wflmpNGDre0x/view?usp=drive_link

____: range from 60 to 700

to add below for audio after the Height command is optional. This is to allow the audio or video to auto play.
  allow="autoplay">

Yes — that’s exactly right, and your summary is a perfect simple way to remember it.

Here’s a clean version with clarifications:


Embedding PDFs or Audio (Google Drive)

<iframe src="URL/preview" width="100%" height="____"></iframe>

Where:

  • URL → the Google Drive link up to /view (remove everything from ? onwards)
  • /preview → required to make it display in the iframe
  • width="100%" → usually full page width
  • height="____" → pixels, depending on content:
    • Audio: 60–100
    • PDF: 400–700

✅ Example: PDF

<iframe src="https://drive.google.com/file/d/FILE_ID/preview" width="100%" height="600"></iframe>

✅ Example: Audio

<iframe src="https://drive.google.com/file/d/FILE_ID/preview" width="100%" height="80"></iframe>

Quick memory trick

  • iframe = box
  • src = what to show
  • /preview = needed for Drive
  • height = enough room for content

If you want, I can make a tiny visual cheat sheet showing PDF vs Audio embed in one table, so it’s super easy to copy-paste. Do you want me to do that?




How to embed Audio into blogger post?

syntex

<iframe  
  src="URL/preview" 
  width="100%" 
  height="60"
  allow="autoplay">
</iframe>
Copied URL, cut the Green Portion to replace the URL in red above
https://drive.google.com/file/d/1X_ZBs31vhazvf8lKVEG_wflmpNGDre0x/view?usp=drive_link

Method 1: Copy the Link and paste into ChatGPT and ask ChatGPT to embed

Step-by-step

Step 1: Upload Audio to Drive and Copy Link
  1. Go to Google Drive
  2. Upload your audio file (MP3, M4A, WAV) to Google Drive
  3. Right-click the file → Share → Share
  4. Change access to “Anyone with the link → drop down arrow, change to Viewer”
  5. Click Copy link
Eg of a Link being Copied looks like the following

https://drive.google.com/file/d/1X_ZBs31vhazvf8lKVEG_wflmpNGDre0x/view?usp=drive_link

Step 2: Ask ChatGPT to embed

Please help to embed the following audio file link for me to post to blogger

It will return with the following results

<iframe height="60" src="https://drive.google.com/file/d/1X_ZBs31vhazvf8lKVEG_wflmpNGDre0x/preview" width="100%"></iframe>

Step 3: Copy the Step to embedded code and paste to blog post HTML Page



Method 2: Create your own embedded code with the following steps

Step-by-step

Step 1: Upload Audio to Drive and Copy Link
  1. Go to Google Drive
  2. Upload your audio file (MP3, M4A, WAV) to Google Drive
  3. Right-click the file → Share → Share
  4. Change access to “Anyone with the link → drop down arrow, change to Viewer”
  5. Click Copy link
Eg of a Link being Copied and paste into any text editing for later use. Copy or Cut only the green portion at the text editor. The rest delete or discard, of no use.

https://drive.google.com/file/d/1X_ZBs31vhazvf8lKVEG_wflmpNGDre0x/view?usp=drive_link

https://drive.google.com/file/d/1X_ZBs31vhazvf8lKVEG_wflmpNGDre0x/view?usp=drive_link

Step 2: Copy and Paste and use the following in the blog HTML
<iframe 
  src="https://drive.google.com/file/d/FILE_ID/preview" 
  width="100%" 
  height="60" 
  allow="autoplay">
</iframe>
Step 3: Replace the Red Portion (FILE_ID) with the Green Portion (1X_ZBs31vhazvf8lKVEG_wflmpNGDre0x)

Copy or Cut and Paste the Green Portion to Paste onto the Red Portion

The Final result is as follow. Ready to use embedded code
<iframe 
src="https://drive.google.com/file/d/1X_ZBs31vhazvf8lKVEG_wflmpNGDre0x/preview"
width="100%" 
height="60" 
allow="autoplay">
</iframe>

Step 4: Copy the Step 3 embedded code and paste into the blog post HTML page






How To Embed PDF and other Documents In Blogger Blog Posts?


<iframe src="URL/preview"
width="100%" height="700px">
</iframe>

<iframe src="https://drive.google.com/file/d/1m6bV62zmabZ9oZnWNLyfN8aX2BVRh0nR/preview"
width="100%" height="700px">
</iframe>

From Dec 2025 onwards
The New UI (User Interface) no longer showing up OPEN IN NEW WINDOW. Have to use following complicated steps from Dec 2025 onwards

Use ChatGPT to help to embed the code

In the event that the following didn't work
Open the pdf file in Google drive (preview mode) - Share - Copy Link - Launch ChatGPT - Paste into Link into chatGPT - TYPE get the embedded code for me

Or

Do the Embedding code yourself

On the pdf file name you want, on the far right, 3 dots menu - click on it - Share - Right arrow - Copy Link, it should look something like this

https://drive.google.com/file/d/1m6bV62zmabZ9oZnWNLyfN8aX2BVRh0nR/view?usp=drive_link

Replace: /view?usp=drive_link
With: /preview:

Result Link:
https://drive.google.com/file/d/1m6bV62zmabZ9oZnWNLyfN8aX2BVRh0nR/preview:

Sample Template of embedded iframe:
<iframe src="PDF_LINK_HERE" width="100%" height="700px"></iframe>

Copy the Result Link to Replace the "PDF_LINK_HERE"

Final Embedded code
<iframe src= https://drive.google.com/file/d/1m6bV62zmabZ9oZnWNLyfN8aX2BVRh0nR/preview:
width="100%" height="700px"></iframe>









Terms:

What src stand for in HTML code?

In HTML, src stands for “source”.

What it means

src specifies the source URL or file location of the content that an element needs to load.

Source + URL (location of the file in Google drive). Ignore the open quote and close quote often used in the example

After any command word, there should not be open and close quote

Example 

src="photo.jpg"
It means
Src=URL(where is the source location of the file to be loaded)

Common examples

Image

<img src="photo.jpg" alt="My photo">
photo.jpg is not the file name, it is the URL (file location in Google drive)
My photo: is just a suggested text that you can replace it with any text you wish to type in, it will not show up unless image failed to be loaded.
<img src=URL alt="______">
Where:

URL → the file location link (where the image is stored)

______ → the alternative text (words of your choice that describe the image)

➡️ The browser loads photo.jpg as the image source.

Audio

<audio controls>
  <source src="song.mp3" type="audio/mpeg">
</audio>
Unfortunately, <audio controls> </audio> cannot accept link from google drive. So it is better to use the <iframe> method as described above

➡️ src points to the audio file.

Video

<video controls src="movie.mp4"></video>

Script (JavaScript)

<script src="app.js"></script>

➡️ Loads an external JavaScript file.

Iframe

<iframe src="https://example.com"></iframe>
WWhen iframe is used, since it is a frame, must provide width and height

➡️ Loads another webpage inside the frame.

In simple terms

src tells the browser: “Get the content from here.”

If you want, I can also explain the difference between src vs href, which often confuses people.


For image, must it end with alt="My photo">

What does alt stands for

Good question 👍

1. Is alt="My photo" required for images?

No, it is not strictly required for the image to load, but it is strongly recommended.

<img src="photo.jpg">

✔️ This will still display the image.

However, best practice is:

<img src="photo.jpg" alt="My photo">

2. What does alt stand for?

alt = “alternative text”

It provides a text alternative to the image.


3. Why alt is important

✅ If the image fails to load

The text in alt will be shown instead.

✅ For screen readers (accessibility)

Visually impaired users rely on alt text to understand what the image represents.

✅ For SEO (search engines)

Search engines cannot “see” images; alt text helps them understand the image content.


4. When to use alt and how

Informative image

<img src="church.jpg" alt="Church building during Christmas service">

Decorative image (no meaning)

<img src="divider.png" alt="">

(Empty alt tells screen readers to skip it.)


Simple summary

  • src = where the image comes from
  • alt = text replacement if the image cannot be seen

If you want, I can also explain when NOT to use alt text or how to write good alt descriptions.



No comments:

Post a Comment