HummusJS icon indicating copy to clipboard operation
HummusJS copied to clipboard

PDFReader hold resource issue

Open hl-a-k opened this issue 7 years ago • 5 comments

sovled PDFReader hold resource issue. Add end method to PDFReaderDriver

hl-a-k avatar May 04 '18 10:05 hl-a-k

Could you please specify how you invoce the end methode using node.js

fxpopp avatar May 04 '18 10:05 fxpopp

Hi

First, you need use my hummus. If you use yarn to manage package, you need remove hummusJs dependence, then

yarn add https://github.com/hl-a-k/HummusJS.git https://github.com/hl-a-k/HummusJS.git

Second: let input = hummus.createReader(doc)

/** use input **/

input.end()

在 2018年5月4日,18:49,fxpopp [email protected] 写道:

Could you please specify how you invoce the end methode using node.js

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/galkahana/HummusJS/pull/276#issuecomment-386565825, or mute the thread https://github.com/notifications/unsubscribe-auth/AG0I7McCaXYjS7xV-trMS-o8OLXpMXTwks5tvDI8gaJpZM4TyZrj.

hl-a-k avatar May 04 '18 11:05 hl-a-k

Thank you very much! I use npm - could you help me with npm, too? How do I use/rebuild your hummus?

fxpopp avatar May 04 '18 16:05 fxpopp

that would be problematic if you delete streams that you dont own.

anyways, can always either:

  1. scope out pdfreader
  2. use PDFRStreamForFile as source for pdfReader, which you can then close with its own method

galkahana avatar May 05 '18 13:05 galkahana

anyways, can always either:

  1. scope out pdfreader

Could you please explain what you mean by scope out? Setting the pdfreader to undefined doesn't do the thing, so what else could I do?

Using the PDFRStreamForFile is not an option because it's really really slow compared to directly passing a file to hummus.createReader

Frank683 avatar Nov 13 '19 12:11 Frank683