PDF digital signature - Cannot find object or property. (Exception from HRESULT: 0x80092004)

A forum for questions or concerns related to the PDF-XChange Core API SDK

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
Zmaster
User
Posts: 2
Joined: Tue Sep 22, 2020 9:56 am

PDF digital signature - Cannot find object or property. (Exception from HRESULT: 0x80092004)

Post by Zmaster »

I am looking for cause or solution for the following exception:
Cannot find object or property. (Exception from HRESULT: 0x80092004)

Problem occur on the following line of code:
DFXCoreAPI.IPXC_Document.WriteToFile(String sDestFileName, IProgressMon pProgress, UInt32 nFlags)

For testing I am using certificate issued by CA with purpose of digital signatures, so there should be no problem with certificate itself. Also, problems does not occur on every machine that I have tested it, just one or two.

Here is the code I am using:

Code: Select all


PXC_Rect signatureRect = new PXC_Rect()
{
	left = rect.Value.left,
	top = rect.Value.bottom - 1,
	right = rect.Value.left + PDF_SIGNATURE_WIDTH,
	bottom = rect.Value.top - PDF_SIGNATURE_HEIGHT - 1
};

byte[] certBuffer = cert.RawData;

contextPointer = CertCreateCertificateContext(PKCS_7_OR_X509_ASN_ENCODING, certBuffer, certBuffer.Length);

UnsafeMethods.DeferedDigitalSignEx(doc, contextPointer, PXC_SignDocumentFlags.Sign_TX_Labels | PXC_SignDocumentFlags.Sign_TX_Name | PXC_SignDocumentFlags.Sign_TX_Date, pageNo, signatureRect, SIGN_REASON, SIGN_LOCATION, SIGN_CONTACT_INFO, null);

doc.WriteToFile(targetPath, null, (int)PXC_DocumentWriteFlags.DocWriteFlag_Incremental);
And the implementation of DeferedDigitalSignEx:

Code: Select all

public static void DeferedDigitalSignEx(IPXC_Document doc, IntPtr pointer, PXC_SignDocumentFlags flags, int pageIndex, PXC_Rect position, string reason, string location, string contact, string imagePath)
{
	unsafe
	{
		_CERT_CONTEXT* contextStructPointer = (_CERT_CONTEXT*)pointer;

		doc.DeferedDigitalSign(ref *(contextStructPointer), (uint)flags, (uint)pageIndex, position, reason, location, contact, imagePath);
	}
}
Edit: Same certificate works from Acrobat Reader and PDF-XChange Editor
Last edited by Zmaster on Thu Sep 24, 2020 7:52 am, edited 1 time in total.
User avatar
Paul - Tracker Supp
Site Admin
Posts: 6813
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: PDF digital signature - Cannot find object or property. (Exception from HRESULT: 0x80092004)

Post by Paul - Tracker Supp »

Hi Zmaster,

I have reached out to the dev team member who is best able to address this and he is otherwise engaged today. He will look at your post/question tomorrow.

regards
Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
User avatar
Paul - Tracker Supp
Site Admin
Posts: 6813
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: PDF digital signature - Cannot find object or property. (Exception from HRESULT: 0x80092004)

Post by Paul - Tracker Supp »

Hi Zmaster,

can you please test signing a document using the same certificate on the same machine using the Stand alone Editor? We want to see if this is specific to the SDK or the Editor in general.
Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
Zmaster
User
Posts: 2
Joined: Tue Sep 22, 2020 9:56 am

Re: PDF digital signature - Cannot find object or property. (Exception from HRESULT: 0x80092004)

Post by Zmaster »

It turned out that problem was not library.

Looks like certificate middleware didn't work without latest Windows update.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PDF digital signature - Cannot find object or property. (Exception from HRESULT: 0x80092004)

Post by Sasha - Tracker Dev Team »

Hello Zmaster,

Case closed then?

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply