- Posts: 814
- Thank you received: 65
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
Convert PDF coordinates to view layout coord
IP: 192.168.0.71
8 years 3 months ago #13001
by Davide
Replied by Davide on topic Convert PDF coordinates to view layout coord
Hi,
please try with that :
For more info check this :
www.radaeepdf.com/documentation/javadocs...age.html#ObjsStart--
please try with that :
Code:
Page p = m_doc.GetPage0();
p.ObjsStart();
p.GetAnnotCount();
p.Close();
For more info check this :
www.radaeepdf.com/documentation/javadocs...age.html#ObjsStart--
IP: 192.168.0.71
8 years 3 months ago #13002
by geertvm
Replied by geertvm on topic Convert PDF coordinates to view layout coord
Hi,
It gives me the same result...
It gives me the same result...
IP: 192.168.0.71
8 years 3 months ago #13003
by Davide
Replied by Davide on topic Convert PDF coordinates to view layout coord
Hi,
this is not an issue.
If you have a license, make sure to activate it before using the methods I suggested you before, if you don't have a license and you want to test the reader in your own project before buying the license, please check and follow this article www.radaeepdf.com/support/knowledge-base?view=kb&kbartid=4
The demo project is activated with a Premium license so you can test all the features available.
this is not an issue.
If you have a license, make sure to activate it before using the methods I suggested you before, if you don't have a license and you want to test the reader in your own project before buying the license, please check and follow this article www.radaeepdf.com/support/knowledge-base?view=kb&kbartid=4
The demo project is activated with a Premium license so you can test all the features available.
IP: 192.168.0.71
8 years 3 months ago #13004
by geertvm
Replied by geertvm on topic Convert PDF coordinates to view layout coord
OK...thanks
I still get 0 annotations however (also tested It with the prof licence
I still get 0 annotations however (also tested It with the prof licence
IP: 192.168.0.71
8 years 3 months ago #13005
by Davide
Replied by Davide on topic Convert PDF coordinates to view layout coord
Hi,
I have checked your pdf with the demo project and it returns 2 annots.
Where do you call the getAnnotCount()? Make sure to call it after the license activation..
I have checked your pdf with the demo project and it returns 2 annots.
Where do you call the getAnnotCount()? Make sure to call it after the license activation..
IP: 192.168.0.71
8 years 3 months ago #13006
by geertvm
Replied by geertvm on topic Convert PDF coordinates to view layout coord
Hi,
I've tried it on 2 places...at the end of the onCreate() and in the button click
Here is my main activity
package be.zetes.pdfview;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import com.radaee.pdf.Document;
import com.radaee.pdf.Global;
import com.radaee.pdf.Page;
import com.radaee.reader.PDFLayoutView;
import com.radaee.util.PDFAssetStream;
public class MainActivity extends AppCompatActivity {
private static final String TAG = "PDFVIEW";
private PDFLayoutView m_view;
private PDFAssetStream m_asset_stream = null;
private Document m_doc;
private Button mBtSignatures;
private ImageButton mBtLeft;
private ImageButton mBtRight;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
Global.Init(this);
mBtSignatures = (Button) findViewById(R.id.btSignatures);
mBtSignatures.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Page p = m_doc.GetPage0();
p.ObjsStart();
int c = p.GetAnnotCount();
Log.d(TAG, "Count = " + c);
p.Close();
}
});
mBtLeft = (ImageButton) findViewById(R.id.arrleft);
mBtLeft.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});
mBtRight = (ImageButton) findViewById(R.id.arrright);
mBtRight.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});
m_view = (PDFLayoutView) findViewById(R.id.view);
m_asset_stream = new PDFAssetStream();
m_asset_stream.open(getAssets(), "tbs.pdf");
m_doc = new Document();
int ret = m_doc.OpenStream(m_asset_stream, null);
m_view.PDFOpen(m_doc, null);
Page p = m_doc.GetPage0();
p.ObjsStart();
int c = p.GetAnnotCount();
Log.d(TAG, "Count = " + c);
p.Close();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
I've tried it on 2 places...at the end of the onCreate() and in the button click
Here is my main activity
package be.zetes.pdfview;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import com.radaee.pdf.Document;
import com.radaee.pdf.Global;
import com.radaee.pdf.Page;
import com.radaee.reader.PDFLayoutView;
import com.radaee.util.PDFAssetStream;
public class MainActivity extends AppCompatActivity {
private static final String TAG = "PDFVIEW";
private PDFLayoutView m_view;
private PDFAssetStream m_asset_stream = null;
private Document m_doc;
private Button mBtSignatures;
private ImageButton mBtLeft;
private ImageButton mBtRight;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
Global.Init(this);
mBtSignatures = (Button) findViewById(R.id.btSignatures);
mBtSignatures.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Page p = m_doc.GetPage0();
p.ObjsStart();
int c = p.GetAnnotCount();
Log.d(TAG, "Count = " + c);
p.Close();
}
});
mBtLeft = (ImageButton) findViewById(R.id.arrleft);
mBtLeft.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});
mBtRight = (ImageButton) findViewById(R.id.arrright);
mBtRight.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});
m_view = (PDFLayoutView) findViewById(R.id.view);
m_asset_stream = new PDFAssetStream();
m_asset_stream.open(getAssets(), "tbs.pdf");
m_doc = new Document();
int ret = m_doc.OpenStream(m_asset_stream, null);
m_view.PDFOpen(m_doc, null);
Page p = m_doc.GetPage0();
p.ObjsStart();
int c = p.GetAnnotCount();
Log.d(TAG, "Count = " + c);
p.Close();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
Time to create page: 0.589 seconds