android


PDFView on landscape


I am trying to open local Pdf file from Assest folder in android studio platform using [barteksc] library. I downloaded the library and managed to open the pdf file. However, when I orient the emulator to landscape mode the pdf width will not fit the screen. I googled the issue and the solution is to use the following piece of code.
Configurator.onRender(new OnRenderListener() {
#Override
public void onInitiallyRendered(int pages, float pageWidth, float pageHeight) {
pdfView.fitToWidth(); // optionally pass page number
}
});
But, I do not know how to implement this code. I wrote the following :
public class Pdf extends AppCompatActivity {
PDFView pdfview;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.pdf);
pdfview=(PDFView)findViewById(R.id.pdfView);
pdfview.fromAsset("h.pdf").load();
PDFView.Configurator.onRender(new OnRenderListener() {
#Override
public void onInitiallyRendered(int pages, float pageWidth, float pageHeight) {
pdfview.fitToWidth(); // optionally pass page number
}
});
}
}
And I got this error ...
Non-static method 'onRender(com.github.barteksc.pdfviewer.listener.OnRenderListener)' cannot be referenced from a static context
Plese show me how can I fix this issue. Loads of thanks in advance for any help you may lend.

Related Links

Are all versions of the android support library given the same revision number?
How to add Currency Symbols in pdf, generated by my application?
Show graphical element/view when tapping on android
Why is Keyguard not being Re-enabled?
Is there a way to get all location point (lat and lon) around a specific country?
How to set Socket timeout of fail connecting
how can decode json data form api in android?
Disable SQLiteLog in Android
http-link to private Dropbox files
Mvvmcross Loading Indicator not showing
VideoView problems in ScrolView
Android app publishing/ google play store app publication query
Php Post FATAL EXCEPTION — Async and permission included
No resource identifier found for attribute 'isSelected' in package 'auto'
XMPP error using asmack
Android - Graying out/changing the alpha of all items aside from the selected item

Categories

HOME
search
adal
awk
github-for-windows
jax-rs
rsa
themes
sh
sublimetext
ms-access-2016
rds
3d-reconstruction
google-admin-sdk
crystal-reports-2013
azure-container-service
barcode
automatic-ref-counting
atlassian
android-intent
google-container-registry
user-experience
pagespeed
ember-cli
ios10.2
parcelable
mongoid6
displaytag
entity-relationship-model
openmdao
cppreference
powershell-ise
deltaspike
git-squash
papaparse
getpixel
python-import
reason
openproject
playframework-2.1
node-mssql
ods
p4merge
azure-arm
textsum
gitlist
cnc
vugen
tf
appdomain
yii2-user
skin
janus
monkey
trigger.io
cvxpy
grails-plugin
omxplayer
envi
lrs
uicolor
swizzling
yajsw
fink
highland.js
sciruby
qt5.2
xenomai
vigenere
ess
fuelcms
lasso
typemock
linked-tables
google-refine
jquery-forms-plugin
android-broadcast
java-security
gamekit
nodelist
device-tree
linkedin-jsapi
twitter-bootstrap-rails
multitasking
xmltodict
scriptaculous
gd-graph
sphinxql
flex++
dolby-audio-api
server-administration
extconf.rb
jsr286
timthumb
collectionviewsource
cfwindow
silverlight-oob
purepdf
xpsdocument
sqlobject
change-management
pbcopy

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App