RadaeePDF.com :: Topic: Android - Merge document - import fail (1/1)
Welcome, Guest
Username: Password: Remember me

Signin/Signup with:

Questions about Android development and PDF

TOPIC: Android - Merge document - import fail

Android - Merge document - import fail 2 years 2 months ago #8870

Hi !

I'm trying to create an app which allow user to merge pdf.
I'm a radaee premium user.

My problem is :
- When I open a PDF in a fragment, and THEN, I'm launching merge => document.ImportPage return false.
- When I kill app and I start merge without open PDF, merge works fine.

Am I forging something ?
On Fragment finishing, I close document and stream...

Thanks.
The administrator has disabled public write access.

Android - Merge document - import fail 2 years 2 months ago #8871

  • Davide
  • Davide's Avatar
  • OFFLINE
  • Moderator
  • Posts: 663
  • Thank you received: 43
  • Karma: 12
Hi,
can you reproduce this issue in the demo project? Do you have this problem with specific pdf or with all?

You have to invoke ImportContext.Destroy() after all pages are imported.
For more info check this: http://www.radaeepdf.com/documentation/javadocs/com/radaee/pdf/Document.html#ImportPage(com.radaee.pdf.Document.ImportContext, int, int)

Maybe this thread will help you: www.radaeepdf.com/forum/Android-developm...g-false?limitstart=0
Last Edit: 2 years 2 months ago by Davide.
The administrator has disabled public write access.

Android - Merge document - import fail 2 years 2 months ago #8873

can you reproduce this issue in the demo project?
No, with demo code it works.
Do you have this problem with specific pdf or with all?
Yes, with all PDF...

I've already jave a look to that thread but it don't helps me :(

The strange behavior is that I need to kill app (not exit and restart, but kill app and restart) to make it work...

I summarizes the problem :
Do not work : launch app, open pdf with reader fragment, close pdf, launch merge ==>document.ImportPage return false.
Works : kill app, launch app, DO NOT open any pdf with reader fragment, launch merge ==> document is merged !

I think doc or stream is not closed, or context is not correct ?

Look at my ReaderFragment's onStop method :
    @Override
    public void onStop() {
        clearCurrentDocument();
        Global.RemoveTmp();
        super.onStop();
    }
    public void clearCurrentDocument() {
        if (mPdfThumbs != null) {
            mPdfThumbs.thumbClose();
        }
        if (mPdfReaderController != null) {
            mPdfReaderController.close();
            mPdfReaderController = null;
        }
        if (doc != null) {
            doc.Close();
            doc = null;
        }
        if (stream != null) {
            stream.close();
            stream = null;
        }
    }
The administrator has disabled public write access.

Android - Merge document - import fail 2 years 2 months ago #8877

I've found the solution : I called Global.RemoveTmp();
The administrator has disabled public write access.
Powered by Kunena Forum