Skip to content

Instantly share code, notes, and snippets.

View navrudh's full-sized avatar
🚂
Chugging Along

Dhruvan Ganesh navrudh

🚂
Chugging Along
  • Bonn
View GitHub Profile
function getHightlightCoords() {
var pageIndex = PDFViewerApplication.pdfViewer.currentPageNumber - 1;
var page = PDFViewerApplication.pdfViewer.getPageView(pageIndex);
var pageRect = page.canvas.getClientRects()[0];
var selectionRects = window.getSelection().getRangeAt(0).getClientRects();
var viewport = page.viewport;
var selected = selectionRects.map(function (r) {
return viewport.convertToPdfPoint(r.left - pageRect.x, r.top - pageRect.y).concat(
viewport.convertToPdfPoint(r.right - pageRect.x, r.bottom - pageRect.y));
});
@navrudh
navrudh / package.json
Created October 26, 2017 09:43
Class 'PendingInterceptorService' incorrectly implements interface 'HttpInterceptor' when running ng serve --prod
{
"name": "app",
"version": "2.1.1",
"license": "",
"angular-cli": {},
"scripts": {
"ng": "ng",
"start-dev-https": "ng serve --host 0.0.0.0 --port 4201 --environment=dev --ssl true --ssl-key %USERPROFILE%/certs/https/server.key --ssl-cert %USERPROFILE%/certs/https/server.crt",
"start-local": "ng serve --port 4200 --environment=prod",
"start-prod-local": "ng serve --port 4200 --prod",