How to use readPostScriptTable method in wpt

Best JavaScript code snippet using wpt

fonts.js

Source:fonts.js Github

copy

Full Screen

...1262 missingGlyphs: missingGlyphs,1263 maxSizeOfInstructions: maxSizeOfInstructions1264 };1265 }1266 function readPostScriptTable(post, properties, maxpNumGlyphs) {1267 var start = (font.start ? font.start : 0) + post.offset;1268 font.pos = start;1269 var length = post.length,1270 end = start + length;1271 var version = font.getInt32();1272 font.getBytes(28);1273 var glyphNames;1274 var valid = true;1275 var i;1276 switch (version) {1277 case 0x00010000:1278 glyphNames = MacStandardGlyphOrdering;1279 break;1280 case 0x00020000:1281 var numGlyphs = font.getUint16();1282 if (numGlyphs !== maxpNumGlyphs) {1283 valid = false;1284 break;1285 }1286 var glyphNameIndexes = [];1287 for (i = 0; i < numGlyphs; ++i) {1288 var index = font.getUint16();1289 if (index >= 32768) {1290 valid = false;1291 break;1292 }1293 glyphNameIndexes.push(index);1294 }1295 if (!valid) {1296 break;1297 }1298 var customNames = [];1299 var strBuf = [];1300 while (font.pos < end) {1301 var stringLength = font.getByte();1302 strBuf.length = stringLength;1303 for (i = 0; i < stringLength; ++i) {1304 strBuf[i] = String.fromCharCode(font.getByte());1305 }1306 customNames.push(strBuf.join(''));1307 }1308 glyphNames = [];1309 for (i = 0; i < numGlyphs; ++i) {1310 var j = glyphNameIndexes[i];1311 if (j < 258) {1312 glyphNames.push(MacStandardGlyphOrdering[j]);1313 continue;1314 }1315 glyphNames.push(customNames[j - 258]);1316 }1317 break;1318 case 0x00030000:1319 break;1320 default:1321 (0, _util.warn)('Unknown/unsupported post table version ' + version);1322 valid = false;1323 if (properties.defaultEncoding) {1324 glyphNames = properties.defaultEncoding;1325 }1326 break;1327 }1328 properties.glyphNames = glyphNames;1329 return valid;1330 }1331 function readNameTable(nameTable) {1332 var start = (font.start ? font.start : 0) + nameTable.offset;1333 font.pos = start;1334 var names = [[], []];1335 var length = nameTable.length,1336 end = start + length;1337 var format = font.getUint16();1338 var FORMAT_0_HEADER_LENGTH = 6;1339 if (format !== 0 || length < FORMAT_0_HEADER_LENGTH) {1340 return names;1341 }1342 var numRecords = font.getUint16();1343 var stringsStart = font.getUint16();1344 var records = [];1345 var NAME_RECORD_LENGTH = 12;1346 var i, ii;1347 for (i = 0; i < numRecords && font.pos + NAME_RECORD_LENGTH <= end; i++) {1348 var r = {1349 platform: font.getUint16(),1350 encoding: font.getUint16(),1351 language: font.getUint16(),1352 name: font.getUint16(),1353 length: font.getUint16(),1354 offset: font.getUint16()1355 };1356 if (r.platform === 1 && r.encoding === 0 && r.language === 0 || r.platform === 3 && r.encoding === 1 && r.language === 0x409) {1357 records.push(r);1358 }1359 }1360 for (i = 0, ii = records.length; i < ii; i++) {1361 var record = records[i];1362 if (record.length <= 0) {1363 continue;1364 }1365 var pos = start + stringsStart + record.offset;1366 if (pos + record.length > end) {1367 continue;1368 }1369 font.pos = pos;1370 var nameIndex = record.name;1371 if (record.encoding) {1372 var str = '';1373 for (var j = 0, jj = record.length; j < jj; j += 2) {1374 str += String.fromCharCode(font.getUint16());1375 }1376 names[1][nameIndex] = str;1377 } else {1378 names[0][nameIndex] = (0, _util.bytesToString)(font.getBytes(record.length));1379 }1380 }1381 return names;1382 }1383 var TTOpsStackDeltas = [0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -2, -2, 0, 0, -2, -5, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, -1, -1, 1, -1, -999, 0, 1, 0, -1, -2, 0, -1, -2, -1, -1, 0, -1, -1, 0, 0, -999, -999, -1, -1, -1, -1, -2, -999, -2, -2, -999, 0, -2, -2, 0, 0, -2, 0, -2, 0, 0, 0, -2, -1, -1, 1, 1, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, 0, -999, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, -999, -999, -999, -999, -999, -1, -1, -2, -2, 0, 0, 0, 0, -1, -1, -999, -2, -2, 0, 0, -1, -2, -2, 0, 0, 0, -1, -1, -1, -2];1384 function sanitizeTTProgram(table, ttContext) {1385 var data = table.data;1386 var i = 0,1387 j,1388 n,1389 b,1390 funcId,1391 pc,1392 lastEndf = 0,1393 lastDeff = 0;1394 var stack = [];1395 var callstack = [];1396 var functionsCalled = [];1397 var tooComplexToFollowFunctions = ttContext.tooComplexToFollowFunctions;1398 var inFDEF = false,1399 ifLevel = 0,1400 inELSE = 0;1401 for (var ii = data.length; i < ii;) {1402 var op = data[i++];1403 if (op === 0x40) {1404 n = data[i++];1405 if (inFDEF || inELSE) {1406 i += n;1407 } else {1408 for (j = 0; j < n; j++) {1409 stack.push(data[i++]);1410 }1411 }1412 } else if (op === 0x41) {1413 n = data[i++];1414 if (inFDEF || inELSE) {1415 i += n * 2;1416 } else {1417 for (j = 0; j < n; j++) {1418 b = data[i++];1419 stack.push(b << 8 | data[i++]);1420 }1421 }1422 } else if ((op & 0xF8) === 0xB0) {1423 n = op - 0xB0 + 1;1424 if (inFDEF || inELSE) {1425 i += n;1426 } else {1427 for (j = 0; j < n; j++) {1428 stack.push(data[i++]);1429 }1430 }1431 } else if ((op & 0xF8) === 0xB8) {1432 n = op - 0xB8 + 1;1433 if (inFDEF || inELSE) {1434 i += n * 2;1435 } else {1436 for (j = 0; j < n; j++) {1437 b = data[i++];1438 stack.push(b << 8 | data[i++]);1439 }1440 }1441 } else if (op === 0x2B && !tooComplexToFollowFunctions) {1442 if (!inFDEF && !inELSE) {1443 funcId = stack[stack.length - 1];1444 ttContext.functionsUsed[funcId] = true;1445 if (funcId in ttContext.functionsStackDeltas) {1446 stack.length += ttContext.functionsStackDeltas[funcId];1447 } else if (funcId in ttContext.functionsDefined && functionsCalled.indexOf(funcId) < 0) {1448 callstack.push({1449 data: data,1450 i: i,1451 stackTop: stack.length - 11452 });1453 functionsCalled.push(funcId);1454 pc = ttContext.functionsDefined[funcId];1455 if (!pc) {1456 (0, _util.warn)('TT: CALL non-existent function');1457 ttContext.hintsValid = false;1458 return;1459 }1460 data = pc.data;1461 i = pc.i;1462 }1463 }1464 } else if (op === 0x2C && !tooComplexToFollowFunctions) {1465 if (inFDEF || inELSE) {1466 (0, _util.warn)('TT: nested FDEFs not allowed');1467 tooComplexToFollowFunctions = true;1468 }1469 inFDEF = true;1470 lastDeff = i;1471 funcId = stack.pop();1472 ttContext.functionsDefined[funcId] = {1473 data: data,1474 i: i1475 };1476 } else if (op === 0x2D) {1477 if (inFDEF) {1478 inFDEF = false;1479 lastEndf = i;1480 } else {1481 pc = callstack.pop();1482 if (!pc) {1483 (0, _util.warn)('TT: ENDF bad stack');1484 ttContext.hintsValid = false;1485 return;1486 }1487 funcId = functionsCalled.pop();1488 data = pc.data;1489 i = pc.i;1490 ttContext.functionsStackDeltas[funcId] = stack.length - pc.stackTop;1491 }1492 } else if (op === 0x89) {1493 if (inFDEF || inELSE) {1494 (0, _util.warn)('TT: nested IDEFs not allowed');1495 tooComplexToFollowFunctions = true;1496 }1497 inFDEF = true;1498 lastDeff = i;1499 } else if (op === 0x58) {1500 ++ifLevel;1501 } else if (op === 0x1B) {1502 inELSE = ifLevel;1503 } else if (op === 0x59) {1504 if (inELSE === ifLevel) {1505 inELSE = 0;1506 }1507 --ifLevel;1508 } else if (op === 0x1C) {1509 if (!inFDEF && !inELSE) {1510 var offset = stack[stack.length - 1];1511 if (offset > 0) {1512 i += offset - 1;1513 }1514 }1515 }1516 if (!inFDEF && !inELSE) {1517 var stackDelta = op <= 0x8E ? TTOpsStackDeltas[op] : op >= 0xC0 && op <= 0xDF ? -1 : op >= 0xE0 ? -2 : 0;1518 if (op >= 0x71 && op <= 0x75) {1519 n = stack.pop();1520 if (!isNaN(n)) {1521 stackDelta = -n * 2;1522 }1523 }1524 while (stackDelta < 0 && stack.length > 0) {1525 stack.pop();1526 stackDelta++;1527 }1528 while (stackDelta > 0) {1529 stack.push(NaN);1530 stackDelta--;1531 }1532 }1533 }1534 ttContext.tooComplexToFollowFunctions = tooComplexToFollowFunctions;1535 var content = [data];1536 if (i > data.length) {1537 content.push(new Uint8Array(i - data.length));1538 }1539 if (lastDeff > lastEndf) {1540 (0, _util.warn)('TT: complementing a missing function tail');1541 content.push(new Uint8Array([0x22, 0x2D]));1542 }1543 foldTTTable(table, content);1544 }1545 function checkInvalidFunctions(ttContext, maxFunctionDefs) {1546 if (ttContext.tooComplexToFollowFunctions) {1547 return;1548 }1549 if (ttContext.functionsDefined.length > maxFunctionDefs) {1550 (0, _util.warn)('TT: more functions defined than expected');1551 ttContext.hintsValid = false;1552 return;1553 }1554 for (var j = 0, jj = ttContext.functionsUsed.length; j < jj; j++) {1555 if (j > maxFunctionDefs) {1556 (0, _util.warn)('TT: invalid function id: ' + j);1557 ttContext.hintsValid = false;1558 return;1559 }1560 if (ttContext.functionsUsed[j] && !ttContext.functionsDefined[j]) {1561 (0, _util.warn)('TT: undefined function: ' + j);1562 ttContext.hintsValid = false;1563 return;1564 }1565 }1566 }1567 function foldTTTable(table, content) {1568 if (content.length > 1) {1569 var newLength = 0;1570 var j, jj;1571 for (j = 0, jj = content.length; j < jj; j++) {1572 newLength += content[j].length;1573 }1574 newLength = newLength + 3 & ~3;1575 var result = new Uint8Array(newLength);1576 var pos = 0;1577 for (j = 0, jj = content.length; j < jj; j++) {1578 result.set(content[j], pos);1579 pos += content[j].length;1580 }1581 table.data = result;1582 table.length = newLength;1583 }1584 }1585 function sanitizeTTPrograms(fpgm, prep, cvt, maxFunctionDefs) {1586 var ttContext = {1587 functionsDefined: [],1588 functionsUsed: [],1589 functionsStackDeltas: [],1590 tooComplexToFollowFunctions: false,1591 hintsValid: true1592 };1593 if (fpgm) {1594 sanitizeTTProgram(fpgm, ttContext);1595 }1596 if (prep) {1597 sanitizeTTProgram(prep, ttContext);1598 }1599 if (fpgm) {1600 checkInvalidFunctions(ttContext, maxFunctionDefs);1601 }1602 if (cvt && cvt.length & 1) {1603 var cvtData = new Uint8Array(cvt.length + 1);1604 cvtData.set(cvt.data);1605 cvt.data = cvtData;1606 }1607 return ttContext.hintsValid;1608 }1609 font = new _stream.Stream(new Uint8Array(font.getBytes()));1610 var VALID_TABLES = ['OS/2', 'cmap', 'head', 'hhea', 'hmtx', 'maxp', 'name', 'post', 'loca', 'glyf', 'fpgm', 'prep', 'cvt ', 'CFF '];1611 var header = readOpenTypeHeader(font);1612 var numTables = header.numTables;1613 var cff, cffFile;1614 var tables = Object.create(null);1615 tables['OS/2'] = null;1616 tables['cmap'] = null;1617 tables['head'] = null;1618 tables['hhea'] = null;1619 tables['hmtx'] = null;1620 tables['maxp'] = null;1621 tables['name'] = null;1622 tables['post'] = null;1623 var table;1624 for (var i = 0; i < numTables; i++) {1625 table = readTableEntry(font);1626 if (VALID_TABLES.indexOf(table.tag) < 0) {1627 continue;1628 }1629 if (table.length === 0) {1630 continue;1631 }1632 tables[table.tag] = table;1633 }1634 var isTrueType = !tables['CFF '];1635 if (!isTrueType) {1636 if (header.version === 'OTTO' && !(properties.composite && properties.cidToGidMap) || !tables['head'] || !tables['hhea'] || !tables['maxp'] || !tables['post']) {1637 cffFile = new _stream.Stream(tables['CFF '].data);1638 cff = new CFFFont(cffFile, properties);1639 adjustWidths(properties);1640 return this.convert(name, cff, properties);1641 }1642 delete tables['glyf'];1643 delete tables['loca'];1644 delete tables['fpgm'];1645 delete tables['prep'];1646 delete tables['cvt '];1647 this.isOpenType = true;1648 } else {1649 if (!tables['loca']) {1650 throw new _util.FormatError('Required "loca" table is not found');1651 }1652 if (!tables['glyf']) {1653 (0, _util.warn)('Required "glyf" table is not found -- trying to recover.');1654 tables['glyf'] = {1655 tag: 'glyf',1656 data: new Uint8Array(0)1657 };1658 }1659 this.isOpenType = false;1660 }1661 if (!tables['maxp']) {1662 throw new _util.FormatError('Required "maxp" table is not found');1663 }1664 font.pos = (font.start || 0) + tables['maxp'].offset;1665 var version = font.getInt32();1666 var numGlyphs = font.getUint16();1667 var maxFunctionDefs = 0;1668 var maxSizeOfInstructions = 0;1669 if (version >= 0x00010000 && tables['maxp'].length >= 22) {1670 font.pos += 8;1671 var maxZones = font.getUint16();1672 if (maxZones > 2) {1673 tables['maxp'].data[14] = 0;1674 tables['maxp'].data[15] = 2;1675 }1676 font.pos += 4;1677 maxFunctionDefs = font.getUint16();1678 font.pos += 6;1679 maxSizeOfInstructions = font.getUint16();1680 }1681 var dupFirstEntry = false;1682 if (properties.type === 'CIDFontType2' && properties.toUnicode && properties.toUnicode.get(0) > '\0') {1683 dupFirstEntry = true;1684 numGlyphs++;1685 tables['maxp'].data[4] = numGlyphs >> 8;1686 tables['maxp'].data[5] = numGlyphs & 255;1687 }1688 var hintsValid = sanitizeTTPrograms(tables['fpgm'], tables['prep'], tables['cvt '], maxFunctionDefs);1689 if (!hintsValid) {1690 delete tables['fpgm'];1691 delete tables['prep'];1692 delete tables['cvt '];1693 }1694 sanitizeMetrics(font, tables['hhea'], tables['hmtx'], numGlyphs);1695 if (!tables['head']) {1696 throw new _util.FormatError('Required "head" table is not found');1697 }1698 sanitizeHead(tables['head'], numGlyphs, isTrueType ? tables['loca'].length : 0);1699 var missingGlyphs = Object.create(null);1700 if (isTrueType) {1701 var isGlyphLocationsLong = int16(tables['head'].data[50], tables['head'].data[51]);1702 var glyphsInfo = sanitizeGlyphLocations(tables['loca'], tables['glyf'], numGlyphs, isGlyphLocationsLong, hintsValid, dupFirstEntry, maxSizeOfInstructions);1703 missingGlyphs = glyphsInfo.missingGlyphs;1704 if (version >= 0x00010000 && tables['maxp'].length >= 22) {1705 tables['maxp'].data[26] = glyphsInfo.maxSizeOfInstructions >> 8;1706 tables['maxp'].data[27] = glyphsInfo.maxSizeOfInstructions & 255;1707 }1708 }1709 if (!tables['hhea']) {1710 throw new _util.FormatError('Required "hhea" table is not found');1711 }1712 if (tables['hhea'].data[10] === 0 && tables['hhea'].data[11] === 0) {1713 tables['hhea'].data[10] = 0xFF;1714 tables['hhea'].data[11] = 0xFF;1715 }1716 var metricsOverride = {1717 unitsPerEm: int16(tables['head'].data[18], tables['head'].data[19]),1718 yMax: int16(tables['head'].data[42], tables['head'].data[43]),1719 yMin: signedInt16(tables['head'].data[38], tables['head'].data[39]),1720 ascent: int16(tables['hhea'].data[4], tables['hhea'].data[5]),1721 descent: signedInt16(tables['hhea'].data[6], tables['hhea'].data[7])1722 };1723 this.ascent = metricsOverride.ascent / metricsOverride.unitsPerEm;1724 this.descent = metricsOverride.descent / metricsOverride.unitsPerEm;1725 if (tables['post']) {1726 var valid = readPostScriptTable(tables['post'], properties, numGlyphs);1727 if (!valid) {1728 tables['post'] = null;1729 }1730 }1731 var charCodeToGlyphId = [],1732 charCode;1733 function hasGlyph(glyphId) {1734 return !missingGlyphs[glyphId];1735 }1736 if (properties.composite) {1737 var cidToGidMap = properties.cidToGidMap || [];1738 var isCidToGidMapEmpty = cidToGidMap.length === 0;1739 properties.cMap.forEach(function (charCode, cid) {1740 if (cid > 0xffff) {...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('wptools');2wptools.readPostScriptTable('en.wikipedia.org', 'Albert Einstein', function(err, data) {3 if (err) {4 console.log(err);5 } else {6 console.log(data);7 }8});9var wptools = require('wptools');10wptools.readPostScriptTable('en.wikipedia.org', 'Albert Einstein', function(err, data) {11 if (err) {12 console.log(err);13 } else {14 console.log(data);15 }16});17var wptools = require('wptools');18wptools.readPostScriptTable('en.wikipedia.org', 'Albert Einstein', function(err, data) {19 if (err) {20 console.log(err);21 } else {22 console.log(data);23 }24});25var wptools = require('wptools');26wptools.readPostScriptTable('en.wikipedia.org', 'Albert Einstein', function(err, data) {27 if (err) {28 console.log(err);29 } else {30 console.log(data);31 }32});33var wptools = require('wptools');34wptools.readPostScriptTable('en.wikipedia.org', 'Albert Einstein', function(err, data) {35 if (err) {36 console.log(err);37 } else {38 console.log(data);39 }40});41var wptools = require('wptools');42wptools.readPostScriptTable('en.wikipedia.org', 'Albert Einstein', function(err, data) {43 if (err) {44 console.log(err);45 } else {46 console.log(data);47 }48});49var wptools = require('wptools');50wptools.readPostScriptTable('en.wikipedia.org', 'Albert Einstein', function(err, data) {51 if (err) {

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('./wptools.js');2var fs = require('fs');3var data = fs.readFileSync('postscript.txt');4var table = wptools.readPostScriptTable(data);5console.log(table);6var readPostScriptTable = function (data) {7 var table = {};8 var lines = data.toString().split('9');10 for (var i = 0; i < lines.length; i++) {11 var line = lines[i];12 var parts = line.split(' ');13 var key = parts[0];14 var value = parts[1];15 table[key] = value;16 }17 return table;18};19module.exports = {20};21var table = {22}23var wptools = require('./wptools.js');24var fs = require('fs');25var data = fs.readFileSync('postscript.txt');26var table = wptools.readPostScriptTable(data);27console.log(table);28var readPostScriptTable = function (data) {29 var table = {};30 var lines = data.toString().split('31');32 for (var i = 0; i < lines.length; i++) {33 var line = lines[i];34 var parts = line.split(' ');35 var key = parts[0];36 var value = parts[1];37 table[key] = value;38 }39 return table;40};41module.exports = {42};

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('wp-tools');2wptools.readPostScriptTable('test.pdf', function(err, table) {3 if (err) {4 console.log('Error reading postscript table: ' + err);5 } else {6 console.log('Postscript table: ' + table);7 }8});9var wptools = require('wp-tools');10wptools.readPostScriptTable('test.pdf', function(err, table) {11 if (err) {12 console.log('Error reading postscript table: ' + err);13 } else {14 console.log('Postscript table: ' + table);15 }16});17var wptools = require('wp-tools');18wptools.readPostScriptTable('test.pdf', function(err, table) {19 if (err) {20 console.log('Error reading postscript table: ' + err);21 } else {22 console.log('Postscript table: ' + table);23 }24});25var wptools = require('wp-tools');26wptools.readPostScriptTable('test.pdf', function(err, table) {27 if (err) {28 console.log('Error reading postscript table: ' + err);29 } else {30 console.log('Postscript table: ' + table);31 }32});33var wptools = require('wp-tools');34wptools.readPostScriptTable('test.pdf', function(err, table) {35 if (err) {36 console.log('Error reading postscript table: ' + err);37 } else {38 console.log('Postscript table: ' + table);39 }40});41var wptools = require('wp-tools');

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptoolkit = require('wptoolkit');2var fs = require('fs');3var fontData = fs.readFileSync('./fonts/MyFont-Regular.ttf');4var font = wptoolkit.createFont(fontData);5var tableData = font.readPostScriptTable();6console.log(tableData);7{ version: 2,8 maxMemType1: 0 }9var wptoolkit = require('wptoolkit');10var fs = require('fs');11var fontData = fs.readFileSync('./fonts/MyFont-Regular.ttf');12var font = wptoolkit.createFont(fontData);13var tableData = font.readHeaderTable();14console.log(tableData);15{ version: 131072,16 glyphDataFormat: 0 }17var wptoolkit = require('wptoolkit');18var fs = require('fs');19var fontData = fs.readFileSync('./fonts/MyFont-Regular.ttf');20var font = wptoolkit.createFont(fontData);21var tableData = font.readHorizontalHeaderTable();22console.log(tableData);23{ version: 65536,

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('wptools');2var page = wptools.page('Wikipedia:WikiProject Missing encyclopedic articles/By topic');3page.readPostScriptTable(function(err, table) {4 if (err) {5 console.log(err);6 } else {7 console.log(table);8 }9});

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('wp-tools');2var wp = new wptools('Node.js');3wp.readPostScriptTable(function(err, data){4if(err) throw err;5});6wp.readPostScriptTable().then(function(data){7console.log(data);8});9wp.readPostScriptTable().then(console.log);10wp.readPostScriptTable().then(function(data){11var table = data.table;12console.log(table);13});14wp.readPostScriptTable().then(function(data){15var table = data.table;16for(var i = 0; i < table.length; i++){17console.log(table[i]);18}19});20wp.readPostScriptTable().then(function(data){21var table = data.table;22for(var i = 0; i < table.length; i++){23var row = table[i];24for(var j = 0; j < row.length; j++){25console.log(row[j]);26}27}28});29wp.readPostScriptTable().then(function(data){30var table = data.table;31for(var i = 0; i < table.length; i++){32var row = table[i];33for(var j = 0; j < row.length; j++){34var cell = row[j];35console.log(cell);36}37}38});39wp.readPostScriptTable().then(function(data){40var table = data.table;41for(var i = 0; i < table.length; i++){42var row = table[i];43for(var j = 0; j < row.length; j++){44var cell = row[j];45console.log(cell.text);46}47}48});49wp.readPostScriptTable().then(function(data){50var table = data.table;51for(var i = 0; i < table.length; i++){52var row = table[i];53for(var j = 0; j < row.length; j++){54var cell = row[j];55console.log(cell.text);56console.log(cell.href);57}58}59});60wp.readPostScriptTable().then(function(data){61var table = data.table;62for(var i = 0; i < table.length; i++){63var row = table[i];64for(var j = 0; j < row.length; j++){65var cell = row[j];66console.log(cell.text);67console.log(cell.href);68console.log(cell.type);69}70}71});72wp.readPostScriptTable().then(function

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run wpt automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful