getRawTextContent() method not consistent in multiple sequential calls
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- javascript, node.js
- 領域
- backend
調査の方向性
getRawTextContent() と compareGeneratedReportContent 内の pdfParser_dataReady ハンドラーから始め、異なる PDF 引数を使った逐次呼び出しで報告された動作を再現します。各呼び出しが以前の呼び出しの内容を保持するのではなく、それ自身の入力の raw content を返して書き込むことを確認します。
索引モデルが issue の本文から書いたものです。
説明
This code parses two pdf files and converts to rawtext and removes the line starting with 'Generated' and then compares those two text files.This method is called more than once sequentially and for each call the arguments to the method changes, but the raw content is not getting replaced for the last call.
function compareGeneratedReportContent(samplePDFFile, sampleXLSXText) {
const pdfParser = new PDFParser(this, true)
const pdfParser2 = new PDFParser(this, true)
const pdfExportPath = path.join(__dirname, '../../resources/report-test/PDFExportedFile.pdf')
const xlsxExportPath = path.join(__dirname, '../../resources/report-test/XLSXExportedFile.xlsx')
let content1 = ''
let content2 = ''
let result = false
pdfParser2.on('pdfParser_dataError', errData => console.log(errData))
pdfParser2.on('pdfParser_dataReady', () => {
content2 = pdfParser2.getRawTextContent().replace(/^.*(Generated).+$/mg, '')
// console.log('content2 ', content2)
fs.writeFileSync(path.join(__dirname, '../../resources/report-test/sample.txt'), content2, 'utf-8')
})
pdfParser2.loadPDF(path.join(__dirname, `../../resources/report-test/${samplePDFFile}.pdf`))
pdfParser.on('pdfParser_dataError', errData => console.log(errData))
pdfParser.on('pdfParser_dataReady', () => {
content1 = pdfParser.getRawTextContent().replace(/^.*(Generated).+$/mg, '')
// console.log('content1 ', content1)
fs.writeFileSync(path.join(__dirname, '../../resources/report-test/generated.txt'), content2, 'utf-8')
})
pdfParser.loadPDF(pdfExportPath)
let readContent2 = fs.readFileSync(path.join(__dirname, '../../resources/report-test/sample.txt'), 'utf-8')
let readContent1 = fs.readFileSync(path.join(__dirname, '../../resources/report-test/generated.txt'), 'utf-8')
if (readContent2 === readContent1) {
console.log('Report pdf file content matches')
result = true
} else {
console.log('Error in matching contents of report pdf')
result = false
}
}
```Can anybody help?
Regards,
Fazi
- 主要言語
- Java
- スター
- 2.2k
- フォーク
- 396
- 平均マージ
- 9日 19時間
- マージ済み PR(30日)
- 3
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
modesty/pdf2json のほかの issue
-
getRawTextContent() returns the lines of every page in reverse order (bottom to top) since 4.0.3オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
-
`getRawTextContent` does not returns words' pieces in proper coordinate order対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
modesty/pdf2json の issue をすべて見る
似ている issue
-
bug subsystem:agent-harness triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ShaftHQ/SHAFT_ENGINE#7797 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
NationalSecurityAgency/ghidra#10155 ·
メンテナーはふだん 2 日以内に返信
-
area:data coverage
難易度 1/5 1時間未満 初心者へのやさしさ 67/100
reacher-z/Awesome-CUA#4864 ·
メンテナーはふだん 19 日以内に返信
-
bug web-ui
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
jenkinsci/jenkins#27705 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
mod bug
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
elmital/FixMCStats#65 · コメント 3 件 ·