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

More
IP: 192.168.0.71 11 years 9 months ago #6415 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?
More
IP: 192.168.0.71 11 years 9 months ago #6416 by manderin87
Global was messing with the cache, it works.

thanks
More
IP: 192.168.0.71 11 years 9 months ago - 11 years 9 months ago #6418 by manderin87
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.
More
IP: 192.168.0.71 11 years 9 months ago #6419 by radaee
do not share 1 file as cache file to 2 document objects.
it is important. and invoke Document.close() to release cache file.
More
IP: 192.168.0.71 11 years 9 months ago #6422 by manderin87
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");
More
IP: 192.168.0.71 11 years 9 months ago - 11 years 9 months ago #6423 by manderin87
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: 11 years 9 months ago by jstampe.
Time to create page: 0.553 seconds
Powered by Kunena Forum