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 - SignFile stack overflow exception
  FAQ FAQ  Forum Search   Register Register  Login Login

SignFile stack overflow exception

 Post Reply Post Reply
Author
Message
jreed View Drop Down
Beginner
Beginner
Avatar

Joined: 01 Nov 12
Location: Indianapolis
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote jreed Quote  Post ReplyReply Direct Link To This Post Topic: SignFile stack overflow exception
    Posted: 01 Nov 12 at 10:13PM
Hi,

I keep getting a stack overflow exception when I try to sign a PDF. For testing purposes I'm using the PFX file that came with the Demo application = qpl_test.pfx

Here's a snippet from the code that does the signing.  The code is in a Class Library project named Foundation.PDF.dll which is referenced by a test console application.

Note: All other QuickPDF functions are working fine (i.e. filling form values).  
_______

_library = new PDFLibrary(@"3rd/DebenuPDFLibraryDLL0911.dll");
_library.UnlockKey(Qpdf.Default.LicenseKey);
if (_library.Unlocked() == 0) throw new Exception("License unlock failed. Please update the LicenseKey setting");

var result = _library.SignFile(inputFileName, openPassword, signatureFieldName, outputFileName, pfxFileName, pfxPassword, reason, location, contactInfo);

_______

The variables in the call to sign file are as follows: in order
inputFileName="test.pdf"
openPassword=""
signatureFieldName="Signature_Employee"
outputFileName="signed.pdf"
pfxFileName="qpl_test.pfx"
pfxPassword="testing"
reason="Employee Signature"
location="Office"
contactInfo="user@user.com"

The exception I'm getting reads:

An unhandled exception of type 'System.StackOverflowException' occurred in Foundation.PDF.dll

The exception occurs in PDFLibrary class:

public int SignFile(string InputFileName, string OpenPassword, string SignatureFieldName, 
            string OutputFileName, string PFXFileName, string PFXPassword, string Reason, 
            string Location, string ContactInfo)
        {
            if (dll == null) return 0;
            else
                return dll.DebenuPDFLibrarySignFile(instanceID, InputFileName, OpenPassword, 
                    SignatureFieldName, OutputFileName, PFXFileName, PFXPassword, Reason, Location, 
                    ContactInfo);
        } 

What can I do? I've tried different editors to make the test pdf with a signature field (Adobe XI, Nitro PDF).

Any help would be greatly appreciated.

Thanks,
Jeremy
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 02 Nov 12 at 9:37AM
Jeremy,

Have you tried running the same Quick PDF Library signfile code using the QPL DLL directly rather than using the QPL DLL that is attached to your DLL.  This could help track down the problem.

Andrew.
Back to Top
jreed View Drop Down
Beginner
Beginner
Avatar

Joined: 01 Nov 12
Location: Indianapolis
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote jreed Quote  Post ReplyReply Direct Link To This Post Posted: 02 Nov 12 at 12:48PM
Andrew,

I just tried what you suggested; still getting the stack overflow exception.  

My test project can be downloaded from here. (VS 2010 C# .Net 4 - target x86)
The test PDF files are in the zip.

That said, here are some new findings.

I've narrowed it down to a specific file that had its form created using Nitro PDF 8 Pro.

I have two test PDF files, both files were based on the original "I-9 Employment Form.pdf" 

The nitroTest.pdf has a number of form fields in it created using Nitro Pro 8. However when I started getting the stack overflow error (screenshot) with this file (trying to sign it with QuickPDF), I edited it with Adobe XI Pro and replaced the signature field with one from Adobe XI.  Still got the stack overflow error.

The I9-adobeXITest.pdf is the original I-9 with just a signature filed added, no other form input fields.  QuickPDF signs this file without issue.

So what is it that is wrong with nitroTest.pdf? As far as I can tell the only difference between it and I9-adobeXITest.pdf is that nitroTest.pdf has several form fields and I9-adobeXITest.pdf only has one field = signature. 

Jeremy

Back to Top
jreed View Drop Down
Beginner
Beginner
Avatar

Joined: 01 Nov 12
Location: Indianapolis
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote jreed Quote  Post ReplyReply Direct Link To This Post Posted: 02 Nov 12 at 5:24PM
Ok,

So I completely recreated the PDF form using Adobe XI Pro, but now I have more problems.

If I just save the form from Adobe XI and try to fill and sign it, the resulting document is corrupted and when opened results in Acrobat stating there was an error opening the file (code 14 = corrupt).

So I saved the file As Optimized support Acrobat version 4.0+ and the code 14 error went away.

However, I can either fill the form fields or sign the file, but not both.  If I fill it and sign it, the signature is just gone.  If I don't fill the fields and just sign it, the file is signed correctly.

For the life of me I can't figure this out.  The only thing I can see that is different after filling the form fields and calling qp.SaveToFile() is that QuickPDF added Helvetica and ZapfDingbats fonts (not sure why???).


Please help, I've already wasted a full day and a half on this tool. I'm going to have to move on to another product soon.

Thanks,
Jeremy
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