implement TL and T*
This commit is contained in:
parent
fa4c34ad06
commit
78d0b3caf1
9
pdf.js
9
pdf.js
@ -1547,6 +1547,7 @@ var CanvasExtraState = (function() {
|
|||||||
this.alphaIsShape = false;
|
this.alphaIsShape = false;
|
||||||
this.fontSize = 0.0;
|
this.fontSize = 0.0;
|
||||||
this.textMatrix = IDENTITY_MATRIX;
|
this.textMatrix = IDENTITY_MATRIX;
|
||||||
|
this.leading = 0.0;
|
||||||
// Current point (in user coordinates)
|
// Current point (in user coordinates)
|
||||||
this.x = 0.0;
|
this.x = 0.0;
|
||||||
this.y = 0.0;
|
this.y = 0.0;
|
||||||
@ -1600,9 +1601,11 @@ var CanvasGraphics = (function() {
|
|||||||
// Text
|
// Text
|
||||||
BT: this.beginText,
|
BT: this.beginText,
|
||||||
ET: this.endText,
|
ET: this.endText,
|
||||||
|
TL: this.setLeading,
|
||||||
Tf: this.setFont,
|
Tf: this.setFont,
|
||||||
Td: this.moveText,
|
Td: this.moveText,
|
||||||
Tm: this.setTextMatrix,
|
Tm: this.setTextMatrix,
|
||||||
|
"T*": this.nextLine,
|
||||||
Tj: this.showText,
|
Tj: this.showText,
|
||||||
TJ: this.showSpacedText,
|
TJ: this.showSpacedText,
|
||||||
|
|
||||||
@ -1774,6 +1777,9 @@ var CanvasGraphics = (function() {
|
|||||||
},
|
},
|
||||||
endText: function() {
|
endText: function() {
|
||||||
},
|
},
|
||||||
|
setLeading: function(leading) {
|
||||||
|
this.current.leading = leading;
|
||||||
|
},
|
||||||
setFont: function(fontRef, size) {
|
setFont: function(fontRef, size) {
|
||||||
var fontRes = this.res.get("Font");
|
var fontRes = this.res.get("Font");
|
||||||
if (!fontRes)
|
if (!fontRes)
|
||||||
@ -1795,6 +1801,9 @@ var CanvasGraphics = (function() {
|
|||||||
this.current.x = this.current.lineX = 0;
|
this.current.x = this.current.lineX = 0;
|
||||||
this.current.y = this.current.lineY = 0;
|
this.current.y = this.current.lineY = 0;
|
||||||
},
|
},
|
||||||
|
nextLine: function() {
|
||||||
|
this.moveText(0, this.current.leading);
|
||||||
|
},
|
||||||
showText: function(text) {
|
showText: function(text) {
|
||||||
this.ctx.save();
|
this.ctx.save();
|
||||||
this.ctx.translate(0, 2 * this.current.y);
|
this.ctx.translate(0, 2 * this.current.y);
|
||||||
|
@ -52,7 +52,8 @@ function load() {
|
|||||||
pageDisplay = document.getElementById("pageNumber");
|
pageDisplay = document.getElementById("pageNumber");
|
||||||
infoDisplay = document.getElementById("info");
|
infoDisplay = document.getElementById("info");
|
||||||
pageNum = parseInt(queryParams().page) || 1;
|
pageNum = parseInt(queryParams().page) || 1;
|
||||||
open("compressed.tracemonkey-pldi-09.pdf");
|
// open("compressed.tracemonkey-pldi-09.pdf");
|
||||||
|
open("compressed.canvas.pdf");
|
||||||
}
|
}
|
||||||
|
|
||||||
function open(url) {
|
function open(url) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user