pdfdataextract
Version:
Extract data from a pdf with pure javascript
494 lines • 8.37 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PdfReferenceOutline = exports.PageNumberOutline = exports.UrlOutline = exports.OCRLang = exports.Sort = exports.VerbosityLevel = void 0;
const pdf_mjs_1 = require("pdfjs-dist/legacy/build/pdf.mjs");
var VerbosityLevel;
(function (VerbosityLevel) {
/**
* logs all errors
*/
VerbosityLevel[VerbosityLevel["ERRORS"] = pdf_mjs_1.VerbosityLevel.ERRORS] = "ERRORS";
/**
* logs all infos
*/
VerbosityLevel[VerbosityLevel["INFOS"] = pdf_mjs_1.VerbosityLevel.INFOS] = "INFOS";
/**
* logs all warnings
*/
VerbosityLevel[VerbosityLevel["WARNINGS"] = pdf_mjs_1.VerbosityLevel.WARNINGS] = "WARNINGS";
})(VerbosityLevel || (exports.VerbosityLevel = VerbosityLevel = {}));
var Sort;
(function (Sort) {
/**
* if it should sort ascending
*/
Sort[Sort["ASC"] = 0] = "ASC";
/**
* if it should sort descending
*/
Sort[Sort["DESC"] = 1] = "DESC";
})(Sort || (exports.Sort = Sort = {}));
var OCRLang;
(function (OCRLang) {
/**
* AFR
*/
OCRLang["AFR"] = "afr";
/**
* AMH
*/
OCRLang["AMH"] = "amh";
/**
* ARA
*/
OCRLang["ARA"] = "ara";
/**
* ASM
*/
OCRLang["ASM"] = "asm";
/**
* AZE
*/
OCRLang["AZE"] = "aze";
/**
* AZE_CYRL
*/
OCRLang["AZE_CYRL"] = "aze_cyrl";
/**
* BEL
*/
OCRLang["BEL"] = "bel";
/**
* BEN
*/
OCRLang["BEN"] = "ben";
/**
* BOD
*/
OCRLang["BOD"] = "bod";
/**
* BOS
*/
OCRLang["BOS"] = "bos";
/**
* BUL
*/
OCRLang["BUL"] = "bul";
/**
* CAT
*/
OCRLang["CAT"] = "cat";
/**
* CEB
*/
OCRLang["CEB"] = "ceb";
/**
* CES
*/
OCRLang["CES"] = "ces";
/**
* CHI_SIM
*/
OCRLang["CHI_SIM"] = "chi_sim";
/**
* CHI_TRA
*/
OCRLang["CHI_TRA"] = "chi_tra";
/**
* CHR
*/
OCRLang["CHR"] = "chr";
/**
* CYM
*/
OCRLang["CYM"] = "cym";
/**
* DAN
*/
OCRLang["DAN"] = "dan";
/**
* DEU
*/
OCRLang["DEU"] = "deu";
/**
* DZO
*/
OCRLang["DZO"] = "dzo";
/**
* ELL
*/
OCRLang["ELL"] = "ell";
/**
* ENG
*/
OCRLang["ENG"] = "eng";
/**
* ENM
*/
OCRLang["ENM"] = "enm";
/**
* EPO
*/
OCRLang["EPO"] = "epo";
/**
* EST
*/
OCRLang["EST"] = "est";
/**
* EUS
*/
OCRLang["EUS"] = "eus";
/**
* FAS
*/
OCRLang["FAS"] = "fas";
/**
* FIN
*/
OCRLang["FIN"] = "fin";
/**
* FRA
*/
OCRLang["FRA"] = "fra";
/**
* FRK
*/
OCRLang["FRK"] = "frk";
/**
* FRM
*/
OCRLang["FRM"] = "frm";
/**
* GLE
*/
OCRLang["GLE"] = "gle";
/**
* GLG
*/
OCRLang["GLG"] = "glg";
/**
* GRC
*/
OCRLang["GRC"] = "grc";
/**
* GUJ
*/
OCRLang["GUJ"] = "guj";
/**
* HAT
*/
OCRLang["HAT"] = "hat";
/**
* HEB
*/
OCRLang["HEB"] = "heb";
/**
* HIN
*/
OCRLang["HIN"] = "hin";
/**
* HRV
*/
OCRLang["HRV"] = "hrv";
/**
* HUN
*/
OCRLang["HUN"] = "hun";
/**
* IKU
*/
OCRLang["IKU"] = "iku";
/**
* IND
*/
OCRLang["IND"] = "ind";
/**
* ISL
*/
OCRLang["ISL"] = "isl";
/**
* ITA
*/
OCRLang["ITA"] = "ita";
/**
* ITA_OLD
*/
OCRLang["ITA_OLD"] = "ita_old";
/**
* JAV
*/
OCRLang["JAV"] = "jav";
/**
* JPN
*/
OCRLang["JPN"] = "jpn";
/**
* KAN
*/
OCRLang["KAN"] = "kan";
/**
* KAT
*/
OCRLang["KAT"] = "kat";
/**
* KAT_OLD
*/
OCRLang["KAT_OLD"] = "kat_old";
/**
* KAZ
*/
OCRLang["KAZ"] = "kaz";
/**
* KHM
*/
OCRLang["KHM"] = "khm";
/**
* KIR
*/
OCRLang["KIR"] = "kir";
/**
* KOR
*/
OCRLang["KOR"] = "kor";
/**
* KUR
*/
OCRLang["KUR"] = "kur";
/**
* LAO
*/
OCRLang["LAO"] = "lao";
/**
* LAT
*/
OCRLang["LAT"] = "lat";
/**
* LAV
*/
OCRLang["LAV"] = "lav";
/**
* LIT
*/
OCRLang["LIT"] = "lit";
/**
* MAL
*/
OCRLang["MAL"] = "mal";
/**
* MAR
*/
OCRLang["MAR"] = "mar";
/**
* MKD
*/
OCRLang["MKD"] = "mkd";
/**
* MLT
*/
OCRLang["MLT"] = "mlt";
/**
* MSA
*/
OCRLang["MSA"] = "msa";
/**
* MYA
*/
OCRLang["MYA"] = "mya";
/**
* NEP
*/
OCRLang["NEP"] = "nep";
/**
* NLD
*/
OCRLang["NLD"] = "nld";
/**
* NOR
*/
OCRLang["NOR"] = "nor";
/**
* ORI
*/
OCRLang["ORI"] = "ori";
/**
* PAN
*/
OCRLang["PAN"] = "pan";
/**
* POL
*/
OCRLang["POL"] = "pol";
/**
* POR
*/
OCRLang["POR"] = "por";
/**
* PUS
*/
OCRLang["PUS"] = "pus";
/**
* RON
*/
OCRLang["RON"] = "ron";
/**
* RUS
*/
OCRLang["RUS"] = "rus";
/**
* SAN
*/
OCRLang["SAN"] = "san";
/**
* SIN
*/
OCRLang["SIN"] = "sin";
/**
* SLK
*/
OCRLang["SLK"] = "slk";
/**
* SLV
*/
OCRLang["SLV"] = "slv";
/**
* SPA
*/
OCRLang["SPA"] = "spa";
/**
* SPA_OLD
*/
OCRLang["SPA_OLD"] = "spa_old";
/**
* SQI
*/
OCRLang["SQI"] = "sqi";
/**
* SRP
*/
OCRLang["SRP"] = "srp";
/**
* SRP_LATN
*/
OCRLang["SRP_LATN"] = "srp_latn";
/**
* SWA
*/
OCRLang["SWA"] = "swa";
/**
* SWE
*/
OCRLang["SWE"] = "swe";
/**
* SYR
*/
OCRLang["SYR"] = "syr";
/**
* TAM
*/
OCRLang["TAM"] = "tam";
/**
* TEL
*/
OCRLang["TEL"] = "tel";
/**
* TGK
*/
OCRLang["TGK"] = "tgk";
/**
* TGL
*/
OCRLang["TGL"] = "tgl";
/**
* THA
*/
OCRLang["THA"] = "tha";
/**
* TIR
*/
OCRLang["TIR"] = "tir";
/**
* TUR
*/
OCRLang["TUR"] = "tur";
/**
* UIG
*/
OCRLang["UIG"] = "uig";
/**
* UKR
*/
OCRLang["UKR"] = "ukr";
/**
* URD
*/
OCRLang["URD"] = "urd";
/**
* UZB
*/
OCRLang["UZB"] = "uzb";
/**
* UZB_CYRL
*/
OCRLang["UZB_CYRL"] = "uzb_cyrl";
/**
* VIE
*/
OCRLang["VIE"] = "vie";
/**
* YID
*/
OCRLang["YID"] = "yid";
})(OCRLang || (exports.OCRLang = OCRLang = {}));
/**
* the outline which includes a url
*/
class UrlOutline {
/**
* @param {string} title - the title
* @param {string} url - the url to which the outline points
* @param {boolean} absolute - if the url is absolute
* @param {Outline[]} [childs] - the childrens
*/
constructor(title, url, absolute, childs) {
this.title = title;
this.url = url;
this.absolute = absolute;
this.childs = childs;
}
}
exports.UrlOutline = UrlOutline;
/**
* the outline which includes a page number
*/
class PageNumberOutline {
/**
* @param {string} title - the title
* @param {number} page - the page number to which the outline points
* @param {Outline[]} [childs] - the childrens
*/
constructor(title, page, childs) {
this.title = title;
this.page = page;
this.childs = childs;
}
}
exports.PageNumberOutline = PageNumberOutline;
/**
* the outline which includes a reference to another pdf
*/
class PdfReferenceOutline {
/**
* @param {string} title - the title
* @param {string} url - the url to which the outline points
* @param {number} page - the remote page number to which the outline points
* @param {Outline[]} [childs] - the childrens
*/
constructor(title, url, page, childs) {
this.title = title;
this.url = url;
this.page = page;
this.childs = childs;
}
}
exports.PdfReferenceOutline = PdfReferenceOutline;
//# sourceMappingURL=types.js.map