- Posts: 21
- Thank you received: 1
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Questions about Android development and PDF
Set cache fails and succeeds randomly
- manderin87
- Topic Author
- Offline
- Junior Member
-
Less
More
IP: 192.168.0.71
11 years 9 months ago #6415
by manderin87
Set cache fails and succeeds randomly was created by manderin87
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?
- manderin87
- Topic Author
- Offline
- Junior Member
-
Less
More
- Posts: 21
- Thank you received: 1
IP: 192.168.0.71
11 years 9 months ago #6416
by manderin87
Replied by manderin87 on topic Set cache fails and succeeds randomly
Global was messing with the cache, it works.
thanks
thanks
- manderin87
- Topic Author
- Offline
- Junior Member
-
Less
More
- Posts: 21
- Thank you received: 1
IP: 192.168.0.71
11 years 9 months ago - 11 years 9 months ago #6418
by manderin87
Replied by manderin87 on topic Set cache fails and succeeds randomly
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: 11 years 9 months ago by jstampe.
IP: 192.168.0.71
11 years 9 months ago #6419
by radaee
Replied by radaee on topic Set cache fails and succeeds randomly
do not share 1 file as cache file to 2 document objects.
it is important. and invoke Document.close() to release cache file.
it is important. and invoke Document.close() to release cache file.
- manderin87
- Topic Author
- Offline
- Junior Member
-
Less
More
- Posts: 21
- Thank you received: 1
IP: 192.168.0.71
11 years 9 months ago #6422
by manderin87
Replied by manderin87 on topic Set cache fails and succeeds randomly
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");
I am using
mDocument.SetCache(Global.tmp_path + "/" + String.valueOf(mPageNumber) + "/temp.dat");
- manderin87
- Topic Author
- Offline
- Junior Member
-
Less
More
- Posts: 21
- Thank you received: 1
IP: 192.168.0.71
11 years 9 months ago - 11 years 9 months ago #6423
by manderin87
Replied by manderin87 on topic Set cache fails and succeeds randomly
This is working mDocument.SetCache(Global.tmp_path + "/" + String.valueOf(mPageNumber) + "temp.dat");
Im assuming setcache does not create directories, though maybe it should.
Im assuming setcache does not create directories, though maybe it should.
Last edit: 11 years 9 months ago by jstampe.
Time to create page: 0.553 seconds