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

How to clean up / destroy worker? #14

Open
btsk1611 opened this issue May 11, 2016 · 3 comments
Open

How to clean up / destroy worker? #14

btsk1611 opened this issue May 11, 2016 · 3 comments

Comments

@btsk1611
Copy link

I have a single page application where i have many pdfs. How do i call the clean up / destroy methods?

@codingisacopingstrategy

This Stack Overflow comment suggests that you should be able to call .destroy(); on the instance of pdf.js, so the easiest maybe is to find a way to expose the pdf.js instance from touchpdf?

@codingisacopingstrategy

Hmm, reading through the source code, I think the functionality might already be implemented:

		/**
		* Destroy the pdf container completely.
		* @function
		* @name $.fn.pdf#destroy
		* @example $("#element").pdf("destroy");
		*/

https://github.com/loicminghetti/touchpdf/blob/master/jquery.touchPDF.js#L262

Will try that first!

@codingisacopingstrategy

I tested this and it doesn’t work at the moment, because it doesn’t call pdfDoc.destroy();
Maybe there’s a reason for that?
Otherwise it does seem to solve the issue so here’s a pull request:
#34

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

2 participants