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

TOPIC:

Include PDFReader in Activity / XML 5 years 3 months ago #14246

  • eddi
  • eddi's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 2
  • Thank you received: 0
Hello,

I want to include a Reader in my Activity with own Buttons like below but the example I found is written with an old PDFReader class.
I always get the error message: error: cannot find symbol class PDFReader.
How can I do that with your new classes?

JAVA
public class EditPDF extends Activity implements PDFReaderListener,
        OnClickListener {
    private RelativeLayout layout;
    private PDFReader reader = null;

XML
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <com.radaee.reader.PDFReader
        android:id="@+id/view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true" >
    </com.radaee.reader.PDFReader>

    <LinearLayout
        android:id="@+id/bar_find"
        android:layout_width="match_parent"
        android:layout_height="80dp"
        android:layout_alignParentBottom="true"
        android:layout_alignParentTop="false"
        android:layout_centerInParent="false" >

        <Button
            android:id="@+id/btn_ink"
            android:layout_width="wrap_content"
            android:layout_height="80dp"
            android:text="Unterschreiben"
            android:textStyle="bold" />

        <Button
            android:id="@+id/btn_loeschen"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:enabled="true"
            android:text="Löschen"
            android:textStyle="bold" />
    </LinearLayout>

</RelativeLayout>

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

Include PDFReader in Activity / XML 5 years 3 months ago #14247

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
you can find the simplest exsample at class com.radaee.reader.PDFGLSimpleAct
in module RDPDFReader.

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

Include PDFReader in Activity / XML 5 years 3 months ago #14248

  • eddi
  • eddi's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 2
  • Thank you received: 0
Thanks, I looked inside the example but I don't know the way to get the layout view into the xml-layout of my activity.
In com.radaee.reader.PDFGLSimpleAct there is no XML-layout linked.

PDFReader is deprecated so I need to migrate to PDFLayoutView. What do I have to do?

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

Include PDFReader in Activity / XML 5 years 3 months ago #14249

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
PDFGLLayoutView has no layout resource, it set a View as Content directly.

how about this layout?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <com.radaee.reader.PDFGLLayoutView
        android:id="@+id/pdf_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true" >
    </com.radaee.reader.PDFGLLayoutView>

    <LinearLayout
        android:id="@+id/bar_find"
        android:layout_width="match_parent"
        android:layout_height="80dp"
        android:layout_alignParentBottom="true"
        android:layout_alignParentTop="false"
        android:layout_centerInParent="false" >

        <Button
            android:id="@+id/btn_ink"
            android:layout_width="wrap_content"
            android:layout_height="80dp"
            android:text="Unterschreiben"
            android:textStyle="bold" />

        <Button
            android:id="@+id/btn_loeschen"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:enabled="true"
            android:text="Löschen"
            android:textStyle="bold" />
    </LinearLayout>

</RelativeLayout>
the JAVA shall be:
public class EditPDF extends Activity
{
    private Document m_doc = new Document();
    private PDFGLLayoutView m_view = null;
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        Global.Init( this );
        m_doc = new Document();
        int ret = m_doc.Open("/sdcard/test.pdf", null);
        setContentView(R.layout.your_id);
        m_view = (PDFGLLayoutView)findViewByID(R.id.pdf_view);
        m_view.PDFOpen(m_doc, null);
    }

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

Last edit: by radaee.
  • Page:
  • 1
Powered by Kunena Forum