Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
naturezhanghn authored Jan 12, 2025
1 parent 27bf77b commit 29ba25e
Showing 1 changed file with 3 additions and 29 deletions.
32 changes: 3 additions & 29 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -288,38 +288,12 @@ <h2 class="title is-3">Video</h2>
<section class="section">
<div class="container is-max-desktop">
<h2 class="title is-3">Sim2Real Presentation</h2>
<canvas id="pdf-canvas"></canvas>
<object data="https://github.com/OpenImagingLab/Sim2Real/raw/main/PPT.pdf" type="application/pdf" width="100%" height="600px">
<p>Your browser does not support PDFs. <a href="https://github.com/OpenImagingLab/Sim2Real/raw/main/PPT.pdf">Download the PDF</a>.</p>
</object>
</div>
</section>

<script>
var url = 'https://github.com/OpenImagingLab/Sim2Real/raw/main/PPT.pdf';
var pdfjsLib = window['pdfjs-dist/build/pdf'];

// Fetch the PDF document
pdfjsLib.getDocument(url).promise.then(function(pdfDoc_) {
var pdfDoc = pdfDoc_;
var pageNum = 1;
var scale = 1.5;

// Render the first page
pdfDoc.getPage(pageNum).then(function(page) {
var viewport = page.getViewport({ scale: scale });
var canvas = document.getElementById('pdf-canvas');
var context = canvas.getContext('2d');

// Set the canvas dimensions
canvas.height = viewport.height;
canvas.width = viewport.width;

// Render the page on the canvas
page.render({
canvasContext: context,
viewport: viewport
});
});
});
</script>


<section class="section" id="BibTeX">
Expand Down

0 comments on commit 29ba25e

Please sign in to comment.