Skip to content
New issue

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

Internal Server Error (500) #1174

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions webapp/static/js/pdf_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,8 @@ Tabula.Selection = Backbone.Model.extend({

var original_pdf_width = page.get('width');
var original_pdf_height = page.get('height');
var pdf_rotation = page.get('rotation');

var scale = (Math.abs(pdf_rotation) == 90 ? original_pdf_height : original_pdf_width) / imageWidth;
var scale = original_pdf_width / imageWidth;
var rp = this.attributes.getDims().relativePos;
this.set({
x1: rp.left * scale,
Expand Down Expand Up @@ -1139,7 +1138,6 @@ Tabula.PDFView = Backbone.View.extend(
var page = Tabula.pdf_view.pdf_document.page_collection.findWhere({number: sel.page});
var original_pdf_width = page.get('width');
var original_pdf_height = page.get('height');
var pdf_rotation = page.get('rotation');

// TODO: create selection models for pages that aren't lazyloaded, but obviously don't display them.
if(Tabula.LazyLoad && !pageView){
Expand All @@ -1152,7 +1150,7 @@ Tabula.PDFView = Backbone.View.extend(
if (!$img.length || $img.data('loaded') !== 'loaded' || !$img.height() ){ // if this page isn't shown currently or the image hasn't been rendered yet, then create a hidden selectionx
return this.pdf_document.selections.createHiddenSelection(sel);
}
var scale = image_width / (Math.abs(pdf_rotation) == 90 ? original_pdf_height : original_pdf_width);
var scale = image_width / original_pdf_width;
var offset = $img.offset();
var absolutePos = _.extend({}, offset,
{
Expand Down