Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #6939 Reply

    Shantanu Paul

    When the pdf document is opened, it is only the document which is displayed without the ActionBar on top of the activity.

    How can I modify the code to allow the ActionBar to be displayed on top of the document?

    My code is as follows InputStream is = new FileInputStream(path.toString());
    int size = is.available();

    if(size>0)
    {
    byte[] data = new byte[size];
    is.read(data);

    SimpleDocumentReader v = SimpleReaderFactory.createSimpleViewer(PdfViewerAcitvity.this,null);
    v.openData(data,data.length,””);
    }
    is.close();

    I am writing this code inside an activity which downloads & displays a pdf document. while the pdf is being downloaded, the ActionBar displays fine but as soon as the pdf is displayed, the ActionBar disappears.

    #6941 Reply

    Dr. Plug
    Moderator

    Hi Shantanu,

    Thank you for your inquiry. I have tried test. As a result, my ActionBar isn’t gone in the ActionBarAcitivty. So, I wonder whether you use what kind of Activity. but it is just my curiosity

    Actually you can avoid this problem by using ReaderView instead of SimpleDocumentReader. Please change to ReaderView, and add it on your layout.

    Thank you
    Dr. Plug

    #6947 Reply

    Shantanu Paul

    Thanks! That fixed my issue. However I also want the background of the rendered pdf to be white instead of the dark grey color. I tried setting the background of the ReaderView to white but that didn’t work.

    #6948 Reply

    Shantanu Paul

    Also, does the library exposes any methods that I can call to go to previous/next page. I am looking to implement two buttons for that purpose.

    #6949 Reply

    Shantanu Paul

    The Activity I was using was ActionBarActivity from support library v7

    #6957 Reply

    Dr. Plug
    Moderator

    Hi Shantanu,

    Thank you for your extra feedback.

    First, you can change background color in behind of page by changing background color of BasePlugPDFDisplay like below.

    Concerning go to previous/next page. you can it by using two method to ‘getPageIdx’ and ‘goToPage’ in the BasePlugPDFDisplay.

    Thank you.
    Dr. Plug

    #6991 Reply

    Shantanu Paul

    Another query: How can I remove the “Please update to the latest version” dialog? I really don’t want it to be present in the production code.

    #6992 Reply

    Dr. Plug
    Moderator

    Hi Shantanu,

    Thank you for your inquiry. Actually our SDK have updated 4 days ago. So, you can download our SDK of latest version at http://plugpdf.com/sdkfile/PlugPDF_Android.zip. If you do not want download, you can ignore that such as ‘PlugPDF.setUpdateCheckEnabled(false);’.

    Thank you,
    Dr. Plug

    #6998 Reply

    Shantanu Paul

    I will definitely update the sdk as frequently as possible but it will be weird if the message pops up on end users. Thanks.

Viewing 9 posts - 1 through 9 (of 9 total)
Reply To: How do I place the viewer inside my Activity with ActionBar on top ?
Your information: