galkahana / HummusJS

Node.js module for high performance creation, modification and parsing of PDF files and streams
http://www.pdfhummus.com
Other
1.14k stars 169 forks source link

PDFReader hold resource issue #276

Open hl-a-k opened 6 years ago

hl-a-k commented 6 years ago

sovled PDFReader hold resource issue. Add end method to PDFReaderDriver

fxpopp commented 6 years ago

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

hl-a-k commented 6 years ago

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 notifications@github.com 写道:

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.

fxpopp commented 6 years ago

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

galkahana commented 6 years ago

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
Frank683 commented 4 years ago

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 PDFRStreamForFileis not an option because it's really really slow compared to directly passing a file to hummus.createReader