Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about Android development and PDF

Android - Merge document - import fail

More
11 years 4 months ago #8870 by maclanglade
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.
More
11 years 4 months ago - 11 years 4 months ago #8871 by Davide
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:

Maybe this thread will help you: www.radaeepdf.com/forum/Android-developm...g-false?limitstart=0
Last edit: 11 years 4 months ago by Davide.
More
11 years 4 months ago #8873 by maclanglade

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 :
Code:
@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; } }
More
11 years 4 months ago #8877 by maclanglade
I've found the solution : I called Global.RemoveTmp();
Time to create page: 0.412 seconds
Powered by Kunena Forum