Viger PDF How to Works is file pdf extract or convert to bitmap use Library Vudroid was write C Language, after that images include to adapter viewpager
Gradle:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.aerdy:Viger-PDF:1.2'
}
minSdkVersion 15
- Vudroid Library PDF
- Retrofit 2 Get Stream Connection
<com.necistudio.vigerpdf.utils.ViewPagerZoomHorizontal
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<com.necistudio.vigerpdf.utils.ViewPagerZoomVertical
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
private void fromNetwork(String endpoint) {
new VigerPDF(this, endpoint).initFromFile(new OnResultListener() {
@Override
public void resultData(ArrayList<Bitmap> data) {
VigerAdapter adapter = new VigerAdapter(getApplicationContext(),data);
viewPager.setAdapter(adapter);
}
});
}
private void fromFile(String path) {
File file = new File(path);
new VigerPDF(this, file).initFromFile(new OnResultListener() {
@Override
public void resultData(ArrayList<Bitmap> data) {
VigerAdapter adapter = new VigerAdapter(getApplicationContext(),data);
viewPager.setAdapter(adapter);
}
});
}
Copyright (C) 2020 Arthdi putra anna
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.