Print Page | Close Window

SignFile stack overflow exception

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2442
Printed Date: 28 Jan 26 at 10:44AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: SignFile stack overflow exception
Posted By: jreed
Subject: SignFile stack overflow exception
Date 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



Replies:
Posted By: AndrewC
Date 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.


Posted By: jreed
Date 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 https://docs.google.com/open?id=0B6ynw2b9mlitQ2tGdlJTSmJpSFU - 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 " https://docs.google.com/open?id=0B6ynw2b9mlitdG51NHpGX1RIUDQ - I-9 Employment Form.pd f" 

The https://docs.google.com/open?id=0B6ynw2b9mlitbFQ1VmRLRFgtbEE - nitroTest.pdf has a number of form fields in it created using Nitro Pro 8. However when I started getting the stack overflow error ( https://docs.google.com/open?id=0B6ynw2b9mlitNWNrU1MwVzgwenc - 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 https://docs.google.com/open?id=0B6ynw2b9mlitd0k1WnVUOUp1REU - 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



Posted By: jreed
Date 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???).

https://docs.google.com/open?id=0B6ynw2b9mlitR3djRjNuOWxPYjg - Here's my newest test project . 

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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk