Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #11580 Reply

    Lenci

    Is it possible to call drawPage on a background thread? I need to show the pages like PageDisplayMode.THUMBNAIL does, but I need bigger cells and additional views in the gridview.

    Now if I call drawPage from the adapter, the drawing is blocking the UI.

    Thank you,
    Lenci

    #11595 Reply

    Dr. Plug
    Moderator

    Hello Lenci

    Thank you for sending your question.

    Yes, it is possible to call drawPage on a background thread.
    Note that, there is asynctask which call the drawpage method in our sample project.

    Best regards,

    Dr.Plug
    PlugPDF Support

    #11603 Reply

    Lenci

    Thank for the answer, however I can’t find the example for this, that you mentioned. But this is my code, and i got an error saying that “Method drawPage must be called from the UI thread, currently inferred thread is worker”.

    ….
    new AsyncTask<Void, Void, Void>() {
    @Override
    protected Void doInBackground(Void… params) {
    try {
    …..
    readerView.drawPage(bitmap, position, 200, 200, 0, 0, 200, 200);
    ….
    } catch (Exception ex) {

    }
    }
    }.execute();

    What is wrong with this approach?

    #11604 Reply

    Lenci

    There is no build error, so I guess some annotations are suggesting the compiler, to show the error while writing the code!?

    #11605 Reply

    Dr. Plug
    Moderator

    Hello Lenci,

    The PageView class in our PlugPDF will be good example for you.
    If you can provide us your code or file via “Contact Us”, we can reproduce your issue more easily.

    If you have any further questions, feel free contact to us.

    Best regards,

    Dr.Plug
    PlugPDF Support

    • This reply was modified 2 months ago by  Dr. Plug.
Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Page drawing
Your information: