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

TOPIC:

How to implement a Pdf in a full view 9 years 6 months ago #7386

  • narezzi
  • narezzi's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 5
  • Thank you received: 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.

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

How to implement a Pdf in a full view 9 years 6 months ago #7387

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
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

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

How to implement a Pdf in a full view 9 years 6 months ago #7448

  • narezzi
  • narezzi's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 5
  • Thank you received: 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.

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

How to implement a Pdf in a full view 9 years 6 months ago #7449

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
Sure, You can modify PDFReaderAct.onCreate, comment the part that shows the grid view and put the part that opens a pdf from path.

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

How to implement a Pdf in a full view 9 years 6 months ago #7450

  • narezzi
  • narezzi's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 5
  • Thank you received: 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

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

  • Page:
  • 1
Powered by Kunena Forum