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

TOPIC:

Convert PDF coordinates to view layout coord 6 years 6 months ago #13001

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Thank you received: 65
Hi,
please try with that :
Page p = m_doc.GetPage0();
p.ObjsStart();
p.GetAnnotCount();
p.Close();

For more info check this :
www.radaeepdf.com/documentation/javadocs...age.html#ObjsStart--

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

Convert PDF coordinates to view layout coord 6 years 6 months ago #13002

  • geertvm
  • geertvm's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 16
  • Thank you received: 0
Hi,

It gives me the same result...

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

Convert PDF coordinates to view layout coord 6 years 6 months ago #13003

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Thank you received: 65
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.

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

Convert PDF coordinates to view layout coord 6 years 6 months ago #13004

  • geertvm
  • geertvm's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 16
  • Thank you received: 0
OK...thanks
I still get 0 annotations however (also tested It with the prof licence

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

Convert PDF coordinates to view layout coord 6 years 6 months ago #13005

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Thank you received: 65
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..

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

Convert PDF coordinates to view layout coord 6 years 6 months ago #13006

  • geertvm
  • geertvm's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 16
  • Thank you received: 0
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);
}
}

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

Powered by Kunena Forum