Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF
  • Page:
  • 1
  • 2

TOPIC:

Lib abilities 9 years 8 months ago #6836

  • Dmitry Kazakov
  • Dmitry Kazakov's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 6
  • Thank you received: 0
Well, when I wrote:

It seems that app doesn’t support this automatically. Can you tell me which part of code is responsible for this?

I mean that I had hide an action bar but free sapce was not occupied by pdf -- it was filled by greay background.
So my questions is it possbile to fill all space with pdf content? Do I nned to modify NDK code?

Global.default_config..

Where I can find this file? I see only Global class in com.radaee.pdf package

Please Log in or Create an account to join the conversation.

Last edit: by .

Lib abilities 9 years 8 months ago #6845

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
default_config is a method inside Global class.

You need to rerender the page after hiding the actionbar, to recalculate the render variables. (m_view.vRenderAsync(page);)

Please Log in or Create an account to join the conversation.

Lib abilities 9 years 8 months ago #6847

  • Dmitry Kazakov
  • Dmitry Kazakov's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 6
  • Thank you received: 0
chnaging values inside this method has not affect pdf viewer.

can not find render async method in classes involved in demo project nor in com.radaee.view package.

Post demo code to make it clear.

public class MainActivity extends Activity
{
private ReaderController m_vPDF = null;
private Document m_doc = new Document();
// private PDFHttpStream m_stream = new PDFHttpStream();

private PDFFileStream stream = new PDFFileStream();

@Override
protected void onCreate(Bundle savedInstanceState)
{

requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(
WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
super.onCreate(savedInstanceState);



Global.Init( this );
m_vPDF = new ReaderController(this);
m_doc.Close();
// m_stream. open("www.androidpdf.mobi/docs/MRBrochoure.pdf");
//m_stream.open("www.radaee.com/files/test.pdf");
String str = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath();
stream.open(str + "/test.pdf");
int ret = m_doc.OpenStream(stream/*m_stream*/, null);
switch( ret )
{
case -1://need input password
finish();
break;
case -2://unknown encryption
finish();
break;
case -3://damaged or invalid format
finish();
break;
case -10://access denied or invalid file path
finish();
break;
case 0://succeeded, and continue
break;
default://unknown error
finish();
break;
}

if( ret == 0 )
{
m_vPDF.open(m_doc);
setContentView( m_vPDF );
}
}

@Override
public void onDestroy()
{
if( m_vPDF != null )
{
m_vPDF.close();
m_vPDF = null;
}
if( m_doc != null )
{
m_doc.Close();
m_doc = null;
}
// if( m_stream != null )
// {
// m_stream.close();
// m_stream = null;
// }
if( stream != null )
{
stream.close();
stream = null;
}
Global.RemoveTmp();
super.onDestroy();
}

}

Please Log in or Create an account to join the conversation.

Lib abilities 9 years 8 months ago #6848

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
You are using the wrong demo app, PDFHttpDemo is only to show how to open a pdf from remote url, it does not implement all the features.

You need to check the general demo project PDFViewerxxx, inside that you will find all the methods i told you about

Please Log in or Create an account to join the conversation.

Lib abilities 9 years 8 months ago #6851

  • Dmitry Kazakov
  • Dmitry Kazakov's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 6
  • Thank you received: 0
Thanks, I found what I need.

Unfortunatly app crashes with pdf with two pages as an inforgaphics and text as well. I have added onTrim call listener and see app receives TRIM_MEMORY_RUNNING_CRITICAL when a look trough pages with zoom.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Powered by Kunena Forum