• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

Community Beginner ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

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

TOPICS
Acrobat SDK and JavaScript , Windows

Views

1.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 23, 2021 Nov 23, 2021

Copy link to clipboard

Copied

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) ).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 23, 2021 Nov 23, 2021

Copy link to clipboard

Copied

Hi,

 

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 26, 2021 Nov 26, 2021

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 17, 2022 Nov 17, 2022

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 17, 2022 Nov 17, 2022

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 17, 2022 Nov 17, 2022

Copy link to clipboard

Copied

That was the issue! Thank's a lot!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 18, 2022 Nov 18, 2022

Copy link to clipboard

Copied

LATEST

I am glad you have the solution.  I never found the solution so I had to redesign our processes a year ago.

I found my old code and tried it with the provided solution (Protected Mode: off) and it worked, but we are now using a totally different process.  I wish someone could solve my other problem:

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 17, 2022 Nov 17, 2022

Copy link to clipboard

Copied

The screenshot shows a empty file (0 bytes).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 17, 2022 Nov 17, 2022

Copy link to clipboard

Copied

I know, that's the issue.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines