Skip to content

Instantly share code, notes, and snippets.

@danila-schelkov
danila-schelkov / pdf_unembedder.js
Created March 10, 2025 14:51
A small script for downloading pdfs from sites with PDF Embedder
function saveToFile(byteArray, fileName) {
const blob = new Blob([byteArray], { type: "application/pdf" });
const url = URL.createObjectURL(blob);
// Note: A link element is used to set the file name
const a = document.createElement("a");
a.href = url;
a.download = fileName;
document.body.appendChild(a);