Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
3b49ce0483
@ -852,7 +852,7 @@ var JpegStream = (function JpegStreamClosure() {
|
|||||||
*/
|
*/
|
||||||
JpegStream.prototype.isNativelySupported =
|
JpegStream.prototype.isNativelySupported =
|
||||||
function JpegStream_isNativelySupported(xref, res) {
|
function JpegStream_isNativelySupported(xref, res) {
|
||||||
var cs = ColorSpace.parse(this.dict.get('ColorSpace'), xref, res);
|
var cs = ColorSpace.parse(this.dict.get('ColorSpace', 'CS'), xref, res);
|
||||||
// when bug 674619 lands, let's check if browser can do
|
// when bug 674619 lands, let's check if browser can do
|
||||||
// normal cmyk and then we won't need to decode in JS
|
// normal cmyk and then we won't need to decode in JS
|
||||||
if (cs.name === 'DeviceGray' || cs.name === 'DeviceRGB')
|
if (cs.name === 'DeviceGray' || cs.name === 'DeviceRGB')
|
||||||
@ -867,7 +867,7 @@ var JpegStream = (function JpegStreamClosure() {
|
|||||||
*/
|
*/
|
||||||
JpegStream.prototype.isNativelyDecodable =
|
JpegStream.prototype.isNativelyDecodable =
|
||||||
function JpegStream_isNativelyDecodable(xref, res) {
|
function JpegStream_isNativelyDecodable(xref, res) {
|
||||||
var cs = ColorSpace.parse(this.dict.get('ColorSpace'), xref, res);
|
var cs = ColorSpace.parse(this.dict.get('ColorSpace', 'CS'), xref, res);
|
||||||
var numComps = cs.numComps;
|
var numComps = cs.numComps;
|
||||||
if (numComps == 1 || numComps == 3)
|
if (numComps == 1 || numComps == 3)
|
||||||
return true;
|
return true;
|
||||||
|
1
test/pdfs/issue1419.pdf.link
Normal file
1
test/pdfs/issue1419.pdf.link
Normal file
@ -0,0 +1 @@
|
|||||||
|
http://www.meal-a-day.asia/sites/default/files/Meal-a-Day%20Asia-Pacific%20Biennial%20Report%202012%20v1.01.pdf
|
@ -604,6 +604,15 @@
|
|||||||
"link": true,
|
"link": true,
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
},
|
},
|
||||||
|
{ "id": "issue1419.pdf",
|
||||||
|
"file": "pdfs/issue1419.pdf",
|
||||||
|
"md5": "b5b6c6405d7b48418bccf97277957664",
|
||||||
|
"rounds": 1,
|
||||||
|
"link": true,
|
||||||
|
"pageLimit": 1,
|
||||||
|
"skipPages": [1],
|
||||||
|
"type": "eq"
|
||||||
|
},
|
||||||
{ "id": "issue1317",
|
{ "id": "issue1317",
|
||||||
"file": "pdfs/issue1317.pdf",
|
"file": "pdfs/issue1317.pdf",
|
||||||
"md5": "6fb46275b30c48c8985617d4f86199e3",
|
"md5": "6fb46275b30c48c8985617d4f86199e3",
|
||||||
|
@ -1665,6 +1665,9 @@ var TextLayerBuilder = function textLayerBuilder(textLayerDiv) {
|
|||||||
var renderInterval = 0;
|
var renderInterval = 0;
|
||||||
var resumeInterval = 500; // in ms
|
var resumeInterval = 500; // in ms
|
||||||
|
|
||||||
|
var canvas = document.createElement('canvas');
|
||||||
|
var ctx = canvas.getContext('2d');
|
||||||
|
|
||||||
// Render the text layer, one div at a time
|
// Render the text layer, one div at a time
|
||||||
function renderTextLayer() {
|
function renderTextLayer() {
|
||||||
if (textDivs.length === 0) {
|
if (textDivs.length === 0) {
|
||||||
@ -1678,9 +1681,12 @@ var TextLayerBuilder = function textLayerBuilder(textLayerDiv) {
|
|||||||
|
|
||||||
if (textDiv.dataset.textLength > 1) { // avoid div by zero
|
if (textDiv.dataset.textLength > 1) { // avoid div by zero
|
||||||
// Adjust div width to match canvas text
|
// Adjust div width to match canvas text
|
||||||
// Due to the .offsetWidth calls, this is slow
|
|
||||||
// This needs to come after appending to the DOM
|
ctx.font = textDiv.style.fontSize + ' sans-serif';
|
||||||
var textScale = textDiv.dataset.canvasWidth / textDiv.offsetWidth;
|
var width = ctx.measureText(textDiv.textContent).width;
|
||||||
|
|
||||||
|
var textScale = textDiv.dataset.canvasWidth / width;
|
||||||
|
|
||||||
CustomStyle.setProp('transform' , textDiv,
|
CustomStyle.setProp('transform' , textDiv,
|
||||||
'scale(' + textScale + ', 1)');
|
'scale(' + textScale + ', 1)');
|
||||||
CustomStyle.setProp('transformOrigin' , textDiv, '0% 0%');
|
CustomStyle.setProp('transformOrigin' , textDiv, '0% 0%');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user