Skip to content
Merged
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
22 changes: 2 additions & 20 deletions plugins/annotations.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,7 @@
}
}

//var pageHeight = this.internal.pageSize.height * this.internal.scaleFactor;
var rect = "/Rect [" + f2(anno.x * k) + " " + f2((pageHeight - anno.y) * k) + " " + f2(anno.x + anno.w * k) + " " + f2(pageHeight - (anno.y + anno.h) * k) + "] ";
var rect = "/Rect [" + f2(anno.x * k) + " " + f2((pageHeight - anno.y) * k) + " " + f2((anno.x + anno.w) * k) + " " + f2((pageHeight - (anno.y + anno.h)) * k) + "] ";

var line = '';
if (anno.options.url) {
Expand Down Expand Up @@ -239,31 +238,14 @@
});
};

/**
* valid options
* <li> pageNumber or url [required]
* <p>If pageNumber is specified, top and zoom may also be specified</p>
*/
jsPDFAPI.link = function(x,y,w,h,options) {
'use strict';
this.annotationPlugin.annotations[this.internal.getCurrentPageInfo().pageNumber].push({
x : x,
y : y,
w : w,
h : h,
options : options,
type : 'link'
});
};

/**
* Currently only supports single line text.
* Returns the width of the text/link
*/
jsPDFAPI.textWithLink = function(text,x,y,options) {
'use strict';
var width = this.getTextWidth(text);
var height = this.internal.getLineHeight();
var height = this.internal.getLineHeight() / this.internal.scaleFactor;
this.text(text, x, y);
//TODO We really need the text baseline height to do this correctly.
// Or ability to draw text on top, bottom, center, or baseline.
Expand Down