- Posts: 2
- Thank you received: 0
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Questions about Android development and PDF
Include PDFReader in Activity / XML
IP: 91.41.120.5
7 years 2 months ago #14246
by eddi
Include PDFReader in Activity / XML was created by eddi
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
XML
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
Code:
public class EditPDF extends Activity implements PDFReaderListener,
OnClickListener {
private RelativeLayout layout;
private PDFReader reader = null;
XML
Code:
<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>
IP: 111.196.247.207
7 years 2 months ago #14247
by radaee
Replied by radaee on topic Include PDFReader in Activity / XML
you can find the simplest exsample at class com.radaee.reader.PDFGLSimpleAct
in module RDPDFReader.
in module RDPDFReader.
IP: 93.236.87.253
7 years 2 months ago #14248
by eddi
Replied by eddi on topic Include PDFReader in Activity / XML
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?
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?
IP: 111.196.246.13
7 years 2 months ago - 7 years 2 months ago #14249
by radaee
Replied by radaee on topic Include PDFReader in Activity / XML
PDFGLLayoutView has no layout resource, it set a View as Content directly.
how about this layout?
the JAVA shall be:
how about this layout?
Code:
<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>
Code:
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);
}
Last edit: 7 years 2 months ago by radaee.
Time to create page: 0.401 seconds