Fix the text layer testing

This commit is contained in:
notmasteryet 2011-12-18 16:15:53 -06:00
parent 0f6291c7b9
commit a52aacab5a

View File

@ -165,9 +165,14 @@ function nextPage(task, loadError) {
canvas.height = pageHeight * pdfToCssUnitsCoef; canvas.height = pageHeight * pdfToCssUnitsCoef;
clear(ctx); clear(ctx);
// using non-attached to the document div to test // using the text layer builder that does nothing to test
// text layer creation operations // text layer creation operations
var textLayer = document.createElement('div'); var textLayerBuilder = {
beginLayout: function nullTextLayerBuilderBeginLayout() {},
endLayout: function nullTextLayerBuilderEndLayout() {},
appendText: function nullTextLayerBuilderAppendText(text, fontName,
fontSize) {}
};
page.startRendering( page.startRendering(
ctx, ctx,
@ -177,7 +182,7 @@ function nextPage(task, loadError) {
failureMessage = 'render : ' + error.message; failureMessage = 'render : ' + error.message;
snapshotCurrentPage(task, failureMessage); snapshotCurrentPage(task, failureMessage);
}, },
textLayer textLayerBuilder
); );
} catch (e) { } catch (e) {
failure = 'page setup : ' + e.toString(); failure = 'page setup : ' + e.toString();