We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It appears that the text overlay for a converted pdf document is misaligned. The PDF I used is available here
My current code is as follows (where PDFDOC is the url provided above):
var PAGE_TO_VIEW = 1; var SCALE = 1.0; var pdfDoc = null; var pageNum = 1; var pageRendering = false; var pageNumPending = null; var container = document.getElementById('viewerContainer'); var pdfLinkService = new PDFJS.PDFLinkService(); var pdfViewer = new PDFJS.PDFViewer({ container: container, linkService: pdfLinkService, }); var getPDF = function() { PDFJS.getDocument(PDFDOC).then(function(pdf) { pdfDoc = pdf; document.getElementById('total-pg-num').textContent = pdfDoc.numPages; document.getElementById('current-pg-num').textContent = pageNum; pdfViewer.setDocument(pdfDoc); pdfLinkService.setDocument(pdfDoc, null); }); } function onNextPage() { if (pageNum >= pdfDoc.numPages) return; pageNum++; $('#page' + pageNum).goTo(70); document.getElementById('current-pg-num').textContent = pageNum; } function onPrevPage() { if (pageNum <= 1) return; pageNum--; $('#page' + pageNum).goTo(70); document.getElementById('current-pg-num').textContent = pageNum; } $(document).ready(function() { pdfLinkService.setViewer(pdfViewer); document.getElementById('doc-next').addEventListener('click', onNextPage); document.getElementById('doc-prev').addEventListener('click', onPrevPage); container.addEventListener('pagesinit', function () { pdfViewer.currentScale = SCALE; }); getPDF(); });
The text was updated successfully, but these errors were encountered:
Closing since this is fixed by #12896 and other work.
Sorry, something went wrong.
No branches or pull requests
It appears that the text overlay for a converted pdf document is misaligned. The PDF I used is available here
My current code is as follows (where PDFDOC is the url provided above):
The text was updated successfully, but these errors were encountered: