"https://github.com/mitmath/JuliaComputation/raw/main/notebooks/Broadening.pdf"👀 Reading hidden code
url = "https://github.com/mitmath/JuliaComputation/raw/main/notebooks/Broadening.pdf"
"/tmp/jl_17tXDz"👀 Reading hidden code
0x25
0x50
0x44
0x46
0x2d
0x31
0x2e
0x33
0x0a
0x25
0xc4
0xe5
0xf2
0xe5
0xeb
0xa7
0xf3
0xa0
0xd0
0xc4
0x36
0x37
0x36
0x0d
0x25
0x25
0x45
0x4f
0x46
0x0d
👀 Reading hidden code
👀 Reading hidden code
# @htl("""
# <embed src=$(url) width="500" height="375"
# type="application/pdf">
# """)
👀 Reading hidden code
using HypertextLiteral
: @htl, @htl_str
👀 Reading hidden code
@htl("""
<script src="https://cdn.jsdelivr.net/npm/pdfjs-dist@3.0.279/build/pdf.min.js" integrity="sha256-DTvuEzaEnHA+06bgzETjueIC6ZR7VSrcVwHOGRY62Yg=" crossorigin="anonymous"></script>
<script id="asdf">
const div = this ?? document.createElement("div")
const url = URL.createObjectURL(new Blob([data]))
pdfjsLib.getDocument(url).promise.then((pdf) => {
const page_promises = [...Array(pdf.numPages)].map((_,i) => pdf.getPage(i+1).then((page) => {
let scale = 1.5;
let viewport = page.getViewport({ scale: scale, });
let outputScale = window.devicePixelRatio || 1;
let canvas = document.createElement('canvas');
Deprecated, use `AbstractPlutoDingetjes.Display.published_to_js(x)` instead of `PlutoRunner.publish_to_js(x)`.
import URIs
👀 Reading hidden code
@htl("""
<iframe style="width: 100%; height: 400px" src=$("https://mozilla.github.io/pdf.js/web/viewer.html?file=$(URIs.escapeuri(url))")></iframe>
""")
👀 Reading hidden code
@htl("""
<script id="asdf">
const embed = this ?? document.createElement("embed")
embed.style = "width: 100%; height: 400px"
const data = $(PlutoRunner.publish_to_js(data))
const url = URL.createObjectURL(new Blob([data]), { type: "application/pdf" })
embed.type = "application/pdf"
embed.src = url
return embed
</script>
""")
👀 Reading hidden code
Deprecated, use `AbstractPlutoDingetjes.Display.published_to_js(x)` instead of `PlutoRunner.publish_to_js(x)`.
@htl("""
<script id="asdf">
const embed = this ?? document.createElement("iframe")
embed.style = "width: 100%; height: 400px"
const data = $(PlutoRunner.publish_to_js(data))
const url = URL.createObjectURL(new Blob([data]), { type: "application/pdf" })
embed.type = "application/pdf"
embed.src = url
return embed
</script>
""")
👀 Reading hidden code
Deprecated, use `AbstractPlutoDingetjes.Display.published_to_js(x)` instead of `PlutoRunner.publish_to_js(x)`.
# @htl("""
# <script id="asdf">
# const iframe = this ?? document.createElement("iframe")
# iframe.style = "width: 100%; height: 400px"
# iframe.allow = "accelerometer; ambient-light-sensor; autoplay; battery; camera; display-capture; document-domain; encrypted-media; execution-while-not-rendered; execution-while-out-of-viewport; fullscreen; geolocation; gyroscope; layout-animations; legacy-image-formats; magnetometer; microphone; midi; navigation-override; oversized-images; payment; picture-in-picture; publickey-credentials-get; sync-xhr; usb; wake-lock; screen-wake-lock; vr; web-share; xr-spatial-tracking"
# const data = $(PlutoRunner.publish_to_js(data))
# const url = URL.createObjectURL(new Blob([data]), { type: "text/html" })
# iframe.src = `https://mozilla.github.io/pdf.js/web/viewer.html?file=\${encodeURIComponent(url)}`
# return iframe
# </script>
# """)
👀 Reading hidden code