Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Android App crashes when Input Fields are set
  FAQ FAQ  Forum Search   Register Register  Login Login

Android App crashes when Input Fields are set

 Post Reply Post Reply
Author
Message
Ludwig View Drop Down
Team Player
Team Player


Joined: 07 May 15
Location: India
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ludwig Quote  Post ReplyReply Direct Link To This Post Topic: Android App crashes when Input Fields are set
    Posted: 01 Apr 16 at 10:58AM
Hi,

I am using Debenu QuickPdf (v12.12)[Android] to set values to Acro Form Fields.
The function I use is:
    mDQPL.SetFormFieldValue(fieldindex, inputValue)


This is working as expected. However for certain PDFs its resulting in a crash.


Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 01 Apr 16 at 8:25PM
Hi Ludwig,

it's often better to post the whole code snippet.
The function you've posted works fine - the prob seems to be anywhere around.
Your form contains 25 form fields.
Inside there are many form field titles consisting of several words separated by spaces - PERHAPS this could be a prob?
 
Cheers,
Ingo

Back to Top
Ludwig View Drop Down
Team Player
Team Player


Joined: 07 May 15
Location: India
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ludwig Quote  Post ReplyReply Direct Link To This Post Posted: 04 Apr 16 at 7:47AM
Here is the complete code: I am using the latest licensed Android version of Debenu Quick PDF Library

int result = mDQPL.LoadFromFile("file_path", password);
int fileHandle = mDQPL.DAOpenFile("file_path", password);

if (result != 0 && fileHandle != 0) {
 int formFieldsCount = mDQPL.DAGetFormFieldCount(fileHandle);
   for (int i = 1; i <= formFieldsCount; i++) {       
              if (mDQPL.GetFormFieldType(i) == TEXT_FIELD_TYPE) {
 int s = mDQPL.SetFormFieldValue(i, "test"); [It CRASHES HERE]
       }
}

I see :
04-04 11:01:12.489: A/libc(29310): Fatal signal 11 (SIGSEGV) at 0x20373220 (code=1), thread 29908 (java-sdk-progre) on my Logcat.

One thing very strange about this pdf is that if before using it with the above function I open the PDF using Adobe Acrobat Reader DC. It asks me if I wish to save changes. If I click Yes the overall size of the PDF is reduced (96kb to 82kb) and the function starts working fine.

Also when i used the original PDF with the windows version of the library it works just fine. 

I have no clue as to how I should handle such PDFs.



Edited by Ludwig - 04 Apr 16 at 7:52AM
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 04 Apr 16 at 7:44PM
Hi Ludwig,

every few weeks i write here something about DA- and Non-DA-functions.
The DA-functions not really opens a pdf - it's only a read.
This saves memory and is faster.
NEVER mix DA- and Non-DA-functions - this won't work!
The first two lines are curious, too.
The second line is the last open-file and it's a DA-function (read only).
So you can't modify the file with this instance.
Don't compare the behavior of QuickPDF with the 100-mb-installation of the pdf-reader - it's a bit unfair ;-)
Working on pdf-forms made by adobe products with QuickPDF could offer additional surprise 'cause adobe has built in protection (InDesign) against changes made by third party tools :(

Cheers,
Ingo

Back to Top
Ludwig View Drop Down
Team Player
Team Player


Joined: 07 May 15
Location: India
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ludwig Quote  Post ReplyReply Direct Link To This Post Posted: 05 Apr 16 at 6:00AM
I have modified the code to use only Non DA functions:
But the problem persists: Cry

int result = mDQPL.LoadFromFile("file_path", password);

if (result != 0) {
 int formFieldsCount = mDQPL.FormFieldCount();
   for (int i = 1; i <= formFieldsCount; i++) {       
              if (mDQPL.GetFormFieldType(i) == TEXT_FIELD_TYPE) {
 int s = mDQPL.SetFormFieldValue(i, "test"); [It CRASHES HERE]
       }
}
Back to Top
Tauheed View Drop Down
Beginner
Beginner


Joined: 05 Apr 16
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tauheed Quote  Post ReplyReply Direct Link To This Post Posted: 05 Apr 16 at 2:35PM
I am an iOS developer using the paid license version of Debenu Quick PDF. I also face the same problem while setting input values to the above pdf.
Link:

The code to set the fields is:-
=====================

- (void) setAcroFieldFormsValue:(NSString*)pdfPAth

{

    DebenuPDFLibraryCPiOSObjC1211* DPL = [DebenuPDFLibraryCPiOSObjC1211 new];


    if ([DPL UnlockKey:@”License_Key”] == 1)// Licensed Key 

    {

        NSLog(@"UnlockKey success: %@", [DPL LicenseInfo]);

        

        [DPL LoadFromFile:pdfPAth :nil];

                

int fieldCount = [DPL FormFieldCount];


        for (int fIndex = 1; fIndex <= fieldCount; fIndex++)

        {

    int fieldType = [DPL GetFormFieldType];


if (fieldType == 1)   //  (“Field Type =>TextField\n");

{

               [DPL SetFormFieldValue:fIndex :@“Test Value”]; // Getting Crash at this point.

}

        }

        

        [DPL SaveToFile:pdfPAth];

    }

}




Edited by Tauheed - 05 Apr 16 at 2:38PM
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 05 Apr 16 at 8:06PM
Hi,

i don't know why you have these probs.
I've downloaded your test1.pdf ...
I've an old app made with version 7.26 of the library and it works.
With my app i've changed field "Name_First" from "andy" to "Ingo" and field "City" i've filled with "Achim".
No problems at all.
So if you're sure that the reason isn't your code you should post the prob in a complete manner onto the official support page from Debenu.

Cheers,
Ingo

Back to Top
Ludwig View Drop Down
Team Player
Team Player


Joined: 07 May 15
Location: India
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ludwig Quote  Post ReplyReply Direct Link To This Post Posted: 06 Apr 16 at 2:06AM
Ok I will post the issue on the Debenu support Page.
In between,
Did you test with the Android Version of the Library?
If yes please share its download link.

Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 06 Apr 16 at 6:51PM
I'm only using the windows version.

Cheers,
Ingo

Back to Top
Tauheed View Drop Down
Beginner
Beginner


Joined: 05 Apr 16
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tauheed Quote  Post ReplyReply Direct Link To This Post Posted: 19 Apr 16 at 11:15AM
I would appreciate if someone replies to the cases I have filled Case #26113. For other cases I am unable to track progress (Case 26072, Case 26079). Can someone help here?



Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 19 Apr 16 at 7:03PM
Tauheed,

i've written already that this here is a user-user-forum.
So nobody here can do anything regarding your issue #26113.
You should enter again the official support pages and asking there with your issue number.
Please keep in mind that you're working with a well priced but extremely huge library.
So you need to be a bit more patient ;-)

Cheers,
Ingo

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store