RadaeePDF.com :: Topic: How to implement a Pdf in a full view (1/1)
Welcome, Guest
Username: Password: Remember me

Signin/Signup with:

Questions about Android development and PDF

TOPIC: How to implement a Pdf in a full view

How to implement a Pdf in a full view 2 years 11 months ago #7386

  • narezzi
  • narezzi's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Karma: 0
Hello sir,

I am use a PDFSimple class but i am not show a pdf in a full view according to device screen.

my code

static Fragment mFragment;
static FragmentManager mFragmentManager;
Context mContext;
View v;
private PDFSimple m_vPDF = null;


Global.Init(getActivity());

m_vPDF = new PDFSimple(getActivity());
String val = "/sdcard/LSR_Pdf_WR/dictionary_of_networking.pdf";
showPDF(val);



private void showPDF(String val){

if( val != null )
{
m_vPDF.Close();
//to open encrypted document, modify codes below:
int ret = m_vPDF.Open(val);
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;
}


}
}

and now i am using a Fragment.
The administrator has disabled public write access.

How to implement a Pdf in a full view 2 years 11 months ago #7387

  • nermeen
  • nermeen's Avatar
  • OFFLINE
  • Moderator
  • Posts: 676
  • Thank you received: 40
  • Karma: 18
The PDFSimple is a very simple view, it draws the pdf page as a bitmap...(so it wont handle the gestures, tabs,...etc)

I invite you to check PDFReaderAct in the demo project...it supports different view types (Vertical, horizontal, curl, single....)...and as a view to use PDFReader instead of PDFSimple
The administrator has disabled public write access.

How to implement a Pdf in a full view 2 years 11 months ago #7448

  • narezzi
  • narezzi's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Karma: 0
sir i am integrate a PDFReaderAct code into my project but issue is that it is grid layout view and how it is possible in these view only want to pass a sd card path in normal type.Means how to remove grid layout.
The administrator has disabled public write access.

How to implement a Pdf in a full view 2 years 11 months ago #7449

  • nermeen
  • nermeen's Avatar
  • OFFLINE
  • Moderator
  • Posts: 676
  • Thank you received: 40
  • Karma: 18
Sure, You can modify PDFReaderAct.onCreate, comment the part that shows the grid view and put the part that opens a pdf from path.
The administrator has disabled public write access.

How to implement a Pdf in a full view 2 years 11 months ago #7450

  • narezzi
  • narezzi's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Karma: 0
m_layout = (RelativeLayout)LayoutInflater.from(this).inflate(R.layout.reader, null);
m_reader = (PDFReader)m_layout.findViewById(R.id.view);
m_thumb = (PDFThumbView)m_layout.findViewById(R.id.thumbs);

//m_doc = new Document();
//m_doc.Open( pdf_path, password );
//m_reader.PDFOpen(m_doc, false, this);
//m_thumb.thumbOpen(m_doc, this);

m_vFiles = new PDFGridView(this, null);
m_vFiles.PDFSetRootPath("/mnt/sdcard/LSR_Pdf_WR/lsr-10313.pdf");///mnt");
m_vFiles.setOnItemClickListener(this);
setContentView(m_vFiles);



sir, it correct path for open a pdf, i try but i found a blank screen
The administrator has disabled public write access.
Powered by Kunena Forum