Ink annotation using ReaderController - RadaeePDF.com
Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
13 Jul 2017
Microsoft has ended support for Windows Phone 8.1
Read More...
Questions about Android development and PDF
  • Page:
  • 1

TOPIC: Ink annotation using ReaderController

Ink annotation using ReaderController 3 years 11 months ago #8145

  • ChrisDon
  • ChrisDon's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 0
Hello,

I've added version3.2 as a library project to my project and using com.example.pdfhttpdemo.MainActivity example I'm able to display a PDF.

Do you have documentation on how I can draw and save ink annotations to the pdf?

I can't find any examples / tutorials.

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

Ink annotation using ReaderController 3 years 11 months ago #8150

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 846
  • Karma: 43
  • Thank you received: 12
open from http link, shall in readonly mode.
content from server can't be modified.

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

Ink annotation using ReaderController 3 years 11 months ago #8156

  • ChrisDon
  • ChrisDon's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 0
I should have made this clear in the OP, I'm reading the PDFs from file.

See code below
	/** Title of the PDF being displayed - for tracking */
	private String mTitle;

    private ReaderController m_vPDF = null;
    private Document m_doc = new Document();
    private PDFHttpStream m_stream = new PDFHttpStream();

	/** Key for retrieving the pdf URL from the intent */
	public static final String KEY_PDF_URL = "KEY_PDF_URL";

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		Global.Init(this);


        final String url = getIntent().getExtras().getString(KEY_PDF_URL);
        if (url != null) {
            String path = ResourceDownloadManager.getFilePathForUrl(url);
            if (DebugHandler.LOG_ENABLED) {
                DebugHandler.log(this, "PATH:" + Config.getSDCardPath() + " " + path);
            }

            m_vPDF = new ReaderController(this);
            m_doc.Close();

            //m_stream.open(url);
            //int ret = m_doc.OpenStream(m_stream, null);

            int ret = m_doc.Open(path, null);

            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;
            }

            if( ret == 0 )
            {
                m_vPDF.open(m_doc);
                setContentView( m_vPDF );
            }

        } else {
            finish();
        }

		mTitle = getIntent().getStringExtra(DETAIL_TO_SHOW);
		
		getSupportActionBar().hide();
	}

When I open the PDF, I see no buttons to select ink colour or save any changes. How do I enable these?

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

Ink annotation using ReaderController 3 years 11 months ago #8157

  • nermeen
  • nermeen's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 865
  • Karma: 23
  • Thank you received: 70
You can find all the examples you need in the main demo project (not http demo project), check PDFReaderAct and PDFReader

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

  • Page:
  • 1
Powered by Kunena Forum