Skip to main content
gekag53654820
Participating Frequently
June 11, 2019
Question

Fill and Sign PDDoc issue.

  • June 11, 2019
  • 4 replies
  • 967 views

Hello,

I'm developing plug-in for Acrobat/Reader(C++) and with recent 19.012.20034 update I start receiving different pointer to PDDoc on PDDocDidSave and PDDocDidClose events which was fork fine until update to latest version.

To clarify:

I'm using a map to store PDDoc pointers on PDDocDidOpen and then I use it to determine which document opened through my procedure.

Should I use PDDocAcquire or it is a bug?

This topic has been closed for replies.

4 replies

BarlaeDC
Community Expert
Community Expert
June 25, 2019

HI,

Does the call work ok if you call a 'SaveAs' as the first signature calls a SaveAs (I think) and a SaveAs, closes and reopens the document, which would invalidate the DocID.

Regards

Malcolm

Legend
June 25, 2019

By the way do you also monitor for DocDidClose event? I would expect that to be called, or it's a bug.

gekag53654820
Participating Frequently
June 25, 2019

Hello,

Test Screen Name

I made a few test and on a simple SaveAs and Close as a result I got the same ids for two documents.

On a simple SaveAs, Save, Close all COM calls works fine.
But when I press on Fill and Sign same behaviour present for PDDocID and as a plus COM calls crushes application.

"By the way do you also monitor for DocDidClose event? I would expect that to be called, or it's a bug."

Yes, i subscribed on this two events and they are called in a row.

BarlaeDC

Hello,

I didn't see DidOpen event because it stops working on DidClose because of COM calls in case of Fill and Sign.

So I remove part of code which was written to obtain PDDocID and left old one which rely on PDDoc pointers with which i can aline with opened documents in Acrobat with my collection.

In case SaveAs I don't see DidOpen event.

Legend
June 25, 2019

Signing inherently saves the file, but perhaps in the latest version it also closes and reopens the file for some reason. May be an enhancement to security, which is always messing us about.

Thom Parker
Community Expert
Community Expert
June 11, 2019

Use something else to ID the Docs, such as the DocID or Path. Both are unique to the particular PDF.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
gekag53654820
Participating Frequently
June 21, 2019

Hello, i tried using PDDocGetID but for every document I got id = 16 and also when I perform this call to obtain PDDoc ID DiDSave event fired twice and on second time it just crushed application.

Legend
June 22, 2019

PDDocGetID returns an array. If you say it's returning 16, it sounds as if you are comparing the number of bytes in the array, rather than the array itself.