Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hummus.createReader can't release resource in Win 32 #275

Open
hl-a-k opened this issue May 4, 2018 · 5 comments
Open

hummus.createReader can't release resource in Win 32 #275

hl-a-k opened this issue May 4, 2018 · 5 comments

Comments

@hl-a-k
Copy link

hl-a-k commented May 4, 2018

In Win 32, I use
hummus.createReader
to create a reader.

And then I want to delete the file, but I found I can't do it, because reader don't release resource.
The reader don't have end() method.

@fxpopp
Copy link

fxpopp commented May 4, 2018

I have the same problem using Windows 7:
hummus.createReader(pathToFile)
blocks the file it reads
How can it be 'closed' to move/delete/update the initial PDF file?

There are no problems on a mac so it may be specific windows problem

@hl-a-k
Copy link
Author

hl-a-k commented May 4, 2018

please refer
#276

@galkahana
Copy link
Owner

that's cause win32 blocks other file pointers if ones opened for reading. you can either:

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

@hl-a-k
Copy link
Author

hl-a-k commented May 5, 2018

Thank you, it is a better way.

const inStream = new hummus.PDFRStreamForFile(f1);
  var input = hummus.createReader(inStream);
....
  inStream.close()

This Library is wonderful, but lack demo and doc.

@galkahana
Copy link
Owner

Oh i defo second that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants