- Posts: 11
- Thank you received: 0
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
Error in some libs in 3.1beta9
IP: 192.168.0.71
11 years 4 months ago - 11 years 4 months ago #7665
by Felix85
Error in some libs in 3.1beta9 was created by Felix85
Hi,
i have some issues with your newest libs.
On some Devices the Documents not get loaded.
And if they get loaded, they are corrupt.
Nexus7 Fails:
Samsung Galaxy Tab S this is working(sadly i cant add the picture of it, but there are pictures on both sides and from top to bottom, not like the cut version on nexus 7):
Thanks
Felix
i have some issues with your newest libs.
On some Devices the Documents not get loaded.
And if they get loaded, they are corrupt.
Nexus7 Fails:
Samsung Galaxy Tab S this is working(sadly i cant add the picture of it, but there are pictures on both sides and from top to bottom, not like the cut version on nexus 7):
Thanks
Felix
Last edit: 11 years 4 months ago by aroundmeflip.
IP: 192.168.0.158
11 years 4 months ago #7672
by nermeen
Replied by nermeen on topic Error in some libs in 3.1beta9
Did you try them with the demo project?
If you face the same problem with the demo project, can you send us a pdf to test?
If you face the same problem with the demo project, can you send us a pdf to test?
IP: 192.168.0.71
11 years 4 months ago #7674
by Felix85
Replied by Felix85 on topic Error in some libs in 3.1beta9
Sry cant do it.
Here you have a code snippet this particular sites are JPG Fileswe have some between our PDFs
Snippet:
Here you have a code snippet this particular sites are JPG Fileswe have some between our PDFs
Snippet:
Code:
public void setPreviewThumbnail(int i, String directory, Page p, Document d, boolean showOnlyAdPageThumbnail) {
//normal thumbnail
String directoryPlusThumbnail = directory + "AndroidNormal_THUMBNAIL_" + i + ".jpg";
//check for adpage-file: thumbnail if not already downloaded
if (p.isAdPage() && !showOnlyAdPageThumbnail){
String temp = directory + "AndroidNormal_PDF_" + i + ".jpg";
File file = new File(temp);
if(file.exists()) {
directoryPlusThumbnail = directory + "AndroidNormal_PDF_" + i + ".jpg";
Log.d(TAG, "#adpage-file here");
} else {
Log.d(TAG, "#no adpage-file here");
}
}
//double-page thumbnail
String directoryPlusThumbnailDoublePage = "";
if(p.isDoublePage()){
directoryPlusThumbnailDoublePage = directory + "AndroidNormal_THUMBNAIL_" + (i +1) + ".jpg";
}
//temporary cache-files
String tempPdf = APAWlApp.getCacheDirectory().getAbsolutePath() + File.separator + issue.getUniqueId() + "_page_" + i + ".pdf";
String cache = APAWlApp.getCacheDirectory().getAbsolutePath() + File.separator + issue.getUniqueId() + "_page_" + i + "_cachefile";
d.Create(tempPdf);
//wichtig! cache muss gesetzt werden!
d.SetCache(cache);
com.radaee.pdf.Page page = null;
if(p.isDoublePage()){
page = d.NewPage(0, (widthThumbnail *2), heightThumbnail);//create A3 quer paper
} else {
page = d.NewPage(0, widthThumbnail, heightThumbnail);//create A4 paper
}
PageContent content = new PageContent();
content.Create();//create content, do not forget.
//set alpha for both fill and stroke
DocGState dgs = d.NewGState();
dgs.SetFillAlpha(0x80);//set alpha value to 0.5
dgs.SetStrokeAlpha(0x80);//set alpha value to 0.5
ResGState rgs = page.AddResGState(dgs);
content.GSSet(rgs);
//write a bitmap
content.GSSave();
dgs = d.NewGState();
dgs.SetFillAlpha(255);//set alpha value to 1
dgs.SetStrokeAlpha(255);//set alpha value to 1
rgs = page.AddResGState(dgs);
content.GSSet(rgs);
Bitmap bit=null;
if(!new File(directoryPlusThumbnail).exists()) {
Log.e(TAG, "#directoryPlusThumbnail="+directoryPlusThumbnail);
bit = Bitmap.createBitmap(50, 100, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bit);
canvas.drawColor(0xFFFFFFFF);
} else {
Log.d(TAG, "#directoryPlusThumbnail="+directoryPlusThumbnail);
}
if(bit == null){
if(p.isDoublePage()){
BitmapFactory.Options options = new BitmapFactory.Options();
options.inPurgeable = false;
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
options.inJustDecodeBounds = false;
//Memory-Fix fuer API-Level <2.3
if (android.os.Build.VERSION.SDK_INT <= android.os.Build.VERSION_CODES.GINGERBREAD_MR1) {
options.inSampleSize = 4;
} else {
options.inSampleSize = 1;
}
bit=combineBitmaps(BitmapFactory.decodeFile(directoryPlusThumbnail, options), BitmapFactory.decodeFile(directoryPlusThumbnailDoublePage, options));
} else {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inPurgeable = false;
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
options.inJustDecodeBounds = false;
//Memory-Fix fuer API-Level <2.3
if (android.os.Build.VERSION.SDK_INT <= android.os.Build.VERSION_CODES.GINGERBREAD_MR1) {
options.inSampleSize = 4;
} else {
options.inSampleSize = 1;
}
bit = BitmapFactory.decodeFile(directoryPlusThumbnail, options);
}
}
DocImage dimg = d.NewImage(bit, true);
bit.recycle();
bit = null;
ResImage rimg = page.AddResImage(dimg);
Matrix mat = null;
if(p.isDoublePage()){
mat = new Matrix( widthThumbnail *2, heightThumbnail, 0, 0 );
} else {
mat = new Matrix( widthThumbnail, heightThumbnail, 0, 0 );
}
content.GSSetMatrix(mat);
mat.Destroy();
content.DrawImage(rimg);
content.GSRestore();
//add content to page
page.AddContent(content, true);
content.Destroy();
page.Close();
//delete temporary files
File cacheFile = new File(cache);
File tempFile = new File(tempPdf);
if(cacheFile.exists()) {
cacheFile.delete();
}
if(tempFile.exists()) {
tempFile.delete();
}
}
IP: 192.168.0.71
11 years 4 months ago #7676
by Felix85
Replied by Felix85 on topic Error in some libs in 3.1beta9
IP: 192.168.0.71
11 years 4 months ago #7677
by radaee
Replied by radaee on topic Error in some libs in 3.1beta9
the last beta java source codes are much changed to earliear version.
package com.radaee.pdf and com.radaee.view has much change.
so,,, both librdpdf.so and java codes need to replace.
package com.radaee.pdf and com.radaee.view has much change.
so,,, both librdpdf.so and java codes need to replace.
IP: 192.168.0.71
11 years 4 months ago #7679
by Felix85
Replied by Felix85 on topic Error in some libs in 3.1beta9
i used 3.1beta9.
I cant find any newer version.
So what do you mean with newer Version.
I cant find any newer version.
So what do you mean with newer Version.
Time to create page: 0.451 seconds