RadaeePDF.com :: Topic: Set cache fails and succeeds randomly (1/2)
Welcome, Guest
Username: Password: Remember me

Signin/Signup with:

Questions about Android development and PDF
  • Page:
  • 1
  • 2

TOPIC: Set cache fails and succeeds randomly

Set cache fails and succeeds randomly 3 years 3 months ago #6415

  • manderin87
  • manderin87's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 21
  • Thank you received: 1
  • Karma: 0
I am trying to save a bitmap to a pdf page. SetCache is failing but sometimes succeeds. Is there a specific order I need to call setCache? What is setcache calling to make sure it succeeds?
The administrator has disabled public write access.

Set cache fails and succeeds randomly 3 years 3 months ago #6416

  • manderin87
  • manderin87's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 21
  • Thank you received: 1
  • Karma: 0
Global was messing with the cache, it works.

thanks
The administrator has disabled public write access.

Set cache fails and succeeds randomly 3 years 3 months ago #6418

  • manderin87
  • manderin87's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 21
  • Thank you received: 1
  • Karma: 0
I thought i fixed it, but the problem is still happening. Setcache returns false and I cannot save a bitmap annotation. Adding the annotation with addbitmapannotation returns true, but the annotation count is 0.
Last Edit: 3 years 3 months ago by jstampe.
The administrator has disabled public write access.

Set cache fails and succeeds randomly 3 years 3 months ago #6419

  • radaee
  • radaee's Avatar
  • OFFLINE
  • Moderator
  • Posts: 825
  • Thank you received: 10
  • Karma: 43
do not share 1 file as cache file to 2 document objects.
it is important. and invoke Document.close() to release cache file.
The administrator has disabled public write access.

Set cache fails and succeeds randomly 3 years 3 months ago #6422

  • manderin87
  • manderin87's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 21
  • Thank you received: 1
  • Karma: 0
I do not share files. I open multiple documents in a view pager. The only sharing is Global. Each has its own PDFReader and Document, but i have found that sometimes calling setcache would fail, but if i closed and reopened the app, setcache would succeed. I always invoke document.close when the view pager destroys the fragment the pdfreader is in.

I am using

mDocument.SetCache(Global.tmp_path + "/" + String.valueOf(mPageNumber) + "/temp.dat");
The administrator has disabled public write access.

Set cache fails and succeeds randomly 3 years 3 months ago #6423

  • manderin87
  • manderin87's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 21
  • Thank you received: 1
  • Karma: 0
This is working mDocument.SetCache(Global.tmp_path + "/" + String.valueOf(mPageNumber) + "temp.dat");

Im assuming setcache does not create directories, though maybe it should.
Last Edit: 3 years 3 months ago by jstampe.
The administrator has disabled public write access.
The following user(s) said Thank You: clavarreda
  • Page:
  • 1
  • 2
Powered by Kunena Forum