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

PDDocSave Doesn't save a doc with a PDSaveCopy flag enabled

New Here ,
Nov 03, 2025 Nov 03, 2025

Hi all ,i am new to this community ,
I am encountering an issue when attempting to save a PDF document using the PDDocSave function with the PDSaveCopy flag. The save operation fails with an "error opening the specified document" error for older PDFs (e.g., those beginning with %PDF-1.3), but works without issue for newer PDFs (e.g., %PDF-1.6).
Observations:
When I use other flags such as  "PDSaveFull or PDSaveForceIncremental" operation on the problematic document using Adobe Acrobat Sdk, a new copy is created that works correctly with PDDocSave .This suggests that the "PDDocSave" process updates the document's internal structure to a newer version, effectively resolving the incompatibility.
The call causing the issue is: PDDocSave(doc, PDSaveCopy, asPath, ASGetDefaultFileSys(), NULL, NULL);
Core Question:
What is the recommended method to programmatically upgrade or adapt an opened document's internal PDF version to a more recent, compatible version before performing operations like PDDocSave with the PDSaveCopy flag?
Request:
I am looking for the best practice to ensure a document's compatibility before executing subsequent actions, thereby preventing these version-related errors.

 ASPathName asPath = ASFileSysCreatePathFromCString(ASGetDefaultFileSys(), nfn);
 if (!asPath)
     throw 0;

 PDDocSave(doc, PDSaveCopy, asPath, ASGetDefaultFileSys(), NULL, NULL);

 PDDoc copyDoc = PDDocOpen(asPath, ASGetDefaultFileSys(), NULL, true);
TOPICS
Acrobat SDK and JavaScript
73
Translate
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 03, 2025 Nov 03, 2025
LATEST

All of the Acrobat save operations perform some type of modification on the PDF.  For the SaveAsCopy, all internal objects associated with Reader Extensions are removed.  So it's not really a clean copy that is saved. Acrobat always has it's fingers in the PDF file, which means upgrading the version. 

 

I have never seen the issue you've described. I suspect that it is a bug, so that there aren't any real best practices for saveing as a copy.

There are other issues around the SaveAsCopy functionality in other modalities. For example this option is no longer available on the "File" menu. The only way I've found to access this functionality from the UI is indirectly by forcing operations that are not allowed on signed PDFs. The SaveAsCopy flag in the doc.saveAs() JavaScript function does not work correctly.  So there might be something about changes in the internal SaveAs thats got an issue. The issues I've mentioned imply that the SaveAsCopy functionality has been partially removed. 

 

But you say that using other flags with PDSaveCopy gets it to work properly? Then it sounds like you have a solution. 

 

    

 

  

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
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