Last week my daughter needed revision notes before an exam.
The notes were available online and could be viewed page by page, but there was no obvious download option.
That led me down the rabbit hole of figuring out what options are available when you can read a document but can’t easily save it for offline access.
If a Google Drive file can be viewed but the Download and Print options are unavailable, the methods in this guide may help you create an offline copy for reading or printing.
In this guide, you’ll learn:
- Why some documents don’t offer downloads
- Alternative ways to save content
- How image-based document viewers work
- How to use a browser script to create a PDF
- An improved version of the script with additional features
This guide is useful for:
- Students preparing for exams
- Teachers sharing notes
- Parents helping children study
- Working professionals accessing training materials
- Anyone who can view a document but cannot download it
If you’re interested in browser automation and simple scripts like this, you’ll probably enjoy our Python automation tutorials as well.
Why Some Documents Don’t Have a Download Button
There are many legitimate reasons why downloads may be disabled:
- Educational institutions sharing reference material
- Companies distributing internal documentation
- Publishers controlling content distribution
- Organizations maintaining version control
- Owners wanting content viewed online only
Just because you can view a document doesn’t automatically mean the owner intended it to be downloaded.
Whenever possible, request a downloadable copy directly from the owner.
| Method | Works on Most Files | Keeps Searchable Text | Printable |
|---|---|---|---|
| Ask Owner | Yes | Yes | Yes |
| Print to PDF | Usually | Usually | Yes |
| Save Offline | Sometimes | Yes | No |
| Browser Script | Depends | Not Always | Yes |
What If Copy, Paste and Print Are Disabled?
Some document viewers restrict:
- Download
- Copy
- Text selection
- Right-click actions
This doesn’t always mean the document is inaccessible.
In many cases, the content is still being displayed inside your browser. The restrictions simply remove the standard buttons and menu options.
That’s why the methods in this guide focus on accessing content that is already visible on screen rather than relying on the built-in controls provided by the website.
How to Check What Type of Document You Have
Before trying any solution, it’s useful to understand how the document is being displayed.
Test 1: Search for a Word
Press: Ctrl + F
or
Cmd + F
Search for a word that appears on the page.
If the viewer finds matching results, the document likely contains a searchable text layer.
Test 2: Select Text
Try highlighting a sentence.
If you can select individual words, the document is text-based.
Test 3: Copy and Paste
Copy a paragraph and paste it into Notepad or Google Docs.
If the text pastes correctly, the PDF contains actual text rather than images.
Why This Matters
Text-based PDFs often have additional options for printing or exporting.
Image-based documents usually require different approaches.
Method 1: Ask for Download Access
Before trying any technical solution, consider asking.
A simple message such as:
“Hi, I can view the document but would like to access it offline for studying. Would it be possible to share a downloadable PDF copy?”
Often solves the problem immediately.
Advantages
- Official solution
- Best quality
- No technical steps
- No compatibility issues
Disadvantages
- Requires approval
- May take time
Method 2: Use Print to PDF
Many document viewers support printing even when direct downloads are unavailable.
Windows
Press:
Ctrl + P
Select:
Save as PDF
Click Save.
Mac
Press:
Cmd + P
Choose:
Save as PDF
Save the document.
This should always be your first technical option because it preserves formatting better than image capture.
What If the Print Option Is Disabled?
Sometimes you’ll find that:
- The Download button is missing
- The Print button is disabled
- Right-click options are blocked
- The document opens inside a custom viewer
In these situations, the content may still be displayed inside your browser page by page.
If the pages are already visible on screen, a browser-based PDF generation script can sometimes create a PDF copy from the displayed content.
This approach does not restore the website’s print functionality. Instead, it creates a new PDF from the pages currently being displayed in your browser.
Once the PDF has been created, you can usually:
- Read it offline
- Save it to your device
- Print it using your normal PDF viewer
- Share it between your own devices
Method 3: Save for Offline Reading
Modern browsers often support:
- Reading Lists
- Offline pages
- Saved webpages
- Browser syncing
These options are useful if your goal is simply to access the content later.
When Download and Print Options Are Both Unavailable
If you’ve confirmed that normal download and print options aren’t available, browser automation can sometimes help.
Many online viewers display document pages inside the browser as individual page elements, images, or rendered canvases.
Since the content is already being displayed on your screen, JavaScript can be used to capture those displayed pages and combine them into a PDF for offline reading.
When you scroll through the document, your browser downloads and displays those images.
A browser script can then:
- Detect the displayed pages.
- Convert them into image data.
- Create PDF pages.
- Download a combined PDF.
The script works with content that is already visible inside your browser window.
What This Script Can Do
The script included in this guide can:
✅ Works with many browser-based document viewers
✅ Detects page-sized content automatically
✅ Suitable for study notes and educational material already visible in the browser
✅ Requires no software installation
✅ Detect image-based document pages
✅ Combine multiple pages into a single PDF
✅ Maintain page order automatically
✅ Scale pages to fit PDF dimensions
✅ Preserve image proportions
✅ Download the PDF automatically
✅ Display progress updates
✅ Prevent unnecessary blank pages
✅ Handle modern blob-based image viewers
✅ Work directly inside Chrome, Edge, Brave, and other Chromium-based browsers
✅ Can create a printable PDF when a website’s built-in print option is unavailable
✅ Allows offline access without relying on the original viewer
✅ Creates a standard PDF that can be opened in Adobe Reader, Preview, Chrome, or other PDF applications
What This Script Cannot Do
It’s important to understand its limitations.
❌ Does not preserve searchable text layers
❌ Does not create editable PDFs
❌ Does not bypass document permissions
❌ It cannot access content you cannot already view.
❌ It cannot bypass login systems.
❌ It cannot recover pages that haven’t loaded.
❌ It cannot extract editable text from image pages.
❌ It cannot guarantee compatibility with every website.
❌ It cannot improve low-quality source images.
How the Script Works
The process is surprisingly simple.
Step 1: Find Images
The script scans the webpage for image elements.
Step 2: Identify Document Pages
The script looks for large page-sized visual elements while ignoring most navigation icons, buttons, and interface graphics.
This helps ensure that only document pages are included in the final PDF.
Step 3: Create a Canvas
Each image is drawn onto a temporary canvas.
Step 4: Convert to Image Data
The canvas converts the page into a format suitable for PDF generation.
Some Chromium-based browsers prevent pasting code into the Console by default. Type allow pasting and press Enter before pasting the script.
Step 5: Create PDF Pages
Each image becomes a page inside a PDF document.
Step 6: Download
The finished PDF is automatically saved to your computer.
Browser Script to Save or Print a View-Only PDF
Compared with older versions commonly shared online, this version adds:
- Newer jsPDF support
- Better browser compatibility
- Automatic page scaling
- Aspect ratio preservation
- Progress logging
- Error handling
- No extra blank page at the end
Important Limitation
If the original document contains searchable text, the generated PDF may not preserve that searchability.
The browser script works by capturing what is visually displayed on the page and combining those pages into a PDF.
Think of it as creating a digital photocopy of what you can already see on screen.
For offline reading, this works well.
For editing or text extraction, it may not.
Before You Run the Script
Make sure:
✓ All pages have loaded completely
✓ You have scrolled through the entire document
✓ The document is visible in your browser
✓ Pop-up downloads are allowed
✓ You are using Chrome, Edge, Brave, or another Chromium-based browser
Browser automation follows the same principles used in many automation projects.
Important for Chrome Users
If Chrome displays a warning about pasting code into Developer Tools, type:
allow pasting
into the Console and press Enter before pasting the script below.
(async () => {
const policy = trustedTypes.createPolicy("pdfExport", {
createScriptURL: input => input
});
const script = document.createElement("script");
script.src = policy.createScriptURL(
"https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.2/jspdf.min.js"
);
script.onload = () => {
const images = [...document.images]
.filter(img => img.src.startsWith("blob:"))
.sort(
(a, b) =>
a.getBoundingClientRect().top -
b.getBoundingClientRect().top
);
console.log(`Found ${images.length} pages`);
const pdf = new jsPDF("p", "mm", "a4");
images.forEach((img, index) => {
const canvas = document.createElement("canvas");
const ctx = canvas.getContext("2d");
canvas.width = img.naturalWidth;
canvas.height = img.naturalHeight;
ctx.drawImage(img, 0, 0);
const imgData =
canvas.toDataURL("image/jpeg", 0.95);
const pageWidth = 210;
const pageHeight = 297;
const ratio = Math.min(
pageWidth / canvas.width,
pageHeight / canvas.height
);
const width = canvas.width * ratio;
const height = canvas.height * ratio;
const x = (pageWidth - width) / 2;
const y = (pageHeight - height) / 2;
if (index > 0) {
pdf.addPage();
}
pdf.addImage(
imgData,
"JPEG",
x,
y,
width,
height
);
console.log(
`Added page ${index + 1}/${images.length}`
);
});
pdf.save("offline-copy.pdf");
console.log("Done");
};
document.body.appendChild(script);
})();
What Happens After Running the Script?
The script scans the currently loaded page, identifies document pages displayed in the browser, converts those pages into PDF format and downloads a new PDF file to your computer.
If successful, the generated PDF can usually be opened, saved, shared between devices and printed using standard PDF software.
Important:
The generated PDF is a new PDF created from the pages displayed in your browser. If successful, it can usually be printed using standard PDF software even when the original website did not provide a print option.
How to Use the Script
Step 1
Open the document in your browser.
Step 2
Scroll through the document to ensure all pages have loaded.
Step 3
Press F12
Step 4
Open the Console tab
Step 5
If Chrome blocks pasting, type:
allow pasting
and press Enter.
This only needs to be done once per browser session.
Step 6
Paste the script.
Step 7
Press Enter.
Step 8
Wait for processing to finish.
Step 9
The generated PDF should download automatically.
Why This Script Is More Reliable
This version has been designed to work better with modern browser-based document viewers.
It automatically:
- Detects page-sized content
- Preserves page proportions
- Avoids unnecessary blank pages
- Shows progress while processing
- Handles common browser errors more gracefully
For larger documents, these improvements make the process smoother and easier to troubleshoot.
Common Problems and Fixes
| Problem | Possible Cause | Solution |
|---|---|---|
| PDF is blank | Pages not loaded | Scroll through all pages |
| Missing pages | Lazy loading | Visit every page before running |
| Blurry output | Low-resolution viewer | Zoom in before running |
| No images found | Unsupported viewer | Try another method |
Can This Be Used for Study Notes, NCERT Solutions and School Worksheets?
Many students discover this issue while accessing:
- NCERT solutions
- School worksheets
- Coaching material
- Question banks
- Revision notes
- Competitive exam preparation material
The same principles discussed in this article apply regardless of the subject.
Frequently Asked Questions
Can I use this on Google Drive?
If the document pages are rendered as images inside your browser, it may work.
Does this work on every website?
No. Different websites use different technologies.
Can I edit the resulting PDF?
Depends
Will the generated PDF remain searchable?
It depends on how the website displays the document.
In many cases, the generated PDF is created from visual page content, which means text searchability may not be preserved.
Can I use it on my phone?
This script is designed for desktop browsers with Developer Tools access.
How do I know if my document is image-based?
Try searching for a word or selecting text.
If searching and text selection do not work, the document is likely image-based and this script is more likely to help.
The website disabled printing. Will this help?
Possibly.
Some websites disable their built-in print button while still displaying the document pages in your browser.
If the pages are visible and the script can detect them, it may be able to generate a new PDF from the displayed content.
The resulting PDF can then typically be printed using your computer’s normal PDF printing options.
Can I Save a View-Only Google Drive File If Download Is Disabled?
In some situations, yes.
If the document is visible inside your browser, there may be alternative ways to create an offline copy such as Print to PDF, browser-based saving options, or the PDF-generation method described in this guide.
The best option depends on how the document viewer is implemented.
Chrome won’t let me paste code into the Console. What should I do?
Some Chromium-based browsers display a security warning when you first try to paste code into Developer Tools.
Simply type:
allow pasting
and press Enter.
You can then paste the script normally.
Final Thoughts
The easiest solution is always to request access or use Print to PDF when available.
However, not every document viewer provides those options.
If the pages are already visible in your browser, the method described above can help create an offline copy that can be saved, viewed later and often printed normally.
For students preparing for exams, teachers sharing notes and professionals reviewing training material, it can be a useful fallback when standard download options aren’t available.
If you enjoy automating repetitive tasks, you may also like learning how to automate Google Sheets with Python.
Have you encountered a document that wouldn’t download or print?
Leave a comment below describing the viewer or website you were using. If possible, I’ll suggest the best approach for saving it for offline reading.
Looking for more beginner-friendly coding projects?
I regularly publish practical automation, AI and coding tutorials here on FunWithAI.