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!
Android App crashes when Input Fields are set |
Post Reply |
Author | |
Ludwig
Team Player Joined: 07 May 15 Location: India Status: Offline Points: 33 |
Post Options
Thanks(0)
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. The following is one of them: https://drive.google.com/file/d/0B_6Z82hoBteTMzAwY2U3ZE13QkU/view?usp=sharing |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
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 |
|
Ludwig
Team Player Joined: 07 May 15 Location: India Status: Offline Points: 33 |
Post Options
Thanks(0)
|
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 |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
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 |
|
Ludwig
Team Player Joined: 07 May 15 Location: India Status: Offline Points: 33 |
Post Options
Thanks(0)
|
I have modified the code to use only Non DA functions:
But the problem persists:
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] } } |
|
Tauheed
Beginner Joined: 05 Apr 16 Status: Offline Points: 2 |
Post Options
Thanks(0)
|
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 |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
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 |
|
Ludwig
Team Player Joined: 07 May 15 Location: India Status: Offline Points: 33 |
Post Options
Thanks(0)
|
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. |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
I'm only using the windows version.
|
|
Cheers,
Ingo |
|
Tauheed
Beginner Joined: 05 Apr 16 Status: Offline Points: 2 |
Post Options
Thanks(0)
|
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? |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
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 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store