pdfdoc.tryLock()

39 views
Skip to first unread message

Siddharth Shah

unread,
Jan 12, 2015, 7:41:51 AM1/12/15
to pdfne...@googlegroups.com
when trying to save the document, I do a tryLock()... but it always returns me false. What can be the reason?

Aaron

unread,
Jan 12, 2015, 3:42:31 PM1/12/15
to pdfne...@googlegroups.com
If tryLock failed, it sounds like some thread already holds a read lock on the document.  You can find further advice for locking at:

Siddharth Shah

unread,
Jan 12, 2015, 11:15:46 PM1/12/15
to pdfne...@googlegroups.com
Yeah I read that... and now I am first doing pdfViewControl.docLock(true);
and then trying lock ... is this good?

Ryan

unread,
Jan 12, 2015, 11:44:55 PM1/12/15
to pdfne...@googlegroups.com
pdfViewControl.docLock(true) is canceling any threads the viewer launched (such as rendering and find text), and then locks it for read/write.

If you call doc.Lock on the same thread, then that would be fine, though you don't need to (on the same thread).

Any other threads would be locked out though.
Reply all
Reply to author
Forward
0 new messages