From 9f9126e2c0725a7b5bbbb92d73a80f8c5ecec32b Mon Sep 17 00:00:00 2001 From: Michal Szczepanski Date: Mon, 22 Jul 2019 23:34:41 +0200 Subject: [PATCH] Documentation for Visitor --- lib/pdf/Visitor.js | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/lib/pdf/Visitor.js b/lib/pdf/Visitor.js index 8cbd7ba..c9c9780 100644 --- a/lib/pdf/Visitor.js +++ b/lib/pdf/Visitor.js @@ -17,10 +17,7 @@ class Visitor { } /** - * - * @param args - * @param page - * @param dependencies + * pdf.OPS.beginText */ beginText(args, page, dependencies) { if (this.debug) console.log('beginText'); @@ -29,13 +26,19 @@ class Visitor { this.currentObject.newLine(); this.objectList.push(this.currentObject); } - + + /** + * pdf.OPS.setFont + */ setFont(args, page, dependencies) { if (this.debug) console.log('setFont'); if (this.skip) return; this.currentFont = this.txt.getFont(args, page, dependencies) } + /** + * pdf.OPS.showText + */ showText(args, page, dependencies) { if (this.debug) console.log("showText"); if (this.skip) return; @@ -46,6 +49,9 @@ class Visitor { el2.setText(this.txt.getText(args[0], el2)+" "); } + /** + * pdf.OPS.showSpacedText + */ showSpacedText(args, page, dependencies) { if (this.debug) console.log("showSpacedText"); if (this.skip) return; @@ -56,12 +62,18 @@ class Visitor { el2.setText(this.txt.getText(args[0], el2)+" "); } + /** + * pdf.OPS.endText + */ endText(args, page, dependencies) { if (this.debug) console.log('endText'); if (this.skip) return; this.currentObject = null; } + /** + * pdf.OPS.moveText + */ moveText(args, page, dependencies) { if (this.debug) console.log('moveText'); if (this.skip) return; @@ -81,6 +93,9 @@ class Visitor { el.setPosition(this.currentObject.x, this.currentObject.y); } + /** + * pdf.OPS.setTextMatrix + */ setTextMatrix(args, page, dependencies) { if (this.debug) console.log('setTextMatrix'); if (this.skip) return; @@ -92,6 +107,9 @@ class Visitor { } + /** + * pdf.OPS.paintFormXObjectBegin + */ paintFormXObjectBegin(args, page, dependencies) { if(this.debug) console.log('paintFormXObjectBegin'); if(!this.config.paintFormXObject) { @@ -99,6 +117,9 @@ class Visitor { } } + /** + * pdf.OPS.paintFormXObjectEnd + */ paintFormXObjectEnd(args, page, dependencies) { if(this.debug) console.log('paintFormXObjectEnd'); this.skip = false;