Skip to main content
Participating Frequently
November 18, 2021
Question

IAC Save function worked for years but now fails starting around November 2021

  • November 18, 2021
  • 3 replies
  • 2333 views

I have used IAC Save function.  Here is the code that no longer works (it was working for a long time until a week ago).  The code still works on our old Acrobat XI Pro systems; it fails on Acrobat DC systems.    Does anyone know what happened or how I can solve the problem?

Here is the statement that fails (always returns false):

pdDocTarget.Save((short)PDSaveFlags.PDSaveFull, targetFilespec)  <--- always returns false now!!!

Note that other function still work.  For example, 

int ctrPagesInSource = pdDocSource.GetNumPages(); ,<--- still works

This topic has been closed for replies.

3 replies

Participant
November 17, 2022

Hi, I know it's been a while but we are currently experiencing the same issue with our application and I was wondering if you found a solution over the past year.

Everything we automate via Acrobat works flawlessly (highlighting specific words in the document, creating comments, etc.) but the save function returns false.

 

Interesting is, that it works for our customers but not anymore on our development machines but we are worried that the issue will spread to our customers sooner than later. Also: in Windows file explorer there is a saved file showing in recent files which can't be opened (not found) and also can't be seen in file explorer when navigating to the folder with file explorer.

 

Thanks in advance for any information you can share on this issue and greetings from the black forest in Germany!

 

Raimo Geisel

Legend
November 17, 2022

Make sure that Protected Mode is off in Acrobat Preferences (Security - Enahanced). This option is DESIGNED TO make it impossible to save files automatically.

Participant
November 17, 2022

That was the issue! Thank's a lot!

Participating Frequently
November 23, 2021

I need to clarify my post. 

pdDocTarget.Save((short)PDSaveFlags.PDSaveFull, targetFilespec) is successful EXCEPT in the following scenario.

pdDocTarget.Save((short)PDSaveFlags.PDSaveFull, targetFilespec) fails when the CAcroPDDOC is acquired via this code:

==============================

avDoc = acroApp.GetActiveDoc();
if ((avDoc != null) && (avDoc.IsValid()))
{
textBoxWindowTitleOfActivePDF.Text = avDoc.GetTitle();
pdDoc = avDoc.GetPDDoc();
if (pdDoc != null)
{
short saveFlag = (short)PDSaveFlags.PDSaveFull;
if (pdDoc.Save(saveFlag, pdfFilespec) == false)
{
Constants.displayErrorMessage("Failed to save: \n" + pdfFilespec);
}

==================================

The user has manually opened a PDF document from another application.  Adobe Acrobat AIC (code shown above) is then used to get the CAcroAVDoc (avDoc = acroApp.GetActiveDoc();) and then get the CAcroPDDOC (pdDoc = avDoc.GetPDDoc();)  That all seems to work.  Trying to save the pdDoc fails every time (pdDoc.Save(saveFlag, pdfFilespec) ).

BarlaeDC
Community Expert
Community Expert
November 23, 2021

Hi,

 

When the user does this are they able to select "Save" or "Save a Copy" from the Acrobat User Interface?

Participating Frequently
November 26, 2021

When the user opens a PDF from the other application, they can save it with any filename.

After my app (which uses Interapplication Communication) successfully "gets" the active document, my app cannot save the document.  This failure began around mid-November 2021;  prior to that time the IAC could successfully save the document.  The app ran successfully for as long as I remember bulding the app.

BarlaeDC
Community Expert
Community Expert
November 18, 2021

HI,

 

This looks like it is probably a bug in Acrobat, although it might be worth changing the paths to different places, just to check it is not some security change.

Participating Frequently
November 18, 2021

I created two posts originally since two problems became active a week or two ago.

Here is a copy of the reply I just sent for the other post.

On Windows 10, Adobe Acrobat DC - fails as stated (even though has worked for a year or more with no code changes.

On Windows 10, Adobe Acrobat XI Pro - works great now and has worked great for a few years.

 

Here are more complex details.

The Visual Studio code builds the app on an Adobe Acrobat XI Pro environment; thus the added reference for Acrobat.dll is from Acrobat XI Pro.  That app is installed on the Acrobat DC system and , somewhat surprisingly, works great until a week ago.  So, I installed Visual Studio on the Acrobat DC system and rebuilt the app which now references the Acrobat.dll from Acrobat DC.  The rebuilt app fails the same way.

Two things broke a week or two ago (with no changes to my code):

1.  if (clipboardData.GetDataPresent(DataFormats.Bitmap)) is always false

2.  pdDocTarget.Save((short)PDSaveFlags.PDSaveFull, targetFilespec)  <--- always returns false now!!!

Note that other function still work no matter which version of Acrobat is used for builds.  For example, 

int ctrPagesInSource = pdDocSource.GetNumPages(); ,<--- still works